/* SUIT 가변폰트 자가호스팅 (2026-06-04) — 웹폰트 정의. weight 100~900 단일 가변폰트(약 610KB),
   ⚠️2026-07-01부터 이 폰트는 '모바일/태블릿(터치 기기)에서만' 실제 적용됨(아래 변수 참고).
   8/5 핫딜: font-display swap→optional — 준비돼 있으면(프리로드+캐시) 처음부터 SUIT, 늦으면 교체 없이 대체 폰트 유지 = 새로고침마다 글자 크기 바뀌는 깜빡임 원천 차단 */
@font-face {
  font-family: 'SUIT Variable';
  src: url('/assets/SUIT-Variable.woff2?v=202606041319') format('woff2');
  font-weight: 100 900;
  font-style: normal;
  font-display: optional;
}

/* ─────────────────────────────────────────────────────────────────────
   본문 폰트 스택 변수 (2026-07-01 하이브리드 도입)
   - 기본값(모바일·태블릿 = 터치 기기): SUIT 웹폰트. 고DPI라 선명 + 브랜드 유지.
   - 데스크탑(마우스 기기 = hover 가능 + 정밀 포인터): 시스템폰트(Windows=맑은고딕 / Mac=Apple SD Gothic Neo).
     저해상도(96DPI) 데스크탑에서 CFF 웹폰트가 흐린 문제를 회피(선명). 이때 SUIT woff2는 참조되지 않아 다운로드조차 안 됨.
   - 기준: 화면폭이 아니라 '입력장치'라 창 축소·F12로 흔들리지 않음.
   사이트 전역의 font-family는 전부 var(--font-main) 사용. ───────────────────── */
:root {
  --font-main: 'SUIT Variable', SUIT, -apple-system, BlinkMacSystemFont, 'Apple SD Gothic Neo', 'Malgun Gothic', '맑은 고딕', sans-serif;
  /* [N] 댓글수 광학 보정 — 폰트별 분리 (2026-07-14 사용자 실기기 확인: PC·안드·iOS 모두 딱 맞음):
     SUIT(터치 기기) 보정 0 / 맑은고딕(데스크탑)만 위로 2px (2026-07-14 사용자 실기기 재확인) */
  --cc-nudge: 0px;
}
@media (hover: hover) and (pointer: fine) {
  :root {
    --font-main: 'Malgun Gothic', 'Apple SD Gothic Neo', -apple-system, BlinkMacSystemFont, sans-serif;
    --cc-nudge: -1.5px;
  }
}

/* 썸네일 row의 위/아래 갭 표준값 — 메인 베스트, 게시판, 게시글내 게시판, 핫글이 공유.
   데스크탑/태블릿 4px, 모바일(≤768) 2px → 썸네일 75×42 (비율 82:46 유지). */
:root {
  --thumb-row-pad: 4px;
}
@media (max-width: 768px) {
  :root { --thumb-row-pad: 2px; }
}

/* Quill 본문 호환 — admin에서 작성된 글의 정렬 클래스 (about/terms/policy 페이지).
   quill.snow.css 전체 로드 없이 정렬만 적용. 색상/배경은 인라인 style이라 자동 작동. */
.ql-align-center { text-align: center; }
.ql-align-right { text-align: right; }
.ql-align-justify { text-align: justify; }

/* ═══════════════════════════════════════════════════════════════
   select 전역 리셋 — iOS Safari가 padding/height 무시하는 문제 해결
   - appearance:none으로 네이티브 스타일 리셋
   - 커스텀 SVG 화살표 data URL로 기본 드롭다운 아이콘 제공
   - 페이지별 .class 규칙은 특정성 높아 padding/width 등 개별 값 유지
   ═══════════════════════════════════════════════════════════════ */
select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236c757d' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  padding-right: 28px;
  line-height: 1.4;
  box-sizing: border-box;
}

/* ═══════════════════════════════════════════════════════════════
   Viewport 폭 계산 완전 일치 보장
   - 세로 스크롤바 항상 강제 (콘텐츠 길이에 관계없이 viewport 폭 동일)
   - 가로 스크롤은 body에서 차단 (html에 overflow-x:hidden 주면 sticky 깨짐)
   - sticky nav 보정: scrollIntoView 시 nav 가림 방지 (nav 97px + gap 10px = 107px)
   ═══════════════════════════════════════════════════════════════ */
html {
  overflow-y: scroll;
  /* scroll-padding-top: 0 (2026-05-20) — 107px가 검색 input의 caret/타이핑/드래그 시 scroll-into-view를
     유발해 페이지가 위로 스크롤되는 진짜 root cause(사용자 콘솔 테스트 확정). iPad overscroll 복귀는
     overflow-anchor:auto(현재값)가 담당하므로 무관. 앵커/댓글 점프 가림은 stableScrollIntoView JS offset으로 별도 처리. */
  scroll-padding-top: 0;
  -webkit-tap-highlight-color: transparent;
}
body {
  max-width: 100%;
  overflow-x: clip;
  font-weight: 500;
  /* 단어/글자 줄바꿈 룰 — 어떤 문자든 컨테이너 폭 넘으면 글자 중간에서도 자름 (긴 한글/영문/URL 모두 wrap, overflow 방지)
     2026-05-11 변경: keep-all → break-all (keep-all로 띄어쓰기 없는 긴 한글이 박스 넘는 회귀) */
  word-break: break-all;
  overflow-wrap: break-word;
}
/* 모든 인터랙티브 요소 클릭 시 파란/회색 점멸 제거 (모바일 브라우저 기본 동작) */
a, button, input, select, textarea, label, [role="button"], [onclick], .side-item, .cta-btn, .nav-link {
  -webkit-tap-highlight-color: transparent;
}

/* form 요소들 폰트 강제 (브라우저 기본 Arial/Times 무시하고 본문 폰트 상속) */
input, textarea, button, select {
  font-family: inherit;
}

/* 로고 이미지 기본(fit 모드): 회색박스 placeholder 높이(32/24)와 동일.
   가로는 비율대로, 높이는 고정. natural 모드는 common.js에서 inline max-height:none으로 해제. */
.nav-logo img { max-height: 46px; width: auto; }
.footer-logo img { max-height: 36px; width: auto; }


/* ── 스티커 슬롯 (장착 스티커 표시 자리) ── */
/* 모든 닉네임 옆에 동일한 양식. 페이지별 인라인 오버라이드 금지.
   - 일반 유저: 검은 테두리
   - 운영자/부운영자(.staff): 금색 테두리
   - 닉네임과의 간격은 슬롯의 margin-right 로만 관리.
   - 기존 .level-badge* 클래스는 alias 로 유지 (호환). */
.sticker-slot,
.level-badge {
  display: inline-block;
  width: 28px;
  height: 28px;
  background: #d1d5db center/cover no-repeat;
  border: 1px solid var(--gray-400);
  border-radius: 5px;
  vertical-align: middle;
  flex-shrink: 0;
  box-sizing: border-box;
  margin-right: 7px;
  overflow: hidden;
}
.sticker-slot-xs,
.level-badge-xs {
  width: 24px;
  height: 24px;
  border-width: 1px;
  border-radius: 5px;
  margin-right: 6px;
}
.sticker-slot-sm,
.level-badge-sm {
  width: 26px;
  height: 26px;
  border-width: 1px;
  border-radius: 5px;
  margin-right: 6px;
}
.sticker-slot-lg,
.level-badge-lg {
  width: 40px;
  height: 40px;
  border-width: 1px;
  border-radius: 7px;
  margin-right: 10px;
}
.sticker-slot.staff,
.level-badge.staff,
.sticker-slot-xs.staff,
.level-badge-xs.staff,
.sticker-slot-sm.staff,
.level-badge-sm.staff,
.sticker-slot-lg.staff,
.level-badge-lg.staff {
  border-color: #d4a017;
}
/* 기본(MID) 슬롯은 폰트 브레이크포인트에 맞춰 자동 축소
   - 데스크탑 13px → 28
   - ≤768 모바일 12px → 26 (SM 동급)
   - ≤360 작은 모바일 11px → 24 (XS 동급) */
@media (max-width: 768px) {
  .sticker-slot:not(.sticker-slot-xs):not(.sticker-slot-sm):not(.sticker-slot-lg),
  .level-badge:not(.level-badge-xs):not(.level-badge-sm):not(.level-badge-lg) {
    width: 26px;
    height: 26px;
    margin-right: 6px;
  }
}
@media (max-width: 360px) {
  .sticker-slot:not(.sticker-slot-xs):not(.sticker-slot-sm):not(.sticker-slot-lg),
  .level-badge:not(.level-badge-xs):not(.level-badge-sm):not(.level-badge-lg) {
    width: 24px;
    height: 24px;
    margin-right: 6px;
  }
}
.sticker-slot > img,
.level-badge > img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
/* 슬롯+닉네임 한 줄 정렬 (인라인 컨텍스트의 baseline 어긋남 해결) */
.author-inline {
  display: inline-flex;
  align-items: center;
  vertical-align: middle;
  white-space: nowrap;
  min-width: 0;
}

