body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: #f5f5f5;
  color: #222;
}
header {
  background: #222;
  color: #fff;
  padding: 10px 15px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 15px;
}
@media (max-width: 640px) {
  header nav {
    order: 1;
    display: flex;
    flex-wrap: wrap;
    gap: 4px 10px;
    width: 100%;
  }
  header nav a {
    margin-right: 0;
    font-size: 0.8em;
  }
}
header .logo {
  color: #fff;
  text-decoration: none;
  font-weight: bold;
  font-size: 1.2em;
}
header nav a {
  color: #aaa;
  text-decoration: none;
  margin-right: 15px;
  font-size: 0.9em;
}
header nav a:hover {
  color: #fff;
}
header .auth {
  margin-left: auto;
}
header .logged-in {
  color: #4caf50;
  margin-right: 8px;
}
header .auth a {
  color: #aaa;
  text-decoration: none;
}
main {
  max-width: 800px;
  margin: 20px auto;
  padding: 0 15px;
}
h1 {
  font-size: 1.5em;
}
.search-form, .chat-form, .suggest-form {
  display: flex;
  gap: 8px;
  margin: 15px 0;
}
.search-form input, .chat-form input, .suggest-form input {
  flex: 1;
  padding: 10px;
  border: 1px solid #ccc;
  border-radius: 4px;
  font-size: 1em;
}
button {
  padding: 10px 16px;
  background: #222;
  color: #fff;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.9em;
}
button:hover {
  background: #444;
}
.inline-form {
  display: inline;
}
.inline-form button {
  padding: 4px 10px;
  font-size: 0.8em;
}
.count {
  color: #666;
  font-size: 0.9em;
}
.results {
  margin-top: 10px;
}
.result-item {
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 4px;
  padding: 12px;
  margin-bottom: 10px;
}
.result-item a {
  text-decoration: none;
  color: #1a73e8;
}
.result-item a:hover {
  text-decoration: underline;
}
.result-item p {
  margin: 5px 0 0;
  color: #444;
  font-size: 0.9em;
  line-height: 1.4;
}
.date {
  color: #999;
  font-size: 0.8em;
  margin-left: 10px;
}
.post-text {
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 4px;
  padding: 15px;
  line-height: 1.5;
  white-space: pre-wrap;
  margin: 10px 0;
}
.chat-history {
  margin: 15px 0;
}
.chat-msg {
  padding: 8px 12px;
  border-radius: 4px;
  margin-bottom: 6px;
}
.chat-msg.user {
  background: #e3f2fd;
}
.chat-msg.bot {
  background: #fff;
  border: 1px solid #ddd;
}
.chat-msg strong {
  display: block;
  margin-bottom: 3px;
}
.result-msg {
  background: #e8f5e9;
  padding: 10px;
  border-radius: 4px;
}
