* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  padding: 32px 18px 56px;
  font-family: "Segoe UI", Arial, Helvetica, sans-serif;
  font-size: 16px;
  line-height: 1.45;
  color: #242320;
  background-color: #cfc9c0;
  background-image: linear-gradient(
    180deg,
    #c5bfb5 0px,
    #d8d3ca 120px,
    #d8d3ca 100%
  );
}

.layout {
  max-width: 580px;
  margin-left: auto;
  margin-right: auto;
  padding: 36px 40px 40px;
  background-color: #fffef9;
  border: 1px solid #b8b3a8;
  border-radius: 4px;
  box-shadow: 0 6px 24px rgba(36, 35, 32, 0.12);
}

header {
  margin-bottom: 32px;
  padding-bottom: 22px;
  border-bottom: 1px solid #d9d4cc;
}

h1 {
  font-family: Georgia, "Times New Roman", Times, serif;
  font-size: 26px;
  font-weight: normal;
  line-height: 1.25;
  margin: 0 0 14px;
  color: #1c1b18;
  letter-spacing: -0.3px;
}

header p {
  margin: 0;
  font-size: 15px;
  color: #4a4844;
  max-width: 520px;
}

h2 {
  font-family: Georgia, "Times New Roman", Times, serif;
  font-size: 18px;
  font-weight: normal;
  margin: 36px 0 16px;
  color: #2a2824;
}

label {
  display: block;
  font-size: 13px;
  margin-bottom: 7px;
  color: #4a4844;
  font-weight: 600;
  letter-spacing: 0.2px;
}

form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

textarea,
input[type="text"] {
  width: 100%;
  padding: 11px 14px;
  font-size: 15px;
  font-family: "Segoe UI", Arial, Helvetica, sans-serif;
  border: 1px solid #a39e94;
  border-radius: 3px;
  background-color: #ffffff;
  color: #242320;
}

textarea::placeholder,
input[type="text"]::placeholder {
  color: #8a8580;
}

textarea {
  min-height: 132px;
  resize: vertical;
}

textarea:focus,
input[type="text"]:focus {
  outline: none;
  border-color: #3d5c4e;
  box-shadow: 0 0 0 2px rgba(61, 92, 78, 0.2);
}

button[type="submit"] {
  align-self: flex-start;
  margin-top: 6px;
  padding: 11px 22px;
  font-size: 15px;
  font-family: "Segoe UI", Arial, Helvetica, sans-serif;
  font-weight: 600;
  color: #fffef9;
  background-color: #3d5c4e;
  border: 1px solid #2f453b;
  border-radius: 3px;
  cursor: pointer;
  box-shadow: 0 2px 0 #2a3f36;
}

button[type="submit"]:hover {
  background-color: #466b5a;
}

button[type="submit"]:active {
  background-color: #355248;
  box-shadow: none;
  transform: translateY(1px);
}

#message-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

#message-list li {
  display: flex;
  flex-direction: column;
  padding: 16px 18px 16px 20px;
  margin-bottom: 14px;
  border: 1px solid #d4cfc4;
  border-left: 4px solid #6b8f7e;
  border-radius: 3px;
  background-color: #faf8f2;
}

.message-head {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
}

.message-avatar {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  border-radius: 20px;
  background-color: #3d5c4e;
  color: #fffef9;
  font-family: "Segoe UI", Arial, Helvetica, sans-serif;
  font-size: 17px;
  font-weight: 700;
  line-height: 40px;
  text-align: center;
}

.message-name {
  position: relative;
  font-family: Georgia, "Times New Roman", Times, serif;
  font-size: 16px;
  margin: 0;
  font-weight: normal;
  color: #2a2824;
}

#message-list li p {
  margin: 0;
  font-size: 15px;
  color: #3d3b37;
  white-space: pre-wrap;
}

.message-time {
  align-self: flex-end;
  margin-top: 10px;
  font-size: 12px;
  line-height: 1.3;
  color: #6e6a64;
  font-family: "Segoe UI", Arial, Helvetica, sans-serif;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (max-width: 520px) {
  body {
    padding: 16px 12px 40px;
  }

  .layout {
    padding: 26px 22px 30px;
  }

  h1 {
    font-size: 22px;
  }
}