.wpaisc-widget {
  --wpaisc-theme: #146ef5;
  --wpaisc-chat-bg: #f6f7f9;
  --wpaisc-user: #146ef5;
  --wpaisc-ai: #fff;
  --wpaisc-text: #1f2937;
  --wpaisc-button-bg: #146ef5;
  --wpaisc-button-text: #fff;
  color: var(--wpaisc-text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  z-index: 99999;
}

.wpaisc-widget--fixed {
  position: fixed;
  bottom: 20px;
}

.wpaisc-widget--right {
  right: 20px;
}

.wpaisc-widget--left {
  left: 20px;
}

.wpaisc-widget--inline {
  position: relative;
  max-width: 380px;
}

.wpaisc-launcher {
  align-items: center;
  background: var(--wpaisc-button-bg);
  border: 0;
  border-radius: 999px;
  box-shadow: 0 14px 35px rgba(0, 0, 0, 0.18);
  color: var(--wpaisc-button-text);
  cursor: pointer;
  display: flex;
  font-weight: 700;
  gap: 8px;
  justify-content: center;
  min-height: 48px;
  padding: 0 18px;
}

.wpaisc-launcher img {
  height: 24px;
  width: 24px;
}

.wpaisc-launcher--circle {
  border-radius: 50%;
  height: 64px;
  padding: 0;
  width: 64px;
}

.wpaisc-launcher--circle span {
  display: none;
}

.wpaisc-launcher--wide {
  border-radius: 12px;
  min-width: 190px;
}

.wpaisc-panel {
  background: var(--wpaisc-chat-bg);
  border-radius: 8px;
  bottom: 64px;
  box-shadow: 0 18px 55px rgba(0, 0, 0, 0.22);
  display: none;
  flex-direction: column;
  height: min(600px, 80vh);
  overflow: hidden;
  position: absolute;
  right: 0;
  width: min(380px, 94vw);
}

.wpaisc-widget--left .wpaisc-panel {
  left: 0;
  right: auto;
}

.wpaisc-widget--inline .wpaisc-panel {
  bottom: auto;
  position: relative;
  right: auto;
}

.wpaisc-widget.is-open .wpaisc-panel {
  display: flex;
}

.wpaisc-widget.is-open .wpaisc-launcher {
  display: none;
}

.wpaisc-header {
  align-items: center;
  background: var(--wpaisc-theme);
  color: #fff;
  display: flex;
  gap: 10px;
  min-height: 58px;
  padding: 0 14px;
}

.wpaisc-header img {
  border-radius: 50%;
  height: 34px;
  object-fit: cover;
  width: 34px;
}

.wpaisc-header strong {
  flex: 1;
  font-size: 15px;
}

.wpaisc-close {
  background: transparent;
  border: 0;
  color: #fff;
  cursor: pointer;
  font-size: 24px;
  line-height: 1;
}

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

.wpaisc-message {
  border-radius: 8px;
  font-size: 14px;
  line-height: 1.65;
  max-width: 86%;
  padding: 10px 12px;
  white-space: pre-wrap;
}

.wpaisc-message--ai {
  align-self: flex-start;
  background: var(--wpaisc-ai);
}

.wpaisc-message--user {
  align-self: flex-end;
  background: var(--wpaisc-user);
  color: #fff;
}

.wpaisc-message a {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.wpaisc-message--ai a {
  color: var(--wpaisc-theme);
}

.wpaisc-sources {
  border-top: 1px solid rgba(31, 41, 55, 0.12);
  margin-top: 10px;
  padding-top: 8px;
}

.wpaisc-sources strong {
  display: block;
  font-size: 12px;
  margin-bottom: 4px;
}

.wpaisc-sources ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.wpaisc-sources li + li {
  margin-top: 4px;
}

.wpaisc-faqs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.wpaisc-faqs span {
  flex-basis: 100%;
  font-size: 12px;
  font-weight: 700;
}

.wpaisc-faqs button {
  background: #fff;
  border: 1px solid rgba(31, 41, 55, 0.15);
  border-radius: 999px;
  cursor: pointer;
  font-size: 13px;
  padding: 7px 10px;
}

.wpaisc-form {
  background: #fff;
  border-top: 1px solid rgba(31, 41, 55, 0.12);
  display: flex;
  gap: 8px;
  padding: 10px;
}

.wpaisc-form input {
  border: 1px solid rgba(31, 41, 55, 0.18);
  border-radius: 8px;
  flex: 1;
  min-width: 0;
  padding: 10px;
}

.wpaisc-form button {
  background: var(--wpaisc-theme);
  border: 0;
  border-radius: 8px;
  color: #fff;
  cursor: pointer;
  font-weight: 700;
  padding: 0 14px;
}
