:root {
  --font: -apple-system, system-ui, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
}

*, *:before, *:after {
  box-sizing: border-box;
  font-family: var(--font);
  font-weight: normal;
  padding: 0;
  margin: 0;
  line-height: 1;
}

html, body, main {
  width: 100%;
  height: 100%;
}

body {
  font-size: 1.2rem;
  font-weight: 300;
  color: #222;
  background-color: #fff;
}

h1 {
  font-size: 1.3em;
  padding: 0.2em 1em;
}

main {
  display: grid;
  grid-template-rows: min-content 1fr min-content;
}

#chat {
  display: grid;
  grid-auto-rows: min-content;
  grid-template-columns: min-content 1fr;
  margin: 0 1em;
  padding: 0.5em 1em;
  border: 1px solid #888;
  scroll-behavior: smooth;
  overflow: auto;
}

div {
  white-space: normal;
  line-height: 1.4;
  padding: 0.2em 0.5em 0.2em 0;
  height: min-content;
}

div.name {
  white-space: nowrap;
  color: #66a;
}

form {
  display: flex;
  flex-wrap: wrap;
  padding: 1em;
}

input, button {
  font-size: 1.2rem;
  width: 5em;
  flex: 1 1 auto;
  padding: 4px;
  border: 0 none;
  border-radius: 0;
  outline: none;
}

input:focus, button:focus {
  outline: none;
}

input#name {
  width: 10em;
}

input#message {
  width: auto;
  flex: 8 1 auto;
}
