/* Chat message layout and readability */
.msg {
  padding: 14px 16px;
  border-radius: 12px;
  margin-bottom: 14px;
  background: #f8fafc;
  border: 1px solid #e5e9f0;
}
.msg-user {
  background: #fff7e6;
  border-color: #f1d8a8;
}
.msg-bot {
  background: #f8fafc;
}
.msg .who {
  font-weight: 700;
  margin-bottom: 8px;
  color: #0e1f31;
}
.msg .msg-body {
  color: #1f2937;
  line-height: 1.65;
  font-size: 16px;
}
.msg .msg-body p { margin: 0 0 12px 0; }
.msg .msg-body h2,
.msg .msg-body h3,
.msg .msg-body h4 {
  margin: 14px 0 8px 0;
  line-height: 1.3;
  color: #0e1f31;
  font-weight: 700;
}
.msg .msg-body ul,
.msg .msg-body ol {
  margin: 8px 0 12px 20px;
  padding: 0;
}
.msg .msg-body li { margin: 5px 0; }
.msg .msg-body a { color: #0b5ed7; }
.msg .msg-body a:hover { color: #084298; text-decoration: underline; }

.msg-actions {
  margin-top: 10px;
  display: flex;
  gap: 10px;
}
.copy-btn {
  border: 1px solid #d1d5db;
  background: #fff;
  border-radius: 6px;
  padding: 6px 10px;
  cursor: pointer;
  font-size: 13px;
}
.copy-btn:hover { background: #f3f4f6; }

/* Optional layout shell */
.chat-container { max-width: 1200px; margin: 20px auto; padding: 0 16px; display: grid; grid-template-columns: 280px 1fr; gap: 16px; }
.chat-sidebar { border: 1px solid #e5e9f0; border-radius: 10px; padding: 12px; background: #f8fafc; }
.chat-main { border: 1px solid #e5e9f0; border-radius: 10px; padding: 12px; background: #fff; display: flex; flex-direction: column; height: 80vh; }
#messages { flex: 1; overflow-y: auto; padding-right: 8px; }
.chat-input-row { display: flex; gap: 8px; margin-top: 8px; }
.chat-input-row input[type="text"] { flex: 1; padding: 10px 12px; border-radius: 8px; border: 1px solid #cbd5e1; }
@media (max-width: 900px) { .chat-container { grid-template-columns: 1fr; } .chat-sidebar { display: none; } }