@font-face {
  font-family: "Archivo";
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url("./fonts/archivo-latin.woff2") format("woff2");
}

:root {
  color-scheme: light;
  --ink: #1c1915;
  --muted: #5c564c;
  --line: #e4ddd2;
  --paper: #f7f4ee;
  --side: #efeae2;
  --card: #fff;
  --accent: #1f4d3a;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Archivo, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--paper);
}

.app {
  display: grid;
  grid-template-columns: 280px 1fr;
  min-height: 100vh;
}

.tree {
  background: var(--side);
  border-right: 1px solid var(--line);
  padding: 20px 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.mark {
  margin: 0;
  font-weight: 750;
  letter-spacing: 0.04em;
}

.tree-head {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

button,
textarea,
input {
  font: inherit;
}

button {
  background: var(--accent);
  color: #fff;
  border: 0;
  border-radius: 999px;
  padding: 8px 14px;
  cursor: pointer;
}

.search {
  font-size: 0.85rem;
  color: var(--muted);
}

#thread-search,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--card);
  padding: 10px 12px;
}

#tree {
  overflow: auto;
}

#tree h2 {
  margin: 16px 0 6px;
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

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

#tree button {
  width: 100%;
  text-align: left;
  background: transparent;
  color: var(--ink);
  border-radius: 10px;
  padding: 8px 10px;
}

#tree button[aria-current="page"] {
  background: var(--card);
  outline: 1px solid var(--line);
}

.empty {
  color: var(--muted);
  font-size: 0.9rem;
}

.chat {
  display: flex;
  flex-direction: column;
  min-width: 0;
  max-width: 820px;
  width: 100%;
  margin: 0 auto;
  padding: 28px 24px 20px;
}

.chat-head h1 {
  margin: 0 0 6px;
  font-size: 1.4rem;
}

.chat-note,
.hint {
  margin: 0;
  color: var(--muted);
}

.log {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 22px 0;
}

.bubble {
  max-width: 42rem;
  padding: 12px 14px;
  border-radius: 16px;
  white-space: pre-wrap;
}

.bubble.user {
  align-self: flex-end;
  background: #e7efe9;
}

.bubble.liya {
  background: var(--card);
  border: 1px solid var(--line);
}

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 14px 16px;
}

.card h2 {
  margin: 0 0 8px;
  font-size: 1rem;
}

.card p,
.card li {
  margin: 0 0 6px;
}

.card ul {
  margin: 0 0 10px;
  padding-left: 18px;
}

#composer {
  display: grid;
  gap: 8px;
}

#composer label {
  font-size: 0.85rem;
  color: var(--muted);
}

#composer button {
  justify-self: end;
}

@media (max-width: 720px) {
  .app {
    grid-template-columns: 1fr;
  }
  .tree {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
  #tree {
    max-height: 28vh;
  }
}
