* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: Verdana, Arial, sans-serif;
}

body {
  background: #111;
  color: #c5c5c5;
  font-size: 13px;
  line-height: 1.4;
  padding: 20px;
}

header {
  text-align: center;
  margin-bottom: 20px;
}

header h1 {
  font-size: 28px;
  color: #ddd;
}

header .subtitle {
  color: #888;
  font-size: 12px;
  margin-bottom: 10px;
}

nav {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 20px;
}

nav a,
.nav-form button {
  color: #6b90da;
  text-decoration: none;
  padding: 2px 6px;
  border-radius: 2px;
  background: transparent;
  border: 0;
  font-weight: normal;
}

nav a:hover,
.nav-form button:hover {
  background: #222;
  text-decoration: none;
}

main {
  max-width: 960px;
  margin: 0 auto;
}

.post,
.flash {
  background: #1b1b1b;
  border: 1px solid #2e2e2e;
  padding: 10px;
  margin-bottom: 10px;
  border-radius: 2px;
}

.post-number {
  font-size: 10px;
  color: #888;
  margin-bottom: 5px;
}

.green {
  color: #789922;
  white-space: pre-wrap;
}

a {
  color: #6b90da;
}

a:hover {
  text-decoration: underline;
}

input,
textarea,
button,
select {
  font-family: Verdana, Arial, sans-serif;
  font-size: 13px;
}

label {
  display: block;
  color: #888;
  margin-bottom: 4px;
}

input,
textarea,
select {
  width: 100%;
  padding: 6px;
  margin-bottom: 10px;
  background: #181818;
  border: 1px solid #2e2e2e;
  color: #c5c5c5;
  border-radius: 2px;
}

textarea {
  resize: vertical;
}

button {
  background: #6b90da;
  border: none;
  color: #111;
  padding: 6px 12px;
  cursor: pointer;
  border-radius: 2px;
  font-weight: bold;
}

button:hover {
  background: #5070b0;
}

button:disabled,
select:disabled {
  opacity: .45;
  cursor: not-allowed;
}

.check {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #c5c5c5;
  margin: 8px 0;
}

.check input {
  width: auto;
  margin: 0;
}

.attachments {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.attachment {
  width: min(280px, 100%);
  border: 1px solid #2e2e2e;
  background: #161616;
  padding: 8px;
}

.attachment span {
  display: block;
  color: #888;
  font-size: 10px;
  margin: 2px 0 8px;
}

.attachment img,
.attachment iframe {
  display: block;
  width: 100%;
  max-height: 260px;
  border: 1px solid #2e2e2e;
  background: #111;
  object-fit: contain;
}

.attachment iframe {
  height: 180px;
}

.flash.error {
  border-color: #6b3030;
  color: #ffb1b1;
}

.flash.success {
  border-color: #3f5520;
  color: #c9ef8d;
}

.row,
.role-row {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 8px;
  align-items: center;
  margin-top: 8px;
}

.role-row {
  grid-template-columns: 1fr 130px 52px auto;
}

.role-row select {
  margin: 0;
}

.color-input {
  width: 52px;
  min-width: 52px;
  height: 31px;
  padding: 2px;
  margin: 0;
}

.user-tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  flex-wrap: wrap;
}

.username {
  color: #c5c5c5;
  font-weight: bold;
}

.rank {
  display: inline-block;
  padding: 1px 4px;
  border: 1px solid #3a3a3a;
  border-radius: 2px;
  color: #aaa;
  background: #161616;
  font-size: 10px;
  line-height: 1.2;
}

.rank-owner {
  color: #ffd166;
  border-color: #795d1e;
}

.rank-admin {
  color: #ff9b9b;
  border-color: #6b3030;
}

.rank-rich {
  color: #9ee6a8;
  border-color: #3f5520;
}

.rank-user {
  color: #9db8ec;
  border-color: #395071;
}

.auth-box {
  max-width: 460px;
  margin-left: auto;
  margin-right: auto;
}

.delete-form {
  margin-top: 10px;
}

.delete-form button {
  background: #6b3030;
  color: #f1d6d6;
}

.delete-form button:hover {
  background: #844040;
}

.notify-panel button[data-subscribed="true"] {
  background: #444;
  color: #ddd;
}

.notify-status {
  margin-bottom: 8px;
}

.moderation-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-top: 10px;
}

.moderation-actions form {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.moderation-actions input {
  width: auto;
  min-width: 90px;
  margin: 0;
}

.moderation-actions input[type="text"] {
  min-width: min(220px, 100%);
}

.dm-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: center;
}

.button-link {
  display: inline-block;
  background: #6b90da;
  color: #111;
  padding: 6px 12px;
  border-radius: 2px;
  text-decoration: none;
  font-weight: bold;
}

.button-link:hover {
  background: #5070b0;
  text-decoration: none;
}

.dm-message.mine {
  border-color: #395071;
}

.dm-message.theirs {
  border-color: #38442b;
}

footer {
  margin-top: 30px;
  text-align: center;
  color: #888;
  font-size: 11px;
}

@media (max-width: 640px) {
  body {
    padding: 12px;
  }

  .row,
  .role-row,
  .dm-row {
    grid-template-columns: 1fr;
  }
}
