:root {
  font:
    15px/1.55 Inter,
    'PingFang SC',
    system-ui,
    sans-serif;
  color: #1b3026;
  background: #f7f8f3;
}
* {
  box-sizing: border-box;
}
[hidden] {
  display: none !important;
}
body {
  margin: 0;
}
.layout {
  min-height: 100svh;
  display: grid;
  grid-template-columns: 245px minmax(0, 1fr);
}
aside {
  background: #20392d;
  color: #f1f6e8;
  display: flex;
  flex-direction: column;
  padding: 27px 20px;
  max-height: 100svh;
  position: sticky;
  top: 0;
}
.brand {
  display: flex;
  gap: 10px;
  align-items: center;
  font-size: 21px;
  letter-spacing: -0.6px;
  font-weight: 650;
}
.brand img {
  border: 1px solid #4d6354;
  border-radius: 8px;
}
button,
textarea,
input,
select {
  font: inherit;
}
button {
  cursor: pointer;
  border: 0;
  border-radius: 7px;
}
button:disabled {
  cursor: wait;
  opacity: 0.55;
}
#newChat {
  margin-top: 34px;
  background: #d8efc9;
  color: #20392d;
  text-align: left;
  padding: 10px;
}
aside h2,
footer {
  font-size: 11px;
  letter-spacing: 0.09em;
  color: #adc1b1;
  margin-top: 26px;
}
footer {
  margin-top: auto;
  padding-top: 28px;
}
#recent {
  min-height: 0;
  overflow-y: auto;
}
nav button {
  display: block;
  width: 100%;
  text-align: left;
  padding: 8px;
  background: transparent;
  color: #d4e2d6;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
nav button:is(:hover, .active) {
  background: #395243;
  color: white;
}
main {
  min-height: 100svh;
  display: flex;
  flex-direction: column;
}
header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  min-height: 66px;
  padding: 16px clamp(20px, 4vw, 70px);
  color: #65786b;
  border-bottom: 1px solid #dbe1d6;
  font-size: 13px;
}
header button {
  background: transparent;
  color: inherit;
}
#login {
  margin: auto;
  width: min(370px, 86%);
  padding: 50px 0 100px;
}
h1 {
  font-weight: 570;
  letter-spacing: -0.055em;
  font-size: clamp(26px, 3.4vw, 44px);
  margin: 9px 0;
}
.icon {
  display: grid;
  place-content: center;
  width: 39px;
  height: 39px;
  background: #c8e8b6;
  border-radius: 12px;
  font-size: 23px;
}
p {
  color: #596e60;
  margin: 4px 0 27px;
}
label {
  font-size: 13px;
  color: #526557;
  font-weight: 600;
}
#loginForm {
  display: grid;
  gap: 10px;
}
input,
select {
  border: 1px solid #b9c8b8;
  background: #fff;
  border-radius: 6px;
  padding: 8px;
  color: inherit;
}
.primary {
  background: #254632;
  color: white;
  font-weight: 600;
  padding: 9px 19px;
}
#loginError {
  color: #a33;
}
#desk {
  width: min(800px, 100%);
  margin: auto;
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 24px clamp(16px, 4vw, 42px);
}
#welcome {
  margin: auto 0;
}
#stream {
  display: grid;
  gap: 22px;
}
article {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
article small {
  display: block;
  color: #63806c;
  font:
    600 11px/2.4 Inter,
    system-ui;
  letter-spacing: 0.08em;
}
article.user {
  border-left: 3px solid #b0cc9e;
  padding-left: 15px;
}
#compose {
  margin-top: auto;
  position: sticky;
  bottom: 12px;
  background: white;
  border: 1px solid #c8d3c2;
  border-radius: 13px;
  padding: 13px 16px;
  box-shadow: 0 4px 18px #243e2210;
}
#stream:not(:empty) {
  padding: 4px 0 30px;
}
#compose select {
  margin-left: 8px;
  max-width: 70%;
  font-size: 13px;
  padding: 3px 6px;
}
textarea {
  border: 0;
  resize: vertical;
  min-height: 80px;
  max-height: 240px;
  width: 100%;
  outline: 0;
  padding: 12px 0;
  background: transparent;
  color: inherit;
}
.sendrow {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
#state {
  font-size: 13px;
  color: #65796a;
}
button:focus-visible,
input:focus,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid #83aa69;
  outline-offset: 2px;
}
@media (max-width: 720px) {
  .layout {
    display: block;
  }
  aside {
    position: static;
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 14px;
    padding: 10px 16px;
  }
  .brand {
    font-size: 17px;
    white-space: nowrap;
  }
  .brand img {
    width: 25px;
    height: 25px;
  }
  #newChat {
    margin: 0;
    font-size: 12px;
    padding: 5px 8px;
    white-space: nowrap;
  }
  #recent {
    max-width: 35%;
    margin-left: auto;
  }
  #recent h2,
  footer {
    display: none;
  }
  #chats {
    max-height: 35px;
    overflow: auto;
  }
  main {
    min-height: calc(100svh - 49px);
  }
  header {
    min-height: 42px;
    padding: 8px 18px;
  }
  #desk {
    padding: 16px;
  }
  #compose {
    bottom: 5px;
  }
}
