.ai-fab {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  z-index: 160;
}

.ai-fab button {
  border: 0;
  border-radius: 999px;
  background: var(--color-accent);
  color: #fff;
  padding: 0.8rem 1.05rem;
  box-shadow: var(--shadow-glow);
}

.ai-widget {
  position: fixed;
  right: 1rem;
  bottom: 4.5rem;
  width: min(96vw, 360px);
  max-height: 70vh;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  background: #0d1323;
  display: none;
  flex-direction: column;
  z-index: 160;
}

.ai-widget.open {
  display: flex;
}

.ai-widget-header,
.ai-widget-form {
  padding: 0.7rem;
  border-bottom: 1px solid var(--color-border);
}

.ai-widget-header {
  position: relative;
  padding-right: 2.8rem;
}

.ai-widget-form {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  border-bottom: 0;
  border-top: 1px solid var(--color-border);
}

.ai-widget-form input {
  flex: 1;
  min-width: 0;
}

.ai-widget-form button {
  flex: 0 0 auto;
  white-space: nowrap;
}

.ai-widget-messages {
  overflow: auto;
  padding: 0.8rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.bubble {
  max-width: 88%;
  padding: 0.55rem 0.7rem;
  border-radius: 12px;
  border: 1px solid var(--color-border);
}

.bubble.user {
  align-self: end;
  background: rgba(255, 92, 0, 0.2);
}

.bubble.assistant {
  align-self: start;
  background: rgba(240, 244, 255, 0.06);
}

.typing {
  display: inline-flex;
  gap: 0.2rem;
}

.typing span {
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: var(--color-text-muted);
  animation: typingDot 1.1s infinite;
}

.typing span:nth-child(2) {
  animation-delay: 0.15s;
}

.typing span:nth-child(3) {
  animation-delay: 0.3s;
}

.chips {
  display: flex;
  gap: 0.45rem;
  flex-wrap: wrap;
}

.ai-widget .chips {
  margin: 0 0 0.8rem;
  padding: 0 0.7rem;
}

.chips button {
  border: 1px solid var(--color-border);
  border-radius: 999px;
  padding: 0.3rem 0.6rem;
  background: #131d33;
}

#aiWidgetClose {
  position: absolute;
  top: 0.45rem;
  right: 0.45rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  min-width: 30px;
  padding: 0;
  border: 1px solid var(--color-border);
  border-radius: 999px;
  background: #131d33;
  color: var(--color-text);
  font-size: 1.2rem;
  line-height: 1;
  text-indent: -9999px;
  overflow: hidden;
}

#aiWidgetClose::before {
  content: "×";
  position: absolute;
  inset: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-indent: 0;
  color: var(--color-text);
  font-size: 1.2rem;
  line-height: 1;
}
