* { box-sizing: border-box; }
html, body {
  margin: 0;
  height: 100%;
  font-family: -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  background: #0f1115;
  color: #e6e6e6;
}
.screen { height: 100vh; }
.hidden { display: none !important; }

#login-screen {
  display: flex;
  align-items: center;
  justify-content: center;
}
.login-card {
  background: #1a1d24;
  padding: 32px;
  border-radius: 12px;
  width: 280px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.login-card h1 {
  font-size: 18px;
  margin: 0 0 8px;
  text-align: center;
}
.login-card input {
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid #333;
  background: #0f1115;
  color: #fff;
  font-size: 14px;
}
.login-card button {
  padding: 10px 12px;
  border-radius: 8px;
  border: none;
  background: #4f7cff;
  color: white;
  font-weight: 600;
  cursor: pointer;
}
.error { color: #ff6b6b; font-size: 13px; min-height: 16px; }

#chat-screen {
  display: flex;
  flex-direction: column;
}
.chat-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  background: #1a1d24;
  border-bottom: 1px solid #262a33;
  flex-shrink: 0;
}
.chat-header button {
  background: transparent;
  border: 1px solid #444;
  color: #ccc;
  padding: 6px 10px;
  border-radius: 6px;
  cursor: pointer;
}
.messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.message { display: flex; flex-direction: column; max-width: 70%; }
.message.mine { align-self: flex-end; align-items: flex-end; }
.message.theirs { align-self: flex-start; align-items: flex-start; }
.meta { font-size: 11px; color: #888; margin: 0 4px 2px; }
.bubble {
  padding: 8px 12px;
  border-radius: 14px;
  word-wrap: break-word;
  white-space: pre-wrap;
}
.message.mine .bubble { background: #4f7cff; color: white; border-bottom-right-radius: 4px; }
.message.theirs .bubble { background: #262a33; color: #eee; border-bottom-left-radius: 4px; }

.send-form {
  display: flex;
  gap: 8px;
  padding: 12px 16px;
  background: #1a1d24;
  border-top: 1px solid #262a33;
  flex-shrink: 0;
}
.send-form input {
  flex: 1;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid #333;
  background: #0f1115;
  color: #fff;
  font-size: 14px;
}
.send-form button {
  padding: 10px 16px;
  border-radius: 8px;
  border: none;
  background: #4f7cff;
  color: white;
  font-weight: 600;
  cursor: pointer;
}
