/* 커뮤니티(게시판 · 채팅방) 공통 스타일. 색은 page.css 토큰을 그대로 쓴다. */
main .wrap.bd-wrap { max-width: 900px; padding-block: 32px 64px; }
.bd-crumb { margin: 0 0 6px; font-size: 13px; color: var(--muted); }
.bd-head { display: flex; align-items: flex-end; gap: 16px; justify-content: space-between; flex-wrap: wrap; margin-bottom: 18px; }
.bd-head h1 { margin: 0 0 4px; }
.bd-head p { margin: 0; max-width: 46em; }
.bd-btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 10px 18px; border-radius: 8px; background: var(--navy); color: #fff !important; font: inherit; font-size: 15px; font-weight: 500; border: 0; cursor: pointer; text-decoration: none; white-space: nowrap; }
.bd-btn:hover { background: var(--navy-2); }
.bd-btn:disabled { opacity: .6; cursor: wait; }
.bd-btn.alt { background: transparent; color: var(--fg) !important; border: 1px solid var(--line); }
.bd-btn.gold { background: #f0c565; color: #231800 !important; }
.bd-tabs { display: flex; gap: 4px; margin: 0 0 16px; padding: 4px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; overflow-x: auto; scrollbar-width: none; }
.bd-tabs::-webkit-scrollbar { display: none; }
.bd-tabs a { flex: 1 0 auto; text-align: center; padding: 8px 12px; border-radius: 7px; font-size: 14.5px; font-weight: 500; color: var(--muted); white-space: nowrap; }
.bd-tabs a:hover { color: var(--fg); background: var(--bg); }
.bd-tabs a[aria-current="page"] { background: var(--navy); color: #fff; }

.bd-search { display: flex; gap: 8px; margin-bottom: 12px; }
.bd-search input { flex: 1; }
.bd-search button { padding: 0 16px; border: 1px solid var(--line); background: var(--surface); color: var(--fg); font: inherit; font-size: 14px; border-radius: 8px; cursor: pointer; }
.bd-list { list-style: none; padding: 0; margin: 0; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.bd-list li + li { border-top: 1px solid var(--line); }
.bd-list li.pinned { background: var(--gold-soft); }
.bd-list a { display: flex; gap: 16px; align-items: center; padding: 14px 18px; }
.bd-list a:hover .bd-tt { color: var(--blue); text-decoration: underline; }
.bd-t { flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; font-size: 15.5px; font-weight: 500; }
.bd-tt { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bd-cc { flex: none; font-size: 12.5px; font-weight: 600; color: var(--blue); }
.bd-m, .bd-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 10px; font-size: 13px; color: var(--muted); }
.bd-m { flex: none; }
.bd-tag { flex: none; font-size: 11.5px; font-weight: 600; padding: 2px 8px; border-radius: 99px; background: var(--blue-soft); color: var(--blue); }
.bd-tag.pin { background: var(--navy); color: #fff; }
.bd-tag.done { background: #e2f4e7; color: #1d6b33; }
.bd-badge { font-size: 11px; font-weight: 600; padding: 1px 7px; border-radius: 99px; background: var(--gold-soft); color: var(--gold); margin-left: -4px; }
.bd-badge.admin { background: var(--navy); color: #f0c565; }
.bd-empty { text-align: center; padding: 40px 0; }
.bd-pages { display: flex; justify-content: center; gap: 4px; margin-top: 18px; flex-wrap: wrap; }
.bd-pages a { min-width: 36px; text-align: center; padding: 6px 10px; border-radius: 6px; font-size: 14px; color: var(--muted); }
.bd-pages a[aria-current] { background: var(--navy); color: #fff; }

.bd-post { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 24px; }
.bd-post-head { border-bottom: 1px solid var(--line); padding-bottom: 14px; margin-bottom: 18px; }
.bd-post-tags { display: flex; gap: 6px; margin-bottom: 8px; }
.bd-post-tags:empty { display: none; }
.bd-post h2 { margin: 0 0 8px; font-size: 22px; }
.bd-body { font-size: 15.5px; line-height: 1.8; min-height: 80px; }
.bd-body a, .bd-cbody a { color: var(--blue); text-decoration: underline; word-break: break-all; }
.bd-actions { display: flex; gap: 8px; flex-wrap: wrap; margin: 22px 0 6px; }
.bd-actions button, .bd-actions a { padding: 7px 14px; border: 1px solid var(--line); background: var(--bg); color: var(--fg); font: inherit; font-size: 14px; border-radius: 8px; cursor: pointer; }
.bd-actions .danger { color: #b3261e; }
.bd-comments { margin-top: 24px; border-top: 1px solid var(--line); padding-top: 18px; }
.bd-comments h3 { font-size: 16px; margin: 0 0 10px; }
.bd-comments ul { list-style: none; padding: 0; margin: 0 0 14px; }
.bd-comments li { padding: 12px 0; border-bottom: 1px solid var(--line); }
.bd-cbody { margin-top: 4px; font-size: 15px; }
.bd-x { margin-left: auto; background: none; border: 0; color: var(--muted); font: inherit; font-size: 12.5px; cursor: pointer; text-decoration: underline; }
.bd-row { display: flex; align-items: center; gap: 12px; justify-content: flex-end; margin-top: 10px; }
.bd-row .msg { margin: 0 auto 0 0; }
.bd-back { font-size: 14px; color: var(--muted); }
.bd-form { max-width: none; }
.bd-form .check { margin-top: 12px; }

@media (max-width: 640px) {
  .bd-list a { flex-direction: column; align-items: stretch; gap: 4px; padding: 12px 14px; }
  .bd-post { padding: 18px 16px; }
}

/* ---------- 채팅방 ---------- */
main .wrap.ch-wrap { max-width: 1120px; padding-block: 24px 40px; }
.ch-layout { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 16px; }
.ch-rooms { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 10px; align-self: start; }
.ch-rooms h2 { font-size: 13px; color: var(--muted); font-weight: 600; margin: 6px 8px 8px; }
.ch-rooms a { display: flex; justify-content: space-between; align-items: center; padding: 10px 12px; border-radius: 8px; font-size: 15px; font-weight: 500; }
.ch-rooms a:hover { background: var(--bg); }
.ch-rooms a[aria-current] { background: var(--navy); color: #fff; }
.ch-rooms .ext { margin-top: 10px; border-top: 1px solid var(--line); padding-top: 10px; }
.ch-rooms .ext a { font-size: 14px; font-weight: 400; color: var(--muted); }
.ch-box { display: flex; flex-direction: column; height: min(78vh, 760px); min-height: 460px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.ch-top { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.ch-top h1 { font-size: 18px; margin: 0; }
.ch-online { font-size: 13px; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.ch-online::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: #2fa84f; }
.ch-top .kakao { margin-left: auto; font-size: 13px; padding: 6px 12px; border-radius: 99px; background: #fee500; color: #191600; font-weight: 600; white-space: nowrap; }
.ch-pin { display: flex; gap: 10px; align-items: flex-start; padding: 10px 16px; background: var(--gold-soft); border-bottom: 1px solid var(--line); font-size: 14px; }
.ch-pin b { flex: none; color: var(--gold); }
.ch-pin .txt { flex: 1; min-width: 0; white-space: pre-wrap; max-height: 4.8em; overflow: auto; }
.ch-pin button { flex: none; background: none; border: 0; color: var(--muted); font: inherit; font-size: 12.5px; cursor: pointer; text-decoration: underline; }
.ch-log { flex: 1; overflow-y: auto; padding: 12px 16px; display: flex; flex-direction: column; gap: 2px; overscroll-behavior: contain; }
.ch-more { align-self: center; margin-bottom: 8px; padding: 5px 14px; font: inherit; font-size: 13px; border: 1px solid var(--line); border-radius: 99px; background: var(--bg); color: var(--muted); cursor: pointer; }
.ch-day { align-self: center; margin: 12px 0 6px; font-size: 12px; color: var(--muted); background: var(--bg); padding: 2px 12px; border-radius: 99px; }
.ch-msg { display: flex; flex-direction: column; align-items: flex-start; max-width: 78%; margin-top: 8px; }
.ch-msg.cont { margin-top: 0; }
.ch-msg.mine { align-self: flex-end; align-items: flex-end; }
.ch-who { font-size: 12.5px; color: var(--muted); margin: 0 4px 3px; display: flex; gap: 6px; align-items: center; }
.ch-msg.cont .ch-who { display: none; }
.ch-row { display: flex; align-items: flex-end; gap: 6px; }
.ch-msg.mine .ch-row { flex-direction: row-reverse; }
.ch-bub { padding: 8px 12px; border-radius: 14px; background: var(--bg); border: 1px solid var(--line); font-size: 15px; line-height: 1.55; white-space: pre-wrap; word-break: break-word; }
.ch-bub a { color: var(--blue); text-decoration: underline; word-break: break-all; }
.ch-msg.mine .ch-bub { background: var(--navy); color: #fff; border-color: var(--navy); }
.ch-msg.mine .ch-bub a { color: #b9dcff; }
.ch-bub img { display: block; max-width: min(280px, 100%); max-height: 320px; border-radius: 8px; cursor: zoom-in; }
.ch-bub img + .t { margin-top: 6px; }
.ch-bub.img-only { padding: 4px; }
.ch-time { flex: none; font-size: 11px; color: var(--muted); }
.ch-tools { display: none; gap: 6px; }
.ch-msg:hover .ch-tools, .ch-msg:focus-within .ch-tools { display: inline-flex; }
.ch-tools button { background: none; border: 0; font: inherit; font-size: 11.5px; color: var(--muted); cursor: pointer; text-decoration: underline; padding: 0; }
@media (hover: none) { .ch-tools { display: inline-flex; } }
.ch-form { border-top: 1px solid var(--line); padding: 10px 12px; display: flex; gap: 8px; align-items: flex-end; background: var(--surface); }
.ch-form textarea { flex: 1; min-height: 44px; max-height: 140px; resize: none; padding: 10px 12px; font-size: 15px; }
.ch-attach { flex: none; width: 44px; height: 44px; display: inline-flex; align-items: center; justify-content: center; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); color: var(--fg); cursor: pointer; }
.ch-attach svg { width: 20px; height: 20px; }
.ch-form .bd-btn { height: 44px; }
.ch-preview { display: flex; align-items: center; gap: 10px; padding: 8px 12px 0; font-size: 13px; color: var(--muted); }
.ch-preview img { width: 56px; height: 56px; object-fit: cover; border-radius: 6px; border: 1px solid var(--line); }
.ch-preview button { background: none; border: 0; color: var(--muted); font: inherit; text-decoration: underline; cursor: pointer; }
.ch-gate { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; text-align: center; padding: 24px; }
.ch-gate p { margin: 0; max-width: 28em; color: var(--muted); }
.ch-err { padding: 6px 16px; font-size: 13px; color: #b3261e; }
.ch-zoom { position: fixed; inset: 0; z-index: 200; background: rgba(4,8,20,.85); display: flex; align-items: center; justify-content: center; padding: 16px; cursor: zoom-out; }
.ch-zoom img { max-width: 100%; max-height: 100%; border-radius: 8px; }

@media (max-width: 760px) {
  main .wrap.ch-wrap { padding: 0; }
  .ch-layout { grid-template-columns: 1fr; gap: 0; }
  .ch-rooms { border-radius: 0; border-width: 0 0 1px; padding: 6px 8px; display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; }
  .ch-rooms h2, .ch-rooms .ext { display: none; }
  .ch-rooms a { flex: 1 0 auto; justify-content: center; padding: 8px 10px; font-size: 14px; }
  .ch-rooms a .n { display: none; }
  .ch-box { border-radius: 0; border-width: 0; height: calc(100dvh - 64px - 52px); min-height: 380px; }
  .ch-msg { max-width: 88%; }
}
