#cfuxx-assist-panel[hidden] {
  display: none !important;
}

#cfuxx-assist-root {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 2147483000;
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #162033;
}

#cfuxx-assist-button {
  border: 0;
  border-radius: 999px;
  background: linear-gradient(135deg, #1f1f1f, #e30613);
  color: #fff;
  box-shadow: 0 16px 40px rgba(0, 0, 0, .28);
  padding: 10px 16px 10px 10px;
  display: flex;
  gap: 9px;
  align-items: center;
  cursor: pointer;
  font-weight: 800;
}

.cfuxx-live-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: #27d35c;
  box-shadow: 0 0 0 0 rgba(39, 211, 92, .72);
  animation: cfuxx-live-pulse 1.35s infinite;
}

@keyframes cfuxx-live-pulse {
  0% { box-shadow: 0 0 0 0 rgba(39, 211, 92, .72); }
  70% { box-shadow: 0 0 0 8px rgba(39, 211, 92, 0); }
  100% { box-shadow: 0 0 0 0 rgba(39, 211, 92, 0); }
}

#cfuxx-assist-button img {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: #fff;
  object-fit: cover;
  border: 2px solid #fff;
}

#cfuxx-assist-panel {
  position: absolute;
  right: 0;
  bottom: 68px;
  width: min(380px, calc(100vw - 32px));
  height: min(620px, calc(100vh - 112px));
  background: #fff;
  border-radius: 24px;
  box-shadow: 0 24px 80px rgba(0, 0, 0, .34);
  overflow: hidden;
  border: 1px solid rgba(18, 58, 104, .16);
  display: flex;
  flex-direction: column;
}

.cfuxx-chat-head {
  background: linear-gradient(135deg, #1f1f1f, #2b2b2b);
  color: #fff;
  padding: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex: 0 0 auto;
}

.cfuxx-chat-title {
  display: flex;
  align-items: center;
  gap: 12px;
}

.cfuxx-chat-title img {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: #fff;
  object-fit: cover;
  border: 2px solid #fff;
}

.cfuxx-chat-title strong {
  display: block;
  font-size: 15px;
}

.cfuxx-chat-title span {
  display: block;
  font-size: 12px;
  opacity: .85;
}

.cfuxx-chat-close {
  background: rgba(255, 255, 255, .16);
  color: #fff;
  border: 0;
  border-radius: 12px;
  width: 34px;
  height: 34px;
  font-size: 24px;
  line-height: 30px;
  cursor: pointer;
}

.cfuxx-chat-log {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  background: linear-gradient(180deg, #f5f8fc, #eef3f8);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.cfuxx-msg {
  max-width: 86%;
  padding: 10px 12px;
  border-radius: 16px;
  font-size: 14px;
  line-height: 1.35;
  white-space: pre-wrap;
  box-shadow: 0 3px 12px rgba(15, 35, 62, .08);
}

.cfuxx-bot {
  align-self: flex-start;
  background: #fff;
  border-bottom-left-radius: 5px;
}

.cfuxx-staff {
  align-self: flex-start;
  background: #fff3d6;
  border-bottom-left-radius: 5px;
  border: 1px solid #ffd780;
}

.cfuxx-user {
  align-self: flex-end;
  background: #1f1f1f;
  color: #fff;
  border-bottom-right-radius: 5px;
}

.cfuxx-chat-input {
  flex: 0 0 auto;
  padding: 12px;
  background: #fff;
  border-top: 1px solid #e6edf5;
  max-height: 210px;
  overflow: auto;
}

.cfuxx-buttons {
  display: grid;
  gap: 8px;
}

.cfuxx-buttons button,
.cfuxx-form button {
  border: 0;
  border-radius: 14px;
  background: #e30613;
  color: #fff;
  padding: 11px 12px;
  font-weight: 800;
  cursor: pointer;
  min-height: 42px;
}

.cfuxx-buttons button:first-child {
  background: #1f1f1f;
}

.cfuxx-form {
  display: flex;
  gap: 8px;
  align-items: stretch;
}

.cfuxx-form-stack {
  display: grid;
  gap: 8px;
}

.cfuxx-message-form {
  display: flex !important;
  align-items: stretch;
}

.cfuxx-message-form textarea {
  min-height: 58px !important;
  height: 58px !important;
}

.cfuxx-send-button {
  flex: 0 0 auto;
  min-width: 82px;
}

.cfuxx-form input,
.cfuxx-form textarea {
  flex: 1;
  border: 1px solid #ccd8e6;
  border-radius: 14px;
  padding: 11px 12px;
  font: inherit;
  min-width: 0;
  box-sizing: border-box;
}

.cfuxx-form textarea {
  resize: vertical;
  min-height: 76px;
  max-height: 120px;
}

.cfuxx-form button {
  white-space: nowrap;
}

@media (max-width: 480px) {
  #cfuxx-assist-root {
    right: 14px;
    bottom: 14px;
  }

  #cfuxx-assist-panel {
    right: -2px;
    bottom: 62px;
    height: min(620px, calc(100vh - 92px));
    border-radius: 20px;
  }

  .cfuxx-form {
    display: grid;
  }

  .cfuxx-message-form {
    display: flex !important;
  }
}
