/* Ask AREE chat box (docs/ask.qmd); colors come from the site's Bootstrap theme. */
.ask-aree {
  margin: 1.5rem 0 2rem;
}

.aa-status {
  margin-bottom: 0.75rem;
}

.aa-messages {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-bottom: 1rem;
}

.aa-msg {
  border-radius: 0.5rem;
  padding: 0.75rem 1rem;
  overflow-wrap: anywhere;
}

.aa-user {
  align-self: flex-end;
  max-width: 85%;
  background: var(--bs-primary-bg-subtle, #e7f0fd);
  white-space: pre-wrap;
}

.aa-assistant {
  border: 1px solid var(--bs-border-color, #dee2e6);
  background: var(--bs-body-bg, #fff);
}

.aa-answer > .aa-segment > :last-child {
  margin-bottom: 0.5rem;
}

.aa-segment {
  overflow-x: auto;
}

.aa-answer table {
  font-size: 0.875rem;
  width: auto;
  overflow-wrap: normal;
}

.aa-answer .aa-study {
  font-family: var(--bs-font-monospace);
  font-size: 0.85em;
  white-space: nowrap;
}

.aa-progress::before {
  content: "";
  display: inline-block;
  width: 0.6rem;
  height: 0.6rem;
  margin-right: 0.4rem;
  border-radius: 50%;
  background: var(--bs-primary, #2780e3);
  animation: aa-pulse 1s ease-in-out infinite alternate;
}

@keyframes aa-pulse {
  from { opacity: 0.25; }
  to { opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  .aa-progress::before { animation: none; }
}

.aa-trace {
  margin-top: 0.5rem;
  border-top: 1px solid var(--bs-border-color, #dee2e6);
  padding-top: 0.5rem;
}

.aa-trace summary {
  cursor: pointer;
  color: var(--bs-secondary-color, #6c757d);
}

.aa-call {
  margin-top: 0.75rem;
}

.aa-call-name {
  font-family: var(--bs-font-monospace);
  font-weight: 600;
  font-size: 0.85rem;
}

.aa-call pre {
  max-height: 16rem;
  overflow: auto;
  font-size: 0.75rem;
  margin: 0.25rem 0;
  padding: 0.5rem;
  background: var(--bs-tertiary-bg, #f8f9fa);
  border-radius: 0.25rem;
}

.aa-call-input {
  color: var(--bs-secondary-color, #6c757d);
}

.aa-call-error {
  border-left: 3px solid var(--bs-danger, #ff0039);
}

.aa-examples {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
  margin-bottom: 0.75rem;
}

.aa-examples .btn {
  text-align: left;
}

.aa-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.aa-actions #aa-turnstile {
  margin-right: auto;
}