/* ── 게시글 배지 ── */
.post-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 20px;
  padding: 0 6px;
  font-size: 10px;
  font-weight: 700;
  line-height: 1;
  color: var(--navy-mid);
  background: var(--navy-pale);
  border-radius: 8px;
  white-space: nowrap;
  flex-shrink: 0;
}
.post-badge.debate { background: var(--red); color: #fff; border-radius: 4px; margin-left: 5px; }
.post-badge.flair { background: var(--gray-100); color: var(--gray-800); }

/* ── 네비 플레어 드롭다운 ── */
.nav-item { position: relative; display: flex; align-items: center; }
.nav-item::after { content: ''; position: absolute; top: 100%; left: 0; right: 0; height: 10px; }
.nav-dropdown { position: absolute; top: calc(100% + 6px); left: 50%; transform: translateX(-50%); background: var(--gray-100); border: 1px solid var(--border); border-radius: 10px; box-shadow: 0 8px 24px rgba(0,0,0,0.14); padding: 10px; z-index: 500; display: grid; grid-auto-flow: column; grid-template-rows: repeat(5, auto); gap: 2px; opacity: 0; visibility: hidden; transition: opacity 0.15s, visibility 0.15s; pointer-events: none; min-width: 120px; }
/* JS nav-expanded 클래스로 드롭다운 보임 — 터치/마우스 공통 */
.nav-item.nav-expanded .nav-dropdown { opacity: 1; visibility: visible; pointer-events: auto; }
/* 마우스 디바이스만 hover로도 드롭다운 보임. html.is-touch는 head inline script가 박음
   (ontouchstart || maxTouchPoints>0 디바이스 = iPad/안드/터치 노트북). 미디어쿼리는 iPad 사파리에서
   pointer:fine 으로 보고되는 경우가 있어 신뢰성 낮음 — JS 감지가 정석 */
html:not(.is-touch) .nav-item:hover .nav-dropdown { opacity: 1; visibility: visible; pointer-events: auto; }
.nav-dropdown-item { font-size: 12px; font-weight: 600; padding: 5px 8px; border-radius: 6px; text-decoration: none; text-align: center; display: block; transition: background 0.1s; white-space: nowrap; }
.nav-dropdown-item:hover { background: #e2e6ea; }

/* ── 닉네임 팝업 ── */
.user-popup {
  display: none;
  position: fixed;
  z-index: 99; /* 네비(100) 아래 — 스크롤 시 팝업이 네비를 덮지 않게 (2026-07-21) */
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 6px 24px rgba(0,0,0,0.16);
  min-width: 180px;
  overflow: hidden;
}
.user-popup .popup-profile {
  display: flex;
  align-items: center;
  gap: 0;
  padding: 9px 14px;
  background: linear-gradient(135deg, #cfe1f4 0%, #dde9f7 100%); /* 파란기 한 단계 더 진하게 (2026-07-17) */
  border-bottom: 1px solid var(--border);
}
.user-popup .popup-profile .user-info { flex: 1; min-width: 0; }
.user-popup .popup-nick {
  font-size: 14px;
  font-weight: 700;
  color: #000;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.user-popup .popup-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 9px 14px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  background: none;
  border: none;
  cursor: pointer;
  font-family: var(--font-main);
  transition: background 0.1s;
}
.user-popup .popup-btn:hover { background: var(--gray-50); }
.user-popup .popup-arrow { color: var(--gray-400); font-size: 14px; }

/* ── 종 아이콘 빨간 점 ── */
.bell-dot {
  display: none;
  position: absolute;
  top: 2px;
  right: 2px;
  width: 7px;
  height: 7px;
  background: #e53935;
  border-radius: 50%;
}

/* ── 알림 팝업 ── */
.bell-popup {
  display: none;
  position: fixed;
  z-index: 9999;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 6px 24px rgba(0,0,0,0.16);
  width: 340px;
  max-width: calc(100vw - 20px);
  max-height: calc(100vh - 140px);
  overflow: hidden;
}
.bell-popup-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: linear-gradient(135deg, #e8f1fb 0%, #f0f5fc 100%);
  border-bottom: 1px solid var(--border);
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
}
.bell-popup-list {
  max-height: 300px;
  overflow-y: auto;
}
.bell-popup-item {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  padding: 10px 14px;
  font-size: 12px;
  color: var(--text);
  cursor: pointer;
  transition: background 0.1s;
  border-bottom: 1px solid var(--border);
  line-height: 1.5;
  position: relative;
}
.bell-popup-item .notif-label {
  color: var(--gray-400);
  font-size: 11px;
  font-weight: 600;
  flex-shrink: 0;
  white-space: nowrap;
  padding-top: 1px;
  width: 58px;
  text-align: center;
}
.bell-popup-item .notif-title {
  font-weight: 700;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  min-width: 0;
  flex: 1;
  text-align: left;
}
.bell-popup-item .notif-time {
  color: var(--gray-400);
  font-size: 11px;
  flex-shrink: 0;
  white-space: nowrap;
  padding-top: 1px;
}
.bell-popup-item:hover { background: var(--gray-50); }
.bell-popup-item.notif-unread { background: rgba(255, 235, 59, 0.15); }
.notif-dot {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 6px;
  height: 6px;
  background: #e53935;
  border-radius: 50%;
}
.bell-popup-empty {
  padding: 20px 14px;
  text-align: center;
  font-size: 12px;
  color: var(--gray-400);
}

/* ── 광고 공용 스타일 ── */
.ad-placeholder {
  background: #e5e7eb;
  border: 1px dashed #9ca3af;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #6b7280;
  font-size: 12px;
  font-weight: 700;
  text-align: center;
  line-height: 1.4;
  box-sizing: border-box;
}
.ad-placeholder .ad-ph-label { display: block; font-size: 13px; }
.ad-placeholder .ad-ph-size  { display: block; font-size: 11px; font-weight: 400; color: #9ca3af; margin-top: 2px; }

/* 좌우 사이드 레일 — sticky 컬럼 방식 (2026-07-29 개편)
   컬럼(.ad-rail-col, absolute) = layout(로그인 사이드바 포함) 세로 범위에 JS가 맞춤.
   레일(.ad-rail, sticky) = 페이지 상단에선 컬럼 시작(=로그인 상단 줄맞춤)에 앉고,
   스크롤하면 브라우저 네이티브 sticky로 부드럽게 고정(뚝뚝 끊김 없음),
   컬럼 끝(=layout 끝)에서 자연 정지 → footer 침범 프레임 자체가 없음.
   표시/숨김은 기존 JS(updateRailVisibility) 그대로. */
.ad-rail-col {
  position: absolute;
  width: 160px;
  pointer-events: none; /* 빈 컬럼이 클릭 가로채지 않게 — 레일 자체는 auto로 복원 */
}
/* ⚠️ 좁은 화면에선 컬럼 자체를 숨김 (2026-07-29 fix): absolute 컬럼은 fixed와 달리 문서 폭을 넓혀
   가로 스크롤을 만든다 — 레일 표시 기준(≈1460px, updateRailVisibility와 동일) 미만이면 통째로 제거 */
@media (max-width: 1459.98px) { .ad-rail-col { display: none; } }
.ad-rail-col-left  { left: calc(50% - 720px); }
.ad-rail-col-right { left: calc(50% + 560px); }
.ad-rail {
  position: sticky;
  position: -webkit-sticky;
  top: max(10px, calc((100vh - 600px) / 2)); /* 떠있을 때 세로 중앙 (네비 고정 해제(7/29)로 상단 하한 10px) */
  width: 160px;
  height: 600px;
  z-index: 50;
  display: none; /* 기본 숨김. JS가 조건 만족 시 block */
  pointer-events: auto;
}

/* 정적 슬롯 — 공간 항상 예약 (CLS 방지). 광고 없으면 placeholder만 숨김 */
.ad-slot[data-slot] { display: block; box-sizing: border-box; }
.ad-slot[data-slot]:not(.has-ad) .ad-placeholder { visibility: hidden; }
/* 광고 미등록 슬롯은 공간 예약 X — 모든 슬롯에 적용 */
.ad-slot:not(.has-ad) { display: none !important; }
/* 광고 없음 확인 시 JS가 .ad-empty 부여 → 초기 예약 자리 collapse (배너 슬롯 초기 예약과 짝, 26-06-17) */
.ad-slot.ad-empty { display: none !important; height: 0 !important; min-height: 0 !important; }
/* 지난 방문에 실제로 채워졌던 슬롯 선예약 (26-07-12): JS가 localStorage(adSeen) 기반으로 ad-reserve 부여 →
   광고 fetch 전부터 자리 확보해 로드 후 아래 내용이 밀리는 시프트 제거. 광고 내려가면 ad-empty가 이김 */
.ad-slot.ad-reserve:not(.has-ad):not(.ad-empty) { display: block !important; }

/* 사이드바 내부 광고 카드 (250x250) */
.ad-sidebar {
  width: 100%;
  height: 250px;
}

/* 가로 배너 (728x90) */
.ad-banner-728 {
  width: 100%;
  max-width: 728px;
  height: 90px;
  margin: 0 auto;
}

/* 가로 배너 슬롯 가운데 정렬 (flex column .post-main 안에서 maxWidth 걸리면 왼쪽 정렬되는 문제 fix) */
.ad-slot[data-slot="post_top"],
.ad-slot[data-slot="post_middle"],
.ad-slot[data-slot="post_bottom"],
.ad-slot[data-slot="top_banner"],
.ad-slot[data-slot="main_best"],
.ad-slot[data-slot="main_bottom"],
.ad-slot[data-slot="board_top"],
.ad-slot[data-slot="board_bottom"],
.ad-slot[data-slot="write_top"],
.ad-slot[data-slot="write_bottom"] {
  margin-left: auto;
  margin-right: auto;
  align-self: center;
}

/* 슬롯 컨테이너 기본 크기 — 공간 예약. 관리자 설정값(width/height)이 있으면 JS가 style로 덮어씀 */
.ad-slot[data-slot="sidebar_top"],
.ad-slot[data-slot="sidebar_mid"] {
  width: 100%;
  max-width: 250px;
  height: 250px;
  overflow: hidden;
}
/* 관리자 전용 요소 (TEMP 등): 기본 숨김, body.is-admin 있을 때만 표시.
   .nav-link 등 다른 !important 규칙을 이기기 위해 복합 선택자 + [class] 조합으로 specificity 강화 */
.admin-only-nav[class] { display: none !important; }
html.is-admin .admin-only-nav.nav-link,
body.is-admin .admin-only-nav.nav-link { display: inline-flex !important; }
html.is-admin .admin-only-nav.nav-mobile-dropdown-item,
body.is-admin .admin-only-nav.nav-mobile-dropdown-item { display: block !important; }
html.is-admin option.admin-only-nav,
body.is-admin option.admin-only-nav { display: initial !important; }
/* 일반 .admin-only 요소 (사이드바 카드 등) — 운영자만 표시 */
.admin-only { display: none !important; }
html.is-admin .admin-only,
body.is-admin .admin-only { display: block !important; }

/* ═══════════════════════════════════════════════════════════════
   공통 사이드바 카드 — index/board/post 동일 적용
   sidebar.js inject markup 기준 (2026-05-07 통합)
   ═══════════════════════════════════════════════════════════════ */
.side-card { background: var(--white); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; min-height: 250px; }
.side-card-head { background: var(--navy); padding: 10px 14px; font-size: 13px; font-weight: 700; color: #fff; display: flex; align-items: center; gap: 6px; }
.side-card-head-dot { width: 6px; height: 6px; border-radius: 50%; background: #85b7eb; }
.side-list { padding: 8px 0; min-height: 200px; display: flex; flex-direction: column; }
.side-empty { flex: 1; display: flex; align-items: center; justify-content: center; font-size: 12px; color: var(--gray-400); }
.side-item { padding: 8px 8px; min-height: 40px; box-sizing: border-box; display: flex; align-items: center; gap: 4px; cursor: pointer; transition: background 0.1s; border-bottom: 1px solid var(--border); color: inherit; text-decoration: none; }
.side-item:visited { color: inherit; }
.side-item:last-child { border-bottom: none; }
.side-item:hover { background: var(--navy-bg); }
.side-rank { font-size: 13px; font-weight: 700; color: var(--navy-mid); width: 18px; text-align: center; flex-shrink: 0; font-family: var(--font-main); }
.side-rank.r1 { color: #e03131; }
.side-rank.r2 { color: #d97706; }
.side-rank.r3 { color: var(--navy-mid); }
.side-text { font-size: 12px; color: var(--text); line-height: 1.4; flex: 1; min-width: 0; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; text-overflow: ellipsis; word-break: break-all; }
.side-vote-mini { display: flex; align-items: baseline; justify-content: flex-start; gap: 0; width: 48px; font-size: 11px; color: var(--gray-400); white-space: nowrap; font-family: var(--font-main); flex-shrink: 0; }
.side-vote-label { flex-shrink: 0; width: 22px; }
.side-vote-num { font-variant-numeric: tabular-nums; flex-shrink: 0; width: 26px; text-align: left; }

/* 통계 카드 (오늘의 현황) */
/* 현황 카드: 4개(2×2). 옛 방식대로 grid min-height로 높이 확보(헤더 36 + grid 214 = 카드 250). flex/:has 안 씀 — 모든 브라우저 확실 (2026-05-26 stats 6→4) */
.stats-grid { display: grid; grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr; gap: 1px; background: var(--border); min-height: 214px; }
.stat-box { background: var(--white); padding: 12px; text-align: center; container-type: inline-size; display: flex; flex-direction: column; justify-content: center; align-items: center; }
.stat-num { font-size: clamp(12px, 16cqi, 20px); font-weight: 700; color: var(--navy-mid); line-height: 1; margin-bottom: 3px; white-space: nowrap; font-family: var(--font-main); }
.stat-lbl { font-size: 11px; color: var(--gray-600); }

/* 바깥 슬롯은 항상 250 고정 (admin.width가 내부 컨테이너 크기용, 바깥이 아님) */
.ad-slot[data-slot="sidebar_bottom"] {
  width: 100%;
  max-width: 250px;
  height: 200px;          /* 기본 세로. 관리자 설정값(ad.height)이 있으면 JS가 덮어씀 */
  overflow: hidden;
  position: relative;
}
.ad-slot[data-slot="post_top"]:not(.ad-empty),
.ad-slot[data-slot="post_middle"]:not(.ad-empty),
.ad-slot[data-slot="main_best"]:not(.ad-empty),
.ad-slot[data-slot="top_banner"]:not(.ad-empty) {
  display: block !important; /* 초기부터 자리 예약(CLS 방지, 26-06-17) — 광고 거의 항상 있음. 없으면 JS가 .ad-empty로 collapse. :not(.ad-empty)=빈슬롯이면 예약 해제→.ad-empty의 display:none이 이겨 flex서 제거(여분 gap 0, 26-06-22 fix) */
  width: 100%;
  max-width: 728px;
  height: 90px;
  margin: 0 auto;
  overflow: hidden;
}
/* 모바일 기본값: 320x100 (가로 배너 슬롯) */
@media (max-width: 767px) {
  .ad-slot[data-slot="post_top"],
  .ad-slot[data-slot="post_middle"],
  .ad-slot[data-slot="main_best"],
  .ad-slot[data-slot="top_banner"] {
    max-width: 320px;
    height: 100px;
  }
}

/* 본문 사이 네이티브 광고 (게시글 한 행처럼 보임) */
.board-table tbody tr.ad-row { background: #f5faff; }
.board-table tbody tr.ad-row:hover { background: #e8f3fd; }
.board-table tbody tr.ad-row td { padding: 11px 14px; }
@media (min-width: 769px) {
  .board-table tbody tr.ad-row td { padding: 2px 14px; }
}
.board-table tbody tr.ad-row td.col-title { overflow: visible; }
.board-table tbody tr.ad-row td.col-title .td-title,
.board-table tbody tr.ad-row td.col-title .td-title-main { overflow: visible; }
.board-table tbody tr.ad-row td.col-title .td-title-text {
  color: var(--text);
  white-space: normal;
  overflow: visible;
  text-overflow: clip;
}
.flair-ad { color: #185FA5 !important; font-weight: 700 !important; }

/* ═══════════════════════════════════════════════════════════════
   반응형: 1100px 이하에서 사이드바 숨기고 단일 컬럼으로 전환
   - 전 페이지 동일 동작 (board/post/notice/register-result 포함)
   - 가로 스크롤 절대 발생하지 않음
   ═══════════════════════════════════════════════════════════════ */
@media (max-width: 1099px) {
  .layout,
  .page-wrap {
    grid-template-columns: 1fr !important;
    min-width: 0 !important;
  }
  .sidebar,
  .admin-menu {
    display: none !important;
  }
}

/* ═══════════════════════════════════════════════════════════════
   검색창 높이 통일: 최상단 네비 검색(.nav-search)
   전 페이지 공통 적용, flair-select(콤보박스)와 같은 36px로 맞춤
   ═══════════════════════════════════════════════════════════════ */
.nav-search {
  height: 36px;
  box-sizing: border-box;
}
.nav-search input,
.nav-search-btn {
  height: 100%;
  padding-top: 0;
  padding-bottom: 0;
  box-sizing: border-box;
}
/* 검색 input scroll-margin — 진짜 fix는 html{scroll-padding-top:0}(2026-05-20). 이건 redundant 안전망으로만 유지 */
.nav-search input { scroll-margin-top: 0 !important; }
.nav-search-btn {
  flex-shrink: 0;
  /* 돋보기 버튼 = 정사각(높이와 동일 폭) — 넓은 패딩이 입력영역을 잡아먹어 글자가 잘리던 것 fix (2026-07-17) */
  width: 36px !important;
  max-width: 36px !important;
  padding: 0 !important;
  box-sizing: border-box !important;
  justify-content: center !important;
}
/* 칩 X 버튼 = 돋보기와 동일 규격(정사각·가운데 정렬, 2026-07-17) */
.nav-chip-x { width: 36px !important; max-width: 36px !important; padding: 0 !important; justify-content: center !important; box-sizing: border-box !important; flex-shrink: 0; }
.nav-chip-x svg { width: 15px; height: 15px; }
/* 모바일: 검색창이 좁아지는 만큼 돋보기·칩X도 분기별로 축소 (2026-07-17) */
@media (max-width: 768px) {
  .nav-search-btn, .nav-chip-x { width: 30px !important; max-width: 30px !important; }
  .nav-search-btn svg { width: 14px; height: 14px; }
  .nav-chip-x svg { width: 14px; height: 14px; }
}
@media (max-width: 360px) {
  .nav-search-btn, .nav-chip-x { width: 28px !important; max-width: 28px !important; }
  .nav-search-btn svg { width: 13px; height: 13px; }
  .nav-chip-x svg { width: 13px; height: 13px; }
}

/* ═══════════════════════════════════════════════════════════════
   콤보 prefix 표시 (.combo-wrap + .combo-face)
   - 드롭다운: plain 옵션 텍스트
   - 선택 후 화면: "게시판: 자유게시판" / "분류: 전체" / "정렬: 최신순"
   - prefix는 파란색, 값은 기본색
   ═══════════════════════════════════════════════════════════════ */
.combo-wrap { position: relative; display: inline-block; }
.combo-wrap .flair-select {
  color: transparent !important;
  -webkit-text-fill-color: transparent !important;
  width: 100%;
}
/* 드롭다운이 열리면 option 텍스트는 기본색으로 복원 (select 상속 방지) */
.combo-wrap .flair-select option {
  color: var(--text) !important;
  -webkit-text-fill-color: var(--text) !important;
  background: var(--white); /* 다크: 흰 배경에 밝은 글자가 겹치던 것 fix (2026-07-17) */
}
.combo-face {
  position: absolute;
  inset: 0;
  padding: 0 26px 0 10px;
  display: flex;
  align-items: center;
  font-size: 13px;
  font-family: var(--font-main);
  pointer-events: none;
  white-space: nowrap;
  overflow: hidden;
  color: var(--text);
}
.combo-face .label-prefix {
  color: var(--navy-mid);
  font-weight: 600;
  margin-right: 4px;
  flex-shrink: 0;
}

/* ── 검색 활성 상태: chip으로 변환 ("토론 게시판 > 민주주의" + X) ── */
.nav-search.has-query {
  background: #c2dbf4; /* 불투명 연파랑 — 입력창(회색)과 확실히 구분 (2026-07-17). 테두리는 기존 유지 */
  border: 1px solid var(--navy-mid);
}
.nav-chip {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 6px;
  height: 100%;
  padding: 0 12px;
  font-size: 13px;
  color: var(--navy);
  font-weight: 700;
  font-family: var(--font-main);
  overflow: hidden;
  white-space: nowrap;
  cursor: pointer;
}
.nav-chip-scope {
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
  flex-shrink: 1;
}
.nav-chip-sep {
  color: var(--navy-mid);
  flex-shrink: 0;
  opacity: 0.5;
  font-weight: 400;
}
.nav-chip-query {
  flex-shrink: 0;
}
.nav-chip-x {
  background: none;
  border: none;
  cursor: pointer;
  padding: 0 10px;
  color: var(--navy);
  display: flex;
  align-items: center;
  height: 100%;
  opacity: 0.7;
  transition: opacity 0.15s;
  flex-shrink: 0;
}
.nav-chip-x:hover { opacity: 1; }

/* ═══════════════════════════════════════════════════════════════
   네비 하단: 게시판 버튼 자연 wrap + 글쓰기/햄버거 고정 오른쪽
   - nav-bottom을 grid 3컬럼으로: [nav-links(1fr)] [글쓰기] [햄버거]
   - nav-links는 flex-wrap으로 좁아지면 2~3줄로 자연 wrap
   - nav-link는 white-space:nowrap으로 글자 세로 쪼개짐 방지
   - 햄버거는 ≤1099px에서만 표시
   ═══════════════════════════════════════════════════════════════ */
.nav-bottom {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto auto;
  align-items: start;
  gap: 4px;
  min-height: 48px;
  height: auto;
  padding: 6px 10px;
}
/* 햄버거가 사라지는 데스크톱(≥1100px)에서는 4번째 컬럼 제거 — 글쓰기 버튼 우측 여백 방지 */
@media (min-width: 1100px) {
  .nav-bottom { grid-template-columns: auto minmax(0, 1fr) auto; }
}
.nav-links {
  display: flex;
  flex-wrap: wrap;
  gap: 2px;
  row-gap: 4px;
  align-items: center;
  justify-content: space-between;
  min-height: 36px;
  width: 100%;
}
/* TEMP(운영자 전용)는 항상 다음 줄로 — 운영자일 때만 이 100%폭 브레이크가 나타나 TEMP를 아래 줄로 밀어냄.
   일반 유저는 브레이크 없음 → 17개 버튼만 배치(균등). JS justifyNavLinks가 TEMP 줄은 좌측정렬 처리 */
.nav-temp-break { display: none; }
html.is-admin .nav-temp-break,
body.is-admin .nav-temp-break { display: block; flex-basis: 100%; width: 100%; height: 0; margin: 0; padding: 0; border: 0; }
.nav-link {
  white-space: nowrap;
  height: 36px !important;
  padding: 0 9.5px !important;
  display: inline-flex !important;
  align-items: center !important;
  box-sizing: border-box !important;
}
/* 글쓰기 버튼 공통 36px 높이 */
.btn-write {
  height: 36px !important;
  padding: 0 16px !important;
  display: inline-flex !important;
  align-items: center !important;
  line-height: 1 !important;
  box-sizing: border-box !important;
}
/* 모바일 — 글쓰기 4글자 폭 명시 (네비 공간 부족 방지) */
@media (max-width: 768px) {
  .btn-write { width: 78px !important; padding: 0 !important; justify-content: center !important; }
  /* 모바일 — 제안 카드 제목 옆 "추천 달성 N/N" 숨김 (진행 바 안 텍스트는 그대로 유지) */
  .propose-card-stats { display: none !important; }
}
.btn-hamburger {
  display: none;
  align-items: center;
  justify-content: center;
  background: var(--navy-light);
  border: none;
  color: #e03131;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  cursor: pointer;
  font-family: var(--font-main);
  transition: background 0.15s, color 0.15s;
  flex-shrink: 0;
  box-sizing: border-box;
}
.btn-hamburger:hover { background: #3a8fe0; }
html.logged-in .btn-hamburger { color: #22c55e; }

/* 사이드바 로그인/사용자 메뉴 첫 렌더 깜빡임 방지 — head inline script가 토큰 보고 html.logged-in 토글 */
html.logged-in #authStateLogin { display: none !important; }
html.logged-in #authStateUser  { display: block !important; }
.btn-hamburger svg { display: block; }
@media (max-width: 1099px) {
  .btn-hamburger { display: inline-flex; }
}

/* ─── 홈 버튼 (모든 크기 공통, 정사각 36x36) ─── */
.btn-mobile-home {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  background: var(--navy-light);
  border: none;
  color: #fff;
  border-radius: 8px;
  cursor: pointer;
  flex-shrink: 0;
  box-sizing: border-box;
  transition: background 0.15s;
  text-decoration: none;
}
.btn-mobile-home:hover { background: #3a8fe0; }
.btn-mobile-home svg { display: block; }

/* ─── 모바일 게시판 드롭다운 (≤768px) ─── */
.nav-mobile-dropdown {
  display: none;
  position: relative;
  flex: 1;
  min-width: 0;
}
.nav-mobile-dropdown-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  background: var(--navy-light);
  border: none;
  border-radius: 8px;
  color: #fff;
  font-size: 13px;
  font-weight: 500;
  font-family: var(--font-main);
  padding: 0 14px;
  cursor: pointer;
  gap: 8px;
  height: 36px;
  box-sizing: border-box;
  line-height: 1;
  transition: background 0.15s;
}
.nav-mobile-dropdown-btn:active { background: #3a8fe0; }
.nav-mobile-dropdown-arrow {
  width: 0; height: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 5px solid #fff;
  flex-shrink: 0;
  transition: transform 0.2s;
}
.nav-mobile-dropdown.open .nav-mobile-dropdown-arrow { transform: rotate(180deg); }
.nav-mobile-dropdown-menu {
  display: none;
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.18);
  z-index: 200;
  max-height: 320px;
  overflow-y: scroll;
  -webkit-overflow-scrolling: touch;
  padding: 4px;
  scrollbar-width: thin;
  scrollbar-color: var(--gray-300) transparent;
}
.nav-mobile-dropdown-menu::-webkit-scrollbar { width: 6px; -webkit-appearance: none; }
.nav-mobile-dropdown-menu::-webkit-scrollbar-track { background: transparent; }
.nav-mobile-dropdown-menu::-webkit-scrollbar-thumb { background: var(--gray-300); border-radius: 3px; }
.nav-mobile-dropdown-menu::-webkit-scrollbar-thumb:hover { background: var(--gray-400); }
.nav-mobile-dropdown.open .nav-mobile-dropdown-menu { display: block; }
.nav-mobile-dropdown-item {
  display: block;
  width: 100%;
  padding: 9px 12px;
  border: none;
  background: none;
  text-align: left;
  font-size: 13px;
  font-family: var(--font-main);
  color: var(--text);
  text-decoration: none;
  cursor: pointer;
  border-radius: 6px;
  transition: background 0.12s;
  box-sizing: border-box;
}
.nav-mobile-dropdown-item:visited { color: var(--text); }
.nav-mobile-dropdown-item:active,
.nav-mobile-dropdown-item:hover { background: var(--gray-100); }
.nav-mobile-dropdown-item.active {
  background: var(--navy);
  color: #fff;
  font-weight: 700;
}
@media (max-width: 768px) {
  /* 가로 스크롤 방지 — hidden은 sticky를 깨므로 clip 사용 (주석: 22번째 라인 참고) */
  html { overflow-x: clip; }
  body { max-width: 100vw; overflow-x: clip; }
  .nav-inner,
  .layout,
  .nav-bottom { max-width: 100% !important; box-sizing: border-box !important; }
  .nav-links { display: none !important; }
  .nav-mobile-dropdown { display: block; }
  .nav-bottom-wrap { overflow: visible; }
  .nav-bottom {
    overflow: visible;
    align-items: center;
    grid-template-columns: auto minmax(0, 1fr) auto auto;
  }
  .nav-top-bg {
    height: auto !important;
    overflow: hidden !important;
    background: var(--navy) !important;
  }
  .nav-top {
    flex-direction: row !important;
    height: auto !important;
    min-height: 0 !important;
    padding: 0 !important;
    gap: 0 !important;
    align-items: center !important;
  }
  /* nav 자체와 nav-inner 도 navy 배경 (실제 DOM 에 nav-top-bg 가 없는 구조 대비) */
  nav { background: var(--navy) !important; }
  .nav-inner {
    flex-direction: row !important;
    flex-wrap: wrap !important;
    height: auto !important;
    min-height: 0 !important;
    padding: 6px 10px 0 !important;
    gap: 0 !important;
    align-items: center !important;
    background: var(--navy) !important;
  }
  .nav-logo {
    display: inline-flex !important;
    align-items: center !important;
    flex: 0 0 128px !important;
    flex-shrink: 0;
    margin-left: 0 !important;
    margin-right: 4px !important; /* 갭 4px = nav-bottom(게시판콤보↔글쓰기)과 통일 (2026-07-17) */
    /* 로고 4:1 → 높이 32px 기준 가로 128px 고정 (이미지 영역 확정). 레이아웃: [로고 128×32](마진 4)[검색창] (390 기기) */
    width: 128px !important;
    height: 32px !important;
  }
  /* 모바일 헤더 로고 = 풋터 로고(4:1, 높이 32px) */
  .nav-logo img { max-height: 32px !important; width: auto !important; }
  .footer-logo img { max-height: 32px !important; width: auto !important; }
  .nav-search {
    position: static !important;
    transform: none !important;
    flex: 1 !important;
    width: 0 !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
  }
  .nav-search input { min-width: 0 !important; flex: 1 !important; }
  .nav-search .search-chip {
    max-width: 100% !important;
    width: 100% !important;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  /* 모바일 검색창 chip — 네비 navy 배경과 대비를 위해 옅은 색으로 */
  .nav-search.has-query {
    background: #c2dbf4 !important;
    border-color: rgba(255,255,255,0.4) !important;
  }
  .hero { display: none !important; }
  img, video, iframe { max-width: 100% !important; }
  table { max-width: 100% !important; }
  pre, code { overflow-x: auto; max-width: 100%; }
  .board-area, .board-section, .post-list,
  .best-top-grid-b,
  .post-card-simple, .post-title-simple,
  .board-section-head { min-width: 0 !important; }
  .post-title-simple { word-break: break-all; overflow-wrap: anywhere; }
  .layout > * { min-width: 0; }
  /* 베스트 TOP4 2열 균일 정사각형 */
  .best-top-grid-b {
    grid-auto-rows: 1fr !important;
    align-items: stretch !important;
  }
  .best-top-b-card {
    width: 100% !important;
    aspect-ratio: 1/1 !important;
    height: auto !important;
    min-width: 0 !important;
    overflow: hidden !important;
  }
  .best-top-b-thumb {
    flex: 1 1 0 !important;
    min-height: 0 !important;
    overflow: hidden !important;
  }
  .best-top-b-thumb img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
  }
  .best-top-b-title {
    word-break: break-all !important;
  }
  /* 베스트 세로리스트 제목만 모바일에서 1px 축소 */
  .post-title { font-size: 13px !important; }
}

/* 좁은 모바일(≤360px): 세로리스트 제목 추가 1px 축소 */
@media (max-width: 360px) {
  .post-title { font-size: 12px !important; }
  .post-title-simple { font-size: 12px !important; }
  .simple-extra { font-size: 12px !important; } /* [N]도 제목과 같이 12px (2026-07-14 — 제목12 vs [N]13 불일치 fix) */
  .card-stats { font-size: 11px !important; }
  /* 네비/검색창/콤보 축소 (320 기기) */
  /* 320 기기: 로고 4:1 → 높이 30px 기준 가로 120px. 레이아웃: [로고 120×30](마진 10)[검색창] */
  .nav-logo { flex: 0 0 120px !important; width: 120px !important; height: 30px !important; }
  .nav-logo img { max-height: 30px !important; }
  .footer-logo img { max-height: 30px !important; }
  .nav-search { height: 34px !important; }
  /* (구 .theme-toggle 34×34 규칙 제거 — 2026-07-20 펼침 패널 items 규칙(30×30)이 담당) */
  .nav-search input { font-size: 12px !important; }
  .nav-link { height: 34px !important; font-size: 12px !important; }
  .nav-bottom { min-height: 46px !important; padding: 6px 10px !important; }
  .btn-write { height: 34px !important; font-size: 12px !important; width: 64px !important; padding: 0 !important; }
  .btn-hamburger { width: 34px !important; height: 34px !important; }
  .btn-mobile-home { width: 34px !important; height: 34px !important; }
  .nav-mobile-dropdown-btn { height: 34px !important; font-size: 12px !important; padding: 0 12px !important; }
  /* 콤보박스: wrapper 34px + select도 픽셀값으로 강제 (iOS Safari는 height:100% 무시) */
  .combo-wrap { height: 34px !important; position: relative !important; overflow: hidden !important; }
  .combo-wrap > select.flair-select {
    position: absolute !important;
    top: 0 !important; left: 0 !important; right: 0 !important;
    height: 34px !important;
    min-height: 34px !important;
    max-height: 34px !important;
    width: 100% !important;
    font-size: 12px !important;
    line-height: 1 !important;
    padding: 0 24px 0 8px !important;
    box-sizing: border-box !important;
  }
  .combo-face { font-size: 12px !important; line-height: 1 !important; }
  .nav-chip { font-size: 12px !important; }
  /* 페이지네이션 버튼/select 34×34 + 폰트 12 */
  .page-btn,
  .btn-page {
    width: 34px !important;
    height: 34px !important;
    font-size: 12px !important;
  }
  .page-select {
    height: 34px !important;
    min-height: 34px !important;
    max-height: 34px !important;
    font-size: 12px !important;
    line-height: 32px !important;
    min-width: 56px !important;
    padding: 0 10px !important;
  }
}

/* ═══════════════════════════════════════════════════════════════
   햄버거 사이드 드로어 — 플로팅 카드 스타일 (오른쪽 상단)
   - 내용(로그인 폼 또는 사용자 메뉴)만큼만 높이 (auto-shrink)
   - 화면 오른쪽 상단에서 10px 여백 두고 떠있음
   - 내부는 사이드바 `.auth-card` 와 동일한 스타일
   ═══════════════════════════════════════════════════════════════ */
.sidebar-drawer {
  position: fixed;
  inset: 0;
  z-index: 1500;
  pointer-events: none;
  visibility: hidden;
  overflow: hidden;
}
.sidebar-drawer.open { pointer-events: auto; visibility: visible; }
.sidebar-drawer-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0);
  transition: background 0.25s;
}
.sidebar-drawer.open .sidebar-drawer-overlay { background: rgba(0,0,0,0.45); }
.sidebar-drawer-panel {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 250px;
  max-width: calc(100vw - 20px);
  max-height: calc(100vh - 20px);
  max-height: calc(100dvh - 20px);
  overflow-y: auto;
  transform: translateX(calc(100% + 20px));
  transition: transform 0.25s;
  filter: drop-shadow(0 12px 36px rgba(0,0,0,0.2));
}
.sidebar-drawer.open .sidebar-drawer-panel { transform: translateX(0); }

/* ─── 공통 로그인 카드 양식 (사이드바 / 드로어 / 모달 공용) ─── */
.auth-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(15,45,82,0.07);
}
.auth-head {
  background: var(--navy);
  padding: 10px 14px;
  font-size: 13px;
  font-weight: 700;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 6px;
  letter-spacing: 0.2px;
}
.auth-head-dot,
.auth-card .side-card-head-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #85b7eb;
  flex-shrink: 0;
}
.auth-inputs {
  display: flex;
  flex-direction: column;
  gap: 7px;
  padding: 14px 14px 0;
}
.auth-input {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 8px 11px;
  font-size: 14px;
  font-family: var(--font-main);
  color: var(--text);
  background: var(--gray-50);
  outline: none;
  transition: border-color 0.15s, background 0.15s;
  box-sizing: border-box;
}
.auth-input:focus { border-color: var(--navy-mid); background: #fff; }
.auth-input::placeholder { color: var(--gray-400); }
.pw-wrap { position: relative; }
.pw-wrap .auth-input {
  padding-right: 36px;
  /* 비번 input의 -webkit-text-security: disc 글리프 일관성 — SUIT 폰트 swap 영향 차단 (2026-05-15) */
  /* 사용자 증상: disc 글자 크기가 처음 작다가 큰 거로 바뀜 (SUIT 폰트 늦게 로드되면서 disc 글리프 크기 변화) */
  font-family: -apple-system, BlinkMacSystemFont, system-ui, 'Apple SD Gothic Neo', 'Malgun Gothic', '맑은 고딕', sans-serif;
}
.pw-toggle {
  position: absolute; right: 9px; top: 50%; transform: translateY(-50%);
  background: none; border: none; cursor: pointer; padding: 0;
  color: var(--gray-400); display: flex; align-items: center;
  transition: color 0.15s;
}
.pw-toggle:hover { color: var(--navy-mid); }
.auth-btn-login {
  display: block;
  width: calc(100% - 28px);
  margin: 7px 14px 0;
  padding: 9px;
  background: var(--navy);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 700;
  font-family: var(--font-main);
  cursor: pointer;
  transition: background 0.15s;
}
.auth-btn-login:hover { background: var(--navy-mid); }
.auth-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 7px 14px 12px;
}
.auth-auto {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  color: var(--gray-600);
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
}
.auth-auto input { cursor: pointer; }
.auth-links {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  white-space: nowrap;
  flex-shrink: 0;
}
.auth-link {
  background: none; border: none;
  font-family: var(--font-main);
  font-size: 11px;
  color: var(--gray-600);
  cursor: pointer;
  padding: 0;
  transition: color 0.15s;
}
.auth-link:hover { color: var(--navy-mid); }
.auth-divider { color: var(--gray-200); }

/* ─── 로그인 상태: user-profile / user-menu / logout 버튼 ─── */
/* gap 0 — 슬롯 옆 간격은 .sticker-slot* 의 margin-right 에서만 처리 */
.user-profile {
  display: flex;
  align-items: center;
  gap: 0;
  padding: 9px 14px;
  background: linear-gradient(135deg, #e8f1fb 0%, #f0f5fc 100%);
  border-bottom: 1px solid var(--border);
}
.user-name { line-height: 1.1; }
.user-exp {
  margin-top: 4px;
  font-size: 11px;
  font-weight: 600;
  color: var(--navy-mid);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.2;
}
.user-badge {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}
.user-info { flex: 1; min-width: 0; }
.user-name {
  font-size: 14px;
  font-weight: 700;
  color: #000;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  letter-spacing: -0.2px;
  flex-shrink: 1;
}
.user-level-label {
  font-size: 11px;
  color: var(--navy-mid);
  font-weight: 600;
  margin-top: 2px;
}
.user-menu { display: flex; flex-direction: column; }
.user-menu-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 11px 14px;
  background: none;
  border: none;
  border-bottom: 1px solid var(--border);
  font-family: var(--font-main);
  font-size: 12px;
  color: var(--gray-800);
  cursor: pointer;
  transition: background 0.15s;
  text-align: left;
  width: 100%;
}
.user-menu-btn:hover { background: var(--gray-50); color: var(--navy-mid); }
.menu-arrow { color: var(--gray-400); font-size: 15px; line-height: 1; }
.auth-btn-logout {
  display: block;
  width: calc(100% - 28px);
  margin: 10px 14px 12px;
  padding: 7px;
  background: none;
  color: var(--red);
  border: 1px solid #ffd0d0;
  border-radius: var(--radius);
  font-size: 12px;
  font-weight: 700;
  font-family: var(--font-main);
  cursor: pointer;
  transition: all 0.15s;
}
.auth-btn-logout:hover { background: #fff0f0; border-color: var(--red); }

/* 드로어 내 에러 메시지 — 비어있으면 자리 차지 X, 에러 생기면 확장 */
.sidebar-drawer .drawer-error {
  color: var(--red);
  font-size: 12px;
  padding: 6px 14px 0;
}
.sidebar-drawer .drawer-error:empty { padding: 0; }
.sidebar-drawer .auth-user {
  padding: 12px 14px 14px;
}

/* 드로어·로그인팝업의 auth-card 는 외곽선 제거 (box-shadow 만으로 분리) */
.sidebar-drawer .auth-card,
#loginModal .auth-card {
  border: none;
}
.sidebar-drawer .drawer-user-nick {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  padding: 6px 0 12px;
  margin-bottom: 8px;
  border-bottom: 1px solid var(--border);
}
.sidebar-drawer .drawer-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 10px;
  background: none;
  border: none;
  border-radius: 6px;
  font-family: var(--font-main);
  font-size: 13px;
  color: var(--text);
  cursor: pointer;
  text-align: left;
  width: 100%;
  transition: background 0.15s;
}
.sidebar-drawer .drawer-btn:hover { background: var(--gray-50); }
.sidebar-drawer .drawer-btn-arrow { color: var(--gray-400); }
.sidebar-drawer .drawer-btn-logout {
  color: var(--red);
  margin-top: 8px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
  border-radius: 0;
}

/* 햄버거 / 드로어 알림 빨간점 */
.btn-hamburger { position: relative; }
.hamburger-dot {
  display: none;
  position: absolute;
  top: 4px;
  right: 4px;
  width: 7px;
  height: 7px;
  background: #e53935;
  border-radius: 50%;
  border: 1px solid var(--navy-light);
}
.hamburger-dot.on { display: block; }
.drawer-menu-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  background: #e53935;
  border-radius: 50%;
  margin-left: 6px;
  vertical-align: middle;
}

/* ── 페이지네이션 공통 (buildPaginationHtml 스타일) ── */
.page-select-wrap {
  display: inline-flex;
  align-items: center;
  height: 36px;
  box-sizing: border-box;
}
@media (max-width: 360px) {
  .page-select-wrap { height: 34px; }
}
.page-select {
  background: #fff;
  background-image: none !important;
  border: 1px solid var(--border);
  border-radius: 6px;
  height: 36px !important;
  min-height: 36px !important;
  max-height: 36px !important;
  padding: 0 12px;
  font-size: 13px;
  font-family: var(--font-main);
  color: var(--gray-600);
  cursor: pointer;
  outline: none;
  text-align: center;
  text-align-last: center;
  min-width: 64px;
  line-height: 34px;
  box-sizing: border-box;
  vertical-align: middle;
}
.page-select:hover:not(:disabled) { border-color: var(--navy-mid); color: var(--navy-mid); }
.page-select:disabled { opacity: 0.35; cursor: default; }

/* 화살표 버튼 (« ‹ › ») 정사각형 36×36 통일 + 내부 텍스트 중앙 정렬 */
.page-btn,
.btn-page {
  width: 36px !important;
  height: 36px !important;
  padding: 0 !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  box-sizing: border-box;
  line-height: 1 !important;
  font-size: 13px !important;
  text-align: center;
  -webkit-appearance: none;
  appearance: none;
}

/* ===== 묶음(block) 페이지네이션 — 2026-05-25 (게시판/게시물내게시판/댓글/내글·남글) ===== */
/* 디시·펨코식 고정묶음 + SVG 체브론(메인 핫이슈·스와이프와 동일). admin은 기존 .page-btn 유지(미적용). */
.pg-block { display: flex; align-items: center; justify-content: center; gap: 6px; flex-wrap: nowrap; }
/* .page-btn/.btn-page 기본 외형(테두리/배경/hover) 재사용 + 사이즈·폰트만 묶음용으로 재정의(!important로 base의 !important 상회) */
.pg-block .pg-btn {
  width: 36px !important; height: 36px !important; font-size: 12px !important;
  flex: 0 0 auto; display: inline-flex !important; align-items: center !important; justify-content: center !important;
  line-height: 1 !important; padding: 0 !important; box-sizing: border-box;
}
.pg-block .pg-btn svg { display: block; }  /* 체브론 상하좌우 정중앙 */
/* 활성(현재) 페이지 = 댓글 이미지추가 버튼 색(옅은 파랑) */
.pg-block .pg-btn.pg-active { background: #e6f1fb !important; border-color: #bcd4f0 !important; color: var(--navy-mid) !important; font-weight: 700; }
@media (max-width: 360px) {
  .pg-block { gap: 4px; }
  .pg-block .pg-btn { width: 34px !important; height: 34px !important; font-size: 11px !important; }
}

/* 풋터 링크 / 카피라이트 폰트 */
.footer-links { font-size: 13px; }
.footer-copyright { font-size: 12px; }
@media (max-width: 360px) {
  .footer-links { font-size: 12px; }
  .footer-copyright { font-size: 11px; }
}

/* ========== 폼 레이아웃 공통 (reg-card 패턴) ========== */
.page-title {
  font-size: 22px;
  font-weight: 700;
  color: var(--navy);
  margin-bottom: 24px;
  text-align: center;
}

.reg-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px 36px;
  margin-top: -6px;
}

.field {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 20px;
}
.field:last-of-type { margin-bottom: 0; }

.field-label {
  width: 130px;
  flex-shrink: 0;
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  padding-top: 10px;
}
.field-label .req { color: var(--red); margin-left: 2px; }

.field-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.inp {
  width: 100%;
  height: 36px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 13px;
  font-family: var(--font-main);
  color: var(--text);
  background: var(--white);
  outline: none;
  transition: border-color 0.15s;
}
.inp:focus { border-color: var(--navy-mid); }
.inp.error { border-color: var(--red); }
.inp.success { border-color: var(--green); }
.inp[readonly] { background: var(--gray-50); color: var(--gray-600); cursor: default; }

.inp-row { display: flex; gap: 8px; }
.inp-row .inp { flex: 1; }

.btn-check {
  height: 36px;
  padding: 0 16px;
  background: var(--navy-pale);
  color: var(--navy-mid);
  border: 1px solid var(--navy-light);
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 700;
  font-family: var(--font-main);
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s;
  flex-shrink: 0;
}
@media (hover: hover) { .btn-check:hover { background: var(--navy-mid); color: #fff; } } /* 터치 hover 붙박이 방지 (2026-07-17) */

.msg { font-size: 12px; display: none; word-break: break-all; overflow-wrap: anywhere; }
.msg.show { display: block; }
.msg.ok  { color: var(--green); }
.msg.err { color: var(--red); }
.hint { font-size: 12px; color: var(--gray-400); }
.msg.show ~ .hint { display: none; }

/* 모바일 ≤768 - 폼 공통 */
@media (max-width: 768px) {
  .page-title { font-size: 15px; }
  .reg-card { padding: 15px; }
  .field { margin-bottom: 10px; }
  .field-label { width: 100px; font-weight: 500; color: var(--gray-600); }
  .btn-check { padding: 0 14px; }
}

/* 모바일 ≤360 - 폼 공통 */
@media (max-width: 360px) {
  .page-title { font-size: 14px; }
  .field-label { width: 85px; font-size: 12px; }
  .inp { height: 34px; }
  .btn-check { height: 34px; font-size: 12px; padding: 0 14px; }
  .hint { font-size: 11px; }
  .msg { font-size: 11px; }
}

/* iOS 자동 줌인은 viewport meta (maximum-scale=1, user-scalable=no) 로 차단됨 → 폰트 16px 강제 불필요 */

/* ========== 네비게이션 공통 ========== */
/* nav 배경 = 페이지 bg(navy-bg)로 통일. nav-bottom-wrap은 자체 navy 배경으로 덮음. */
/* 2026-07-29 사용자 확정: 네비(검색창 포함) 상단 고정 해제 — 페이지와 함께 스크롤됨. z-index는 드롭다운 겹침용 유지 */
nav { background: var(--navy-bg); position: relative; z-index: 100; }
.nav-inner { max-width: 1080px; margin: 0 auto; padding: 0 10px; }
.nav-top { display: flex; align-items: center; height: 56px; gap: 16px; position: relative; }
.nav-logo { font-family: 'DM Serif Display', serif; font-size: 22px; color: var(--navy); letter-spacing: -0.5px; flex-shrink: 0; text-decoration: none; margin-left: 10px; }
.nav-logo span { color: #85b7eb; }
.nav-search {
  position: absolute; left: 50%; transform: translateX(-50%);
  width: 360px; display: flex; align-items: center;
  background: var(--gray-100); border: 1px solid var(--border);
  border-radius: 8px; overflow: hidden; transition: border-color 0.15s, background 0.15s;
}
.nav-search:focus-within { border-color: var(--navy-mid); background: #fff; }
.nav-search input { flex: 1; background: transparent; border: none; outline: none; color: var(--text); font-size: 13px; font-family: var(--font-main); padding: 8px 12px; }
.nav-search input::placeholder { color: var(--gray-400); }
.nav-search-btn { background: transparent; border: none; cursor: pointer; padding: 8px 12px; color: var(--gray-600); display: flex; align-items: center; transition: color 0.15s; }
.nav-search-btn:hover { color: var(--navy-mid); }
.nav-bottom-wrap { background: var(--navy); }
.nav-bottom { max-width: 1080px; margin: 0 auto; }
.nav-link { color: rgba(255,255,255,0.7); font-size: 13px; padding: 5px 12px; border-radius: 8px; cursor: pointer; transition: all 0.15s; border: none; background: transparent; text-decoration: none; font-family: var(--font-main); }
.nav-link:visited { color: rgba(255,255,255,0.7); }
.nav-link.active:visited { color: #fff; }
/* active(현재 게시판)는 디바이스 무관. hover는 마우스 디바이스만 — iPad가 .nav-link를 hover-capable 인식해서
   첫 탭=hover, 두 번째 탭=click 처리하던 문제 차단 (3탭 → 2탭) */
.nav-link.active { background: rgba(255,255,255,0.1); color: #fff; }
html:not(.is-touch) .nav-link:hover { background: rgba(255,255,255,0.1); color: #fff; }
.btn-write { background: var(--navy-light); border: none; color: #fff; padding: 6px 14px; border-radius: 8px; font-size: 13px; cursor: pointer; font-family: var(--font-main); font-weight: 500; transition: background 0.15s; }
html:not(.is-touch) .btn-write:hover { background: #3a8fe0; }

/* R2 이미지 fallback 적용 시 — 비율 보존 + 빈 공간 회색 배경 (2026-05-15) */
img[data-fb-applied] { object-fit: contain; background: #f5f5f5; }

/* SEO h1 sr-only — 봇은 인식, 시각/레이아웃 0 영향 (2026-05-16) */
.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; }

/* ═══════════════════════════════════════════════════════════════
   다크모드 (2026-07-17 실험) — html.dark 클래스가 붙으면 전 페이지 공통 전환.
   각 페이지 :root가 정의하는 라이트 팔레트를 여기서 통째로 뒤집음
   (html.dark 특이도(0,1,1) > :root(0,1,0) → 로드 순서 무관하게 승리).
   부트(클래스 부여)와 토글 UI는 nav.js가 담당.
   ═══════════════════════════════════════════════════════════════ */
html.dark {
  color-scheme: dark; /* 브라우저 기본 스크롤바·폼 컨트롤을 다크로 (쪽지함 등 스크롤 영역 흰 스크롤바 fix) */
  --navy-mid: #5b9fe3;
  --navy-light: #3d8ede;
  --navy-pale: #1b2f47;
  --navy-bg: #0e141b;
  --red-pale: #331a1d;
  --white: #1a222c;
  --gray-50: #202a36;
  --gray-100: #26313f;
  --gray-200: #2f3d4f;
  --gray-300: #3a4a5e;
  --gray-400: #8494a7;
  --gray-600: #aebccb;
  --gray-800: #dde5ee;
  --text: #e8eef5;
  --border: #2c3a4a;
}
/* 변수 공유로 못 잡는 공용 지점 (하드코딩 색) */
/* 로고: 필터 금지 — 원본 PNG가 흰색+검은 테두리 디자인이라 다크 배경에서도 원본 그대로 잘 보임 (2026-07-17 확인) */
html.dark .nav-search:focus-within { background: var(--gray-50) !important; }
html.dark .auth-input:focus { background: var(--gray-50); }
html.dark .user-profile { background: linear-gradient(135deg, #1d2a3b 0%, #17202b 100%); }
html.dark .user-name { color: var(--text); }
html.dark .auth-btn-logout { border-color: #5a2f33; }
html.dark .auth-btn-logout:hover { background: var(--red-pale); border-color: var(--red); }
html.dark .auth-btn-login { background: var(--navy-light); }
html.dark .auth-btn-login:hover { background: #4f9ae8; }
html.dark .ad-placeholder { background: #232e3b; border-color: #4a5768; color: #8b98a8; }
html.dark .sticker-slot, html.dark .level-badge { background-color: #3a4656; }
html.dark img[data-fb-applied] { background: #232e3b; }
/* 공통 팝업(common.js showPopup/confirm) — 인라인 style이라 !important 필요 */
html.dark #popupModal > div, html.dark #confirmModal > div { background: var(--white) !important; }
html.dark #popupModalMsg, html.dark #confirmModalMsg { color: var(--text) !important; }

/* ── 다크모드 토글 (nav.js가 검색창 라인 우측에 삽입) ──
   2줄 구성: 위 글자(현재 상태 LIGHT↔DARK 전환), 아래 스위치.
   - 폭: 항상 LIGHT 글자 폭 고정 (두 캡션을 grid로 겹쳐 넓은 쪽이 폭 결정, 비활성은 visibility만 숨김)
   - 총높이(글자+간격+스위치) = 검색창 높이(36px, ≤360에선 34px) — 위로 삐져나감 방지 */
/* 2026-07-19: nav 우측 유틸 버튼(APP/SHARE) — 다크토글과 동일 2로우 정사각 */
/* 그룹 구조(2026-07-20): [손잡이(모바일만)][items: APP/SHARE/다크] — PC는 손잡이 숨김·items gap 10px */
.nav-util-group { display: flex; align-items: center; margin-left: auto; } /* 검색창 다음 우측 그룹 시작점 */
.nav-util-items { display: flex; align-items: center; gap: 10px; } /* PC 버튼 간격 10px (2026-07-20 사용자 지정) */
.nav-util-btn { display: grid; grid-template-rows: 3px 1fr 1fr; align-items: center; justify-items: center; width: 36px; height: 36px; cursor: pointer; flex-shrink: 0; background: none; border: none; padding: 0; color: #000; font-family: var(--font-main); } /* 2026-07-20: PC 아이콘 = 글자색(#000) 통일 */
html.dark .nav-util-btn { color: #dbe7f5; } /* PC 다크 아이콘 = 글자색(#dbe7f5) 통일 */
.nav-util-btn .nav-util-ico { grid-row: 2; display: flex; align-items: center; justify-content: center; }
.nav-util-btn .nav-util-ico svg { width: 20px; height: 20px; display: block; stroke: currentColor; } /* 2026-07-20: 전구(20px)와 동일 크기 */
/* 글자색 = 다크토글 캡션과 동일 (라이트 #000 / 다크 #dbe7f5) — 아이콘색과 별개로 진하게 */
.nav-util-btn .nav-util-cap { grid-row: 3; transform: translateY(2px); font-size: 10px; font-weight: 800; letter-spacing: 0; line-height: 1; white-space: nowrap; user-select: none; color: #000; } /* 2026-07-20: 자간 0 — PC도 SHARE 좌측 치우침 방지 */
html.dark .nav-util-btn .nav-util-cap { color: #dbe7f5; }
.nav-util-btn:hover { color: var(--navy-mid); }
/* 모바일 손잡이 [<] — PC에선 숨김 (2026-07-20) */
.nav-util-arrow { display: none; }
@media (max-width: 768px) {
  /* 2026-07-20: 모바일 = 손잡이 [<] + 펼침 패널. 접힘 = items 폭0 클립(3버튼 안 보임) */
  .nav-util-group { margin-left: 4px; border-radius: 8px; }
  /* 2026-07-20: 핑크 톤 — 손잡이 #de3d8e(밝은 핑크), 펼친 패널 #792a4d(어두운 로즈). 기존 블루 조합(#3d8ede/#2a4d79)의 색상만 회전, 톤 관계 동일. 라이트/다크 공통 */
  .nav-util-group.expanded { background: #792a4d; }
  .nav-util-arrow { display: flex; align-items: center; justify-content: center; width: 36px; height: 36px; flex-shrink: 0; padding: 0; cursor: pointer; background: #de3d8e; border: none; border-radius: 8px; color: #fff; } /* 36×36 — 검색창 높이와 동일. 화살표색=글쓰기 글자색 #fff (2026-07-20) */
  .nav-util-group.expanded .nav-util-arrow { background: #de3d8e; } /* 펼쳐도 손잡이는 자기 색 유지 */
  .nav-util-arrow svg { width: 26px; height: 26px; display: block; transition: transform 0.25s ease; } /* 18→26: 화살표 글리프가 viewBox 일부라 사람아이콘 체감 크기에 맞춤 (2026-07-20) */
  .nav-util-group.expanded .nav-util-arrow svg { transform: rotate(180deg); } /* [<]→[>] */
  /* items 펼침: [32][4][32][4][32][2] = 106 (앞 2 없음 — 2026-07-20 사용자 지정. 손잡이 36 포함 총 142) */
  .nav-util-items { max-width: 0; opacity: 0; overflow: hidden; gap: 4px; padding: 0; transition: max-width 0.25s ease, opacity 0.18s ease, padding 0.25s ease; }
  .nav-util-group.expanded .nav-util-items { max-width: 106px; opacity: 1; padding: 0 2px 0 0; }
  .nav-util-items .nav-util-btn, .nav-util-items .theme-toggle { display: grid !important; width: 32px !important; height: 32px !important; margin: 0 !important; transform: translateY(-1px); } /* 모바일만 1px 위로 (2026-07-20 사용자 지정: 2px에서 1 내림) */
  /* 32 상자에 맞춰 내용물 비례 축소(36→32): 아이콘 20→18, 글자 10→9 (2026-07-20) */
  .nav-util-items .nav-util-ico svg, .nav-util-items .tg-bulb svg { width: 18px !important; height: 18px !important; }
  .nav-util-items .nav-util-cap, .nav-util-items .tg-caption { font-size: 9px !important; letter-spacing: 0 !important; } /* 자간 제거 — SHARE(5자)가 32 상자 넘침+마지막 자간만큼 좌측 치우침 fix */
  .nav-util-btn .nav-util-cap { color: #dbe7f5; } /* 모바일 navy 배경 — 다크토글 캡션과 동일 밝은색 */
  /* 아이콘 색 글자와 통일(#dbe7f5) — 전구는 윤곽선만 통일, 노란 채움(라이트 켜짐)은 유지 (2026-07-20 사용자 지정) */
  .nav-util-items .nav-util-btn, html.dark .nav-util-items .nav-util-btn { color: #dbe7f5; } /* 다크는 html.dark 특이도 때문에 별도 명시 */
  /* 전구 윤곽선 색만 밝게(#dbe7f5, 로즈 패널 대비) — 켜짐/꺼짐(fill 유무)은 base 규칙이 담당 → 모바일도 라이트=노랑켜짐/다크=윤곽꺼짐 토글 (2026-07-20) */
  .nav-util-items .tg-bulb .bulb-body, .nav-util-items .tg-bulb .bulb-base { stroke: #dbe7f5; }
  html.dark .nav-util-items .tg-bulb .bulb-spark { stroke: #dbe7f5; }
}
@media (max-width: 360px) {
  .nav-util-arrow { width: 34px; height: 34px; } /* 34×34 — 검색창 34 구간. 내부 버튼(30)과 별개 */
  .nav-util-items .nav-util-btn, .nav-util-items .theme-toggle { width: 30px !important; height: 30px !important; }
  /* 30 상자: 아이콘 16, 글자 8 */
  .nav-util-items .nav-util-ico svg, .nav-util-items .tg-bulb svg { width: 16px !important; height: 16px !important; }
  .nav-util-items .nav-util-cap, .nav-util-items .tg-caption { font-size: 8px !important; }
  .nav-util-group.expanded .nav-util-items { max-width: 100px; } /* [30][4][30][4][30][2] (손잡이 34 포함 총 134) */
}

/* 공용 공유 모달 (2026-07-19 nav SHARE — post.html 것과 동일 디자인, 전 페이지 공용. id=globalShareModal) */
.gshare-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 10000; display: none; align-items: center; justify-content: center; }
.gshare-overlay.active { display: flex; }
.gshare-box { background: var(--white); border-radius: 12px; width: 360px; max-width: 90vw; overflow: hidden; box-shadow: 0 8px 32px rgba(0,0,0,0.2); }
.gshare-head { padding: 14px 18px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--border); background: var(--navy); }
.gshare-head-title { font-size: 15px; font-weight: 700; color: #fff; }
.gshare-close { background: none; border: none; cursor: pointer; color: rgba(255,255,255,0.7); font-size: 20px; padding: 0; line-height: 1; }
.gshare-grid { display: grid; grid-template-columns: repeat(5,1fr); gap: 0; padding: 16px 12px; }
.gshare-btn { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 10px 4px; border: none; background: none; cursor: pointer; border-radius: 8px; transition: background 0.15s; }
.gshare-btn:hover { background: var(--gray-100); }
.gshare-icon { width: 40px; height: 40px; border-radius: 50%; display: flex; align-items: center; justify-content: center; }
.gshare-label { font-size: 11px; color: var(--gray-600); font-weight: 500; white-space: nowrap; }

/* 다크토글(전구+캡션) — nav-util-items 안 요소. 간격은 items gap이 담당. 상단 3px 여백 로우 + 전구/글자 2로우 */
.theme-toggle { display: grid; grid-template-rows: 3px 1fr 1fr; align-items: center; justify-items: center; width: 36px; height: 36px; cursor: pointer; flex-shrink: 0; }
.theme-toggle .tg-caption { grid-row: 3; display: inline-grid; align-content: center; transform: translateY(2px); padding: 0; font-size: 10px; font-weight: 800; letter-spacing: 0; line-height: 1; color: #000; user-select: none; font-family: var(--font-main); white-space: nowrap; text-align: center; } /* 2026-07-20: 자간 0 — nav-util-cap과 통일 */
.theme-toggle .tg-caption > span { grid-area: 1 / 1; }
html.dark .theme-toggle .tg-caption { color: #dbe7f5; } /* 2026-07-19: nav APP/SHARE 캡션(#dbe7f5)과 통일 */
.theme-toggle .tg-cap-dark { visibility: hidden; }
html.dark .theme-toggle .tg-cap-light { visibility: hidden; }
html.dark .theme-toggle .tg-cap-dark { visibility: visible; }
/* 모바일(≤768): 네비 배경이 navy로 바뀌는 분기 — 캡션은 테마 무관 항상 밝은색 */
@media (max-width: 768px) {
  .theme-toggle .tg-caption { color: #dbe7f5 !important; }
}
/* 2026-07-19: 다크모드 = 전구 아이콘(켜짐/꺼짐). knob/track 슬라이드 폐기 — 찌그러짐 씨름 종결.
   같은 전구 모양, 라이트=노랑 채움(켜짐) / 다크=회색 윤곽(꺼짐). APP/SHARE 아이콘과 톤 통일 */
.theme-toggle .tg-bulb { grid-row: 2; display: flex; align-items: center; justify-content: center; }
.theme-toggle .tg-bulb svg { width: 20px; height: 20px; display: block; }
.tg-bulb .bulb-body  { fill: #f5c518; stroke: #000; stroke-width: 1.8; }   /* 라이트: 노란 전구(켜짐), 윤곽=글자색 #000·굵기 1.8(꺼짐과 동일) (2026-07-20) */
.tg-bulb .bulb-base  { fill: none; stroke: #000; stroke-width: 2; }
.tg-bulb .bulb-spark { fill: #f5c518; stroke: none; }                       /* 라이트: 반짝임 채움 */
html.dark .tg-bulb .bulb-body  { fill: none; stroke: #dbe7f5; stroke-width: 1.8; } /* 다크: 윤곽(꺼짐)=글자색 #dbe7f5 (2026-07-20) */
html.dark .tg-bulb .bulb-base  { stroke: #dbe7f5; }
html.dark .tg-bulb .bulb-spark { fill: none; stroke: #dbe7f5; stroke-width: 1.4; }

html.dark .nav-dropdown-item:hover { background: var(--gray-200); }
/* 메인/약관 팝업 공용 (index·about·policy 동일 클래스) */
html.dark .popup-card, html.dark .popup-body { background: var(--white); }
html.dark .popup-footer { background: var(--gray-100); }
html.dark { --red-pale-border: #5a2f33; }
/* 다크: textarea·기본 입력창 UA 흰 배경 제거 (댓글/답글/쪽지 등) */
html.dark textarea { background: var(--gray-50); color: var(--text); border-color: var(--border); }
html.dark textarea::placeholder { color: var(--gray-600); }
/* 네비 마우스오버 분류 드롭다운 — 다크: 밝은 테두리 + 밝은 글자 (아이템 색은 common.js 인라인이라 !important) */
html.dark .nav-dropdown { border-color: #46596e; }
html.dark .nav-dropdown-item { color: var(--text) !important; }
/* 닉네임 팝업 — 다크에선 관리자 팝업처럼 어두운 카드로 통째 전환 (2026-07-17 사용자 확정)
   버튼/화살표 색은 base 규칙이 변수(var(--text)/gray) 기반이라 자동 전환 — 배경·헤더만 지정 */
html.dark .user-popup { background: var(--white); }
html.dark .user-popup .popup-profile { background: linear-gradient(135deg, #273c5c 0%, #1e2c40 100%); } /* 파란기 한 단계 더 진하게 (2026-07-17) */
html.dark .page-title { color: #9cc4ee; } /* "회원 정보 변경" 등 페이지 제목 — var(--navy)가 다크에서 안 보임 */
/* 문의하기 모달 — 다크 제대로 적용 (인라인 style 덮기용 !important, 2026-07-17) */
html.dark .inq-card { background: var(--white) !important; }
html.dark #inqCategory { background: var(--gray-50) !important; }
html.dark #inqTitle { background: var(--gray-50); }
html.dark .inq-cancel { background: var(--gray-100) !important; }
html.dark .hint { color: var(--gray-600); } /* 힌트 통일 — 다크에선 문의하기 라벨과 동일 톤 (2026-07-17) */
/* 플레이스홀더도 힌트로 통일 — 다크에서 전 페이지 동일 톤 (인라인/페이지 규칙 덮기용 !important, 2026-07-17) */
html.dark input::placeholder, html.dark textarea::placeholder { color: var(--gray-600) !important; }
/* PC: 로고 센터 = 컨테이너 왼쪽 끝 ~ 검색창 왼쪽 끝(50%-180px)의 1/2 지점 (2026-07-17 사용자 지정)
   = (0 + 50% - 180px) / 2 = 25% - 90px. 모바일(≤768)은 기존 flex 배치 유지 */
@media (min-width: 769px) {
  .nav-top { position: relative; }
  .nav-logo { position: absolute; left: calc(25% - 90px); top: 50%; transform: translate(-50%, -50%); margin: 0; }
}
/* 검색창 테두리 = 토글 테두리와 동일 (라이트 진한회색 / 다크 밝은 회청) — 2026-07-17 사용자 지정.
   페이지 인라인 .nav-search(동일 특이도)보다 늦게 로드돼 승리, :focus-within(navy-mid)은 특이도 높아 유지 */
.nav-search { border-color: #6c757d; }
html.dark .nav-search { border-color: #9fb1c4; }
html.dark .nav-chip { color: #0d1b2a; } /* 칩 배경이 불투명 연파랑 고정 → 글자는 테마 무관 어두운 색 (2026-07-17) */
html.dark .nav-search.has-query { background: #c2dbf4; } /* 다크도 동일 불투명 연파랑 (2026-07-17) */
html.dark .nav-chip-x { color: #0d1b2a; } /* 칩 X — 연파랑 배경 위 어두운 색 (2026-07-17) */
/* 모바일 칩: 배경(#c7dbf0 연파랑)이 테마 무관 고정이라 글자도 항상 어두운 색 (2026-07-17) */
@media (max-width: 768px) {
  .nav-chip { color: #0d1b2a !important; }
  .nav-chip-x { color: #0d1b2a !important; }
}

/* html 배경 = 페이지 배경색 통일(최상단 픽셀행 흰색 비침 방지).
   (구 sticky 네비 1px 봉합 규칙(top:-1px)은 2026-07-29 네비 고정 해제로 제거 — sticky 전용 보정이었음) */
html { background: var(--navy-bg, #f0f5fc); }

/* ═══════════════════════════════════════════════════════════════
   공용 커스텀 콤보 cbx (2026-07-18)
   iPad 사파리가 "옵션 재작성 직후 첫 네이티브 팝오버"를 즉시 닫는 WebKit 버그(글쓰기 콤보 7/17 실측) 회피.
   네이티브 select = 숨긴 값 저장소(.value 읽는 기존 코드 무변경), 버튼이 select의 class/style 승계로 모습 유지.
   리스트 = position:fixed 오버레이 — 레이아웃 안 밀고, overflow:hidden 조상/모달에도 안 잘리고,
   열 때 뷰포트 우/하단 클램프 + 공간 부족 시 위로 펼침 (cbx JS에서 좌표 계산)
   ═══════════════════════════════════════════════════════════════ */
.cbx-host { position: relative; display: inline-block; vertical-align: middle; }
.cbx-face { appearance: none; -webkit-appearance: none; -moz-appearance: none; text-align: left; }
/* 클래스 없는 네이티브 select(관리자/모달 다수)를 감싼 버튼 — 표준 셀렉트 모양 부여.
   클래스 있는 콤보(flair-select·field-select 등)는 자기 클래스 CSS를 그대로 사용 */
.cbx-face.cbx-plain {
  display: inline-flex;
  align-items: center;
  background: var(--white, #fff) url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236c757d' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'><polyline points='6 9 12 15 18 9'/></svg>") no-repeat right 10px center;
  border: 1px solid var(--border, #d0dce8);
  border-radius: 8px;
  color: var(--text, #0d1b2a);
  font-size: 13px;
  font-family: var(--font-main);
  padding: 0 30px 0 12px;
  height: 36px;
  max-width: 100%;
  box-sizing: border-box;
  cursor: pointer;
  white-space: nowrap;
}
html.dark .cbx-face.cbx-plain { background-color: var(--gray-50); }
/* 모바일 분기 — 사이트 표준(기본 36/13 → 360px 이하 34/12) */
@media (max-width: 360px) {
  .cbx-face.cbx-plain { height: 34px; font-size: 12px; }
  .cbx-opt { padding: 8px 10px; font-size: 12px; }
}
/* 페이지 점프 콤보("3/25")는 원래 스타일이 가운데 정렬 — 승계. 다크 오버라이드는 원래 없던 것 보강 */
.cbx-face.page-select { text-align: center; justify-content: center; display: inline-flex; align-items: center; }
html.dark .cbx-face.page-select { background-color: var(--gray-50); }
.cbx-face:disabled { opacity: 0.6; cursor: default; }
.cbx-list {
  position: fixed;
  max-height: 264px;
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain; /* 리스트 끝에서 스크롤이 뒤 페이지로 넘어가는 체이닝 차단 (2026-07-18) */
  background: var(--white, #fff);
  border: 1px solid var(--navy-mid, #185FA5); /* 2026-07-20: 열림 리스트 보더 = 포커스 색(라이트/다크 자동), csel과 통일 */
  border-radius: 8px;
  box-shadow: 0 6px 20px rgba(0,0,0,0.12);
  z-index: 12000;
  display: none;
  box-sizing: border-box;
}
.cbx-list.open { display: block; }
/* 스크롤 표시 = JS 막대(cbx-thumb) 단일화 — 네이티브/스타일드 스크롤바는 숨김
   (안드로이드에서 스타일드+JS 막대 2개 중복되던 문제 fix, 2026-07-18) */
.cbx-list { scrollbar-width: none; }
.cbx-list::-webkit-scrollbar { display: none; }
.cbx-thumb { position: fixed; width: 6px; background: var(--gray-400, #adb5bd); border-radius: 3px; z-index: 12001; pointer-events: none; } /* 4px→6px 확폭 (2026-07-21, 너무 얇음) */
.cbx-opt { padding: 9px 12px; font-size: 13px; color: var(--text, #0d1b2a); cursor: pointer; white-space: nowrap; font-family: var(--font-main); }
.cbx-opt:hover, .cbx-opt.focus { background: var(--gray-100, #f1f3f5); }
.cbx-opt.selected { color: var(--navy-mid, #185FA5); font-weight: 700; }
.cbx-opt.disabled { color: var(--gray-400, #adb5bd); cursor: default; }
.cbx-opt.disabled:hover { background: none; }
html.dark .cbx-list { box-shadow: 0 6px 20px rgba(0,0,0,0.45); }
/* combo-wrap(분류:/정렬: face 오버레이) 안에서는 face가 라벨 담당 — 버튼 글자 투명 규칙과 공존 */
@media (max-width: 360px) {
  .combo-wrap .cbx-host { position: absolute; inset: 0; }
  .combo-wrap .cbx-face { width: 100%; height: 100%; font-size: 12px !important; line-height: 1 !important; padding: 0 24px 0 8px !important; }
}

/* ═══════════════════════════════════════════════════════════════
   공용 에디터 툴바 tt-* (2026-07-18) — 글쓰기 페이지 툴바와 동일 양식.
   NPEditor.buildToolbar(관리자 공지/팝업/약관 등)가 사용. write.html은 자체 동일 정의 보유(중복 무해)
   ═══════════════════════════════════════════════════════════════ */
.tt-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 5px 2px; border-bottom: 1px solid var(--gray-200, #e9ecef); padding: 2px 0; position: relative; }
.tt-group { display: flex; align-items: center; gap: 2px; padding-right: 8px; margin-right: 8px; border-right: 1px solid var(--gray-200, #e9ecef); }
.tt-group:last-child { border-right: none; margin-right: 0; padding-right: 0; }
.tt-btn { min-width: 28px; height: 28px; border: none; background: none; border-radius: 4px; color: var(--gray-600, #6c757d); cursor: pointer; display: flex; align-items: center; justify-content: center; flex-direction: column; font-family: var(--font-main); font-size: 14px; font-weight: 700; padding: 0; }
.tt-btn svg { width: 16px; height: 16px; display: block; pointer-events: none; }
.tt-btn:hover { background: var(--gray-100, #f1f3f5); color: var(--text, #0d1b2a); }
.tt-btn.active { color: var(--navy-light, #2d7dd2); background: var(--navy-pale, #e6f1fb); }
.tt-btn:disabled { opacity: 0.35; cursor: default; background: none; }
.tt-picker { position: relative; }
.tt-picker-btn { width: auto; padding: 0 6px; font-size: 13px; font-weight: 600; flex-direction: row; gap: 4px; }

/* 2026-07-19: 본문→제목1~3 라벨 폭 선확보 — 전환 시 툴바 밀림 방지 */
.tt-header-label { display: inline-block; min-width: 3.4em; text-align: center; }
.tt-caret { font-size: 9px; color: var(--gray-400, #adb5bd); }
.tt-menu { position: absolute; top: calc(100% + 4px); left: 0; z-index: 60; background: var(--white, #fff); border: 1px solid var(--border, #d0dce8); border-radius: 6px; box-shadow: 0 4px 16px rgba(0,0,0,0.12); padding: 4px; display: none; min-width: 90px; }
.tt-picker.open .tt-menu { display: block; }
.tt-opt { padding: 6px 10px; font-size: 13px; color: var(--text, #0d1b2a); border-radius: 4px; cursor: pointer; white-space: nowrap; }
.tt-opt:hover { background: var(--gray-100, #f1f3f5); }
.tt-opt.selected { color: var(--navy-light, #2d7dd2); font-weight: 700; }
.tt-opt[data-h="1"] { font-size: 17px; font-weight: 700; }
.tt-opt[data-h="2"] { font-size: 15px; font-weight: 700; }
.tt-opt[data-h="3"] { font-size: 14px; font-weight: 700; }
.tt-swatches { display: grid; grid-template-columns: repeat(7, 18px); gap: 4px; padding: 2px; }
.tt-swatch { width: 18px; height: 18px; border-radius: 3px; border: 1px solid rgba(0,0,0,0.15); cursor: pointer; padding: 0; }
.tt-swatch:hover { transform: scale(1.15); }
.tt-reset { grid-column: 1 / -1; font-size: 12px; color: var(--gray-600, #6c757d); text-align: center; padding: 4px 0 2px; cursor: pointer; border-radius: 4px; }
.tt-reset:hover { background: var(--gray-100, #f1f3f5); }
.tt-color-bar { display: block; width: 14px; height: 3px; border-radius: 1px; margin-top: 1px; background: var(--gray-600, #6c757d); }
html.dark .tt-btn { color: #aebccb; }
html.dark .tt-btn:hover { background: rgba(255,255,255,0.08); color: var(--text); }
html.dark .tt-btn.active { color: var(--navy-light); background: rgba(45,125,210,0.18); }
html.dark .tt-menu { background: var(--white); border-color: var(--border); box-shadow: 0 4px 16px rgba(0,0,0,0.4); }
html.dark .tt-opt:hover { background: rgba(255,255,255,0.08); }
html.dark .tt-reset:hover { background: rgba(255,255,255,0.08); }
html.dark .tt-swatch { border-color: rgba(255,255,255,0.25); }

/* ── 포커스/열림 보더 색 전 사이트 통일 (2026-07-20 사용자 확정) ──
   콤보(cbx/csel)·입력창·댓글창 등 모든 입력 요소의 포커스/열림 = var(--navy-mid) (라이트 파랑/다크 밝은 파랑 자동).
   페이지별 인라인·개별 규칙이 제각각이라 !important로 통일 (글쓰기 csel 기준과 동일 색) */
input:not([type=checkbox]):not([type=radio]):focus,
textarea:focus,
select:focus,
.cbx-face:focus,
.cbx-face.cbx-open {
  border-color: var(--navy-mid) !important;
}

/* ── 팝업 상자 보더 통일 (2026-07-21 사용자 확정: 고정 회색, 라이트/다크 동일) ──
   알림/확인/로그인/문의/신고/이동/쪽지/탈퇴/공유/스티커샵 + 닉네임 팝업(user-popup) + 운영자 제목 팝업(admin-action-menu).
   인라인 스타일·페이지 개별 규칙보다 이겨야 해서 !important */
#popupModal > div, #confirmModal > div, #inquiryModal > div, #reportModal > div,
#loginModal > div, #adminMoveModal > div, #popupOverlay > div, #withdrawModal > div,
#shareModal .share-box, #stickerShopModal > .ssh-box,
.user-popup, .admin-action-menu {
  border: 1px solid #adb5bd !important;
}
