* { box-sizing: border-box; }

body {
  margin: 8px;
  font-family: Helvetica, Arial, sans-serif;
  font-size: 14px;
  color: #000;
  background: #fff;
}

a { color: #0000ee; text-decoration: underline; cursor: pointer; }

header {
  max-width: 1000px;
  margin: 0 auto 14px;
  padding: 8px 10px;
  background: #eee;
  border-bottom: 1px solid #ccc;
}

header h1 {
  display: inline;
  margin: 0;
  color: #551a8b;
  font-size: 24px;
  font-weight: bold;
}

header p {
  display: inline;
  margin-left: 12px;
  color: #555;
}

.layout {
  max-width: 1000px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 18px;
  align-items: start;
}

h2 { margin: 0; font-size: 16px; }

.folders-panel,
.post-box { border: 1px solid #ccc; }

.section-title,
.post-box > h2,
.board-title {
  padding: 5px 8px;
  background: #eee;
  border-bottom: 1px solid #ccc;
}

.section-title,
.board-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.folders-list { padding: 5px 0; }

.folder-row {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 8px;
}

.folder-link {
  flex: 1;
  display: block;
  padding: 4px 0;
  color: #0000ee;
  text-decoration: underline;
}

.folder-link.active {
  color: #551a8b;
  font-weight: bold;
}

.folder-form {
  padding: 8px;
  border-top: 1px solid #ccc;
}

.folder-form input {
  width: 100%;
  margin-bottom: 5px;
}

.post-box { margin-bottom: 18px; }
.post-box form { padding: 10px; }

.field { margin-bottom: 9px; }

label {
  display: block;
  margin-bottom: 3px;
  font-weight: bold;
}

input,
textarea {
  padding: 3px;
  font-family: Helvetica, Arial, sans-serif;
  font-size: 14px;
  border: 1px solid #888;
  border-radius: 0;
  background: #fff;
}

input[type="text"],
textarea {
  width: 100%;
  max-width: 600px;
}

textarea { resize: vertical; }

button {
  padding: 2px 8px;
  font-family: Helvetica, Arial, sans-serif;
  font-size: 13px;
  color: #000;
  background: #eee;
  border: 1px solid #888;
  border-radius: 0;
  cursor: pointer;
}

button:disabled { color: #777; cursor: default; }

.actions {
  display: flex;
  gap: 10px;
  align-items: center;
}

#charCount,
.status,
.image-help,
.delete-note {
  color: #666;
  font-size: 12px;
}

.status { margin: 7px 0 0; min-height: 1em; }
.delete-note { margin: 7px 0 0; }

#emptyState {
  padding: 12px 8px;
  color: #555;
  border: 1px solid #ddd;
  border-top: 0;
}

.message {
  padding: 8px;
  border-bottom: 1px solid #ccc;
}

.message:nth-child(even) { background: #f7f7f7; }

.message-header {
  margin-bottom: 4px;
  display: flex;
  align-items: baseline;
  gap: 8px;
  flex-wrap: wrap;
}

.author {
  color: #0000ee;
  font-weight: bold;
  text-decoration: underline;
}

.time {
  color: #666;
  font-size: 12px;
}

.message-text {
  margin: 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  line-height: 1.25;
}

.delete-link {
  padding: 0;
  margin-left: auto;
  border: 0;
  background: transparent;
  color: #0000ee;
  text-decoration: underline;
  font-size: 12px;
  font-weight: normal;
}

.delete-link:hover { background: transparent; }

.delete-countdown {
  color: #777;
  font-size: 11px;
}

.image-help { margin-top: 4px; }

.image-preview-wrap { margin-top: 7px; }

.image-preview-wrap img,
.post-image {
  display: block;
  max-width: min(500px, 100%);
  max-height: 500px;
  width: auto;
  height: auto;
  object-fit: contain;
  border: 1px solid #888;
  background: #fff;
}

.image-preview-wrap button { margin-top: 5px; }
.post-image { margin-top: 7px; }

footer {
  max-width: 1000px;
  margin: 24px auto 0;
  padding: 8px 0;
  text-align: center;
  color: #666;
  font-size: 12px;
  border-top: 1px solid #ccc;
}

@media (max-width: 700px) {
  header h1, header p { display: block; }
  header p { margin: 3px 0 0; }
  .layout { grid-template-columns: 1fr; }
}
