body {
  font-family: Arial, sans-serif;
  background: #f2f2f2;
  display: flex;
  justify-content: center;
  padding: 40px;
}

.chat-container {
  width: 400px;
  background: white;
  border-radius: 10px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

#messages-list {
  list-style: none;
  margin: 0;
  padding: 14px;
}

#messages-list li {
  background: #eaeeef;
  padding: 10px 14px;
  margin-bottom: 12px;
  border-radius: 10px;
  max-width: 80%;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.message-header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 6px;
  font-size: 0.85rem;
  color: #555;
}

.username {
  font-weight: bold;
  color: #333;
}

.username::before {
  content: "💬 ";
}

.timestamp {
  font-size: 0.75rem;
  color: #888;
  align-items: flex-end;
}

.message-text {
  font-size: 1rem;
  color: #222;
}

form {
  display: flex;
  gap: 10px;
  padding: 15px;
  background: #fff;
  border-top: 1px solid #ddd;
}
form input {
  flex: 1;
  min-width: 0; /* IMPORTANT: prevents overflow */
}

input {
  flex: 1;
  padding: 10px;
  border-radius: 6px;
  border: 1px solid #ccc;
}

button {
  padding: 10px 15px;
  border: none;
  background: #0078ff;
  color: white;
  border-radius: 6px;
  cursor: pointer;
}

button:hover {
  background: #005fcc;
}
