* {
  box-sizing: border-box;
}

html, body {
  height: 100%;
  margin: 0;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: #111318;
  color: #e8e8ea;
}

.screen {
  height: 100dvh;
  display: flex;
  flex-direction: column;
}

.hidden {
  display: none !important;
}

#login-screen {
  align-items: center;
  justify-content: center;
}

#login-form {
  width: min(320px, 90vw);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

#login-form h1 {
  text-align: center;
  margin-bottom: 8px;
}

input, textarea, select, button {
  font: inherit;
  color: inherit;
}

input, textarea {
  background: #1c1f26;
  border: 1px solid #2d313b;
  border-radius: 8px;
  padding: 10px 12px;
}

button {
  background: #3b6fe0;
  border: none;
  border-radius: 8px;
  padding: 10px 12px;
  cursor: pointer;
}

.error {
  color: #e05555;
  min-height: 1.2em;
  margin: 0;
}

header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid #2d313b;
}

#model-select {
  background: #1c1f26;
  border: 1px solid #2d313b;
  border-radius: 6px;
  padding: 4px 8px;
  max-width: 55vw;
}

#messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.msg {
  max-width: 80%;
  padding: 10px 14px;
  border-radius: 14px;
  white-space: pre-wrap;
  word-break: break-word;
}

.msg.user {
  align-self: flex-end;
  background: #3b6fe0;
}

.msg.assistant {
  align-self: flex-start;
  background: #1c1f26;
}

#chat-form {
  display: flex;
  gap: 8px;
  padding: 12px;
  border-top: 1px solid #2d313b;
}

#message-input {
  flex: 1;
  resize: none;
}
