
* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: Arial, sans-serif;
  background: #101116;
  color: #f5f5f7;
}

.app { display: flex; height: 100dvh; }

.sidebar {
  width: 245px;
  padding: 22px;
  background: #171820;
  border-right: 1px solid #30313c;
}

.sidebar h2 { color: #b7a5ff; }

.sidebar button {
  width: 100%;
  padding: 13px;
  background: #292a36;
  border: 1px solid #454655;
  border-radius: 10px;
  color: white;
  cursor: pointer;
}

.sidebar-note {
  margin-top: 30px;
  color: #898998;
  font-size: 13px;
}

.main {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

header {
  padding: 20px;
  border-bottom: 1px solid #292a36;
  font-weight: bold;
}

header span {
  font-size: 12px;
  color: #a69bcb;
  margin-left: 10px;
}

.messages {
  flex: 1;
  overflow-y: auto;
  padding: 25px max(20px, 12%);
}

.welcome {
  text-align: center;
  margin-top: 15vh;
}

.welcome h1 { color: #c3b5ff; }

.welcome p { color: #9696a5; }

.message {
  padding: 15px 18px;
  border-radius: 14px;
  margin: 15px 0;
  line-height: 1.6;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.user {
  background: #353047;
  margin-left: 12%;
}

.bot {
  background: #20212b;
  margin-right: 12%;
}

.message img {
  display: block;
  max-width: 250px;
  margin-top: 10px;
  border-radius: 10px;
}

.composer {
  width: min(850px, 94%);
  margin: 0 auto 20px;
}

#preview img {
  max-height: 100px;
  border-radius: 8px;
  margin-bottom: 10px;
}

form {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  background: #252630;
  border: 1px solid #454654;
  border-radius: 18px;
}

textarea {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: white;
  resize: none;
  font: inherit;
}

.upload {
  cursor: pointer;
  font-size: 28px;
}

.send {
  background: #8064e9;
  border: none;
  border-radius: 10px;
  color: white;
  padding: 12px;
  cursor: pointer;
}

small {
  display: block;
  text-align: center;
  color: #777887;
  margin-top: 10px;
}

@media (max-width: 650px) {
  .sidebar { display: none; }
  .messages { padding: 15px; }
  .welcome h1 { font-size: 24px; }
}
