:root {
  color-scheme: light;
  background: #faf7f0;
  color: #293f38;
  font: 100%/1.55 "Segoe UI", system-ui, sans-serif;
  scrollbar-gutter: stable;
}
* { box-sizing: border-box; }
body { margin: 0; }
main { width: min(100% - 2rem, 48rem); margin: clamp(1rem, 6vw, 4rem) auto; }
header { padding: 0 .4rem; margin-bottom: 1.35rem; }
header a { color: inherit; display: inline-flex; align-items: center; min-height: 44px; }
h1 { font: 400 clamp(2.3rem, 7vw, 4rem)/1.08 Georgia, serif; margin: .3rem 0 0; }
section {
  overflow: hidden;
  border: 1px solid #b8c8bb;
  border-radius: 1.25rem;
  background: #fffcf7;
  box-shadow: 0 14px 38px #293f3810;
}
#messages {
  min-height: 13rem;
  max-height: min(46vh, 32rem);
  overflow: auto;
  padding: clamp(.85rem, 4vw, 1.5rem);
}
#welcome {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  align-content: center;
  gap: clamp(.55rem, 3vw, 1.5rem);
  min-height: 10rem;
}
#welcome[hidden] { display: none; }
#welcome img { display: block; width: clamp(4rem, 16vw, 7rem); height: auto; }
.suggestions { display: grid; gap: .55rem; justify-items: start; }
button, textarea { font: inherit; color: inherit; }
button {
  min-height: 44px;
  border: 1px solid #a4b5a7;
  border-radius: .8rem;
  background: #fffcf7;
  padding: .6rem .85rem;
  cursor: pointer;
}
button:disabled { opacity: .6; cursor: default; }
button:not(:disabled):hover { background: #dce8de; }
#welcome button { text-align: left; width: fit-content; }
.turn {
  width: fit-content;
  max-width: min(100%, 38rem);
  padding: .65rem .9rem;
  margin: 0 0 .7rem;
  border-radius: .9rem;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  background: #f3ece1;
}
.turn.user { margin-left: auto; background: #dce8de; }
.turn-row.assistant { display: flex; align-items: flex-start; gap: .55rem; }
.turn-row.assistant .turn { min-width: 0; }
.avatar { flex: 0 0 auto; border-radius: 50%; background: #dce8de; }
.typing-dots {
  display: flex;
  align-items: center;
  gap: .25rem;
  height: 1rem;
}
.typing-dots > span {
  width: .4rem;
  height: .4rem;
  border-radius: 50%;
  background: #3f6657;
}
@media (prefers-reduced-motion: no-preference) {
  .typing-dots > span { animation: typing 1.2s ease-in-out infinite; }
  .typing-dots > span:nth-child(2) { animation-delay: .15s; }
  .typing-dots > span:nth-child(3) { animation-delay: .3s; }
}
@keyframes typing {
  0%, 60%, 100% { transform: translateY(0); opacity: .55; }
  30% { transform: translateY(-.23rem); opacity: 1; }
}
.turn strong { display: block; font-size: .88rem; margin-bottom: .2rem; }
.turn a { color: #294c3e; text-underline-offset: .16em; }
form { padding: clamp(.85rem, 4vw, 1.5rem); background: #edf1e7; border-top: 1px solid #cbd7c9; }
label { display: block; font-weight: 600; margin-bottom: .35rem; }
textarea { display: block; width: 100%; max-height: 12rem; resize: vertical; border: 1px solid #a4b5a7; border-radius: .75rem; padding: .65rem .75rem; background: #fffcf7; }
small { display: block; margin-top: .4rem; }
#status { margin: .4rem 0; }
#status:empty,
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
.actions { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .8rem; }
#send { background: #3f6657; color: #fff; border-color: #3f6657; }
#send:not(:disabled):hover { background: #293f38; }
:focus-visible { outline: 3px solid #3f6657; outline-offset: 3px; }
