/* botchat.css — the live agent on the landing page.
 *
 * Deliberately not styled as a floating widget. A launcher bubble in the corner
 * reads as support you have to go looking for; this sits in the page where the
 * demo used to, at the size of a section, because talking to it *is* the demo.
 *
 * Tokens only — see theme.css. Nothing here introduces a colour.
 */

.botchat {
  border: 1px solid var(--line);
  background: var(--bg-panel);
  display: grid;
  gap: 0;
}

/* Tall enough to hold a real exchange, capped so the page still scrolls past
   it. `overscroll-behavior` keeps a scroll inside the log from grabbing the
   page once it bottoms out. */
.botchat__log {
  min-height: 18rem;
  max-height: 26rem;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  scrollbar-width: thin;
  scrollbar-color: var(--accent-deep) transparent;
}

.botchat__row { display: flex; }
.botchat__row--me { justify-content: flex-end; }
.botchat__row--bot { justify-content: flex-start; }

.botchat__bubble {
  max-width: min(46ch, 88%);
  padding: 0.7rem 0.9rem;
  font-size: 0.9rem;
  line-height: 1.55;
  border: 1px solid var(--line);
  white-space: pre-wrap;   /* the agent sends paragraphs, not markup */
  word-break: break-word;
}

.botchat__row--bot .botchat__bubble {
  background: var(--bg-raise);
  color: var(--fg);
  border-left: 2px solid var(--accent);
}

.botchat__row--me .botchat__bubble {
  background: var(--bg-inset);
  color: var(--fg-dim, var(--fg));
  border-right: 2px solid var(--accent-soft);
}

/* Three dots, because a spinner suggests a page load and this is a person-like
   pause. Motion is removed wholesale under reduced-motion below. */
.botchat__bubble--thinking {
  display: inline-flex;
  gap: 0.3rem;
  align-items: center;
  padding: 0.85rem 0.9rem;
}
.botchat__bubble--thinking i {
  width: 0.32rem;
  height: 0.32rem;
  background: var(--accent);
  opacity: 0.35;
  animation: botpulse 1.1s ease-in-out infinite;
}
.botchat__bubble--thinking i:nth-child(2) { animation-delay: 0.18s; }
.botchat__bubble--thinking i:nth-child(3) { animation-delay: 0.36s; }

@keyframes botpulse {
  0%, 60%, 100% { opacity: 0.25; transform: translateY(0); }
  30%           { opacity: 1;    transform: translateY(-0.18rem); }
}

.botchat__form {
  display: flex;
  gap: 0;
  border-top: 1px solid var(--line);
}

.botchat__input {
  flex: 1 1 auto;
  min-width: 0;
  border: 0;
  background: transparent;
  padding: 0.95rem 1.25rem;
  font: inherit;
  font-size: 0.9rem;
  color: var(--fg);
}
.botchat__input::placeholder { color: var(--fg-mute, #6b7a85); }
.botchat__input:focus { outline: none; background: var(--bg-inset); }
.botchat__input:disabled { opacity: 0.5; }

.botchat__send {
  flex: 0 0 auto;
  border: 0;
  border-left: 1px solid var(--line);
  padding: 0.95rem 1.5rem;
}
.botchat__send:disabled { opacity: 0.45; cursor: default; }

.botchat__suggest {
  border-top: 1px solid var(--line);
  padding: 1rem 1.25rem;
}
.botchat__suggest-label {
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--fg-mute, #6b7a85);
  margin: 0 0 0.6rem;
}
.botchat__chips { display: flex; flex-wrap: wrap; gap: 0.5rem; }

.botchat__chip {
  border: 1px solid var(--line);
  background: transparent;
  color: var(--fg);
  font: inherit;
  font-size: 0.8rem;
  padding: 0.42rem 0.7rem;
  cursor: pointer;
  text-align: left;
}
.botchat__chip:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.botchat__note {
  border-top: 1px solid var(--line);
  margin: 0;
  padding: 0.8rem 1.25rem;
  font-size: 0.8rem;
  color: var(--fg-mute, #6b7a85);
}
.botchat__note a { margin-left: 0.35rem; }

@media (max-width: 40rem) {
  .botchat__log { min-height: 14rem; max-height: 20rem; padding: 1rem; }
  .botchat__bubble { max-width: 92%; }
  .botchat__send { padding: 0.95rem 1rem; }
}

@media (prefers-reduced-motion: reduce) {
  .botchat__bubble--thinking i { animation: none; opacity: 0.6; }
}
