:root {
  --bg: #fff4e0;
  --ink: #3b2a1a;
  --muted: #8a7560;
  --louis: #ffffff;
  --person: #ffd89b;
  --accent: #5865f2;
  --accent-ink: #ffffff;
  --line: #ecd9b8;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  height: 100%;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Noto Sans KR",
    "Malgun Gothic", sans-serif;
  font-size: 17px;
  line-height: 1.5;
}

[hidden] {
  display: none !important;
}

.notice {
  min-height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 24px;
  padding: max(24px, env(safe-area-inset-top)) 24px max(24px, env(safe-area-inset-bottom));
  text-align: center;
}

.face {
  width: 144px;
  height: 144px;
  border-radius: 32px;
}

.button {
  display: inline-block;
  padding: 14px 28px;
  border-radius: 12px;
  background: var(--accent);
  color: var(--accent-ink);
  font-weight: 600;
  text-decoration: none;
}

/* The chat: messages scroll, the composer stays at the bottom. */
#chat {
  height: 100%;
  display: flex;
  flex-direction: column;
}

#messages {
  flex: 1;
  overflow-y: auto;
  margin: 0;
  padding: max(16px, env(safe-area-inset-top)) 12px 12px;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

#messages li {
  max-width: 85%;
  padding: 10px 14px;
  border-radius: 18px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

#messages li.louis {
  align-self: flex-start;
  background: var(--louis);
  border-bottom-left-radius: 6px;
}

#messages li.person {
  align-self: flex-end;
  background: var(--person);
  border-bottom-right-radius: 6px;
}

#messages .note {
  display: block;
  margin-top: 4px;
  font-size: 14px;
  color: var(--muted);
}

#composer {
  border-top: 1px solid var(--line);
  padding: 8px 8px max(8px, env(safe-area-inset-bottom));
  background: var(--bg);
}

#composer .row {
  display: flex;
  align-items: flex-end;
  gap: 6px;
}

#text {
  flex: 1;
  min-height: 44px;
  max-height: 160px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: #ffffff;
  color: var(--ink);
  font: inherit;
  resize: none;
}

.icon {
  flex: none;
  width: 44px;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 22px;
  background: transparent;
  font-size: 22px;
  cursor: pointer;
}

#mic.on {
  background: var(--person);
}

#send {
  flex: none;
  height: 44px;
  padding: 0 16px;
  border: none;
  border-radius: 22px;
  background: var(--accent);
  color: var(--accent-ink);
  font: inherit;
  font-weight: 600;
}

#send:disabled {
  opacity: 0.5;
}

#chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

#chips:not(:empty) {
  margin-bottom: 6px;
}

.chip {
  padding: 4px 10px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #ffffff;
  color: var(--ink);
  font-size: 14px;
}

#status {
  margin: 4px 8px 0;
  min-height: 1em;
  font-size: 14px;
  color: var(--muted);
}

#status:empty {
  display: none;
}
