:root {
  font-family: system-ui, sans-serif;
  color: #33302d;
  background: #f7f4ef;
  line-height: 1.6;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
}
header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 4vw;
  border-bottom: 1px solid #ddd5ca;
  gap: 1rem;
  flex-wrap: wrap;
}
a {
  color: #604537;
}
h1,
h2 {
  font-family: serif;
  font-weight: 500;
}
h1 {
  font-size: clamp(2rem, 5vw, 3.3rem);
}
main {
  max-width: 1000px;
  margin: auto;
  padding: 2rem 1rem;
}
.brand {
  text-decoration: none;
  font-size: 1.4rem;
}
.brand small {
  font-size: 0.8rem;
  margin-left: 1rem;
}
nav {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
}
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1rem;
}
.card,
form,
.message {
  background: #fffdf9;
  border: 1px solid #e1d9ce;
  border-radius: 12px;
  padding: 1.2rem;
  margin-bottom: 1rem;
}
button,
.button {
  background: #715444;
  color: white;
  border: 0;
  padding: 0.7rem 1rem;
  border-radius: 8px;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
}
button.secondary {
  background: #e5ddd3;
  color: #443a32;
}
button:disabled {
  opacity: 0.5;
  cursor: wait;
}
input,
textarea,
select {
  display: block;
  width: 100%;
  padding: 0.7rem;
  border: 1px solid #c8bfb4;
  border-radius: 6px;
  background: white;
  color: #333;
  font: inherit;
  margin: 0.3rem 0 1rem;
}
textarea {
  min-height: 100px;
}
label {
  font-size: 0.9rem;
}
pre {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  background: #eee9e2;
  padding: 1rem;
  font-size: 0.8rem;
}
#notice:not(:empty) {
  padding: 0.8rem;
  background: #f4e2d0;
  margin-bottom: 1rem;
}
.message {
  white-space: pre-wrap;
}
.message.user {
  margin-left: 12%;
  background: #ece4da;
}
.message.character {
  margin-right: 12%;
}
.muted {
  color: #706b65;
}
.actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}
audio {
  max-width: 100%;
}
.composer {
  position: relative;
  background: #f7f4ef;
  padding-top: 0.5rem;
}
dialog {
  max-width: 600px;
  width: 95%;
  border: 1px solid #c8bfb4;
  border-radius: 12px;
}
.row {
  display: flex;
  gap: 1rem;
  align-items: center;
}
@media (max-width: 600px) {
  main {
    padding: 1rem;
  }
  .message.user,
  .message.character {
    margin-left: 0;
    margin-right: 0;
  }
  nav button {
    padding: 0.5rem;
  }
  .row {
    display: block;
  }
}

.chat-log {
  max-height: 65vh;
  overflow-y: auto;
  padding-top: 1rem;
}
.reply-suggestions {
  margin: 1rem 0;
}
.suggestion {
  padding: 0.75rem;
  margin: 0.5rem 0;
  border: 1px solid #b8b8b8;
  border-radius: 0.5rem;
  overflow-wrap: anywhere;
}
.suggestion p {
  white-space: pre-wrap;
}
