.ai-chat {
  --chat-accent: #f97316;
  position: fixed;
  right: 20px;
  bottom: calc(20px + env(safe-area-inset-bottom, 0px));
  z-index: 900;
  color: var(--store-fg, #18181b);
  font-family: inherit;
}
.ai-chat [hidden],
.ai-chat[hidden] {
  display: none !important;
}
.ai-chat button,
.ai-chat textarea {
  font: inherit;
}
.ai-chat button {
  cursor: pointer;
}
.ai-chat button:focus-visible,
.ai-chat textarea:focus-visible {
  outline: 3px solid var(--chat-accent);
  outline-offset: 3px;
}
.ai-chat-launcher {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
  min-height: 52px;
  padding: 13px 20px;
  border: 1px solid #fb923c;
  border-radius: 999px;
  background: var(--chat-accent);
  color: #18181b;
  font-weight: 750 !important;
  box-shadow: 0 6px 24px #0003;
}
.ai-chat-launcher i {
  font-size: 21px;
}
.ai-chat-launcher:hover {
  background: #fb923c;
}
.ai-chat-panel {
  width: 380px;
  height: min(590px, calc(100dvh - 110px));
  display: flex;
  flex-direction: column;
  margin-bottom: 12px;
  overflow: hidden;
  background: var(--store-card-bg, #fff);
  border: 1px solid var(--store-border, #e8e8ec);
  border-radius: 20px;
  box-shadow: 0 18px 65px #0003;
}
.ai-chat-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 19px 16px;
  background: #18181b;
  color: #fff;
  border-bottom: 3px solid var(--chat-accent);
}
.ai-chat-mark {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: var(--chat-accent);
  color: #18181b;
  font-size: 20px;
}
.ai-chat-heading {
  flex: 1;
}
.ai-chat-heading h2 {
  margin: 0;
  font-size: 17px;
  font-weight: 750;
  color: #fff;
}
.ai-chat-heading p {
  margin: 5px 0 0;
  font-size: 12px;
  color: #d4d4d8;
}
.ai-chat-close {
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 50%;
  background: #ffffff12;
  color: #fff;
  font-size: 25px !important;
}
.ai-chat-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 18px;
  border-bottom: 1px solid var(--store-border);
  font-size: 12px;
  font-weight: 650;
}
.ai-chat-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  background: var(--chat-accent);
  border-radius: 50%;
  margin-right: 6px;
}
.ai-chat-toolbar button {
  background: none;
  border: 0;
  color: var(--store-fg-muted);
  padding: 5px;
  font-size: 12px;
}
.ai-chat-conversation {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 24px 18px 12px;
}
.ai-chat-eyebrow {
  font-size: 9px;
  font-weight: 750;
  letter-spacing: 1.1px;
  color: var(--store-fg-muted);
}
.ai-chat-welcome h3 {
  margin: 10px 0 8px;
  color: var(--store-fg);
  font-size: 24px;
  line-height: 1.25;
}
.ai-chat-welcome p {
  margin: 0;
  color: var(--store-fg-muted);
  font-size: 14px;
  line-height: 1.6;
}
.ai-chat-prompts {
  display: grid;
  gap: 8px;
  margin: 22px 0 12px;
}
.ai-chat-prompts button {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px;
  text-align: left;
  border: 1px solid var(--store-border);
  border-radius: 10px;
  background: var(--store-header-surface);
  color: var(--store-fg);
  font-size: 12px;
}
.ai-chat-prompts button:hover {
  border-color: var(--chat-accent);
}
.ai-chat-prompts span {
  color: var(--chat-accent);
  font-size: 17px;
}
.ai-chat-messages {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.ai-chat-message {
  max-width: 92%;
  padding: 11px 14px;
  border-radius: 14px 14px 14px 4px;
  background: var(--store-header-surface);
  color: var(--store-fg);
  font-size: 14px;
  line-height: 1.6;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.ai-chat-message--user {
  align-self: flex-end;
  border-radius: 14px 14px 4px 14px;
  background: #ffedd5;
  color: #431407;
}
.ai-chat-message a {
  color: inherit;
  text-decoration: underline;
}
.ai-chat-status {
  padding: 0 18px;
  font-size: 12px;
  line-height: 1.5;
  color: var(--store-fg-muted);
}
.ai-chat-status:not(:empty) {
  padding-top: 8px;
  padding-bottom: 8px;
}
.ai-chat-form {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  margin: 12px 14px 0;
  padding: 7px;
  border: 1px solid var(--store-border);
  border-radius: 14px;
}
.ai-chat-form textarea {
  flex: 1;
  min-width: 0;
  height: 40px;
  max-height: 96px;
  resize: none;
  border: 0;
  background: transparent;
  color: var(--store-fg);
  padding: 10px 5px;
  font-size: 16px;
  line-height: 20px;
}
.ai-chat-form textarea::placeholder {
  color: var(--store-fg-muted);
}
.ai-chat-form button {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 10px;
  background: var(--chat-accent);
  color: #18181b;
}
.ai-chat button:disabled {
  opacity: 0.5;
  cursor: default;
}
.ai-chat-note {
  margin: 10px 14px 14px;
  text-align: center;
  color: var(--store-fg-muted);
  font-size: 10px;
  line-height: 1.5;
}
.ai-chat-sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}
@media (max-width: 560px) {
  .ai-chat {
    right: 12px;
    bottom: calc(12px + env(safe-area-inset-bottom, 0px));
  }
  body:has(.pd-sticky-buy.visible) .ai-chat {
    bottom: calc(82px + env(safe-area-inset-bottom, 0px));
  }
  .ai-chat-launcher {
    min-height: 46px;
    padding: 10px 16px;
    font-size: 13px !important;
  }
  .ai-chat-panel {
    width: calc(100vw - 24px);
    height: min(570px, calc(100dvh - 95px - env(safe-area-inset-bottom, 0px)));
  }
  body:has(.pd-sticky-buy.visible) .ai-chat-panel {
    height: min(570px, calc(100dvh - 165px - env(safe-area-inset-bottom, 0px)));
  }
}

.ai-chat-card {
  padding: 14px;
  border: 1px solid var(--store-border);
  border-left: 3px solid var(--chat-accent);
  border-radius: 12px;
  color: var(--store-fg);
  font-size: 13px;
  line-height: 1.6;
  overflow-wrap: anywhere;
}
.ai-chat-card strong {
  display: block;
  font-size: 14px;
}
.ai-chat-card p {
  margin: 8px 0;
}
.ai-chat-card a,
.ai-chat-note a {
  color: var(--store-fg);
  text-decoration: underline;
}
.ai-chat-card a {
  display: inline-block;
  margin-top: 6px;
  font-weight: 650;
}
