.wp-ai-chat-widget {
  --wp-ai-chat-width: 380px;
  --wp-ai-chat-height: 560px;
  --wp-ai-chat-primary: #0f172a;
  --wp-ai-chat-accent: #22c55e;
  --wp-ai-chat-text: #111827;
  font-family: "Manrope", "Segoe UI", sans-serif;
  color: var(--wp-ai-chat-text);
  z-index: 999999;
}

.wp-ai-chat-floating {
  position: fixed;
  bottom: 24px;
}

.wp-ai-chat-bottom-right {
  right: 24px;
}

.wp-ai-chat-bottom-left {
  left: 24px;
}

.wp-ai-chat-launcher {
  min-height: 58px;
  border-radius: 999px;
  border: 0;
  cursor: pointer;
  font-weight: 700;
  color: #fff;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px 10px 10px;
  background: linear-gradient(130deg, var(--wp-ai-chat-primary), var(--wp-ai-chat-accent));
  box-shadow: 0 14px 30px rgba(15, 23, 42, 0.3);
}

.wp-ai-chat-launcher-icon {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  letter-spacing: 0.3px;
  background: rgba(255, 255, 255, 0.22);
}

.wp-ai-chat-launcher-glyph {
  font-size: 13px;
  line-height: 1;
}

.wp-ai-chat-launcher-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

.wp-ai-chat-launcher-text {
  font-size: 14px;
  line-height: 1.2;
  text-align: left;
}

.wp-ai-chat-panel {
  width: var(--wp-ai-chat-width);
  height: var(--wp-ai-chat-height);
  margin-top: 10px;
  background: #fff;
  border: 1px solid #d7dde5;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 26px 48px rgba(15, 23, 42, 0.2);
  display: flex;
  flex-direction: column;
}

.wp-ai-chat-panel[hidden] {
  display: none !important;
}

.wp-ai-chat-shortcode .wp-ai-chat-panel {
  margin-top: 0;
}

.wp-ai-chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: linear-gradient(160deg, var(--wp-ai-chat-primary), #1e293b);
  color: #fff;
  padding: 12px;
}

.wp-ai-chat-header-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

.wp-ai-chat-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  object-fit: cover;
}

.wp-ai-chat-avatar-fallback {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--wp-ai-chat-accent);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
}

.wp-ai-chat-close {
  all: unset;
  box-sizing: border-box;
  width: 30px;
  height: 30px;
  border-radius: 10px;
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: #fff;
  background: rgba(255, 255, 255, 0.16);
  transition: background 0.15s ease, transform 0.15s ease;
}

.wp-ai-chat-close:hover {
  background: rgba(255, 255, 255, 0.28);
  transform: translateY(-1px);
}

.wp-ai-chat-close:focus-visible {
  outline: 2px solid rgba(255, 255, 255, 0.75);
  outline-offset: 1px;
}

.wp-ai-chat-close svg {
  width: 16px;
  height: 16px;
  display: block;
  pointer-events: none;
}

.wp-ai-chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 12px;
  background: linear-gradient(180deg, #f8fafc 0%, #eef3f8 100%);
}

.wp-ai-chat-message {
  max-width: 86%;
  margin: 0 0 10px;
  padding: 10px 12px;
  border-radius: 12px;
  line-height: 1.45;
  box-shadow: 0 8px 16px rgba(15, 23, 42, 0.08);
}

.wp-ai-chat-message p {
  margin: 0;
  white-space: pre-wrap;
}

.wp-ai-chat-message-bot {
  background: #fff;
  border: 1px solid #d8e1ea;
}

.wp-ai-chat-message-user {
  margin-left: auto;
  color: #fff;
  background: linear-gradient(135deg, var(--wp-ai-chat-primary), var(--wp-ai-chat-accent));
}

.wp-ai-chat-sources {
  margin-top: 8px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.wp-ai-chat-source-chip {
  font-size: 12px;
  text-decoration: none;
  color: #0f172a;
  border: 1px solid #cbd5e1;
  border-radius: 999px;
  padding: 4px 8px;
  background: #f8fafc;
}

.wp-ai-chat-input-wrap {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  padding: 10px;
  border-top: 1px solid #e2e8f0;
  background: #fff;
}

.wp-ai-chat-input {
  min-height: 42px;
  max-height: 120px;
  resize: vertical;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  padding: 10px;
  font: inherit;
}

.wp-ai-chat-send {
  border: 0;
  border-radius: 10px;
  cursor: pointer;
  color: #fff;
  padding: 0 14px;
  background: var(--wp-ai-chat-primary);
}

@media (max-width: 767px) {
  .wp-ai-chat-floating {
    right: 10px;
    left: 10px;
    bottom: 12px;
  }

  .wp-ai-chat-launcher {
    width: 100%;
    justify-content: center;
  }

  .wp-ai-chat-panel {
    width: calc(100vw - 20px);
    max-height: 78vh;
  }
}
