:root {
  color-scheme: light;
  font-family: Arial, Helvetica, sans-serif;
  background: #eef2f5;
  color: #17202a;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
}

.app {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.chat {
  width: min(960px, 100%);
  height: min(760px, calc(100vh - 48px));
  display: grid;
  grid-template-rows: auto 1fr auto;
  background: #ffffff;
  border: 1px solid #d8e0e7;
  border-radius: 8px;
  box-shadow: 0 18px 60px rgba(20, 38, 54, 0.14);
  overflow: hidden;
}

.chat__header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 22px 24px;
  border-bottom: 1px solid #e5ebf0;
  background: #fbfcfd;
}

.eyebrow {
  margin: 0 0 4px;
  font-size: 12px;
  font-weight: 700;
  color: #1d7f5f;
}

h1 {
  margin: 0;
  font-size: 24px;
  line-height: 1.2;
}

.status {
  align-self: start;
  padding: 6px 10px;
  border-radius: 999px;
  background: #e9f7f1;
  color: #126c50;
  font-size: 13px;
}

.messages {
  padding: 22px 24px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.message {
  max-width: 78%;
  padding: 14px 16px;
  border-radius: 8px;
  line-height: 1.45;
  white-space: pre-wrap;
}

.message p {
  margin: 0;
}

.message--bot {
  align-self: flex-start;
  background: #eef5f2;
}

.message--user {
  align-self: flex-end;
  background: #1f6feb;
  color: #ffffff;
}

.message--error {
  background: #fff0f0;
  color: #9b1c1c;
}

.composer {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  padding: 18px 24px 22px;
  border-top: 1px solid #e5ebf0;
  background: #fbfcfd;
}

textarea {
  width: 100%;
  resize: none;
  border: 1px solid #c8d3dc;
  border-radius: 8px;
  padding: 13px 14px;
  font: inherit;
  line-height: 1.35;
}

textarea:focus {
  outline: 2px solid #8ab4f8;
  border-color: #1f6feb;
}

button {
  min-width: 128px;
  border: 0;
  border-radius: 8px;
  background: #1d7f5f;
  color: white;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

button:disabled {
  cursor: wait;
  opacity: 0.7;
}

@media (max-width: 640px) {
  .app {
    padding: 0;
  }

  .chat {
    height: 100vh;
    border: 0;
    border-radius: 0;
  }

  .composer {
    grid-template-columns: 1fr;
  }

  button {
    min-height: 46px;
  }

  .message {
    max-width: 92%;
  }
}
