/* Floating AI consultant chat */
.kgafa-chat-toggle {
  position: fixed;
  right: 1.25rem;
  bottom: 1.25rem;
  z-index: 1000;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  border: none;
  border-radius: 999px;
  background: #0d4f4f;
  color: #fff;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 8px 28px rgba(13, 79, 79, 0.35);
}

.kgafa-chat-toggle:hover {
  background: #0a3d3d;
}

.kgafa-chat-toggle-label {
  font-size: 0.9rem;
}

.kgafa-chat-panel {
  position: fixed;
  right: 1.25rem;
  bottom: 5rem;
  z-index: 1000;
  width: min(380px, calc(100vw - 2rem));
  max-height: min(520px, 70vh);
  display: flex;
  flex-direction: column;
  background: #fffdf9;
  border: 1px solid #e7e0d5;
  border-radius: 12px;
  box-shadow: 0 16px 48px rgba(28, 25, 23, 0.15);
  opacity: 0;
  pointer-events: none;
  transform: translateY(12px);
  transition: opacity 0.2s, transform 0.2s;
}

.kgafa-chat-panel.is-open {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.kgafa-chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.85rem 1rem;
  background: #0d4f4f;
  color: #fff;
  border-radius: 12px 12px 0 0;
  font-size: 0.95rem;
}

.kgafa-chat-badge {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  background: rgba(255, 255, 255, 0.2);
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
}

.kgafa-chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  min-height: 200px;
}

.kgafa-chat-msg {
  max-width: 92%;
  padding: 0.55rem 0.75rem;
  border-radius: 10px;
  font-size: 0.88rem;
  line-height: 1.45;
  white-space: pre-wrap;
}

.kgafa-chat-msg--user {
  align-self: flex-end;
  background: #e8f0ef;
  color: #1c1917;
}

.kgafa-chat-msg--assistant {
  align-self: flex-start;
  background: #f4f1eb;
  border: 1px solid #e7e0d5;
}

.kgafa-chat-form {
  display: flex;
  gap: 0.5rem;
  padding: 0.75rem;
  border-top: 1px solid #e7e0d5;
}

.kgafa-chat-input {
  flex: 1;
  padding: 0.55rem 0.65rem;
  border: 1px solid #e7e0d5;
  border-radius: 8px;
  font: inherit;
}

.kgafa-chat-send {
  padding: 0.55rem 0.85rem;
  font-size: 0.85rem;
}

@media (max-width: 480px) {
  .kgafa-chat-toggle-label {
    display: none;
  }
}
