:root {
  --bg: #f5f6f8;
  --card: #ffffff;
  --text: #1f2937;
  --muted: #6b7280;
  --accent: #2563eb;
  --border: #e5e7eb;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
}

.topbar {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  padding: 0.75rem 1.25rem;
  background: var(--card);
  border-bottom: 1px solid var(--border);
}
.topbar .brand { font-weight: 700; color: var(--accent); text-decoration: none; }
.topbar nav a { color: var(--text); text-decoration: none; margin-right: 1rem; }

.container { max-width: 800px; margin: 1.5rem auto; padding: 0 1rem; }

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.25rem;
  margin-bottom: 1rem;
}

h1 { margin-top: 0; }
.meta { color: var(--muted); font-size: 0.875rem; margin: 0.25rem 0 0.75rem; }
.body { white-space: pre-wrap; }

.thread-list { list-style: none; padding: 0; margin: 0; }
.thread-list li { padding: 0.75rem 0; border-bottom: 1px solid var(--border); }
.thread-list li:last-child { border-bottom: 0; }
.thread-link { color: var(--accent); text-decoration: none; }
.thread-link:hover { text-decoration: underline; }

.reply-list { list-style: none; padding: 0; margin: 0; }
.reply { padding: 0.75rem 0; border-bottom: 1px solid var(--border); }
.reply:last-child { border-bottom: 0; }

.empty { color: var(--muted); font-style: italic; }

.form { display: flex; flex-direction: column; gap: 0.75rem; }
.form label { display: flex; flex-direction: column; gap: 0.25rem; font-size: 0.9rem; }
.form input, .form textarea {
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  font: inherit;
}
.form button {
  align-self: flex-start;
  padding: 0.5rem 1rem;
  background: var(--accent);
  color: white;
  border: 0;
  border-radius: 6px;
  cursor: pointer;
}
.form button:hover { filter: brightness(1.1); }

.back { display: inline-block; margin-bottom: 0.75rem; color: var(--accent); text-decoration: none; }
.back:hover { text-decoration: underline; }

.footer { text-align: center; color: var(--muted); padding: 1rem; font-size: 0.85rem; }