/* ============ Meathead community board — shared styles ============
   Used by community.html, thread.html (and reusable by sdlc/admin pages).
   Depends on styles.css variables (--ink, --panel, --gold, …). */

.board-wrap { max-width: 1080px; margin: 0 auto; padding: 26px 22px 80px; }

.board-head { display: flex; align-items: baseline; gap: 16px; flex-wrap: wrap; margin: 14px 0 20px; }
.board-head h1 {
  font-family: var(--px); font-weight: 800; color: var(--gold); font-size: clamp(24px, 2.8vw, 32px);
  line-height: 1.5; text-shadow: 3px 3px 0 rgba(0,0,0,.55);
}
.board-head .sub { color: var(--dim); font-family: var(--vt); font-weight: 500; font-size: 15px; }

/* ---------- toolbar: tabs / sort / search ---------- */
.board-bar { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 18px; }
.mh-tabs { display: flex; gap: 6px; }
.mh-tab {
  font-family: var(--px); font-weight: 800; font-size: 12px; cursor: pointer; line-height: 1;
  color: var(--cream); background: var(--panel); border: 2px solid var(--line);
  padding: 10px 12px 9px;
}
.mh-tab:hover { border-color: var(--gold-dim); color: var(--gold); }
.mh-tab.active { color: #241a05; background: var(--gold); border-color: var(--gold); box-shadow: 0 3px 0 var(--gold-dim); }
.mh-sort { display: flex; gap: 2px; align-items: center; }
.mh-sort-btn {
  font-family: var(--vt); font-weight: 500; font-size: 14px; letter-spacing: .06em; cursor: pointer;
  color: var(--dim); background: none; border: 0; padding: 6px 9px; border-bottom: 2px solid transparent;
}
.mh-sort-btn:hover { color: var(--cream); }
.mh-sort-btn.active { color: var(--gold); border-bottom-color: var(--gold); }
.board-bar .spacer { flex: 1; }
.mh-search {
  font-family: var(--vt); font-weight: 500; font-size: 15px; background: var(--panel2); color: var(--cream);
  border: 2px solid var(--line); padding: 8px 12px; min-width: 200px;
}
.mh-search::placeholder { color: #5b5566; }

/* ---------- generic chips ---------- */
.mh-chip {
  display: inline-block; font-family: var(--vt); font-weight: 500; font-size: 13px; letter-spacing: .08em;
  line-height: 1.2; padding: 2px 8px; border: 1px solid var(--line);
  background: var(--panel2); color: var(--cream); white-space: nowrap; vertical-align: middle;
}
.mh-chip.k-pinned { color: var(--meat); border-color: var(--meat); }
.mh-chip.k-feature { color: var(--gold); border-color: var(--gold-dim); }
.mh-chip.k-discussion { color: var(--rare); border-color: #2a6b6b; }
/* SDLC status colors */
.mh-chip.st-proposed    { color: #8b8ba0; border-color: #8b8ba0; }
.mh-chip.st-accepted    { color: #f2b13d; border-color: #f2b13d; }
.mh-chip.st-in_progress { color: #4f9cf9; border-color: #4f9cf9; }
.mh-chip.st-testing     { color: #b06bf0; border-color: #b06bf0; }
.mh-chip.st-shipped     { color: #43b581; border-color: #43b581; }
.mh-chip.st-live        { color: #2ecc71; border-color: #2ecc71; }
.mh-chip.st-rejected    { color: #e5484d; border-color: #e5484d; }
.mh-chip.st-merged      { color: #8b8ba0; border-color: #8b8ba0; }
/* roles + backer */
.mh-chip.role-developer { color: #4f9cf9; border-color: #2b4f80; }
.mh-chip.role-moderator { color: #43b581; border-color: #2b5c44; }
.mh-chip.role-admin     { color: #e5484d; border-color: #7c2b2f; }
.mh-chip.backer {
  color: #241a05; background: var(--gold); border-color: var(--gold-dim); font-weight: 600;
}

/* ---------- vote widget ---------- */
.mh-vote { display: flex; flex-direction: column; align-items: center; gap: 1px; min-width: 34px; }
.mh-vote-btn {
  cursor: pointer; background: none; border: 0; color: #5b5566; font-size: 15px;
  line-height: 1; padding: 3px 8px;
}
.mh-vote-btn:hover { color: var(--cream); }
.mh-vote-btn.up.on { color: var(--gold); }
.mh-vote-btn.down.on { color: var(--meat); }
.mh-vote-score { font-family: var(--vt); font-weight: 500; font-size: 15px; color: var(--gold); line-height: 1; }
.mh-vote-score.neg { color: var(--meat); }
.mh-vote.horiz { flex-direction: row; gap: 4px; }

/* ---------- thread list rows ---------- */
.thread-list { display: flex; flex-direction: column; gap: 10px; }
.thread-row { display: flex; gap: 14px; padding: 14px 16px; align-items: flex-start; }
.thread-row.pinned { border-color: var(--gold-dim); }
.thread-main { flex: 1; min-width: 0; }
.thread-title {
  font-family: var(--body); font-weight: 600; font-size: 17.5px; color: var(--cream);
  text-decoration: none; overflow-wrap: anywhere;
}
.thread-title:hover { color: var(--gold); }
.thread-pin { color: var(--gold); font-family: var(--vt); font-weight: 500; font-size: 13px; margin-right: 6px; }
.thread-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 7px; }
.thread-meta .who { color: var(--dim); font-family: var(--vt); font-weight: 500; font-size: 14px; }
.thread-meta .who b { color: var(--common); font-weight: 400; }
.thread-meta .dot { color: #5b5566; }
.thread-comments { color: var(--dim); font-family: var(--vt); font-weight: 500; font-size: 14px; white-space: nowrap; }
.board-empty { text-align: center; color: var(--dim); font-family: var(--vt); font-weight: 500; font-size: 15px; padding: 44px 0; }

/* ---------- pagination ---------- */
.mh-pager { display: flex; align-items: center; justify-content: center; gap: 16px; margin-top: 22px; }
.mh-pager button {
  font-family: var(--px); font-weight: 800; font-size: 12px; cursor: pointer; color: var(--gold);
  background: var(--panel); border: 2px solid var(--gold-dim); padding: 10px 14px 9px;
}
.mh-pager button:disabled { color: #5b5566; border-color: var(--line); cursor: default; }
.mh-pager .page-info { font-family: var(--vt); font-weight: 500; font-size: 14px; color: var(--dim); }

/* ---------- composer / forms ---------- */
.mh-form label { display: block; color: var(--common); font-family: var(--vt); font-weight: 500; font-size: 14px; letter-spacing: .08em; margin: 12px 0 5px; }
.mh-form input[type="text"], .mh-form select, .mh-form textarea {
  width: 100%; font-family: var(--vt); font-weight: 500; font-size: 15px;
  background: var(--panel2); color: var(--cream);
  border: 2px solid var(--line); padding: 10px 14px;
}
.mh-form textarea { min-height: 130px; resize: vertical; font-size: 19px; line-height: 1.4; }
.mh-form input::placeholder, .mh-form textarea::placeholder { color: #5b5566; }
.mh-form .row { display: flex; gap: 14px; flex-wrap: wrap; }
.mh-form .row > * { flex: 1; min-width: 170px; }
.mh-form .actions { display: flex; align-items: center; gap: 14px; margin-top: 16px; flex-wrap: wrap; }
.mh-file-label {
  display: inline-block; cursor: pointer; font-family: var(--vt); font-weight: 500; font-size: 14px;
  color: var(--rare); border: 2px dashed var(--line); padding: 8px 14px;
}
.mh-file-label:hover { border-color: var(--rare); }
.mh-file-label input { display: none; }
.mh-img-preview { position: relative; display: inline-block; margin-top: 10px; }
.mh-img-preview img { max-height: 120px; max-width: 220px; border: 2px solid var(--line); display: block; }
.mh-img-preview button {
  position: absolute; top: -8px; right: -8px; cursor: pointer;
  background: var(--meat); color: var(--cream); border: 0; font-size: 13px;
  width: 22px; height: 22px; line-height: 1;
}
.composer-panel { padding: 20px 22px 22px; margin-bottom: 22px; }
.composer-note { color: var(--dim); font-family: var(--vt); font-weight: 500; font-size: 14px; }
.composer-note a { color: var(--gold); }

/* ---------- thread page ---------- */
.crumb { font-family: var(--vt); font-weight: 500; font-size: 14px; margin-bottom: 16px; }
.crumb a { color: var(--dim); text-decoration: none; }
.crumb a:hover { color: var(--gold); }
.thread-hero { padding: 22px 24px; }
.thread-hero h1 {
  font-family: var(--body); font-weight: 700; font-size: clamp(20px, 3vw, 28px);
  line-height: 1.3; color: var(--cream); margin: 8px 0 4px; overflow-wrap: anywhere;
}
.thread-hero .badges { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.thread-body { margin-top: 14px; font-size: 16.5px; color: var(--cream); overflow-wrap: anywhere; }
.thread-body p { margin: 0 0 12px; }
.thread-body p:last-child { margin-bottom: 0; }
.thread-body code { background: var(--panel2); border: 1px solid var(--line); padding: 1px 6px; font-size: 14.5px; }
.thread-body .md-h { font-weight: 700; color: var(--gold); font-size: 19px; }
.thread-imgs { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 16px; }
.thread-imgs a img { max-height: 200px; max-width: 320px; border: 2px solid var(--line); display: block; }
.thread-imgs a:hover img { border-color: var(--gold-dim); }
.thread-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 16px; align-items: center; }

/* small utility buttons (report, reply, mod toggles) */
.mh-btn-sm {
  font-family: var(--vt); font-weight: 500; font-size: 13px; letter-spacing: .06em; cursor: pointer;
  color: var(--dim); background: none; border: 1px solid var(--line); padding: 4px 10px;
}
.mh-btn-sm:hover { color: var(--cream); border-color: var(--dim); }
.mh-btn-sm.danger:hover { color: var(--meat); border-color: var(--meat); }
.mh-btn-sm.gold { color: var(--gold); border-color: var(--gold-dim); }
.mh-btn-sm.gold:hover { color: #241a05; background: var(--gold); }
.mh-btn-sm.on { color: #241a05; background: var(--gold); border-color: var(--gold-dim); }

/* ---------- SDLC timeline strip ---------- */
.sdlc-strip { padding: 16px 20px; margin-top: 18px; }
.sdlc-strip h4 { font-family: var(--px); font-weight: 800; font-size: 12px; color: var(--dim); margin-bottom: 12px; letter-spacing: .06em; }
.sdlc-steps { display: flex; flex-wrap: wrap; gap: 0; align-items: center; }
.sdlc-step { display: flex; align-items: center; }
.sdlc-step + .sdlc-step::before { content: "▶"; color: #3a3a4a; font-size: 11px; margin: 0 8px; }
.sdlc-node { text-align: center; }
.sdlc-node .nm { font-family: var(--vt); font-weight: 500; font-size: 13px; letter-spacing: .06em; color: var(--dim); }
.sdlc-node .dt { font-family: var(--vt); font-weight: 500; font-size: 14px; color: #5b5566; }
.sdlc-node.done .nm { color: var(--cream); }
.sdlc-node.current .nm { color: var(--gold); }
.sdlc-note { color: var(--dim); font-family: var(--vt); font-weight: 500; font-size: 13px; margin-top: 8px; }

/* ---------- dev questions ---------- */
.devq-panel { border-color: #2b4f80; padding: 18px 22px; margin-top: 18px; }
.devq-panel > h3 { color: #4f9cf9; font-family: var(--px); font-weight: 800; font-size: 12px; margin-bottom: 4px; }
.devq { border-top: 1px dashed var(--line); padding: 14px 0 6px; margin-top: 10px; }
.devq:first-of-type { border-top: 0; }
.devq-body { font-size: 16.5px; overflow-wrap: anywhere; }
.devq-meta { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 6px; }
.mh-chip.q-open { color: #43b581; border-color: #2b5c44; }
.mh-chip.q-decided { color: var(--gold); border-color: var(--gold-dim); }
.mh-chip.q-closed { color: #8b8ba0; border-color: #8b8ba0; }
.devq-answers { margin-top: 10px; display: flex; flex-direction: column; gap: 8px; }
.devq-answer { display: flex; gap: 12px; align-items: flex-start; background: var(--panel2); border: 1px solid var(--line); padding: 10px 12px; }
.devq-answer.accepted { border-color: #2ecc71; background: rgba(46,204,113,.06); }
.devq-answer .acc-mark { color: #2ecc71; font-family: var(--vt); font-weight: 500; font-size: 14px; white-space: nowrap; }
.devq-answer .a-body { flex: 1; font-size: 15.5px; overflow-wrap: anywhere; }
.devq-answer .a-meta { color: var(--dim); font-family: var(--vt); font-weight: 500; font-size: 13px; margin-top: 4px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

/* ---------- comments ---------- */
.comments-head { margin-top: 30px; }
.comment-tree { display: flex; flex-direction: column; gap: 12px; margin-top: 14px; }
.comment { display: flex; gap: 12px; align-items: flex-start; }
.comment-card { flex: 1; min-width: 0; background: var(--panel); border: 1px solid var(--line); padding: 12px 14px; }
.comment.hidden-c > .comment-card { opacity: .55; border-style: dashed; }
.comment-byline { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 6px; }
.comment-byline .who { color: var(--common); font-family: var(--vt); font-weight: 500; font-size: 14px; }
.comment-byline .when { color: #5b5566; font-family: var(--vt); font-weight: 500; font-size: 13px; }
.comment-body { font-size: 15.5px; overflow-wrap: anywhere; }
.comment-body p { margin: 0 0 10px; }
.comment-body p:last-child { margin-bottom: 0; }
.comment-imgs { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 8px; }
.comment-imgs a img { max-height: 120px; max-width: 200px; border: 2px solid var(--line); display: block; }
.comment-foot { display: flex; gap: 10px; align-items: center; margin-top: 9px; flex-wrap: wrap; }
.comment-children { margin-left: 34px; border-left: 2px solid #23232e; padding-left: 14px; display: flex; flex-direction: column; gap: 12px; margin-top: 12px; }
.reply-box { margin-top: 10px; }

/* AI review comments */
.comment-card.ai-review { border: 2px solid var(--gold); background: #1a1712; }
.ai-review-head {
  display: flex; align-items: center; gap: 10px; cursor: pointer; user-select: none;
  color: var(--gold); font-family: var(--px); font-weight: 800; font-size: 12px; line-height: 1.6;
}
.ai-review-head .tog { margin-left: auto; color: var(--dim); font-family: var(--vt); font-weight: 500; font-size: 13px; }
.comment-card.ai-review .comment-body { margin-top: 10px; }
.comment-card.ai-review.collapsed .comment-body,
.comment-card.ai-review.collapsed .comment-foot { display: none; }

/* dev note comments */
.comment-card.dev-note { border-left: 4px solid #4f9cf9; }

/* ---------- mod / dev control bars ---------- */
.ctl-panel { padding: 14px 18px; margin-top: 18px; }
.ctl-panel h4 { font-family: var(--px); font-weight: 800; font-size: 12px; color: var(--dim); margin-bottom: 10px; letter-spacing: .06em; }
.ctl-row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.ctl-row select, .ctl-row input[type="text"] {
  font-family: var(--vt); font-weight: 500; font-size: 14px; background: var(--panel2); color: var(--cream);
  border: 2px solid var(--line); padding: 7px 10px;
}
.ctl-row input[type="text"] { flex: 1; min-width: 160px; }

/* ---------- toasts ---------- */
.mh-toasts { position: fixed; bottom: 20px; right: 20px; z-index: 2000; display: flex; flex-direction: column; gap: 8px; }
.mh-toast {
  font-family: var(--vt); font-weight: 500; font-size: 15px; letter-spacing: .04em; max-width: 340px;
  padding: 10px 16px; border: 2px solid var(--meat); background: #1c1216; color: var(--cream);
  opacity: 0; transform: translateY(8px); transition: opacity .25s, transform .25s;
}
.mh-toast.ok { border-color: var(--common); background: #131a10; }
.mh-toast.show { opacity: 1; transform: none; }

/* ---------- responsive ---------- */
@media (max-width: 700px) {
  .thread-row { padding: 12px; gap: 10px; }
  .board-bar { gap: 10px; }
  .mh-search { min-width: 0; flex: 1 1 100%; }
  .comment-children { margin-left: 12px; padding-left: 10px; }
  .thread-imgs a img { max-width: 100%; }
}

/* -- dev-question polls -- */
.poll-options { display: flex; flex-direction: column; gap: 8px; margin: 12px 0; }
.poll-opt { position: relative; border: 1px solid #26262f; background: #101017; overflow: hidden; }
.poll-opt.votable { cursor: pointer; }
.poll-opt.votable:hover { border-color: var(--gold, #f2b13d); }
.poll-opt.mine { border-color: var(--gold, #f2b13d); }
.poll-opt.winner { border-color: #43b581; }
.poll-bar { position: absolute; inset: 0 auto 0 0; background: rgba(242, 177, 61, .13); transition: width .25s ease; }
.poll-opt.winner .poll-bar { background: rgba(67, 181, 129, .16); }
.poll-opt-inner { position: relative; display: flex; align-items: center; gap: 10px; padding: 10px 12px; }
.poll-pick { color: var(--gold, #f2b13d); font-size: 13px; width: 14px; }
.poll-label { flex: 1; color: #e8e8f0; font-size: 14.5px; }
.poll-count { font-family: 'Barlow', sans-serif; font-weight: 500; font-size: 17px; color: #8b8ba0; white-space: nowrap; }
.poll-total { font-family: 'Barlow', sans-serif; font-weight: 500; font-size: 17px; color: #8b8ba0; }

/* -- vote widget real tallies -- */
.mh-vote-n { display: block; font-family: 'Barlow', sans-serif; font-weight: 500; font-size: 14px; line-height: 1; color: #8b8ba0; }
.mh-vote-btn.on .mh-vote-n { color: inherit; }

/* -- community rank chip (PLACEHOLDER tiers until levels are decided) -- */
.mh-chip.rank { color: #8bc34a; border-color: #3a5c2c; background: rgba(139,195,74,.08);
                font-size: 12px; letter-spacing: .04em; }

/* -- rank / supporter / avatar chips (v2) -- */
.mh-chip.rank { font-size: 11px; letter-spacing: .08em; font-weight: 700; border-width: 1px; }
.mh-chip.rank.rookie  { color: #8b8ba0; border-color: #33333f; background: rgba(139,139,160,.07); }
.mh-chip.rank.lifter  { color: #8bc34a; border-color: #3a5c2c; background: rgba(139,195,74,.09); }
.mh-chip.rank.regular { color: #4f9cf9; border-color: #274a75; background: rgba(79,156,249,.09); }
.mh-chip.rank.veteran { color: #f2b13d; border-color: #b98526; background: rgba(242,177,61,.11); }
/* supporter chip stays deliberately small + grey — money buys no prominence */
.mh-chip.supporter { font-size: 10px; color: #7d7d8c; border-color: #2b2b38; background: none;
                     letter-spacing: .06em; }
.mh-avatar { display: inline-flex; align-items: center; justify-content: center;
             vertical-align: middle; border: 1px solid #2b2b38; overflow: hidden;
             image-rendering: pixelated; flex: none; }
.mh-avatar img { width: 82%; height: 82%; object-fit: contain; image-rendering: pixelated; }
