/* Floating AI chat — Frank Lloyd Wright */
.ai-chat-toggle {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: #2c5f4a;
  border: 0;
  cursor: pointer;
  z-index: 9990;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.ai-chat-toggle:hover {
  background: #1c1c1c;
}

.ai-chat-toggle svg {
  width: 26px;
  height: 26px;
  fill: #ffffff;
}

.ai-chat-panel {
  position: fixed;
  bottom: 96px;
  right: 24px;
  width: 300px;
  height: 480px;
  max-height: calc(100vh - 120px);
  background: #ffffff;
  border: 1px solid #d8cfc4;
  z-index: 9991;
  display: none;
  flex-direction: column;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
}

.ai-chat-panel.is-open {
  display: flex;
}

.ai-chat-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 14px;
  background: #2c5f4a;
  color: #ffffff;
  font-family: var(--font-mono, monospace);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.ai-chat-close {
  background: transparent;
  border: 0;
  color: #fff;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  min-width: 44px;
  min-height: 44px;
}

.ai-chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: #f5f0e8;
}

.ai-chat-bubble {
  max-width: 88%;
  padding: 10px 12px;
  font-family: var(--font-body, Georgia, serif);
  font-size: 0.9rem;
  line-height: 1.45;
}

.ai-chat-bubble--bot {
  align-self: flex-start;
  background: #ffffff;
  border: 1px solid #d8cfc4;
  color: #1c1c1c;
}

.ai-chat-bubble--user {
  align-self: flex-end;
  background: #2c5f4a;
  color: #ffffff;
}

.ai-chat-typing {
  display: none;
  align-self: flex-start;
  padding: 10px 14px;
  background: #ffffff;
  border: 1px solid #d8cfc4;
  font-family: monospace;
  font-size: 0.85rem;
}

.ai-chat-typing.is-visible {
  display: block;
}

.ai-chat-typing span {
  animation: ai-dot 1.2s infinite ease-in-out;
  opacity: 0.3;
}

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

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

@keyframes ai-dot {
  0%,
  80%,
  100% {
    opacity: 0.2;
  }
  40% {
    opacity: 1;
  }
}

.ai-chat-input-row {
  display: flex;
  gap: 8px;
  padding: 10px;
  border-top: 1px solid #d8cfc4;
  background: #ffffff;
}

.ai-chat-input-row input {
  flex: 1;
  min-height: 44px;
  border: 1px solid #d8cfc4;
  padding: 0 12px;
  font-family: var(--font-body, serif);
  font-size: 0.9rem;
  border-radius: 0;
}

.ai-chat-input-row input:focus {
  outline: 2px solid #2c5f4a;
  border-color: #2c5f4a;
}

.ai-chat-send {
  min-width: 44px;
  min-height: 44px;
  background: #2c5f4a;
  color: #fff;
  border: 0;
  cursor: pointer;
  font-family: var(--font-mono, monospace);
  font-size: 0.7rem;
  text-transform: uppercase;
}

@media (max-width: 400px) {
  .ai-chat-panel {
    right: 12px;
    left: 12px;
    width: auto;
  }

  .ai-chat-toggle {
    right: 12px;
  }
}
