#cb-launcher {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 999999;
  pointer-events: auto;
}

#cb-launcher-btn {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  border: none;
  background: #2563eb;
  color: #fff;
  font-size: 26px;
  cursor: pointer;
  box-shadow: 0 14px 34px rgba(15,23,42,.25);
  pointer-events: auto;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

#cb-window {
  position: fixed;
  bottom: 100px;
  right: 24px;
  width: 360px;
  max-width: 92vw;
  height: 520px;
  max-height: 80vh;
  background: #ffffff;
  border-radius: 16px;
  box-shadow: 0 14px 34px rgba(15,23,42,.18);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  z-index: 999999;
  font-family: inherit;
  pointer-events: auto;
}

.cb-hidden {
  display: none !important;
}

#cb-header {
  background: #2563eb;
  color: #fff;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-weight: 600;
}

#cb-close-btn {
  background: transparent;
  border: none;
  color: #fff;
  font-size: 16px;
  cursor: pointer;
  touch-action: manipulation;
}

#cb-messages {
  flex: 1;
  padding: 14px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: #f5f7fb;
  -webkit-overflow-scrolling: touch;
}

.cb-msg {
  max-width: 80%;
  padding: 10px 14px;
  border-radius: 14px;
  font-size: 14px;
  line-height: 1.4;
  white-space: pre-wrap;
}

.cb-msg-bot {
  background: #ffffff;
  color: #0f172a;
  align-self: flex-start;
  border-bottom-left-radius: 4px;
  box-shadow: 0 2px 6px rgba(15,23,42,.06);
}

.cb-msg-user {
  background: #2563eb;
  color: #fff;
  align-self: flex-end;
  border-bottom-right-radius: 4px;
}

#cb-suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 0 14px 10px 14px;
  background: #f5f7fb;
}

.cb-suggestion-chip {
  border: 1px solid #2563eb;
  background: #fff;
  color: #2563eb;
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 13px;
  cursor: pointer;
  touch-action: manipulation;
}

#cb-inputbar {
  display: flex;
  gap: 8px;
  padding: 12px 14px;
  border-top: 1px solid #e5e7eb;
  background: #fff;
}

#cb-textinput {
  flex: 1;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 16px;
  outline: none;
}

#cb-attach-btn {
  border: 1px solid #e5e7eb;
  background: #f5f7fb;
  color: #2563eb;
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 16px;
  cursor: pointer;
  touch-action: manipulation;
}

.cb-msg-file {
  background: #eef2ff;
  color: #1e3a8a;
  align-self: flex-end;
  border-bottom-right-radius: 4px;
  border: 1px dashed #93a5f0;
}

#cb-send-btn {
  border: none;
  background: #2563eb;
  color: #fff;
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  touch-action: manipulation;
}

#cb-actions {
  display: flex;
  gap: 8px;
  padding: 0 14px 14px 14px;
  background: #fff;
}

#cb-actions button {
  flex: 1;
  border: 1px solid #e5e7eb;
  background: #f5f7fb;
  color: #0f172a;
  border-radius: 10px;
  padding: 10px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  touch-action: manipulation;
}

@media (max-width: 480px) {
  #cb-launcher {
    bottom: max(16px, env(safe-area-inset-bottom));
    right: 16px;
  }

  #cb-launcher-btn {
    width: 54px;
    height: 54px;
    font-size: 22px;
  }

  #cb-window {
    bottom: 0;
    right: 0;
    left: 0;
    width: 100vw;
    max-width: 100vw;
    height: 100vh;
    max-height: 100vh;
    border-radius: 0;
  }

  #cb-inputbar {
    padding-bottom: max(12px, env(safe-area-inset-bottom));
  }

  #cb-actions {
    padding-bottom: max(14px, env(safe-area-inset-bottom));
  }
}