:root {
  --amz-ai-primary: #0f5cff;
  --amz-ai-text: #172033;
  --amz-ai-muted: #6b7280;
  --amz-ai-border: #e5e7eb;
  --amz-ai-bg: #ffffff;
  --amz-ai-soft: #f6f8fb;
}

.amz-ai-launcher,
.amz-ai-panel,
.amz-ai-panel * {
  box-sizing: border-box;
}

.amz-ai-launcher {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 2147483000;
  width: 58px;
  height: 58px;
  border: 0;
  border-radius: 18px;
  background: var(--amz-ai-primary);
  color: #fff;
  box-shadow: 0 14px 34px rgba(15, 92, 255, 0.32);
  cursor: pointer;
  font: 700 22px/1 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.amz-ai-panel {
  position: fixed;
  right: 22px;
  bottom: 92px;
  z-index: 2147483000;
  display: none;
  width: min(390px, calc(100vw - 28px));
  height: min(620px, calc(100vh - 120px));
  overflow: hidden;
  border: 1px solid var(--amz-ai-border);
  border-radius: 12px;
  background: var(--amz-ai-bg);
  box-shadow: 0 22px 70px rgba(15, 23, 42, 0.22);
  color: var(--amz-ai-text);
  font: 14px/1.55 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.amz-ai-panel.is-open {
  display: flex;
  flex-direction: column;
}

.amz-ai-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--amz-ai-border);
}

.amz-ai-title {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
}

.amz-ai-subtitle {
  margin: 2px 0 0;
  color: var(--amz-ai-muted);
  font-size: 12px;
}

.amz-ai-close {
  width: 32px;
  height: 32px;
  border: 1px solid var(--amz-ai-border);
  border-radius: 8px;
  background: #fff;
  cursor: pointer;
}

.amz-ai-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  background: var(--amz-ai-soft);
}

.amz-ai-message {
  max-width: 88%;
  margin: 0 0 12px;
  padding: 10px 12px;
  border-radius: 10px;
  white-space: pre-wrap;
}

.amz-ai-message.user {
  margin-left: auto;
  background: var(--amz-ai-primary);
  color: #fff;
}

.amz-ai-message.assistant {
  margin-right: auto;
  border: 1px solid var(--amz-ai-border);
  background: #fff;
}

.amz-ai-suggestions {
  display: grid;
  gap: 8px;
  margin-bottom: 12px;
}

.amz-ai-suggestion {
  border: 1px solid var(--amz-ai-border);
  border-radius: 9px;
  background: #fff;
  padding: 9px 10px;
  text-align: left;
  color: var(--amz-ai-text);
  cursor: pointer;
}

.amz-ai-composer {
  padding: 12px;
  border-top: 1px solid var(--amz-ai-border);
  background: #fff;
}

.amz-ai-input {
  width: 100%;
  min-height: 72px;
  max-height: 140px;
  resize: vertical;
  border: 1px solid var(--amz-ai-border);
  border-radius: 10px;
  padding: 10px;
  color: var(--amz-ai-text);
  outline: none;
  font: inherit;
}

.amz-ai-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 10px;
}

.amz-ai-note {
  color: var(--amz-ai-muted);
  font-size: 12px;
}

.amz-ai-send {
  border: 0;
  border-radius: 9px;
  background: var(--amz-ai-primary);
  color: #fff;
  padding: 9px 16px;
  font-weight: 700;
  cursor: pointer;
}

.amz-ai-send:disabled {
  opacity: 0.55;
  cursor: wait;
}

@media (max-width: 560px) {
  .amz-ai-panel {
    right: 10px;
    left: 10px;
    bottom: 82px;
    width: auto;
    height: min(620px, calc(100vh - 98px));
  }

  .amz-ai-launcher {
    right: 14px;
    bottom: 14px;
  }
}
