/* Message board */
.bd-wrap { max-width: 760px; }
.bd-compose { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px; margin-bottom: 28px; }
.bd-compose.drag { border-color: var(--accent); box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 35%, transparent); }
.bd-compose textarea, .bd-linkrow input, .bd-name, .bd-edit textarea, .bd-edit input, .bd-replyform input {
  width: 100%; background: var(--bg); border: 1px solid var(--border); color: var(--text); border-radius: 10px; padding: 10px 12px; font: inherit; font-size: 16px; color-scheme: dark;
}
.bd-compose textarea, .bd-edit textarea { resize: vertical; min-height: 64px; }
.bd-compose textarea:focus, .bd-linkrow input:focus, .bd-name:focus, .bd-edit textarea:focus, .bd-edit input:focus, .bd-replyform input:focus { outline: none; border-color: var(--accent); }
.bd-linkrow { margin-top: 8px; }
.bd-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 10px; }
.bd-tool { display: inline-flex; align-items: center; gap: 6px; background: var(--bg); border: 1px solid var(--border); color: var(--muted); border-radius: 999px; padding: 7px 12px; font: inherit; font-size: 0.88rem; cursor: pointer; }
.bd-tool:hover { color: var(--text); }
.bd-pin input { accent-color: var(--accent); margin: 0; }
.bd-pin:has(input:checked) { color: var(--text); border-color: var(--accent); }
.bd-name { width: 150px; padding: 8px 12px; margin-left: auto; }
.bd-post { padding: 9px 22px; }
.bd-err { color: #ff8a8a; margin: 8px 0 0; font-size: 0.9rem; min-height: 0; }
.bd-err:empty { display: none; }
.bd-previews { display: flex; flex-wrap: wrap; gap: 8px; }
.bd-previews:not(:empty) { margin-top: 10px; }
.bd-prev { position: relative; width: 84px; height: 84px; border-radius: 10px; overflow: hidden; border: 1px solid var(--border); background: var(--bg); }
.bd-prev img { width: 100%; height: 100%; object-fit: cover; display: block; }
.bd-prev button { position: absolute; top: 3px; right: 3px; width: 24px; height: 24px; border-radius: 50%; border: 0; background: rgba(0, 0, 0, 0.7); color: #fff; font-size: 15px; line-height: 1; cursor: pointer; }
.bd-prev.busy::after { content: "…"; position: absolute; inset: 0; display: grid; place-items: center; background: rgba(0, 0, 0, 0.55); color: #fff; font-size: 1.4rem; }

.bd-h { font-family: Rajdhani, sans-serif; font-size: 1.3rem; margin: 0 0 12px; }
#bd-pinned-wrap { margin-bottom: 26px; }
.bd-feed { display: flex; flex-direction: column; gap: 14px; }
.bd-empty { color: var(--muted); background: var(--surface); border: 1px dashed var(--border); border-radius: var(--radius); padding: 18px; margin: 0; }
.bd-more { margin-top: 16px; }

.bd-post-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; }
.bd-post-card.pinned { border-color: color-mix(in srgb, var(--accent) 55%, var(--border)); background: linear-gradient(180deg, color-mix(in srgb, var(--accent) 9%, var(--surface)), var(--surface)); }
.bd-head { display: flex; align-items: center; gap: 10px; }
.bd-av { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; color: #fff; flex: none; font-size: 0.95rem; }
.bd-who { min-width: 0; flex: 1; }
.bd-who b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bd-who span { color: var(--muted); font-size: 0.82rem; }
.bd-badge { font-size: 0.75rem; color: var(--accent); border: 1px solid color-mix(in srgb, var(--accent) 50%, transparent); border-radius: 999px; padding: 2px 8px; white-space: nowrap; }
.bd-menu-btn { background: none; border: 0; color: var(--muted); font-size: 1.3rem; line-height: 1; padding: 4px 8px; border-radius: 8px; cursor: pointer; }
.bd-menu-btn:hover { background: var(--surface-2); color: var(--text); }
.bd-menu { display: none; gap: 6px; flex-wrap: wrap; margin-top: 10px; }
.bd-post-card.menu-open .bd-menu { display: flex; }
.bd-menu button, .bd-small { background: var(--bg); border: 1px solid var(--border); color: var(--muted); border-radius: 8px; padding: 5px 11px; font: inherit; font-size: 0.85rem; cursor: pointer; }
.bd-menu button:hover, .bd-small:hover { color: var(--text); border-color: var(--accent); }
.bd-menu button.sure, .bd-small.sure { color: #fff; background: #d64545; border-color: #d64545; }

.bd-body { margin: 10px 0 0; white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.5; }
.bd-body a { color: var(--accent-2); }
.bd-media { display: grid; gap: 4px; margin-top: 10px; border-radius: 12px; overflow: hidden; }
.bd-media.n2, .bd-media.n4 { grid-template-columns: 1fr 1fr; }
.bd-media.n3, .bd-media.n5, .bd-media.n6 { grid-template-columns: 1fr 1fr 1fr; }
.bd-media button { padding: 0; border: 0; background: var(--bg); cursor: zoom-in; display: block; }
.bd-media img { display: block; width: 100%; height: 100%; object-fit: cover; aspect-ratio: 1; }
.bd-media.n1 img { aspect-ratio: auto; max-height: 560px; object-fit: contain; background: #000; }
.bd-embed { margin-top: 10px; border-radius: 12px; overflow: hidden; background: #000; }
.bd-embed iframe, .bd-embed video { display: block; width: 100%; border: 0; aspect-ratio: 16 / 9; }
.bd-embed.tall { max-width: 340px; }
.bd-embed.tall iframe { aspect-ratio: 9 / 16; }
.bd-embed video { max-height: 560px; aspect-ratio: auto; }
.bd-embed img { display: block; max-width: 100%; max-height: 560px; margin: 0 auto; }
.bd-linkcard { display: flex; align-items: center; gap: 10px; margin-top: 10px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px; background: var(--bg); color: var(--text); text-decoration: none; overflow: hidden; }
.bd-linkcard span { color: var(--muted); font-size: 0.85rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bd-linkcard:hover { border-color: var(--accent); }

.bd-acts { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; align-items: center; }
.bd-react { background: var(--bg); border: 1px solid var(--border); color: var(--text); border-radius: 999px; padding: 4px 10px; font: inherit; font-size: 0.9rem; cursor: pointer; display: inline-flex; gap: 5px; align-items: center; }
.bd-react b { font-weight: 600; font-size: 0.82rem; color: var(--muted); }
.bd-react.mine { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 18%, var(--bg)); }
.bd-react.mine b { color: var(--text); }
.bd-react.zero { opacity: 0.55; }
.bd-react.zero:hover { opacity: 1; }
.bd-reply-btn { margin-left: auto; background: none; border: 0; color: var(--muted); font: inherit; font-size: 0.88rem; cursor: pointer; padding: 4px 6px; }
.bd-reply-btn:hover { color: var(--text); }

.bd-replies { margin-top: 12px; border-top: 1px solid var(--border); padding-top: 10px; display: none; }
.bd-post-card.show-replies .bd-replies { display: block; }
.bd-reply { display: flex; gap: 8px; padding: 6px 0; }
.bd-reply .bd-av { width: 26px; height: 26px; font-size: 0.75rem; }
.bd-reply div { flex: 1; min-width: 0; }
.bd-reply b { font-size: 0.88rem; }
.bd-reply time { color: var(--muted); font-size: 0.78rem; margin-left: 6px; }
.bd-reply p { margin: 2px 0 0; white-space: pre-wrap; overflow-wrap: anywhere; font-size: 0.95rem; }
.bd-reply .bd-x { background: none; border: 0; color: var(--muted); cursor: pointer; font-size: 0.8rem; padding: 2px 6px; border-radius: 6px; align-self: flex-start; }
.bd-reply .bd-x.sure { color: #fff; background: #d64545; }
.bd-replyform { display: flex; gap: 8px; margin-top: 8px; }
.bd-replyform input { padding: 8px 12px; }
.bd-replyform button { flex: none; }

.bd-edit { margin-top: 10px; display: flex; flex-direction: column; gap: 8px; }
.bd-edit .row { display: flex; gap: 8px; justify-content: flex-end; }

.bd-view { padding: 0; border: 0; background: transparent; max-width: 96vw; max-height: 94dvh; }
.bd-view::backdrop { background: rgba(0, 0, 0, 0.85); }
.bd-view img { display: block; max-width: 96vw; max-height: 94dvh; object-fit: contain; cursor: zoom-out; border-radius: 8px; }

.bd-toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px); background: var(--surface-2); border: 1px solid var(--border); color: var(--text); padding: 10px 16px; border-radius: 10px; opacity: 0; pointer-events: none; transition: opacity 0.2s, transform 0.2s; z-index: 50; }
.bd-toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 560px) {
  .bd-name { width: 100%; margin-left: 0; order: 5; }
  .bd-post { order: 6; width: 100%; }
  .bd-post-card { padding: 12px; }
}
.bd-more[hidden], .bd-linkrow[hidden] { display: none; }
