/* The chat page. The tokens, header and footer are in site.css. */

html { -webkit-text-size-adjust: 100%; }

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.intro { padding: 72px 0 28px; }

.intro h1 {
  font-size: clamp(2.1rem, 4.4vw, 3.2rem);
  max-width: 820px;
}

.intro .hero-sub {
  margin: 20px 0 0;
  max-width: 680px;
  font-size: 1.08rem;
}

.col { max-width: 760px; }

main { padding-bottom: 72px; }

.chat { margin-top: 8px; }

.stage {
  position: relative;
  min-height: 300px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
}

.empty { padding: 20px 16px 8px; }

.empty[hidden] { display: none; }

.empty p {
  margin: 0 0 12px;
  color: var(--blue);
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.examples {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
}

.example {
  display: block;
  width: 100%;
  text-align: left;
  font: inherit;
  color: var(--text);
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 14px;
  cursor: pointer;
}

.example:hover { border-color: var(--teal); color: var(--teal); }

.messages {
  max-height: 55vh;
  overflow-y: auto;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.messages:empty { padding: 0; }

.msg { display: flex; }

.msg.user { justify-content: flex-end; }

.msg.bot { justify-content: flex-start; }

.bubble {
  max-width: 88%;
  padding: 9px 13px;
  border-radius: 12px;
  overflow-wrap: anywhere;
}

.msg.user .bubble {
  background: var(--surface-2);
  border: 1px solid rgba(0, 245, 196, 0.25);
  color: var(--text);
  white-space: pre-wrap;
  border-bottom-right-radius: 4px;
}

.msg.bot .bubble {
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-bottom-left-radius: 4px;
}

.bubble p { margin: 0; color: var(--text); }

.bubble p + p,
.bubble p + pre,
.bubble pre + p { margin-top: 6px; }

.bubble pre {
  margin: 0;
  padding: 8px 10px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  font-family: var(--font-mono);
  font-size: 0.875rem;
  line-height: 1.45;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.status {
  margin: 8px 2px 0;
  min-height: 1.5em;
  color: var(--text-dim);
  font-size: 0.9rem;
}

.status[hidden] { display: block !important; visibility: hidden; }

.composer { margin-top: 8px; }

.composer label {
  display: block;
  margin-bottom: 6px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-dim);
}

textarea {
  display: block;
  width: 100%;
  min-height: 3.5rem;
  max-height: 10rem;
  resize: vertical;
  font: inherit;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  padding: 12px 16px;
}

textarea:focus-visible {
  outline: none;
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(0, 245, 196, 0.15);
}

textarea:disabled { opacity: 0.6; }

.actions {
  margin-top: 8px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.count {
  color: var(--text-dim);
  font-size: 0.875rem;
  font-variant-numeric: tabular-nums;
}

.buttons { display: flex; flex-wrap: wrap; gap: 8px; }

button { font: inherit; }

.primary,
.secondary {
  border-radius: 999px;
  padding: 10px 24px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
}

.primary {
  background: var(--accent-grad);
  color: #04140f;
  box-shadow: 0 4px 16px -6px rgba(0, 245, 196, 0.35);
}

.primary:hover:not(:disabled) { box-shadow: 0 6px 20px -6px rgba(0, 245, 196, 0.45); }

.secondary {
  background: rgba(255, 255, 255, 0.02);
  color: var(--text);
  border-color: var(--border-strong);
}

.secondary:hover:not(:disabled) { border-color: var(--teal); color: var(--teal); }

button:disabled { opacity: 0.55; cursor: default; }

textarea:focus-visible,
.messages:focus-visible,
summary:focus-visible,
.example:focus-visible,
.primary:focus-visible,
.secondary:focus-visible {
  outline: 3px solid var(--teal);
  outline-offset: 2px;
}

.retention {
  margin: 14px 2px 0;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-dim);
}

.faq { margin-top: 48px; }

.faq h2 {
  margin: 0 0 12px;
  font-size: 1.6rem;
}

details {
  border-top: 1px solid var(--border);
  padding: 2px 0;
}

details:last-of-type { border-bottom: 1px solid var(--border); }

summary {
  cursor: pointer;
  padding: 10px 2px;
  font-weight: 550;
}

details p {
  margin: 0 0 12px;
  padding: 0 2px;
  color: var(--text-dim);
}

details a,
.footer-bottom a { color: var(--teal); text-decoration: underline; text-underline-offset: 3px; }

@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
  .example,
  .primary,
  .secondary { transition: border-color 0.15s ease, background-color 0.15s ease; }
}

@media (max-width: 720px) {
  .intro { padding: 48px 0 20px; }
}

@media (max-width: 480px) {
  .container { padding: 0 16px; }
  .bubble { max-width: 94%; }
  .buttons { width: 100%; }
  .buttons button { flex: 1 1 auto; }
  .brand { font-size: 1.05rem; }
}

.footer-bottom p { color: var(--text-dim); }
