:root {
  font-family: system-ui, sans-serif;
  color-scheme: dark;
  --bg: #0f1419;
  --panel: #1a2332;
  --border: #2d3a4d;
  --accent: #4e9cff;
  --text: #e8eef7;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  height: 100vh;
}
.layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  height: 100vh;
}
.sidebar {
  border-right: 1px solid var(--border);
  background: var(--panel);
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.sidebar-head {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}
.sidebar-head h1 {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
}
.conv-list {
  list-style: none;
  margin: 0;
  padding: 0.5rem;
  overflow: auto;
  flex: 1;
}
.conv-list li button {
  width: 100%;
  text-align: left;
  padding: 0.5rem 0.75rem;
  margin-bottom: 0.25rem;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: inherit;
  cursor: pointer;
}
.conv-list li button:hover,
.conv-list li button:focus-visible {
  border-color: var(--border);
  outline: none;
}
.conv-list li button.active {
  border-color: var(--accent);
  background: rgba(78, 156, 255, 0.12);
}
.main {
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.thread-head {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border);
  font-weight: 600;
}
.messages {
  flex: 1;
  overflow: auto;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.msg {
  max-width: 85%;
  padding: 0.6rem 0.85rem;
  border-radius: 8px;
  background: var(--panel);
  border: 1px solid var(--border);
  white-space: pre-wrap;
  word-break: break-word;
}
.msg.self {
  align-self: flex-end;
  border-color: rgba(78, 156, 255, 0.4);
}
.composer {
  border-top: 1px solid var(--border);
  padding: 0.75rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
#input-body {
  width: 100%;
  resize: vertical;
  min-height: 2.5rem;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: inherit;
  padding: 0.5rem 0.65rem;
}
.composer-actions {
  display: flex;
  gap: 0.5rem;
}
button {
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--panel);
  color: inherit;
  padding: 0.45rem 0.85rem;
  cursor: pointer;
}
button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
#btn-new-conv {
  font-size: 0.85rem;
}
