.acw-root {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 9999;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  /* Credeksa brand: indigo → purple → magenta */
  --acw-grad: linear-gradient(135deg, #4b1ed6 0%, #7a1fc4 45%, #d91c6c 100%);
  --acw-grad-hover: linear-gradient(135deg, #4318bd 0%, #6a1ab0 45%, #c11560 100%);
  --acw-accent: #8a1fbf;
}

.acw-launcher {
  background: var(--acw-grad);
  color: #fff;
  border: none;
  border-radius: 999px;
  padding: 12px 20px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(120, 20, 120, 0.35);
}
.acw-launcher:hover { background: var(--acw-grad-hover); }

.acw-panel {
  position: absolute;
  right: 0;
  bottom: 56px;
  width: 360px;
  max-width: calc(100vw - 40px);
  height: 520px;
  max-height: calc(100vh - 100px);
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 12px 40px rgba(75, 30, 214, 0.25);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.acw-header {
  background: var(--acw-grad);
  color: #fff;
  padding: 14px 16px;
  font-weight: 600;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.acw-close {
  background: none;
  border: none;
  color: #fff;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}

.acw-messages {
  flex: 1;
  overflow-y: auto;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: #f7f8fa;
}

.acw-msg {
  max-width: 85%;
  padding: 9px 13px;
  border-radius: 14px;
  font-size: 14px;
  line-height: 1.45;
  white-space: pre-wrap;
  word-wrap: break-word;
}
.acw-user {
  align-self: flex-end;
  background: var(--acw-grad);
  color: #fff;
  border-bottom-right-radius: 4px;
}
.acw-assistant {
  align-self: flex-start;
  background: #fff;
  color: #1a1a1a;
  border: 1px solid #e5e7eb;
  border-bottom-left-radius: 4px;
}
.acw-typing { font-size: 20px; letter-spacing: 2px; }

.acw-inputbar {
  display: flex;
  gap: 8px;
  padding: 10px;
  border-top: 1px solid #eee;
  background: #fff;
}
.acw-inputbar input {
  flex: 1;
  border: 1px solid #d0d7de;
  border-radius: 8px;
  padding: 9px 12px;
  font-size: 14px;
  outline: none;
}
.acw-inputbar input:focus { border-color: var(--acw-accent); }
.acw-inputbar button {
  background: var(--acw-grad);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 0 16px;
  font-weight: 600;
  cursor: pointer;
}
.acw-inputbar button:disabled { opacity: 0.5; cursor: default; }

.acw-form {
  align-self: stretch;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.acw-form-title { font-size: 13px; font-weight: 600; color: #333; }
.acw-form input,
.acw-form textarea {
  border: 1px solid #d0d7de;
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 13px;
  font-family: inherit;
  outline: none;
}
.acw-form input:focus,
.acw-form textarea:focus { border-color: var(--acw-accent); }
.acw-form-actions { display: flex; gap: 8px; }
.acw-form-actions button {
  background: var(--acw-grad);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 8px 14px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
}
.acw-form-cancel { background: #e5e7eb !important; color: #333 !important; }
.acw-form-error { color: #d33; font-size: 12px; }
.acw-form-done {
  align-self: stretch;
  background: #fdeaf3;
  border: 1px solid #f3b6d4;
  color: #a01458;
  border-radius: 12px;
  padding: 12px;
  font-size: 13px;
}
