body {
  font-family: Arial, sans-serif;
  background: #f4f4f4;
  margin: 0;
  padding: 0;
}
.forum-wrapper {
  width: 90%;
  margin: 1rem auto;
  padding: 1rem;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}
.forum-wrapper h1 {
  text-align: center;
  margin-bottom: 1rem;
}
.category {
  margin-bottom: 2rem;
}
.category h2 {
  border-bottom: 2px solid #007bff;
  padding-bottom: 0.5rem;
}
.forum {
  padding: 0.5rem 0;
  border-bottom: 1px solid #e0e0e0;
}
.forum h3 {
  margin: 0;
}
.forum .last-post {
  font-size: 0.85rem;
  color: #777;
}
.thread-list {
  width: 100%;
  border-collapse: collapse;
  margin-top: 1rem;
}
.thread-list th,
.thread-list td {
  padding: 0.75rem;
  border: 1px solid #ddd;
  text-align: left;
}
.thread-list th {
  background: #f0f0f0;
}
.posts .post {
  border-bottom: 1px solid #e0e0e0;
  padding: 1rem 0;
}
.posts .post:last-child {
  border-bottom: none;
}
.posts .post header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 0.5rem;
}
.posts .post .username {
  font-weight: bold;
}
.posts .post time {
  font-size: 0.85rem;
  color: #777;
}
form#postForm {
  display: flex;
  flex-direction: column;
  margin-top: 2rem;
}
form#postForm textarea {
  min-height: 100px;
  padding: 0.5rem;
  font-size: 1rem;
  border: 1px solid #ccc;
  border-radius: 8px;
  resize: vertical;
}
form#postForm #charCount {
  align-self: flex-end;
  margin: 0.5rem 0;
  font-size: 0.9rem;
  color: #555;
}
form#postForm button,
.btn {
  align-self: flex-end;
  padding: 0.5rem 1rem;
  border: none;
  background: #007bff;
  color: #fff;
  border-radius: 8px;
  cursor: pointer;
}
.error {
  color: red;
}
.admin-controls {
  margin: 2rem 0;
  padding: 1rem;
  background: #eef;
  border: 1px solid #99f;
  border-radius: 8px;
}
.admin-controls h2 {
  margin-top: 0;
}
.admin-form {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1rem;
}
.admin-form label {
  display: flex;
  flex-direction: column;
  flex: 1 1 200px;
}
.admin-form button {
  align-self: flex-end;
  padding: .5rem 1rem;
  background: #28a745;
  color: #fff;
  border: none;
  border-radius: 6px;
  cursor: pointer;
}
#newThreadForm {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-top: 1rem;
}

#newThreadForm label {
  display: flex;
  flex-direction: column;
  font-weight: 600;
  color: #333;
}

#newThreadForm input[type="text"],
#newThreadForm textarea {
  padding: 0.75rem;
  font-size: 1rem;
  border: 1px solid #ccc;
  border-radius: 6px;
  background: #fff;
  transition: border-color .2s;
}

#newThreadForm input[type="text"]:focus,
#newThreadForm textarea:focus {
  border-color: #007BFF;
  outline: none;
}

.form-actions {
  display: flex;
  gap: 0.5rem;
  justify-content: flex-end;
  margin-top: 0.5rem;
}

.btn {
  padding: 0.6rem 1.2rem;
  background: #d32f2f;
  color: #fff;
  border: none;
  border-radius: 6px;
  font-weight: 600;
  cursor: pointer;
  transition: background .2s;
}

.btn:hover {
  background: #b71c1c;
}

.btn-secondary {
  padding: 0.6rem 1.2rem;
  background: #f5f5f5;
  color: #333;
  border: 1px solid #ccc;
  border-radius: 6px;
  font-weight: 600;
  cursor: pointer;
  transition: background .2s, border-color .2s;
}

.btn-secondary:hover {
  background: #e0e0e0;
  border-color: #bbb;
}

/* Vorschau-Bereich */
.preview-area {
  border-radius: 6px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.preview-area h2 {
  margin-top: 0;
  font-size: 1.25rem;
  border-bottom: 1px solid #ddd;
  padding-bottom: 0.5rem;
  color: #444;
}

#previewContent {
  padding: 0.75rem 0;
  color: #222;
  line-height: 1.5;
  white-space: pre-wrap;
}