/* assistant -- the Assistenz screens. Tokens from @foundry/admin; the shapes echo the Postfach's messages. */

.as-screen {
  display: grid;
  gap: 1rem;
}

/* One conversation fills the column: heading, the messages that scroll, the composer that stays. */
.as-chat {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: 0.75rem;
  height: calc(100vh - 7rem);
  min-height: 24rem;
}

.as-msgs {
  display: grid;
  align-content: start;
  gap: 0.75rem;
  overflow-y: auto;
  padding: 0.25rem 0.25rem 1rem;
}

.as-msg {
  max-width: min(46rem, 100%);
  padding: 0.8rem 1rem;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-lg);
  background: var(--surface);
}

/* The person's own words, set off — which side a message came from is the first thing the eye needs. */
.as-msg[data-out] {
  justify-self: end;
  border-inline-start: 3px solid var(--accent);
  background: var(--surface-2);
}

.as-msg.live .as-body:empty {
  display: none;
}

.as-msg.error {
  border-color: color-mix(in srgb, var(--bad) 45%, var(--line));
  display: grid;
  gap: 0.6rem;
  justify-items: start;
}

.as-body {
  margin: 0;
  font-size: 0.92rem;
  line-height: 1.55;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.as-state {
  margin-top: 0.4rem;
  font-size: 0.8rem;
}

/* What the answer was built from: the tools it used, the proposals it made. */
.as-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 0.6rem;
}

.as-chip {
  padding: 0.1rem 0.5rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--muted);
  text-decoration: none;
}

.as-chip.bad {
  border-color: color-mix(in srgb, var(--bad) 50%, var(--line));
  color: var(--bad);
}

.as-chip.proposal {
  font-family: var(--sans);
  border-color: color-mix(in srgb, var(--warn) 60%, var(--line));
  color: var(--warn);
}

.as-composer {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.5rem;
  align-items: end;
}

.as-input {
  width: 100%;
  resize: vertical;
  padding: 0.6rem 0.75rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--fg);
  font: inherit;
  font-size: 0.92rem;
  line-height: 1.45;
}

.as-input:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

/* The CLI's own login screen. Dark whatever the theme: a terminal is a terminal. */
.as-term {
  min-height: 26rem;
  padding: 0.5rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: #131316;
}

.as-term .xterm {
  height: 25rem;
}
