* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: sans-serif;
  background: #f4f4f5;
  color: #111827;
}

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

.sidebar {
  background: #ffffff;
  border-right: 1px solid #e5e7eb;
  padding: 12px;
}

.sidebar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.sidebar-header h1 {
  margin: 0;
  font-size: 18px;
}

.identity {
  display: grid;
  gap: 6px;
  margin-bottom: 12px;
}

.identity label {
  font-size: 12px;
  color: #6b7280;
}

.identity input,
.chat-header select,
.composer textarea {
  width: 100%;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  padding: 8px;
  font-size: 14px;
}

.session-list {
  display: grid;
  gap: 8px;
}

.session-item {
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: #fafafa;
  padding: 8px;
  cursor: pointer;
}

.session-item.active {
  border-color: #2563eb;
  background: #eff6ff;
}

.session-topic {
  font-size: 14px;
  font-weight: 600;
}

.session-meta {
  font-size: 12px;
  color: #6b7280;
}

.chat {
  display: grid;
  grid-template-rows: auto 1fr auto;
}

.chat-header {
  display: grid;
  grid-template-columns: 1fr 220px;
  gap: 8px;
  align-items: center;
  border-bottom: 1px solid #e5e7eb;
  background: #ffffff;
  padding: 12px;
}

.messages {
  padding: 12px;
  overflow: auto;
  display: grid;
  gap: 8px;
}

.message {
  max-width: 85%;
  border-radius: 10px;
  padding: 10px;
  white-space: pre-wrap;
}

.message.user {
  justify-self: end;
  background: #dbeafe;
}

.message.assistant {
  justify-self: start;
  background: #ffffff;
  border: 1px solid #e5e7eb;
}

.composer {
  display: grid;
  grid-template-columns: 1fr 120px;
  gap: 8px;
  padding: 12px;
  border-top: 1px solid #e5e7eb;
  background: #ffffff;
}

button {
  border: 1px solid #d1d5db;
  background: #ffffff;
  border-radius: 8px;
  padding: 8px 10px;
  cursor: pointer;
}

button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

@media (max-width: 900px) {
  .app {
    grid-template-columns: 1fr;
  }

  .sidebar {
    border-right: 0;
    border-bottom: 1px solid #e5e7eb;
  }
}
