:root {
  --bg: #f3f5f8;
  --panel: #fff;
  --line: #dfe4ea;
  --text: #17202a;
  --muted: #6b7280;
  --primary: #183b63;
  --primary-soft: #eaf1f8;
  --danger: #b42318;
  --success: #16794b;
  --warning: #9a6700;
  --shadow: 0 10px 30px rgba(18, 40, 66, .08);
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; font-family: Pretendard, "Noto Sans KR", Arial, sans-serif; color: var(--text); background: var(--bg); }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
.wrap { width: min(1240px, calc(100% - 32px)); margin: 0 auto; }
.hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.topbar { position: sticky; top: 0; z-index: 50; background: rgba(255,255,255,.96); border-bottom: 1px solid var(--line); backdrop-filter: blur(12px); }
.topbar-inner { min-height: 68px; display: flex; align-items: center; gap: 24px; }
.logo { font-weight: 900; letter-spacing: .09em; color: var(--primary); white-space: nowrap; }
.topnav { display: flex; align-items: center; gap: 6px; flex: 1; flex-wrap: wrap; }
.topnav a { padding: 9px 11px; border-radius: 8px; font-size: 14px; font-weight: 700; color: #3d4b59; }
.topnav a:hover, .topnav a.active { background: var(--primary-soft); color: var(--primary); }
.auth-box, .user-box { display: flex; align-items: center; gap: 8px; }
.avatar { width: 34px; height: 34px; border-radius: 50%; object-fit: cover; background: #d9e1e8; }
.link-button { border: 0; padding: 4px; background: transparent; font-weight: 700; color: var(--primary); }
.btn { border: 1px solid transparent; border-radius: 8px; padding: 9px 14px; font-weight: 750; background: #fff; color: var(--text); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-light { border-color: var(--line); background: #fff; }
.btn-danger { background: var(--danger); color: #fff; }
.page-layout { display: grid; grid-template-columns: minmax(0, 1fr) 270px; gap: 22px; padding: 30px 0 60px; }
.main-column { min-width: 0; }
.board-head { display: flex; justify-content: space-between; gap: 20px; align-items: flex-end; margin-bottom: 18px; }
.board-head h1 { margin: 3px 0 5px; font-size: clamp(26px, 4vw, 40px); }
.eyebrow { margin: 0; color: var(--primary); font-size: 12px; letter-spacing: .14em; font-weight: 900; }
.status-text { margin: 0; color: var(--muted); }
.head-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.panel, .notice { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); }
.panel { padding: 22px; }
.notice { padding: 14px 16px; margin-bottom: 15px; background: #fff8db; color: #664d03; }
.welcome-panel h2 { margin-top: 0; }
.feature-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 20px; }
.feature-grid article { border: 1px solid var(--line); border-radius: 12px; padding: 18px; background: #fafbfd; }
.feature-grid strong, .feature-grid span { display: block; }
.feature-grid span { margin-top: 7px; color: var(--muted); line-height: 1.55; }
.toolbar { display: flex; align-items: center; gap: 8px; margin-bottom: 16px; flex-wrap: wrap; }
.toolbar input { min-width: 240px; flex: 1; }
input, select, textarea { width: 100%; border: 1px solid #cfd6df; border-radius: 8px; padding: 10px 11px; background: #fff; color: var(--text); }
input:focus, select:focus, textarea:focus { outline: 3px solid rgba(24,59,99,.12); border-color: var(--primary); }
textarea { resize: vertical; line-height: 1.65; }
.toolbar select { width: auto; min-width: 150px; }
.table-scroll { overflow-x: auto; }
.board-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.board-table th { padding: 11px 8px; background: #f6f8fa; color: #4b5563; border-top: 2px solid var(--primary); border-bottom: 1px solid var(--line); white-space: nowrap; }
.board-table td { padding: 12px 8px; border-bottom: 1px solid #edf0f3; text-align: center; }
.board-table td.title-cell { text-align: left; min-width: 260px; }
.board-table tr:hover td { background: #fbfcfd; }
.board-table .num { width: 64px; }
.board-table .category { width: 105px; }
.board-table .author { width: 130px; }
.board-table .date { width: 100px; }
.board-table .count { width: 70px; }
.post-title-link { font-weight: 750; color: #20364d; }
.post-subline { margin-top: 6px; display: flex; gap: 5px; flex-wrap: wrap; }
.empty { padding: 40px !important; color: var(--muted); text-align: center !important; }
.pagination { display: flex; gap: 6px; justify-content: center; margin-top: 18px; flex-wrap: wrap; }
.pagination button.active { background: var(--primary); color: #fff; }
.section-title-row, .detail-action-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.section-title-row { margin-bottom: 20px; }
.section-title-row h2 { margin: 0; }
.write-form { display: grid; gap: 16px; }
.write-form label { display: grid; gap: 7px; font-weight: 750; }
.write-form.compact { gap: 10px; }
.form-grid { display: grid; gap: 12px; }
.two-columns { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.three-columns { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.form-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 4px; }
.tag-fieldset { border: 1px solid var(--line); border-radius: 10px; padding: 15px; }
.tag-fieldset legend { padding: 0 6px; font-weight: 850; }
.tag-fieldset legend span { color: var(--muted); font-weight: 500; font-size: 13px; }
.tag-input-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; }
.check-label { display: flex !important; grid-template-columns: auto 1fr; align-items: center; justify-content: flex-start; }
.check-label input { width: auto; }
.privacy-note, .summary-box { border: 1px solid #d9e5f0; background: #f4f8fc; border-radius: 10px; padding: 13px 15px; line-height: 1.65; }
.detail-head { border-bottom: 1px solid var(--line); padding-bottom: 16px; margin-bottom: 22px; }
.detail-head h2 { margin: 12px 0; font-size: 28px; }
.badge, .meta-chip, .tag-chip, .status-chip { display: inline-flex; align-items: center; border-radius: 999px; padding: 4px 9px; font-size: 12px; font-weight: 800; }
.badge { color: #fff; background: var(--primary); }
.meta-chip { background: #edf2f7; color: #425466; }
.tag-chip { background: #f5ecff; color: #6b21a8; }
.status-chip { background: #eaf7ef; color: var(--success); }
.status-chip.closed { background: #f1f2f4; color: #667085; }
.chip-row { display: flex; gap: 6px; flex-wrap: wrap; margin: 10px 0; }
.detail-meta { color: var(--muted); font-size: 14px; }
.author-profile-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.warning-text { color: var(--danger); font-weight: 750; }
.summary-box p { margin: 8px 0 0; }
.detail-content { white-space: pre-wrap; line-height: 1.8; min-height: 160px; word-break: break-word; }
.detail-action-row { margin-top: 24px; padding-top: 16px; border-top: 1px solid var(--line); }
.detail-action-row > div { display: flex; gap: 7px; }
.recommend-box { text-align: center; padding: 22px 0; }
.recommend-box span { margin-left: 8px; font-weight: 850; }
.comments, .proposal-section, .consultation-box { margin-top: 30px; border-top: 1px solid var(--line); padding-top: 22px; }
.comment-form { display: grid; grid-template-columns: 1fr auto; gap: 8px; align-items: end; }
.comment-item, .proposal-card { border-bottom: 1px solid #edf0f3; padding: 14px 0; }
.comment-head, .proposal-head { display: flex; justify-content: space-between; gap: 12px; color: var(--muted); font-size: 13px; margin-bottom: 7px; }
.comment-body, .proposal-body { white-space: pre-wrap; line-height: 1.6; }
.card-list { display: grid; gap: 12px; }
.content-card { border: 1px solid var(--line); border-radius: 12px; padding: 17px; background: #fff; }
.content-card:hover { border-color: #b9c7d6; box-shadow: 0 6px 18px rgba(18,40,66,.06); }
.content-card h3 { margin: 7px 0; }
.card-topline, .card-meta { display: flex; gap: 8px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.card-meta { color: var(--muted); font-size: 13px; margin-top: 10px; }
.card-summary { color: #3f4d5c; line-height: 1.65; white-space: pre-wrap; }
.profile-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 14px; }
.profile-card { border: 1px solid var(--line); border-radius: 12px; padding: 18px; display: grid; gap: 10px; }
.profile-card h3 { margin: 0; }
.profile-card p { margin: 0; color: #465466; line-height: 1.6; }
.profile-hero { display: grid; grid-template-columns: 110px 1fr; gap: 22px; align-items: start; }
.profile-photo { width: 110px; height: 110px; object-fit: cover; border-radius: 14px; background: #e5e7eb; }
.profile-section { margin-top: 24px; }
.profile-section h3 { border-bottom: 1px solid var(--line); padding-bottom: 8px; }
.profile-section p { white-space: pre-wrap; line-height: 1.75; }
.author-card { margin-top: 28px; border: 1px solid var(--line); background: #fafbfd; border-radius: 12px; padding: 16px; }
.sidebar { display: flex; flex-direction: column; gap: 14px; }
.side-card, .ad-box { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 17px; }
.side-card h3 { margin-top: 0; }
.side-card ul { padding-left: 18px; margin-bottom: 0; color: var(--muted); line-height: 1.7; }
.ad-box { min-height: 180px; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; color: var(--muted); }
.ad-box strong { color: var(--primary); margin-bottom: 8px; }
.admin-tabs { display: flex; gap: 8px; margin-bottom: 18px; }
.admin-table td { vertical-align: middle; }
.admin-table .admin-actions { display: flex; justify-content: center; gap: 5px; }
.modal-dialog { width: min(680px, calc(100% - 24px)); border: 0; border-radius: 14px; padding: 0; box-shadow: 0 30px 80px rgba(0,0,0,.25); }
.modal-dialog::backdrop { background: rgba(0,0,0,.46); }
.modal-dialog form { padding: 24px; }
.field-help { color: var(--muted); font-size: 13px; margin-top: -5px; }
@media (max-width: 1020px) {
  .page-layout { grid-template-columns: 1fr; }
  .sidebar { display: grid; grid-template-columns: 1fr 1fr; }
  .side-card { grid-column: 1 / -1; }
  .topnav { overflow-x: auto; flex-wrap: nowrap; }
  .tag-input-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  .wrap { width: min(100% - 20px, 1240px); }
  .topbar-inner { align-items: flex-start; flex-wrap: wrap; padding: 12px 0; gap: 10px; }
  .topnav { order: 3; width: 100%; }
  .auth-box { margin-left: auto; }
  .page-layout { padding-top: 20px; }
  .board-head { align-items: stretch; flex-direction: column; }
  .head-actions { justify-content: flex-start; }
  .feature-grid, .profile-grid, .two-columns, .three-columns { grid-template-columns: 1fr; }
  .toolbar > * { width: 100% !important; min-width: 0 !important; }
  .tag-input-grid { grid-template-columns: 1fr 1fr; }
  .board-table .author, .board-table .date, .board-table .count { display: none; }
  .comment-form { grid-template-columns: 1fr; }
  .profile-hero { grid-template-columns: 1fr; }
  .sidebar { display: flex; }
}

/* v5.3 프로필/권한 보강 */
.comment-author-link {
  font-weight: 800;
  color: var(--primary);
  text-decoration: none;
}
.comment-author-link:hover {
  text-decoration: underline;
}
.profile-card-photo {
  width: 76px;
  height: 76px;
  border-radius: 20px;
  object-fit: cover;
  background: #eef3fb;
  border: 1px solid var(--line);
  margin-bottom: 12px;
}
.photo-edit-row {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 18px;
  align-items: start;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #fbfcff;
}
.preview-photo {
  width: 112px;
  height: 112px;
  border-radius: 24px;
  object-fit: cover;
  background: #eef3fb;
}
.empty-photo {
  background: linear-gradient(135deg, #eef3fb, #dfe9f8);
}
@media (max-width: 720px) {
  .photo-edit-row {
    grid-template-columns: 1fr;
  }
}
