/* VEAF documentation chatbot widget (POC). Theme-aware via Material's CSS variables.
   Font sizes use a fixed 14px base on the panel to decouple from Material's 125% root. */

.veaf-chat-fab {
  position: fixed;
  right: 1.25rem;
  bottom: 1.25rem;
  z-index: 1000;
  width: 3rem;
  height: 3rem;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  background: var(--md-primary-fg-color, #3f51b5);
  color: var(--md-primary-bg-color, #fff);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
  font-size: 1.25rem;
  line-height: 1;
  transition: transform 0.15s ease;
}
.veaf-chat-fab:hover {
  transform: scale(1.06);
}

/* Resizable, full-height sidebar (ported from the Solde chat UI). Width is set inline by JS. */
.veaf-chat-panel {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 1001;
  display: none;
  flex-direction: column;
  width: 380px;
  max-width: 95vw;
  font-size: 15px;
  background: var(--md-default-bg-color, #fff);
  color: var(--md-default-fg-color, #000);
  border-left: 1px solid var(--md-default-fg-color--lightest, #e0e0e0);
  box-shadow: -4px 0 24px rgba(0, 0, 0, 0.18);
}
.veaf-chat-panel.is-open {
  display: flex;
}

.veaf-chat-resize-handle {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 5px;
  cursor: col-resize;
  z-index: 10;
}
.veaf-chat-resize-handle:hover,
.veaf-chat-resize-handle:active {
  background: var(--md-primary-fg-color, #3f51b5);
  opacity: 0.4;
}

.veaf-chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.6rem 0.85rem;
  background: var(--md-primary-fg-color, #3f51b5);
  color: var(--md-primary-bg-color, #fff);
  font-weight: 600;
  font-size: 0.95em;
}
.veaf-chat-header button {
  background: none;
  border: none;
  color: inherit;
  cursor: pointer;
  font-size: 1em;
  padding: 0 0.35rem;
}

.veaf-chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 0.85rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  font-size: 0.88em;
}
.veaf-chat-msg {
  max-width: 88%;
  padding: 0.5rem 0.7rem;
  border-radius: 0.6rem;
  line-height: 1.5;
  word-wrap: break-word;
}
.veaf-chat-msg.user {
  align-self: flex-end;
  background: var(--md-primary-fg-color, #3f51b5);
  color: var(--md-primary-bg-color, #fff);
}
.veaf-chat-msg.assistant {
  align-self: flex-start;
  background: var(--md-code-bg-color, #f0f0f0);
  color: var(--md-default-fg-color, #000);
}
.veaf-chat-msg p:first-child {
  margin-top: 0;
}
.veaf-chat-msg p:last-child {
  margin-bottom: 0;
}
.veaf-chat-msg pre {
  overflow-x: auto;
}
/* The standing note about the shared free allowance: present, but not competing with the answer. */
.veaf-chat-note {
  font-size: 0.92em;
  opacity: 0.75;
}

.veaf-chat-input {
  display: flex;
  gap: 0.4rem;
  padding: 0.6rem;
  border-top: 1px solid var(--md-default-fg-color--lightest, #e0e0e0);
}
.veaf-chat-input textarea {
  flex: 1;
  resize: none;
  border: 1px solid var(--md-default-fg-color--lighter, #ccc);
  border-radius: 0.4rem;
  padding: 0.45rem 0.55rem;
  font: inherit;
  font-size: 0.88em;
  background: var(--md-default-bg-color, #fff);
  color: var(--md-default-fg-color, #000);
}
.veaf-chat-input button {
  border: none;
  border-radius: 0.4rem;
  padding: 0 0.85rem;
  cursor: pointer;
  background: var(--md-primary-fg-color, #3f51b5);
  color: var(--md-primary-bg-color, #fff);
  font-weight: 600;
  font-size: 0.88em;
}
.veaf-chat-input button:disabled {
  opacity: 0.5;
  cursor: default;
}
