/* =====================================================
   style.css — 패들렛 클론
   ===================================================== */
:root {
  --primary:   #5b6cf5;
  --primary-h: #4757e0;
  --danger:    #e5534b;
  --muted:     #6b7280;
  --border:    #e5e7eb;
  --radius:    12px;
  --shadow:    0 2px 8px rgba(0,0,0,.08);
  --bg:        #f8f9fb;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: 'Pretendard','Apple SD Gothic Neo','Noto Sans KR',sans-serif;
  font-size: 15px; background: var(--bg); color: #1f2937; min-height: 100vh;
}

/* ── 헤더 ─────────────────────────────────────────── */
.site-header {
  display: flex; align-items: center; gap: 8px;
  padding: 0 20px; height: 52px; background: #fff;
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 100;
}
.site-logo { font-size: 17px; font-weight: 700; color: var(--primary); text-decoration: none; margin-right: auto; }
.board-title-header { font-size: 14px; font-weight: 600; color: #374151; max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-right: auto; }
.header-actions { display: flex; align-items: center; gap: 6px; }
.user-name { font-size: 13px; color: var(--muted); }

/* ── 버튼 ─────────────────────────────────────────── */
.btn {
  display: flex; align-items: center; gap: 4px;
  padding: 7px 14px; border-radius: 8px; border: 1px solid transparent;
  font-size: 13px; font-weight: 500; cursor: pointer;
  transition: background .15s; text-decoration: none; white-space: nowrap; font-family: inherit;
}
.btn-primary  { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-h); }
.btn-ghost    { background: transparent; border-color: var(--border); color: #374151; }
.btn-ghost:hover { background: #f3f4f6; }
.btn-danger   { background: var(--danger); color: #fff; border-color: var(--danger); }
.btn-danger:hover { background: #c0392b; }
.btn-sm  { padding: 5px 10px; font-size: 12px; }
.btn-xs  { padding: 3px 7px; font-size: 11px; }
.btn-full { width: 100%; justify-content: center; }
.btn-icon {
  background: none; border: none; cursor: pointer;
  font-size: 14px; padding: 2px 5px; border-radius: 4px;
  opacity: .55; transition: opacity .15s, background .15s;
}
.btn-icon:hover { opacity: 1; background: rgba(0,0,0,.07); }
.btn-icon.danger:hover { background: rgba(229,83,75,.12); }

/* ── 컨테이너 ────────────────────────────────────── */
.container { max-width: 1200px; margin: 0 auto; padding: 32px 24px; }
.page-title-row { display: flex; align-items: center; justify-content: space-between; margin-bottom: 24px; }
.page-title-row h2 { font-size: 20px; font-weight: 700; }

/* ── 보드 목록 ───────────────────────────────────── */
.boards-grid { display: grid; grid-template-columns: repeat(auto-fill,minmax(240px,1fr)); gap: 16px; }
.board-card {
  background: #fff; border-radius: var(--radius); border: 1px solid var(--border);
  overflow: hidden; transition: box-shadow .2s, transform .2s; display: flex; flex-direction: column;
}
.board-card::before { content:''; display:block; height:72px; background: var(--bg); }
.board-card:hover { box-shadow: var(--shadow); transform: translateY(-2px); }
.board-card-body { flex:1; padding:14px 16px; text-decoration:none; color:inherit; display:block; }
.board-card-body h3 { font-size:14px; font-weight:600; margin-bottom:6px; }
.board-card-body p  { font-size:12px; color:var(--muted); margin-bottom:6px; }
.post-count   { font-size:11px; color:#9ca3af; }
.layout-badge { font-size:11px; background:#ede9fe; color:var(--primary); padding:2px 7px; border-radius:99px; }
.board-card-footer { padding:8px 14px; border-top:1px solid var(--border); display:flex; gap:6px; justify-content:flex-end; }
.empty-state { text-align:center; padding:60px 20px; color:var(--muted); }

/* ── 보드 캔버스 ─────────────────────────────────── */
.board-canvas { min-height: calc(100vh - 52px); background: var(--board-bg,#f0f4ff); padding: 24px 32px; }
.board-empty  { text-align:center; padding:80px 20px; color:var(--muted); line-height:1.8; }

/* ── 섹션 헤더 ───────────────────────────────────── */
.section-block  { margin-bottom: 28px; }
.section-header {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 14px; background: rgba(255,255,255,.65);
  backdrop-filter: blur(4px); border-radius: 8px; margin-bottom: 12px;
  
}
.section-title   { font-size:14px; font-weight:700; flex:1; }
.section-count   { font-size:12px; color:rgba(0,0,0,.4); background:rgba(0,0,0,.08); padding:1px 7px; border-radius:99px; }
.section-actions { display:flex; gap:4px; }
.section-empty   { color:#9ca3af; font-size:13px; padding:16px; text-align:center; }

/* ── 포스트 카드 ─────────────────────────────────── */
.post-card {
  background: #fff; border-radius: 12px;
  border: 1px solid rgba(0,0,0,.07);
  box-shadow: 0 1px 4px rgba(0,0,0,.07);
  overflow: hidden; transition: box-shadow .2s, transform .15s;
  display: flex; flex-direction: column; cursor: pointer;
}
.post-card:hover { box-shadow: 0 4px 16px rgba(0,0,0,.12); transform: translateY(-2px); }
.post-card-header { display:flex; align-items:center; gap:8px; padding:10px 12px 6px; }
.post-avatar {
  width:30px; height:30px; border-radius:50%; background:var(--primary);
  color:#fff; font-size:13px; font-weight:700;
  display:flex; align-items:center; justify-content:center; flex-shrink:0;
}
.post-meta { flex:1; }
.post-author-name { font-size:12px; font-weight:600; display:block; }
.post-date        { font-size:11px; color:var(--muted); }
.post-header-actions { display:flex; gap:2px; opacity:0; transition:opacity .15s; }
.post-card:hover .post-header-actions { opacity:1; }
.post-image { width:100%; display:block; max-height:200px; object-fit:cover; }
.post-title   { font-size:14px; font-weight:600; padding:8px 12px 4px; color:#111827; }
.post-content { font-size:13px; color:#374151; line-height:1.6; padding:4px 12px 8px; word-break:break-word; }

/* ── 이모지 반응 ─────────────────────────────────── */
.post-reactions { display:flex; align-items:center; padding:6px 10px 8px; gap:6px; }
.reaction-trigger {
  background: transparent; border: 1px solid rgba(0,0,0,.12);
  border-radius: 99px; padding: 2px 8px; font-size: 14px;
  cursor: pointer; color: #b0b0b0;
  transition: border-color .15s, color .15s; font-family: inherit;
}
.reaction-trigger:hover { border-color: rgba(0,0,0,.25); color: #6b7280; }
.reaction-counts { font-size:12px; color:#6b7280; }

/* ── 이모지 피커 팝업 ────────────────────────────── */
.emoji-picker {
  display:flex; gap:2px; padding:6px 8px;
  background:#fff; border:1px solid #e5e7eb; border-radius:12px;
  box-shadow:0 4px 20px rgba(0,0,0,.14); z-index:9999;
}
.emoji-pick-btn {
  font-size:20px; background:none; border:none; cursor:pointer;
  padding:4px 5px; border-radius:7px;
  transition:transform .1s, background .12s; font-family:inherit;
}
.emoji-pick-btn:hover { transform:scale(1.3); background:#f0f4ff; }

/* ── 파일 첨부 ───────────────────────────────────── */
.file-attach-card {
  display:flex; align-items:center; gap:10px;
  padding:12px; background:#f8f9fb;
}
.file-attach-card .file-icon { font-size:26px; flex-shrink:0; }
.file-attach-card .file-name { font-size:12px; font-weight:500; color:#374151; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }

/* ── 섹션 + 버튼 ─────────────────────────────────── */
.section-add-btn { display: none; }
.fab-add {
  position:fixed; bottom:32px; right:32px;
  width:52px; height:52px; border-radius:50%;
  background:var(--primary); color:#fff;
  font-size:28px; border:none; cursor:pointer;
  box-shadow:0 4px 16px rgba(91,108,245,.4);
  display:flex; align-items:center; justify-content:center;
  transition:transform .15s; z-index:50;
}
.fab-add:hover { transform:scale(1.08); }

/* ══ 레이아웃별 ══════════════════════════════════════ */

/* 그리드 */
.posts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 280px));
  gap: 20px;
  align-items: start;
  justify-content: center;
}

/* 담벼락 */
.posts-wall { columns:4 220px; column-gap:16px; }
.posts-wall .post-card { break-inside:avoid; margin-bottom:16px; display:block; }
@media (max-width:1200px) { .posts-wall { columns:3 220px; } }
@media (max-width:800px)  { .posts-wall { columns:2 220px; } }
@media (max-width:500px)  { .posts-wall { columns:1; } }

/* 행 */
.layout-row .section-header { background:rgba(0,0,0,.18); border-left:none; border-radius:8px; }
.layout-row .section-title  { color:#fff; }
.layout-row .section-count  { background:rgba(255,255,255,.2); color:#fff; }
.posts-row {
  display:flex; flex-direction:row; gap:14px;
  overflow-x:auto; padding-bottom:10px; align-items:flex-start;
}
.posts-row .post-card { flex:0 0 240px; min-width:240px; }
.posts-row::-webkit-scrollbar { height:5px; }
.posts-row::-webkit-scrollbar-track { background:rgba(0,0,0,.06); border-radius:3px; }
.posts-row::-webkit-scrollbar-thumb { background:rgba(0,0,0,.18); border-radius:3px; }

/* 컬럼 */
.layout-column .board-canvas {
  display: flex !important;
  flex-direction: row;
  gap: 14px;
  align-items: stretch;
  overflow-x: auto;
  overflow-y: hidden;
  padding-bottom: 20px;
  height: calc(100vh - 52px);
  box-sizing: border-box;
}
.layout-column .board-canvas::-webkit-scrollbar { height: 6px; }
.layout-column .board-canvas::-webkit-scrollbar-thumb { background: rgba(0,0,0,.2); border-radius: 3px; }

.column-block {
  flex: 0 0 280px;
  min-width: 280px;
  background: rgba(0,0,0,.1);
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  height: calc(100vh - 92px);
  overflow: hidden;
}

/* 섹션 헤더 고정 */
.column-block-header {
  padding: 11px 14px;
  display: flex; align-items: center; gap: 8px;
  background: rgba(0,0,0,.25);
  flex-shrink: 0;
  position: sticky;
  top: 0;
  z-index: 10;
}
.column-block-header .section-title { color: #fff; font-size: 13px; font-weight: 700; }
.column-block-header .section-count { background: rgba(255,255,255,.2); color: #fff; }

/* 포스트 영역 독립 스크롤 */
.column-posts {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 10px;
  min-height: 60px;
  overflow-y: auto;
  overflow-x: hidden;
  flex: 1;
  scrollbar-width: thin;
  scrollbar-color: transparent transparent;
  transition: scrollbar-color .2s;
  align-items: stretch;
}
.column-posts .post-card {
  width: 100%;
  min-height: unset;
  flex-shrink: 0;
}
.column-posts:hover {
  scrollbar-color: rgba(0,0,0,.2) transparent;
}
.column-posts::-webkit-scrollbar { width: 5px; }
.column-posts::-webkit-scrollbar-track { background: transparent; }
.column-posts::-webkit-scrollbar-thumb {
  background: transparent;
  border-radius: 3px;
  transition: background .2s;
}
.column-posts:hover::-webkit-scrollbar-thumb { background: rgba(0,0,0,.2); }

.column-add-btn {
  width: 100%; padding: 8px;
  background: rgba(255,255,255,.12);
  border: 1px dashed rgba(255,255,255,.35);
  border-radius: 8px;
  color: rgba(255,255,255,.75);
  font-size: 13px; cursor: pointer;
  text-align: center;
  transition: background .15s;
  font-family: inherit;
  flex-shrink: 0;
}
.column-add-btn:hover { background: rgba(255,255,255,.22); }

/* 테이블 */
.layout-table .board-canvas { padding:20px; }
.layout-table .section-block { margin-bottom:36px; }
.table-wrap { background:#fff; border-radius:10px; overflow:hidden; box-shadow:var(--shadow); }
.table-header {
  display:grid; grid-template-columns:44px 160px 1fr 220px 1fr 90px;
  background:#f1f3f5; border-bottom:1px solid var(--border);
}
.table-header-cell { padding:9px 12px; font-size:12px; font-weight:600; color:var(--muted); border-right:1px solid var(--border); }
.table-header-cell:last-child { border-right:none; }
.table-row {
  display:grid; grid-template-columns:44px 160px 1fr 220px 1fr 90px;
  border-bottom:1px solid var(--border); min-height:64px; transition:background .12s; cursor:pointer;
}
.table-row:last-child { border-bottom:none; }
.table-row:hover { background:#f8f9fb; }
.table-cell { padding:10px 12px; border-right:1px solid var(--border); display:flex; align-items:center; font-size:13px; color:#374151; }
.table-cell:last-child { border-right:none; }
.table-cell-num { justify-content:center; color:var(--muted); font-size:12px; font-weight:600; }
.author-info { display:flex; align-items:center; gap:8px; }
.author-avatar { width:28px; height:28px; border-radius:50%; background:var(--primary); color:#fff; font-size:11px; font-weight:700; display:flex; align-items:center; justify-content:center; flex-shrink:0; }
.author-name { font-size:12px; font-weight:600; }
.author-date { font-size:11px; color:var(--muted); }
.table-cell-actions { justify-content:center; gap:4px; }
.table-empty { padding:20px; text-align:center; color:var(--muted); font-size:13px; }

/* ── 모달 ─────────────────────────────────────────── */
.modal-overlay {
  position:fixed; inset:0; background:rgba(0,0,0,.45);
  display:flex; align-items:center; justify-content:center; z-index:1000;
}
.modal-box { background:#fff; border-radius:16px; padding:26px; width:100%; max-width:440px; max-height:90vh; overflow-y:auto; }
.modal-wide { max-width:540px; }
.modal-box h3 { font-size:16px; font-weight:700; margin-bottom:18px; }
.modal-actions { display:flex; justify-content:flex-end; gap:8px; margin-top:18px; }

/* ── 폼 ──────────────────────────────────────────── */
.form-group { margin-bottom:14px; }
.form-group label { display:block; font-size:12px; font-weight:600; color:#374151; margin-bottom:5px; }
.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="password"],
.form-group textarea,
.form-group select {
  width:100%; padding:8px 11px; border:1px solid var(--border); border-radius:7px;
  font-size:13px; background:#fff; color:#1f2937; font-family:inherit; transition:border-color .15s;
}
.form-group input:focus,.form-group textarea:focus,.form-group select:focus {
  outline:none; border-color:var(--primary); box-shadow:0 0 0 3px rgba(91,108,245,.1);
}
.form-group textarea { resize:vertical; min-height:80px; }
.form-row { display:flex; gap:12px; }
.flex1 { flex:1; } .flex2 { flex:2; }

/* ── 댓글 ─────────────────────────────────────────── */
.comment-list { max-height:240px; overflow-y:auto; border:1px solid var(--border); border-radius:8px; padding:8px; }
.comment-item { display:grid; grid-template-columns:auto 1fr auto; gap:6px; padding:6px 0; border-bottom:1px solid #f3f4f6; font-size:13px; align-items:baseline; }
.comment-item:last-child { border-bottom:none; }
.comment-author { font-weight:600; color:#374151; }
.comment-text   { color:#4b5563; }
.comment-time   { font-size:11px; color:#9ca3af; }
.comment-hidden { opacity:.5; background:#fafafa; }
.comment-hidden .comment-text { color:#9ca3af; font-style:italic; }
.comment-actions { display:inline-flex; gap:4px; margin-left:8px; }
.comment-btn { font-size:11px; padding:1px 6px; border-radius:4px; border:1px solid var(--border); background:#fff; cursor:pointer; color:#374151; font-family:inherit; }
.comment-btn:hover { background:#f3f4f6; }
.comment-btn.danger { color:var(--danger); border-color:#fecaca; }
.comment-btn.danger:hover { background:#fef2f2; }

/* ── 인증 ─────────────────────────────────────────── */
.auth-page { display:flex; align-items:center; justify-content:center; min-height:100vh; background:linear-gradient(135deg,#e0e7ff 0%,#f0fdf4 100%); }
.auth-card { background:#fff; border-radius:20px; padding:40px 36px; width:100%; max-width:400px; box-shadow:0 8px 32px rgba(0,0,0,.1); }
.auth-logo { font-size:24px; font-weight:800; color:var(--primary); text-align:center; margin-bottom:28px; }
.auth-form { display:flex; flex-direction:column; gap:2px; }
.auth-switch { text-align:center; margin-top:16px; font-size:13px; color:var(--muted); }
.auth-switch a { color:var(--primary); text-decoration:none; font-weight:500; }
.alert { padding:10px 14px; border-radius:8px; font-size:13px; margin-bottom:14px; }
.alert-error { background:#fef2f2; color:#b91c1c; border:1px solid #fecaca; }

/* ── 레이아웃 드롭다운 ───────────────────────────── */
.layout-dropdown { position:relative; }
.layout-menu { position:absolute; top:34px; right:0; background:#fff; border:1px solid var(--border); border-radius:8px; box-shadow:var(--shadow); z-index:200; min-width:110px; overflow:hidden; }
.layout-menu-item { display:block; width:100%; padding:8px 14px; background:none; border:none; text-align:left; font-size:13px; cursor:pointer; color:#374151; font-family:inherit; }
.layout-menu-item:hover { background:#f3f4f6; }
.layout-menu-item.active { color:var(--primary); font-weight:600; }
.layout-picker { display:flex; gap:8px; flex-wrap:wrap; }
.layout-option { display:flex; flex-direction:column; align-items:center; gap:4px; padding:10px 12px; border:1px solid var(--border); border-radius:8px; cursor:pointer; font-size:12px; transition:border-color .15s,background .15s; }
.layout-option:has(input:checked) { border-color:var(--primary); background:#f0f0ff; color:var(--primary); }
.layout-option input { display:none; }
.layout-icon { font-size:18px; }
.layout-badge { font-size:11px; background:#ede9fe; color:var(--primary); padding:2px 7px; border-radius:99px; }

/* ══ 뷰어 모달 ══════════════════════════════════════ */
.viewer-modal {
  position:fixed; inset:0; background:rgba(0,0,0,.88);
  display:flex; align-items:center; justify-content:center; z-index:2000;
}
.viewer-normal {
  display:flex; flex-direction:column;
  width:92vw; height:90vh; max-width:1100px;
  background:#111118; border-radius:14px; overflow:hidden;
}
.viewer-toolbar {
  display:flex; align-items:center; justify-content:space-between;
  padding:10px 16px; background:rgba(0,0,0,.5); flex-shrink:0; gap:12px;
}
.viewer-meta-top { display:flex; align-items:center; gap:8px; flex:1; min-width:0; overflow:hidden; }
.viewer-toolbar-right { display:flex; gap:8px; flex-shrink:0; }
.viewer-toolbar-btn {
  padding:5px 12px; background:rgba(255,255,255,.1);
  border:1px solid rgba(255,255,255,.2); border-radius:7px;
  color:#fff; font-size:12px; cursor:pointer; font-family:inherit; transition:background .15s;
}
.viewer-toolbar-btn:hover { background:rgba(255,255,255,.22); }
.viewer-file-area {
  flex:1; display:flex; align-items:center; justify-content:center;
  overflow:auto; padding:16px; background:#0a0a12; position:relative;
}
.viewer-file-area img { max-width:100%; max-height:100%; object-fit:contain; border-radius:4px; }
.viewer-nav {
  display:flex; align-items:center; justify-content:center; gap:20px;
  padding:10px; background:rgba(0,0,0,.45); flex-shrink:0;
}
.viewer-nav-btn {
  background:rgba(255,255,255,.1); border:none; color:#fff;
  width:36px; height:36px; border-radius:50%; font-size:22px;
  cursor:pointer; display:flex; align-items:center; justify-content:center; transition:background .15s;
}
.viewer-nav-btn:hover { background:rgba(255,255,255,.25); }
.viewer-loading,.viewer-error { color:rgba(255,255,255,.65); font-size:14px; text-align:center; padding:40px; }

/* 발표모드 */
.viewer-present {
  position:fixed; inset:0; background:#000;
  display:flex; flex-direction:column; align-items:center; justify-content:center; z-index:3000;
}
.viewer-present-img {
  width:100vw; height:100vh;
  display:flex; align-items:center; justify-content:center; overflow:hidden;
}
.viewer-present-img img { max-width:100vw; max-height:100vh; width:auto; height:auto; object-fit:contain; display:block; }
.viewer-present-nav {
  position:fixed; bottom:24px; left:50%; transform:translateX(-50%);
  display:flex; align-items:center; gap:20px;
  background:rgba(0,0,0,.6); padding:8px 20px; border-radius:99px;
  backdrop-filter:blur(6px); z-index:3001;
}
.viewer-present-btn {
  background:rgba(255,255,255,.15); border:none; color:#fff;
  width:40px; height:40px; border-radius:50%; font-size:26px;
  cursor:pointer; display:flex; align-items:center; justify-content:center; transition:background .15s;
}
.viewer-present-btn:hover { background:rgba(255,255,255,.3); }
.viewer-present-close {
  position:fixed; top:16px; right:20px;
  background:rgba(255,255,255,.1); border:1px solid rgba(255,255,255,.2);
  border-radius:8px; color:rgba(255,255,255,.7);
  padding:6px 14px; font-size:12px; cursor:pointer; font-family:inherit; z-index:3001;
}
.viewer-present-close:hover { background:rgba(255,255,255,.2); color:#fff; }

/* ── 반응형 ───────────────────────────────────────── */
@media (max-width:600px) {
  .container { padding:20px 16px; }
  .board-canvas { padding:14px; }
  .posts-grid { grid-template-columns:1fr; }
  .boards-grid { grid-template-columns:1fr; }
  .modal-box { margin:12px; border-radius:12px; padding:20px; }
  .site-header { padding:0 14px; }
  .table-header,.table-row { grid-template-columns:36px 120px 1fr 120px; }
  .table-header-cell:nth-child(5),.table-cell:nth-child(5),
  .table-header-cell:nth-child(6),.table-cell:nth-child(6) { display:none; }
}

/* 섹션 헤더 큰 + 버튼 */
.section-plus-btn {
  width: 44px; height: 44px;
  background: rgba(255,255,255,.9);
  border: 2px solid rgba(0,0,0,.15);
  border-radius: 50%;
  font-size: 28px; line-height: 1;
  cursor: pointer; color: #374151;
  display: flex; align-items: center; justify-content: center;
  transition: background .15s, color .15s, transform .1s, box-shadow .15s;
  font-family: inherit; flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(0,0,0,.1);
}
.section-plus-btn:hover {
  background: var(--primary); color: #fff;
  border-color: var(--primary); transform: scale(1.12);
  box-shadow: 0 4px 14px rgba(91,108,245,.4);
}

/* ══ 패들렛 스타일 뷰어 ══════════════════════════════ */
.viewer-modal {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.7);
  display: flex; align-items: center; justify-content: center;
  z-index: 2000;
}
.viewer-wrap {
  display: flex;
  width: 95vw; height: 92vh;
  max-width: 1400px;
  background: #fff;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0,0,0,.3);
}

/* 왼쪽: 파일 */
.viewer-left {
  flex: 1;
  display: flex; flex-direction: column;
  background: #1a1a2e;
  overflow: hidden;
}
  max-width: 100%; max-height: 100%;
  width: auto; height: auto;
  object-fit: contain; display: block;
}
.viewer-nav {
  display: flex; align-items: center; justify-content: center; gap: 16px;
  padding: 10px 16px; background: rgba(0,0,0,.6); flex-shrink: 0;
}
.viewer-nav-btn {
  background: rgba(255,255,255,.15); border: none; color: #fff;
  width: 36px; height: 36px; border-radius: 50%; font-size: 22px;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
}
.viewer-nav-btn:hover { background: rgba(255,255,255,.3); }
.viewer-page-info { color: #fff; font-size: 13px; }
.viewer-loading, .viewer-error, .viewer-empty {
  color: rgba(255,255,255,.6); font-size: 14px;
  text-align: center; padding: 40px;
}
.viewer-text-only {
  color: #fff; font-size: 16px; line-height: 1.8;
  max-width: 640px; padding: 40px; text-align: left;
}

/* 오른쪽: 정보 패널 */
.viewer-right {
  width: 300px; flex-shrink: 0;
  background: #fff; display: flex; flex-direction: column;
  border-left: 1px solid #e5e7eb; overflow-y: auto;
}
.viewer-right-header {
  display: flex; align-items: center; justify-content: flex-end; gap: 8px;
  padding: 12px 14px; border-bottom: 1px solid #f0f0f0; flex-shrink: 0;
}
.viewer-close-btn, .viewer-fullscreen-btn {
  width: 32px; height: 32px; border-radius: 50%;
  background: #f3f4f6; border: none; cursor: pointer;
  font-size: 14px; display: flex; align-items: center; justify-content: center;
  transition: background .15s;
}
.viewer-close-btn:hover, .viewer-fullscreen-btn:hover { background: #e5e7eb; }
.viewer-author {
  display: flex; align-items: center; gap: 8px;
  padding: 14px 16px 8px;
}
.viewer-title-text {
  font-size: 17px; font-weight: 700;
  padding: 4px 16px 12px; color: #111827; line-height: 1.4;
}
.viewer-filename {
  display: flex; align-items: center; gap: 6px;
  padding: 4px 16px 12px; font-size: 12px; color: #6b7280;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.viewer-divider { height: 1px; background: #f0f0f0; margin: 0 16px; }
.viewer-reactions-row {
  display: flex; flex-wrap: wrap; gap: 6px; padding: 12px 16px;
}
.viewer-reaction-btn {
  display: flex; align-items: center; gap: 3px;
  padding: 4px 10px; border-radius: 99px;
  border: 1px solid #e5e7eb; background: #fff;
  font-size: 16px; cursor: pointer; transition: background .15s;
  font-family: inherit;
}
.viewer-reaction-btn:hover { background: #f0f4ff; border-color: var(--primary); }
.viewer-reaction-btn.active { background: #ede9fe; border-color: var(--primary); }
.viewer-comment-area { padding: 12px 16px; }
.viewer-comment-btn {
  width: 100%; padding: 10px; background: #f8f9fb;
  border: 1px solid #e5e7eb; border-radius: 8px;
  font-size: 13px; cursor: pointer; text-align: left;
  color: #6b7280; font-family: inherit; transition: background .15s;
}
.viewer-comment-btn:hover { background: #f0f4ff; color: var(--primary); }

/* ══ 발표모드 ════════════════════════════════════════ */
.present-modal {
  position: fixed; inset: 0; background: #000;
  display: flex; align-items: center; justify-content: center;
  z-index: 3000;
}
.present-img {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
}
.present-img img {
  max-width: 100vw; max-height: 100vh;
  width: 100vw; height: 100vh;
  object-fit: contain; display: block;
}

/* 양쪽 이전/다음 버튼 */
.present-side-btn {
  position: fixed; top: 50%; transform: translateY(-50%);
  background: rgba(255,255,255,.15); border: none; color: #fff;
  width: 56px; height: 56px; border-radius: 50%;
  font-size: 32px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  z-index: 3002; transition: background .15s, opacity .15s;
  opacity: 0;
}
.present-modal:hover .present-side-btn { opacity: 1; }
.present-side-btn:hover { background: rgba(255,255,255,.35); }
.present-side-left  { left: 20px; }
.present-side-right { right: 20px; }

/* 닫기 버튼 */
.present-close-btn {
  position: fixed; top: 16px; right: 20px;
  background: rgba(0,0,0,.5); border: 1px solid rgba(255,255,255,.25);
  border-radius: 8px; color: #fff;
  padding: 7px 16px; font-size: 13px; cursor: pointer;
  font-family: inherit; z-index: 3002;
  opacity: 0; transition: opacity .15s, background .15s;
}
.present-modal:hover .present-close-btn { opacity: 1; }
.present-close-btn:hover { background: rgba(255,255,255,.2); }

/* 하단 페이지 표시 */
.present-bottom {
  position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%);
  background: rgba(0,0,0,.5); border-radius: 99px;
  padding: 5px 18px; z-index: 3002;
  opacity: 0; transition: opacity .15s;
}
.present-modal:hover .present-bottom { opacity: 1; }
.present-page-text { color: rgba(255,255,255,.85); font-size: 13px; }

@media (max-width: 768px) {
  .viewer-wrap { flex-direction: column; width: 98vw; height: 96vh; }
  .viewer-right { width: 100%; flex: 0 0 200px; border-left: none; border-top: 1px solid #e5e7eb; }
}

/* PDF iframe 뷰어 */
.viewer-pdf-iframe {
  width: 100%;
  height: 100%;
  border: none;
  display: block;
  background: #fff;
}

.viewer-pdf-iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: none;
  display: block;
  background: #fff;
}

/* 전체화면 버튼 항상 표시 */
.viewer-fullscreen-btn {
  display: flex !important;
}

/* 뷰어 포스트 이전/다음 버튼 */
.viewer-post-nav {
  display: flex;
  justify-content: center;
  gap: 12px;
  padding: 14px 16px;
}
.viewer-post-nav-btn {
  width: 44px; height: 44px;
  border-radius: 50%;
  background: #f3f4f6;
  border: 1px solid #e5e7eb;
  font-size: 24px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background .15s;
  color: #374151;
}
.viewer-post-nav-btn:hover:not(:disabled) { background: #e5e7eb; }
.viewer-post-nav-btn:disabled { opacity: .3; cursor: not-allowed; }

/* ── 뷰어 세로 사이드바 ──────────────────────────── */
.viewer-sidebar {
  width: 52px;
  flex-shrink: 0;
  background: #fff;
  border-left: 1px solid #e5e7eb;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 8px 0;
  gap: 4px;
  z-index: 10;
}
.vsb-btn {
  width: 38px; height: 38px;
  border-radius: 50%;
  background: transparent;
  border: none;
  font-size: 16px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  color: #374151;
  transition: background .15s;
  font-family: inherit;
}
.vsb-btn:hover { background: #f3f4f6; }
.vsb-btn:disabled { opacity: .3; cursor: not-allowed; }

/* 더보기 메뉴 */
.vsb-more-wrap { position: relative; }
.vsb-menu {
  position: absolute;
  right: 46px;
  top: 0;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  box-shadow: 0 4px 16px rgba(0,0,0,.12);
  min-width: 160px;
  overflow: hidden;
  z-index: 100;
}
.vsb-menu-item {
  display: block; width: 100%;
  padding: 10px 16px;
  background: none; border: none;
  text-align: left; font-size: 13px;
  cursor: pointer; color: #374151;
  font-family: inherit;
  transition: background .15s;
  white-space: nowrap;
}
.vsb-menu-item:hover { background: #f3f4f6; }

/* 정보패널 */
#viewerInfoPanel {
  transition: width .2s, opacity .2s;
}
#viewerInfoPanel.hidden {
  width: 0; opacity: 0; overflow: hidden; padding: 0; border: none;
}

/* 섹션 헤더 + 버튼 */
.section-header-plus {
  width: 32px; height: 32px;
  background: rgba(255,255,255,.9);
  border: 2px solid rgba(0,0,0,.15);
  border-radius: 50%;
  font-size: 22px; font-weight: 300; line-height: 1;
  cursor: pointer; color: #374151;
  display: flex; align-items: center; justify-content: center;
  transition: background .15s, color .15s, transform .1s;
  font-family: inherit; flex-shrink: 0;
}
.section-header-plus:hover {
  background: var(--primary); color: #fff;
  border-color: var(--primary); transform: scale(1.1);
}

/* 모바일 뷰어 */
@media (max-width: 768px) {
  .viewer-wrap {
    flex-direction: column;
    width: 100vw;
    height: 100vh;
    border-radius: 0;
  }
  .viewer-left {
    flex: 1;
    min-height: 0;
  }
  .viewer-right {
    display: none !important;
  }
  .viewer-sidebar {
    width: 100%;
    flex-direction: row;
    justify-content: flex-end;
    padding: 6px 12px;
    border-left: none;
    border-top: 1px solid #e5e7eb;
    height: auto;
    flex-shrink: 0;
    gap: 4px;
  }
  .vsb-btn {
    width: 40px;
    height: 40px;
  }
  .vsb-menu {
    right: 0;
    top: auto;
    bottom: 52px;
    left: auto;
  }
}

/* 모바일 뷰어 개선 */
@media (max-width: 768px) {
  .viewer-modal {
    align-items: stretch;
    justify-content: stretch;
  }
  .viewer-wrap {
    flex-direction: column;
    width: 100vw;
    height: 100vh;
    max-width: 100vw;
    border-radius: 0;
  }
  .viewer-left {
    flex: 1;
    min-height: 0;
    height: 0;
  }
  .viewer-file-area {
    flex: 1;
    padding: 0 !important;
    height: 100%;
  }
  .viewer-pdf-iframe {
    width: 100%;
    height: 100%;
  }
  .viewer-img-full {
    width: 100%;
    height: 100%;
    object-fit: contain;
  }
  .viewer-right { display: none !important; }
  .viewer-sidebar {
    width: 100%;
    flex-direction: row;
    justify-content: space-between;
    padding: 6px 16px;
    border-left: none;
    border-bottom: 1px solid #e5e7eb;
    height: 48px;
    flex-shrink: 0;
    gap: 4px;
    order: -1;
    background: #fff;
  }
  .vsb-btn { width: 36px; height: 36px; font-size: 14px; }
  .vsb-menu {
    right: 8px;
    top: 48px;
    bottom: auto;
    left: auto;
  }
  .viewer-nav {
    flex-shrink: 0;
    padding: 6px;
  }
}

@media (max-width: 768px) {
  /* 페이지 내비 버튼 크게 */
  .viewer-nav-btn {
    width: 52px;
    height: 52px;
    font-size: 30px;
  }
  .viewer-nav {
    padding: 12px;
    gap: 24px;
  }
  .viewer-page-info {
    font-size: 15px;
  }
  /* 사이드바 버튼 크게 */
  .vsb-btn {
    width: 44px !important;
    height: 44px !important;
    font-size: 18px !important;
  }
}

@media (max-width: 768px) {
  /* 포스트 이전/다음 버튼 크게 */
  .viewer-post-nav-btn {
    width: 52px !important;
    height: 52px !important;
    font-size: 28px !important;
  }
  .viewer-post-nav {
    padding: 10px 16px;
    gap: 20px;
  }
}

@media (max-width: 768px) {
  /* 포스트 이전/다음 < > 버튼 크게 */
  #viewerPostPrevBtn,
  #viewerPostNextBtn {
    width: 52px !important;
    height: 52px !important;
    font-size: 32px !important;
  }

  /* 페이지 내비 고정 - 항상 보이게 */
  .viewer-nav {
    position: sticky;
    bottom: 0;
    background: rgba(0,0,0,.7);
    flex-shrink: 0;
    z-index: 10;
  }
}

@media (max-width: 768px) {
  .viewer-modal {
    height: 100dvh;
  }
  .viewer-wrap {
    height: 100dvh;
  }
}

@media (max-width: 768px) {
  .viewer-modal,
  .viewer-wrap {
    height: -webkit-fill-available;
    height: 100dvh;
  }
}

@media (max-width: 768px) {
  .viewer-modal {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    height: auto !important;
  }
  .viewer-wrap {
    height: auto !important;
    min-height: 0;
    flex: 1;
  }
}

@media (max-width: 768px) {
  .viewer-modal {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100% !important;
    height: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
  }
  .viewer-wrap {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100% !important;
    height: 100% !important;
    border-radius: 0 !important;
  }
}

.viewer-text-only {
  color: #fff;
  font-size: 16px;
  line-height: 1.8;
  max-width: 700px;
  width: 100%;
  text-align: left;
}
.viewer-text-only p {
  white-space: pre-wrap;
  word-break: break-word;
}

/* ── 보드 상단 헤더 (패들렛 스타일) ─────────────── */
.board-top-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px 12px;
  background: var(--board-bg, #f0f4ff);
  border-bottom: 1px solid rgba(0,0,0,.08);
}
.board-top-left {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
  min-width: 0;
}
.board-back-btn {
  font-size: 20px;
  color: rgba(0,0,0,.5);
  text-decoration: none;
  width: 36px; height: 36px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
  transition: background .15s;
  flex-shrink: 0;
}
.board-back-btn:hover { background: rgba(0,0,0,.08); color: #111; }
.board-title-wrap { min-width: 0; }
.board-title-big {
  font-size: 26px;
  font-weight: 800;
  color: #111827;
  cursor: pointer;
  display: inline-block;
  border-radius: 6px;
  padding: 2px 6px;
  transition: background .15s;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 60vw;
}
.board-title-big:hover { background: rgba(0,0,0,.07); }
.board-title-input {
  font-size: 26px;
  font-weight: 800;
  color: #111827;
  border: 2px solid var(--primary);
  border-radius: 6px;
  padding: 2px 8px;
  outline: none;
  width: 400px;
  max-width: 60vw;
  font-family: inherit;
}
.board-top-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

/* site-header 기존 버튼들 유지 */
.site-header { position: sticky; top: 0; z-index: 100; }

@media (max-width: 768px) {
  .board-top-header { padding: 12px 16px 10px; }
  .board-title-big { font-size: 20px; max-width: 55vw; }
  .board-title-input { font-size: 18px; width: 240px; }
}

/* 보드 상단 헤더 위치 조정 */
.board-top-header {
  order: 1;
}
.site-header {
  order: 0;
}
.board-top-header {
  border-top: 1px solid rgba(0,0,0,.06);
}

.site-logo-input {
  font-size: 17px;
  font-weight: 700;
  color: var(--primary);
  border: 2px solid var(--primary);
  border-radius: 6px;
  padding: 2px 8px;
  outline: none;
  width: 220px;
  font-family: inherit;
  background: #fff;
}

/* ── 카드 크기 옵션 ──────────────────────────────── */
.card-size-small .posts-grid {
  grid-template-columns: repeat(auto-fill, minmax(180px, 200px));
  gap: 12px;
}
.card-size-small .post-card { font-size: 12px; }
.card-size-small .post-image { max-height: 120px; }

.card-size-medium .posts-grid {
  grid-template-columns: repeat(auto-fill, minmax(260px, 280px));
  gap: 20px;
}

.card-size-large .posts-grid {
  grid-template-columns: repeat(auto-fill, minmax(340px, 380px));
  gap: 24px;
}
.card-size-large .post-card { font-size: 15px; }
.card-size-large .post-image { max-height: 280px; }

/* ── 검색란 ──────────────────────────────────────── */
.search-wrap {
  position: relative;
  display: flex;
  align-items: center;
}
.search-input {
  width: 220px;
  padding: 6px 32px 6px 12px;
  border: 1px solid var(--border);
  border-radius: 99px;
  font-size: 13px;
  background: #f3f4f6;
  outline: none;
  transition: width .2s, background .15s, border-color .15s;
  font-family: inherit;
}
.search-input:focus {
  width: 280px;
  background: #fff;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(91,108,245,.1);
}
.search-clear {
  position: absolute;
  right: 8px;
  background: none;
  border: none;
  cursor: pointer;
  color: #9ca3af;
  font-size: 12px;
  width: 20px; height: 20px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
  transition: background .15s;
}
.search-clear:hover { background: #e5e7eb; color: #374151; }

@media (max-width: 768px) {
  .search-input { width: 140px; }
  .search-input:focus { width: 180px; }
}

/* 뷰어 사이드바 이전/다음 버튼 크게 */
#viewerPostPrevBtn,
#viewerPostNextBtn {
  width: 46px !important;
  height: 46px !important;
  font-size: 28px !important;
  background: #f0f0f0 !important;
  border: 1px solid #ddd !important;
  font-weight: 300;
}
#viewerPostPrevBtn:hover,
#viewerPostNextBtn:hover {
  background: var(--primary) !important;
  color: #fff !important;
  border-color: var(--primary) !important;
}
#viewerPostPrevBtn:disabled,
#viewerPostNextBtn:disabled {
  opacity: .25 !important;
  background: #f0f0f0 !important;
}

/* ── 포스트 링크 카드 ────────────────────────────── */
.post-link-card {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  margin: 4px 8px 8px;
  background: #f8f9fb;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  text-decoration: none;
  color: #374151;
  font-size: 12px;
  transition: background .15s;
  overflow: hidden;
}
.post-link-card:hover { background: #ede9fe; border-color: var(--primary); }
.post-link-favicon { width: 14px; height: 14px; flex-shrink: 0; }
.post-link-domain  { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.post-link-arrow   { flex-shrink: 0; color: var(--primary); }

/* 링크 미리보기 */
.link-preview {
  display: flex;
  align-items: center;
  padding: 6px 10px;
  background: #f8f9fb;
  border: 1px solid #e5e7eb;
  border-radius: 7px;
  margin-top: 6px;
}

/* ── 드래그&드롭 영역 ────────────────────────────── */
.drop-zone {
  border: 2px dashed #d1d5db;
  border-radius: 8px;
  padding: 16px 12px;
  text-align: center;
  cursor: pointer;
  transition: border-color .15s, background .15s;
  background: #f9fafb;
  min-height: 60px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
}
.drop-zone:hover,
.drop-zone-over {
  border-color: var(--primary) !important;
  background: #f0f0ff !important;
}
.drop-zone-active {
  border-color: #10b981 !important;
  background: #f0fdf4 !important;
}
.drop-zone-text {
  font-size: 12px;
  color: #9ca3af;
}
.drop-zone-filename {
  font-size: 12px;
  color: #374151;
  font-weight: 500;
  word-break: break-all;
}

/* 뷰어 전체화면 — 주소창까지 꽉 차게 */
.viewer-modal {
  position: fixed !important;
  inset: 0 !important;
  width: 100% !important;
  height: 100% !important;
  z-index: 9999 !important;
}
.viewer-wrap {
  width: 100% !important;
  height: 100% !important;
  max-width: 100% !important;
  border-radius: 0 !important;
}

/* 뷰어 전체화면 — 주소창까지 꽉 차게 */
.viewer-modal {
  position: fixed !important;
  inset: 0 !important;
  width: 100% !important;
  height: 100% !important;
  z-index: 9999 !important;
}
.viewer-wrap {
  width: 100% !important;
  height: 100% !important;
  max-width: 100% !important;
  border-radius: 0 !important;
}

/* 포스트 조회수 */
.post-views {
  font-size: 11px;
  color: #9ca3af;
  padding: 4px 12px 8px;
  display: flex;
  align-items: center;
  gap: 3px;
}
