/* =========================================================================
   Automated Iterations - Chat page (claude.ai-style: minimal, one prompt box)
   Load AFTER styles.css so the design tokens exist. Used by chat.html.
   ========================================================================= */

.aic {
  display: flex;
  flex-direction: column;
  height: calc(100dvh - 66px); /* viewport minus the sticky header */
  background: var(--bg-primary);
}
@supports not (height: 100dvh) {
  .aic { height: calc(100vh - 66px); }
}

/* Scrolling conversation area */
.aic__log { flex: 1 1 auto; overflow-y: auto; scroll-behavior: smooth; }
.aic__inner {
  max-width: 740px;
  margin-inline: auto;
  padding: var(--space-6) var(--space-3) var(--space-4);
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.aic__msg { white-space: pre-wrap; word-wrap: break-word; }
.aic__msg--bot {
  align-self: stretch;
  color: var(--text-secondary);
  font-size: var(--body-lg);
  line-height: 1.75;
}
.aic__msg--bot strong { color: var(--text-primary); }
.aic__msg--user {
  align-self: flex-end;
  max-width: 85%;
  background: var(--bg-secondary);
  border: 1px solid var(--border-dark);
  padding: 0.8rem 1.05rem;
  color: var(--text-primary);
  font-size: var(--body);
  line-height: 1.6;
}

.aic__typing { align-self: flex-start; display: inline-flex; gap: 0.3rem; padding: 0.5rem 0; }
.aic__typing span { width: 0.45rem; height: 0.45rem; border-radius: 50%; background: var(--text-muted); animation: aic-bounce 1s infinite ease-in-out; }
.aic__typing span:nth-child(2) { animation-delay: 0.15s; }
.aic__typing span:nth-child(3) { animation-delay: 0.3s; }
@keyframes aic-bounce { 0%, 60%, 100% { transform: translateY(0); opacity: 0.5; } 30% { transform: translateY(-4px); opacity: 1; } }

/* Composer pinned to the bottom */
.aic__composer {
  flex: 0 0 auto;
  border-top: 1px solid var(--border-dark);
  background: var(--bg-primary);
  padding: var(--space-3) var(--space-3) var(--space-4);
}
.aic__form { max-width: 740px; margin-inline: auto; display: flex; gap: 0.6rem; align-items: flex-end; }
.aic__input {
  flex: 1 1 auto;
  resize: none;
  min-height: 52px;
  max-height: 180px;
  padding: 0.9rem 1rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border-dark);
  border-radius: 0;
  color: var(--text-primary);
  font-size: var(--body);
  line-height: 1.5;
  font-family: inherit;
}
.aic__input:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: var(--accent); }
.aic__input::placeholder { color: var(--text-muted); }
.aic__send {
  flex-shrink: 0;
  height: 52px;
  padding: 0 1.4rem;
  background: var(--accent);
  border: 1px solid var(--accent);
  color: var(--text-primary);
  font-weight: 700;
  font-size: 0.85rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background-color var(--transition-fast), border-color var(--transition-fast);
}
.aic__send:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.aic__send:disabled { opacity: 0.5; cursor: not-allowed; }

.aic__hint { max-width: 740px; margin: var(--space-2) auto 0; font-size: var(--small); color: var(--text-muted); text-align: center; line-height: 1.5; }
.aic__hint a { color: var(--accent); }

@media (max-width: 768px) {
  .aic { height: calc(100dvh - 64px); }
  @supports not (height: 100dvh) { .aic { height: calc(100vh - 64px); } }
  .aic__send { padding: 0 1rem; }
}
