:root {
  --bg: #0b0f19;
  --panel: #111827;
  --panel2: #0f172a;
  --line: #243044;
  --text: #e5e7eb;
  --muted: #94a3b8;
  --accent: #10a37f;
  --blue: #2563eb;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Arial, Helvetica, sans-serif;
}

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

.sidebar {
  background: #050814;
  border-right: 1px solid var(--line);
  padding: 16px;
  overflow-y: auto;
}

.brand {
  margin-bottom: 16px;
}

.brand strong {
  display: block;
  font-size: 22px;
}

.brand span {
  display: block;
  color: var(--muted);
  font-size: 13px;
  margin-top: 4px;
}

.new-btn {
  width: 100%;
  background: var(--accent);
  color: #04130f;
  border: 0;
  font-weight: 800;
  border-radius: 12px;
  padding: 13px;
  cursor: pointer;
  margin-bottom: 18px;
}

.section-title {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .08em;
  margin: 14px 0 8px;
}

.conversation {
  padding: 12px;
  border-radius: 12px;
  color: #cbd5e1;
  cursor: pointer;
  margin-bottom: 6px;
  border: 1px solid transparent;
}

.conversation:hover,
.conversation.active {
  background: var(--panel);
  border-color: var(--line);
  color: white;
}

.main {
  display: grid;
  grid-template-rows: auto 1fr auto;
  min-width: 0;
}

.topbar {
  min-height: 70px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
  background: var(--panel2);
  display: flex;
  align-items: center;
  gap: 12px;
}

.topbar strong {
  display: block;
}

.topbar span {
  display: block;
  color: var(--muted);
  font-size: 13px;
  margin-top: 4px;
}

.mobile-menu {
  display: none;
  background: transparent;
  border: 1px solid var(--line);
  color: var(--text);
  border-radius: 10px;
  padding: 8px 10px;
}

.messages {
  padding: 24px;
  overflow-y: auto;
}

.message {
  max-width: 900px;
  margin: 0 auto 14px;
  padding: 15px 17px;
  border-radius: 16px;
  line-height: 1.5;
  white-space: pre-wrap;
}

.message.user {
  background: var(--blue);
  color: white;
}

.message.assistant {
  background: var(--panel);
  border: 1px solid var(--line);
  color: var(--text);
}

.composer {
  display: flex;
  gap: 10px;
  padding: 16px;
  border-top: 1px solid var(--line);
  background: var(--panel2);
}

.composer textarea {
  flex: 1;
  resize: none;
  min-height: 48px;
  max-height: 160px;
  border: 1px solid var(--line);
  background: #050814;
  color: white;
  border-radius: 14px;
  padding: 14px;
  outline: none;
  font-family: inherit;
}

.composer button {
  background: var(--accent);
  color: #04130f;
  border: 0;
  border-radius: 14px;
  padding: 0 18px;
  font-weight: 800;
  cursor: pointer;
}

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

  .sidebar {
    display: none;
    border-right: 0;
    border-bottom: 1px solid var(--line);
    max-height: 280px;
  }

  .sidebar.open {
    display: block;
  }

  .mobile-menu {
    display: inline-block;
  }

  .messages {
    padding: 14px;
  }

  .composer {
    padding: 12px;
  }
}
