/* Floating button */
.cq-fab {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 999999;
  border: 0;
  border-radius: 999px;
  padding: 12px 14px;
  cursor: pointer;
  background: #111;
  color: #fff;
  box-shadow: 0 10px 30px rgba(0,0,0,.20);
  display: flex;
  align-items: center;
  gap: 10px;
  font: 600 14px/1 system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
}

.cq-fab:hover { opacity: .92; }

.cq-fab-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #22c55e;
  display: inline-block;
}

.cq-fab-text { letter-spacing: .2px; }

/* Panel */
.cq-panel {
  position: fixed;
  right: 18px;
  bottom: 76px;
  width: 340px;
  max-width: calc(100vw - 36px);
  height: 460px;
  max-height: calc(100vh - 110px);
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 18px 60px rgba(0,0,0,.22);
  z-index: 999999;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  border: 1px solid rgba(0,0,0,.08);
}

.cq-hidden { display: none; }

.cq-header {
  padding: 12px 12px;
  background: #111;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.cq-title {
  font: 700 14px/1.2 system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
}

.cq-header-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.cq-link {
  background: transparent;
  border: 0;
  color: rgba(255,255,255,.85);
  cursor: pointer;
  font: 600 12px/1 system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  text-decoration: underline;
  padding: 6px 6px;
}

.cq-close {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  border: 0;
  cursor: pointer;
  background: rgba(255,255,255,.14);
  color: #fff;
  font-size: 20px;
  line-height: 0;
}

.cq-messages {
  padding: 12px;
  overflow: auto;
  flex: 1;
  background: #fafafa;
}

.cq-msg {
  display: flex;
  margin: 8px 0;
}

.cq-user { justify-content: flex-end; }
.cq-assistant { justify-content: flex-start; }

.cq-bubble {
  max-width: 78%;
  padding: 10px 12px;
  border-radius: 14px;
  font: 500 13px/1.35 system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  white-space: pre-wrap;
  word-wrap: break-word;
}

.cq-user .cq-bubble {
  background: #111;
  color: #fff;
  border-bottom-right-radius: 6px;
}

.cq-assistant .cq-bubble {
  background: #fff;
  color: #111;
  border: 1px solid rgba(0,0,0,.08);
  border-bottom-left-radius: 6px;
}

.cq-footer {
  padding: 10px;
  display: flex;
  gap: 8px;
  background: #fff;
  border-top: 1px solid rgba(0,0,0,.08);
}

.cq-input {
  flex: 1;
  resize: none;
  border-radius: 12px;
  border: 1px solid rgba(0,0,0,.14);
  padding: 10px 10px;
  font: 500 13px/1.25 system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  outline: none;
}

.cq-input:focus { border-color: rgba(0,0,0,.35); }

.cq-send {
  border: 0;
  border-radius: 12px;
  padding: 10px 12px;
  cursor: pointer;
  background: #111;
  color: #fff;
  font: 700 13px/1 system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
}

.cq-send:disabled { opacity: .6; cursor: not-allowed; }
