/* ═══════════════════════════════════════════
   BSN 관리자 유틸리티 — 공통 UI 킷
   다른 프로젝트에서도 재사용 가능한 기반 스타일
   ═══════════════════════════════════════════ */
@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+KR:wght@400;500;600;700&display=swap');

/* ── CSS 변수 (라이트) ── */
:root {
  --primary: #111827;
  --primary-hover: #1f2937;
  --accent: #1d6fab;
  --danger: #dc2626;
  --danger-bg: #fef2f2;
  --bg: #ffffff;
  --bg-surface: #ffffff;
  --bg-input: #ffffff;
  --bg-header: #f9fafb;
  --text: #111827;
  --text-secondary: #6b7280;
  --text-muted: #9ca3af;
  --border: #e5e7eb;
  --hover: #f9fafb;
  --shadow-lg: 0 10px 15px -3px rgba(0,0,0,.1), 0 4px 6px -4px rgba(0,0,0,.1);
}

/* ── CSS 변수 (다크) ── */
body.dark {
  --primary: #f9fafb;
  --primary-hover: #e5e7eb;
  --danger-bg: #2e1619;
  --bg: #111827;
  --bg-surface: #1f2937;
  --bg-input: #374151;
  --bg-header: #1f2937;
  --text: #f9fafb;
  --text-secondary: #9ca3af;
  --text-muted: #6b7280;
  --border: #374151;
  --hover: rgba(255,255,255,.05);
  --shadow-lg: 0 10px 15px rgba(0,0,0,.5);
}

/* ── 리셋 & 기본 타이포그래피 ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: 'Noto Sans KR', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  letter-spacing: -0.01em;
  color: var(--text);
  background: #1e293b;
  height: 100dvh;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
body.dark { background: #0f172a; }
button { cursor: pointer; font: inherit; border: none; background: none; color: inherit; }
table { border-collapse: collapse; }

/* ── 레이아웃 ── */
.app { display: flex; flex-direction: column; height: 100dvh; overflow: hidden; background: var(--bg); }
.container { max-width: 1280px; margin: 0 auto; padding: 0 24px; width: 100%; }

/* ── 상단 내비게이션 바 ── */
.navbar {
  background: #1e293b;
  flex-shrink: 0;
  padding-top: env(safe-area-inset-top, 0);
}
body.dark .navbar { background: #0f172a; }
.navbar .container {
  display: flex; align-items: center;
  min-height: 56px;
  gap: 24px;
}
.navbar-brand {
  display: flex; align-items: center; gap: 10px;
  margin-right: 8px;
}
.navbar-title { font-weight: 600; font-size: 17px; white-space: nowrap; color: #fff; }
.navbar-nav { display: flex; align-items: center; gap: 2px; }
.nav-item {
  display: flex; align-items: center; gap: 6px;
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 14px; font-weight: 500;
  white-space: nowrap;
  text-decoration: none;
  transition: background .15s, color .15s;
  color: #94a3b8;
}
.nav-item:hover { background: rgba(255,255,255,.08); color: #e2e8f0; }
.nav-item.active { background: rgba(255,255,255,.12); color: #fff; font-weight: 600; }
.navbar-spacer { flex: 1; }
.navbar-actions { display: flex; align-items: center; gap: 8px; }
.navbar .btn-icon { color: #94a3b8; }
.navbar .btn-icon:hover { background: rgba(255,255,255,.08); color: #e2e8f0; }

/* ── 페이지 헤더 ── */
.page-header {
  background: var(--bg-surface);
  box-shadow: 0 1px 3px rgba(0,0,0,.08);
  flex-shrink: 0;
  position: relative;
  z-index: 1;
}
.page-header .container {
  padding-top: 16px; padding-bottom: 16px;
  display: flex; align-items: center; justify-content: space-between;
}
.page-header h1 { font-size: 18px; font-weight: 600; }

/* ── 버튼 (높이 36px 통일) ── */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  height: 36px; padding: 0 16px;
  border-radius: 6px;
  font-size: 14px; font-weight: 600;
  transition: all .15s;
  white-space: nowrap;
  box-sizing: border-box;
}
.btn:disabled { opacity: .4; cursor: not-allowed; }
.btn-primary { background: var(--primary); color: var(--bg); }
.btn-primary:hover:not(:disabled) { background: var(--primary-hover); }
.btn-outline {
  display: inline-flex; align-items: center; gap: 6px;
  height: 36px; padding: 0 14px;
  border-radius: 6px;
  font-size: 13px; font-weight: 500;
  border: 1px solid var(--border);
  color: var(--text-secondary);
  background: var(--bg-surface);
  transition: all .15s;
  box-sizing: border-box;
}
.btn-outline:hover { background: var(--hover); color: var(--text); }
.btn-icon {
  width: 36px; height: 36px;
  padding: 0;
  display: flex; align-items: center; justify-content: center;
  border-radius: 6px;
  font-size: 18px;
  color: var(--text-secondary);
  transition: background .15s;
}
.btn-icon:hover { background: var(--hover); }

/* ── 모달 ── */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.4);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s;
}
.modal-backdrop.visible {
  opacity: 1;
  pointer-events: auto;
}
.modal {
  position: relative;
  width: 90%;
  max-width: 520px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow-lg);
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  transform: translateY(12px);
  transition: transform .2s;
}
.modal-backdrop.visible .modal { transform: translateY(0); }
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}
.modal-header h2 { font-size: 16px; font-weight: 600; margin: 0; }
.modal-close {
  width: 32px; height: 32px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 6px;
  font-size: 18px;
  color: var(--text-muted);
  transition: background .15s;
}
.modal-close:hover { background: var(--hover); color: var(--text); }
.modal-body {
  padding: 20px;
  overflow-y: auto;
  overflow-x: hidden;
  overflow-wrap: break-word;
  font-size: 13.5px;
  line-height: 1.7;
  color: var(--text-secondary);
}
.modal-body h3 {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  margin: 18px 0 8px;
}
.modal-body h3:first-child { margin-top: 0; }
.modal-body p { margin: 0 0 6px; }
.modal-body code {
  font-family: 'SF Mono', Menlo, monospace;
  font-size: 12px;
  background: var(--hover);
  padding: 2px 5px;
  border-radius: 4px;
  color: var(--text);
  word-break: break-all;
}
.modal-body ol { margin: 0 0 8px; padding-left: 1.4em; }
.modal-body li { margin-bottom: 6px; }

/* ── 단계 설명 (모달 내) ── */
.flow-step {
  display: flex; align-items: flex-start; gap: 10px;
  margin-bottom: 10px;
}
.flow-num {
  flex-shrink: 0;
  width: 22px; height: 22px;
  background: #1e293b;
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  margin-top: 1px;
}
.flow-text { flex: 1; }
.flow-title { font-weight: 600; color: var(--text); margin-bottom: 4px; }
.flow-desc { color: var(--text-secondary); margin-bottom: 6px; }
.flow-tag {
  display: inline-block;
  padding: 2px 8px;
  font-size: 13px;
  color: var(--text-secondary);
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--bg-input);
}

/* ── 모달 내 테이블 ── */
.modal-table { width: 100%; font-size: 13.5px; margin-top: 8px; }
.modal-table th { padding: 6px 10px; text-align: left; color: var(--text-secondary); font-weight: 500; border-bottom: 1px solid var(--border); }
.modal-table td { padding: 6px 10px; }
.modal-table .r { text-align: right; font-weight: 500; }

/* ── 모달 안내 ── */
.modal-note {
  margin-top: 12px;
  padding: 10px 12px;
  font-size: 13.5px;
  line-height: 1.5;
  color: var(--text-secondary);
}

/* ── 배지 ── */
.badge {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 1px 10px 3px;
  border-radius: 10px;
  font-size: 11px; font-weight: 600;
  line-height: 16px;
  white-space: nowrap;
  vertical-align: baseline;
  position: relative;
  top: -1px;
}
.badge-high { background: #ecfdf5; color: #047857; }
.badge-medium { background: #fffbeb; color: #b45309; }
.badge-none { background: #fef2f2; color: #b91c1c; }
.badge-error { background: #fff7ed; color: #c2410c; }
body.dark .badge-high { background: #064e3b; color: #6ee7b7; }
body.dark .badge-medium { background: #451a03; color: #fbbf24; }
body.dark .badge-none { background: #450a0a; color: #fca5a5; }
body.dark .badge-error { background: #431407; color: #fb923c; }

/* ── 도움 버튼 (?) ── */
.help-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 16px; height: 16px;
  border: 1px solid var(--border);
  border-radius: 50%;
  font-size: 10px; font-weight: 700;
  color: var(--text-muted);
  vertical-align: middle;
  margin: 0 2px;
  transition: all .15s;
}
.help-btn:hover { border-color: var(--text-secondary); color: var(--text-secondary); }

/* ── 빈 상태 ── */
.empty-state {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 40px 0 80px;
  color: var(--text-muted);
  font-size: 14px; text-align: center;
}
.empty-icon { margin-bottom: 16px; color: var(--text-muted); opacity: .35; }
.empty-icon svg { width: 48px; height: 48px; }

/* ── 안내 오버레이 ── */
.guide-overlay {
  position: absolute;
  top: 12px;
  right: 12px;
  max-width: calc(100% - 24px);
  z-index: 10;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 14px;
  box-shadow: 0 4px 12px rgba(0,0,0,.08);
  pointer-events: auto;
  transition: opacity .3s, transform .3s;
}
.guide-overlay.hidden { opacity: 0; transform: translateY(-8px); pointer-events: none; }
.guide-overlay__icon {
  flex-shrink: 0;
  width: 20px; height: 20px;
  color: var(--text-muted);
}
.guide-overlay__text {
  font-size: 13px;
  line-height: 1.4;
  color: var(--text);
}
.guide-overlay__close {
  flex-shrink: 0;
  width: 20px; height: 20px;
  display: flex; align-items: center; justify-content: center;
  color: var(--text-muted);
  cursor: pointer;
  border-radius: 4px;
  transition: background .15s, color .15s;
  border: none; background: none; padding: 0;
}
.guide-overlay__close:hover { background: var(--hover); color: var(--text); }

/* ── 스피너 ── */
.spinner {
  width: 16px; height: 16px;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── 스크롤바 ── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #d1d5db; border-radius: 3px; }
body.dark ::-webkit-scrollbar-thumb { background: #4b5563; }

/* ── 지도 다크모드 (CSS 필터, 네이버 JS API 미지원 대체) ── */
body.dark .map-wrap > div:first-child,
body.dark .map-container > div:first-child { filter: invert(90%) hue-rotate(180deg); }
/* 핀 오버레이: 지도 invert(90%)를 invert(100%)로 상쇄 → 텍스트가 ~90% 흰색으로 복원 */
body.dark .trade-pin-overlay { filter: invert(100%) hue-rotate(180deg); }

/* ── 실거래가 핀 (OverlayView 기반, 공통) ── */
.trade-pin { cursor: pointer; white-space: nowrap; width: 56px; }
.trade-pin__body {
  background: #6D6E72;
  border-radius: 8px;
  padding: 5px 0;
  text-align: center;
}
.trade-pin__tail {
  width: 0; height: 0;
  border-left: 6px solid transparent;
  border-right: 6px solid transparent;
  border-top: 7px solid #6D6E72;
  margin: 0 auto;
}
.trade-pin__price { font-size: 13px; font-weight: 700; line-height: 1.2; color: #fff; }
.trade-pin__sub { font-size: 9px; margin-top: 1px; color: rgba(255,255,255,.75); }
/* 다크모드: 텍스트를 더 밝게 */
body.dark .trade-pin__price { color: #fff; }
body.dark .trade-pin__sub { color: rgba(255,255,255,.95); }
.trade-pin--sale .trade-pin__body { background: #d32f2f; }
.trade-pin--sale .trade-pin__tail { border-top-color: #d32f2f; }
.trade-pin--my-charge .trade-pin__body { box-shadow: 0 0 0 1.5px rgba(255,152,0,.6); }
.trade-pin--my-charge .trade-pin__tail { border-top-color: #ff9800; }
.trade-pin--selected .trade-pin__body { background: #1e3a8a; }
.trade-pin--selected .trade-pin__tail { border-top-color: #1e3a8a; }

/* ── 클러스터 핀 (공통) ── */
.cluster-pin {
  display: flex; align-items: center; justify-content: center; flex-direction: column;
  border-radius: 50%; cursor: pointer;
}
.cluster-pin:hover { transform: scale(1.08); transition: transform .15s; }
.cluster-pin--gu { width: 56px; height: 56px; background: rgba(71,85,105,.88); color: #fff; }
.cluster-pin--dong { width: 48px; height: 48px; background: rgba(100,116,139,.85); color: #fff; }
.cluster-pin__name { font-size: 11px; font-weight: 600; line-height: 1.2; }
.cluster-pin__count { font-size: 10px; opacity: .85; margin-top: 1px; }

/* ── 메인 콘텐츠 영역 ── */
.main { flex: 1; overflow-y: auto; overflow-x: hidden; background: var(--bg-header); }
.main .container { padding-top: 24px; padding-bottom: 24px; }

/* ── 폼 ── */
.form-group { margin-bottom: 16px; }
.form-group label {
  display: block; font-size: 13px; font-weight: 500;
  color: var(--text-secondary); margin-bottom: 6px;
}
.form-group input, .form-group textarea, .form-group select {
  width: 100%; height: 36px; padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--bg-input);
  color: var(--text);
  font: inherit; font-size: 14px;
  transition: border-color .15s;
  box-sizing: border-box;
}
.form-group textarea { height: auto; padding: 8px 12px; resize: vertical; min-height: 60px; }
.form-group input:focus, .form-group textarea:focus, .form-group select:focus {
  outline: none; border-color: var(--text-secondary);
}
.hint { font-size: 12px; color: var(--text-muted); margin-top: 4px; }

/* ── 데이터 테이블 ── */
.data-table { width: 100%; white-space: nowrap; font-size: 13px; }
.data-table thead { background: var(--bg-header); position: sticky; top: 0; z-index: 1; }
.data-table th {
  padding: 10px 12px; text-align: left;
  font-size: 13px; font-weight: 600; color: var(--text);
  border-bottom: 1px solid var(--border);
  user-select: none; cursor: pointer;
  transition: color .15s; letter-spacing: 0;
}
.data-table td { padding: 10px 12px; border-bottom: 1px solid var(--border); }
.data-table tbody tr { transition: background .1s; }
.data-table tbody tr:hover { background: var(--hover); }
.data-table tbody tr:last-child td { border-bottom: none; }
.data-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.data-table .center { text-align: center; }

/* ── 테이블 래퍼 ── */
.table-wrap {
  margin-top: 0; background: var(--bg-surface);
  overflow: hidden; border: 1px solid var(--border); border-radius: 6px;
}
.table-scroll { overflow-x: auto; }
.sort-icon { font-size: 10px; margin-left: 4px; opacity: .3; }
.data-table th.sorted .sort-icon { opacity: 1; color: var(--text); }

/* ── 편집 테이블 ── */
.edit-table { width: 100%; font-size: 13px; }
.edit-table th { text-align: left; padding: 6px 8px; color: var(--text-secondary); font-weight: 500; border-bottom: 1px solid var(--border); }
.edit-table td { padding: 6px 8px; border-bottom: 1px solid var(--border); }
.edit-table input {
  width: 100%; padding: 4px 8px; border: 1px solid var(--border);
  border-radius: 4px; background: var(--bg-input); color: var(--text);
  font: inherit; font-size: 13px;
}

/* ── 섹션 카드 ── */
.edit-section {
  background: var(--bg-surface); border-radius: 12px;
  padding: 20px; margin-bottom: 12px;
}
.section-title {
  font-size: 15px; font-weight: 700; margin: 24px 0 12px;
  display: flex; align-items: center; justify-content: space-between;
}
.section-title:first-child { margin-top: 0; }

/* ── 서브탭 ── */
.sub-tabs {
  display: flex; gap: 2px; margin-bottom: 16px;
  border-bottom: 1px solid var(--border); padding-bottom: 0;
}
.sub-tab {
  padding: 8px 16px; font-size: 14px; font-weight: 500;
  color: var(--text-secondary); border-bottom: 2px solid transparent;
  margin-bottom: -1px; transition: all .15s;
}
.sub-tab:hover { color: var(--text); }
.sub-tab.active { color: var(--text); border-bottom-color: var(--text); font-weight: 600; }
.sub-content { display: none; }
.sub-content.active { display: block; }

/* ── 모달 헤더 h3 (owners-report 등) ── */
.modal-header h3 { font-size: 16px; font-weight: 600; margin: 0; }
.modal-footer {
  display: flex; justify-content: flex-end; gap: 8px;
  padding: 16px 20px; border-top: 1px solid var(--border);
}

/* ── 로딩 상태 ── */
.loading { text-align: center; padding: 40px; color: var(--text-muted); font-size: 14px; }

/* ── 미리보기 영역 ── */
.preview-area {
  padding: 12px; background: var(--bg-header);
  border-radius: 8px;
}

/* ── 상태 배지 ── */
.status-badge {
  display: inline-block; padding: 2px 8px;
  border-radius: 4px; font-size: 12px; font-weight: 500;
}
.status-badge.sent { background: #dcfce7; color: #166534; }
.status-badge.draft { background: #fef3c7; color: #92400e; }
.status-badge.ready { background: #dbeafe; color: #1e40af; }
.status-badge.none { background: var(--bg-header); color: var(--text-muted); }
body.dark .status-badge.sent { background: #14532d; color: #86efac; }
body.dark .status-badge.draft { background: #78350f; color: #fde68a; }
body.dark .status-badge.ready { background: #1e3a5f; color: #93c5fd; }
body.dark .status-badge.none { background: var(--bg-input); }

/* ═══════════════════════════════════════════
   Liquid Glass 공통 디자인 토큰
   ═══════════════════════════════════════════ */
.glass {
  background: rgba(255,255,255,.82);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  border: 1px solid rgba(0,0,0,.06);
  box-shadow: 0 2px 16px rgba(0,0,0,.10);
}
body.dark .glass {
  background: rgba(30,30,30,.78);
  border-color: rgba(255,255,255,.08);
  box-shadow: 0 2px 16px rgba(0,0,0,.3);
}
.scroll-thin { scrollbar-width: thin; }
.scroll-thin::-webkit-scrollbar { width: 6px; }
.scroll-thin::-webkit-scrollbar-thumb { background: rgba(0,0,0,.15); border-radius: 3px; }
.scroll-thin::-webkit-scrollbar-track { background: transparent; }

/* ═══════════════════════════════════════════
   토스트
   ═══════════════════════════════════════════ */
.toast {
  position: fixed; bottom: 80px; left: 50%; transform: translateX(-50%) translateY(20px);
  z-index: 600; padding: 12px 24px;
  background: rgba(30,30,30,.78);
  border-radius: 22px;
  border: 1px solid rgba(255,255,255,.08);
  box-shadow: 0 2px 16px rgba(0,0,0,.3);
  color: #f9fafb; font-size: 14px; font-weight: 500;
  pointer-events: none; opacity: 0;
  transition: opacity .3s, transform .3s;
  white-space: nowrap;
}
.toast.visible { opacity: 1; transform: translateX(-50%) translateY(0); }
body.dark .toast {
  background: rgba(255,255,255,.82);
  border-color: rgba(0,0,0,.06);
  box-shadow: 0 2px 16px rgba(0,0,0,.10);
  color: #111827;
}

/* ═══════════════════════════════════════════
   이미지 라이트박스
   ═══════════════════════════════════════════ */
.attach-lightbox {
  position: fixed; inset: 0; z-index: 9999; background: rgba(0,0,0,.85);
  display: none; align-items: center; justify-content: center;
  -webkit-tap-highlight-color: transparent; touch-action: none;
}
.attach-lightbox.open { display: flex; }
.attach-lightbox img { max-width: 92vw; max-height: 88vh; border-radius: 0; object-fit: contain; touch-action: none; transition: transform .15s ease; }
.attach-lightbox__close {
  position: absolute; top: 16px; right: 16px;
  width: 36px; height: 36px; border-radius: 50%;
  background: rgba(255,255,255,.2); border: none; color: #fff;
  font-size: 20px; cursor: pointer; display: flex; align-items: center; justify-content: center;
}
.attach-lightbox__nav {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 36px; height: 36px; border-radius: 50%;
  background: rgba(255,255,255,.12); border: none; color: #fff;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
}
.attach-lightbox__nav:hover { background: rgba(255,255,255,.25); }
.attach-lightbox__nav--prev { left: 12px; }
.attach-lightbox__nav--next { right: 12px; }
.attach-lightbox__counter {
  position: absolute; bottom: 20px; left: 50%; transform: translateX(-50%);
  color: rgba(255,255,255,.7); font-size: 14px;
}
@media (max-width: 768px) {
  .attach-lightbox__nav--prev, .attach-lightbox__nav--next { top: auto; bottom: 14px; transform: none; }
  .attach-lightbox__nav--prev { left: calc(50% - 80px); }
  .attach-lightbox__nav--next { right: calc(50% - 80px); }
  .attach-lightbox__counter { bottom: 22px; }
}

/* ═══════════════════════════════════════════
   로그인 모달
   ═══════════════════════════════════════════ */
.login-modal { max-width: 400px; }
.login-modal .modal-header { padding: 10px 20px; }
.login-modal .modal-body { padding: 24px 20px; }
.login-social-btns { display: flex; flex-direction: column; gap: 10px; }
.login-social-btn {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  width: 100%; height: 48px;
  border-radius: 10px; border: none;
  font-size: 14px; font-weight: 600; cursor: pointer;
  transition: opacity .15s; font-family: inherit;
}
.login-social-btn:hover { opacity: .85; }
.login-social-btn svg { flex-shrink: 0; }
.login-social-btn--naver { background: #03C75A; color: #fff; border-color: #03C75A; }
.login-social-btn--kakao { background: #FEE500; color: #191919; border-color: #FEE500; }
.login-social-btn--apple { background: #000; color: #fff; border-color: #000; }
body.dark .login-social-btn--apple { background: #fff; color: #000; }
body.dark .login-submit-btn, body.dark .login-email-btn { background: #3b82f6; }
body.dark .login-agree-list a { color: #60a5fa; }
.login-divider {
  display: flex; align-items: center; gap: 12px;
  margin: 18px 0; font-size: 13px; color: var(--text-muted);
}
.login-divider::before, .login-divider::after {
  content: ''; flex: 1; height: 1px; background: var(--border);
}
.login-input {
  width: 100%; height: 48px; padding: 0 14px;
  border: 1.5px solid rgba(0,0,0,.1); border-radius: 10px;
  background: rgba(0,0,0,.03); color: var(--text);
  font-size: 14px; outline: none;
  box-sizing: border-box; font-family: inherit;
}
.login-input:focus { border-color: var(--accent); background: #fff; }
body.dark .login-input { border-color: rgba(255,255,255,.12); background: rgba(255,255,255,.05); }
body.dark .login-input:focus { border-color: #60a5fa; background: rgba(255,255,255,.08); }
.login-input + .login-input { margin-top: 10px; }
.login-email-row { display: flex; gap: 8px; }
.login-email-row .login-input { flex: 1; }
.login-email-btn {
  padding: 0 20px; border-radius: 10px; border: none;
  background: #1d6fab; color: #fff;
  font-size: 15px; font-weight: 600; cursor: pointer; white-space: nowrap;
  transition: opacity .15s; font-family: inherit;
}
.login-email-btn:hover { opacity: .9; }
.login-step-desc {
  font-size: 14px; color: var(--text-secondary); margin-bottom: 14px; line-height: 1.5;
}
.login-step-desc strong { color: var(--text); }
.login-submit-btn {
  width: 100%; padding: 13px; margin-top: 14px;
  border-radius: 10px; border: none; background: #1d6fab; color: #fff;
  font-size: 15px; font-weight: 600; cursor: pointer; font-family: inherit;
}
.login-submit-btn:hover { opacity: .9; }
.login-submit-btn:disabled { opacity: .5; cursor: not-allowed; }
.login-back-btn {
  display: flex; align-items: center; gap: 4px; margin-bottom: 12px;
  font-size: 13px; color: var(--text-muted); cursor: pointer;
  background: none; border: none; padding: 0; font-family: inherit;
}
.login-back-btn:hover { color: var(--text-secondary); }
.login-agreements { margin-top: 16px; font-size: 13px; color: var(--text-secondary); }
.login-agree-all {
  display: flex; align-items: center; gap: 8px;
  font-weight: 600; cursor: pointer; padding: 4px 0;
}
.login-agree-toggle {
  display: inline-flex; align-items: center; cursor: pointer;
  margin-left: auto; color: var(--text-muted);
  transition: transform .2s;
}
.login-agree-toggle.collapsed { transform: rotate(-180deg); }
.login-agree-list { display: flex; flex-direction: column; gap: 2px; padding-top: 8px; }
.login-agree-list.collapsed { display: none; }
.login-agree-list label {
  display: flex; align-items: center; gap: 6px;
  font-size: 13px; cursor: pointer; padding: 2px 0;
}
.login-agree-list a { color: var(--accent); text-decoration: none; }
.login-agree-list a:hover { text-decoration: underline; }
.login-error { color: #ef4444; font-size: 13px; margin-top: 12px; }
.login-field-error { color: #ef4444; font-size: 12px; margin: 2px 0 8px 2px; display: none; }
.login-terms-footer {
  display: flex; justify-content: center; gap: 12px;
  padding: 14px 0 4px; font-size: 12px;
  border-top: 1px solid var(--border); margin-top: 16px;
}
.login-terms-footer a { color: var(--text-muted, #9ca3af); text-decoration: none; }
.login-terms-footer a:hover { text-decoration: underline; }
.login-user-menu {
  position: fixed; top: 68px; right: 16px;
  width: 200px; padding: 14px;
  border-radius: 12px; z-index: 600;
  opacity: 0; pointer-events: none;
  transform: translateY(-4px);
  transition: opacity .15s, transform .15s;
}
.login-user-menu.visible { opacity: 1; pointer-events: auto; transform: translateY(0); }
body.dark .login-user-menu {
  background: rgba(30,30,30,.78);
  border-color: rgba(255,255,255,.08);
  box-shadow: 0 2px 16px rgba(0,0,0,.3);
}
.login-user-info { padding-bottom: 10px; border-bottom: 1px solid var(--border); margin-bottom: 8px; }
.login-user-name { display: block; font-size: 14px; font-weight: 600; color: var(--text); }
.login-user-email { display: block; font-size: 12px; color: var(--text-muted, #9ca3af); margin-top: 2px; }
.login-user-menu-item {
  display: block; width: 100%; padding: 6px 0;
  font-size: 13px; color: var(--text-secondary); background: none; border: none;
  text-align: left; cursor: pointer; font-family: inherit;
}
.login-user-menu-item:hover { color: #ef4444; }

/* ═══════════════════════════════════════════
   문의하기 (댓글/답글)
   ═══════════════════════════════════════════ */
.contact-write { padding: 12px 16px; border-bottom: 1px solid var(--border); flex-shrink: 0; }
.contact-write textarea {
  width: 100%; padding: 10px 12px; border: 1.5px solid rgba(0,0,0,.08); border-radius: 10px;
  background: transparent; color: var(--text); font: inherit; font-size: 14px;
  resize: none; min-height: 72px; box-sizing: border-box;
}
body.dark .contact-write textarea { border-color: rgba(255,255,255,.10); background: transparent; }
.contact-write textarea:focus { outline: none; border-color: var(--accent); }
.contact-write textarea:disabled { opacity: .5; cursor: not-allowed; }
.contact-write__toolbar { display: flex; align-items: center; gap: 10px; margin-top: 8px; }
.contact-write__secret {
  display: flex; align-items: center; gap: 4px; font-size: 13px;
  color: var(--text-secondary); cursor: pointer; user-select: none;
}
.contact-write__secret input[type="checkbox"] { display: none; }
.contact-write__secret svg { width: 18px; height: 18px; }
.contact-write__secret.checked svg { color: var(--accent); }
.contact-write__secret.checked { color: var(--accent); }
.contact-write__attach-btn {
  cursor: pointer; color: var(--text-secondary); display: flex; align-items: center;
  padding: 4px; border-radius: 6px;
}
.contact-write__attach-btn:hover { background: rgba(0,0,0,.04); }
.contact-write__attach-btn svg { width: 18px; height: 18px; }
.contact-write__submit {
  margin-left: auto; padding: 6px 16px; font-size: 13px; font-weight: 600;
  border: none; border-radius: 8px; background: var(--text); color: var(--bg);
  cursor: pointer;
}
.contact-write__submit:disabled { opacity: .4; cursor: not-allowed; }
.contact-write__previews { display: flex; gap: 8px; margin-top: 8px; flex-wrap: wrap; }
.contact-write__preview {
  position: relative; width: 100px; height: 100px; border-radius: 8px; overflow: hidden;
  flex-shrink: 0;
}
.contact-write__preview img { width: 100%; height: 100%; object-fit: cover; }
.contact-write__preview-del {
  position: absolute; top: 2px; right: 2px; width: 20px; height: 20px;
  background: rgba(0,0,0,.6); border-radius: 50%; color: #fff; font-size: 14px; line-height: 1;
  display: flex; align-items: center; justify-content: center; cursor: pointer; border: none;
}
.contact-scroll { flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; }
.contact-thread { padding: 16px; border-bottom: 1px solid var(--border); }
.contact-comment__header { display: flex; align-items: center; gap: 6px; margin-bottom: 4px; }
.contact-comment__author { font-size: 14px; font-weight: 600; color: var(--text); }
.contact-comment__admin-badge {
  font-size: 11px; padding: 1px 6px; border-radius: 4px;
  background: var(--accent); color: #fff; font-weight: 500;
}
.contact-comment__date { font-size: 12px; color: var(--text-muted); margin-left: auto; }
.contact-comment__secret-badge { color: var(--text-muted); display: inline-flex; align-items: center; }
.contact-comment__body {
  font-size: 14px; line-height: 1.65; color: var(--text);
  white-space: pre-wrap; word-break: break-word;
}
.contact-comment__body a { color: var(--accent); text-decoration: underline; }
.contact-comment__body--hidden { color: var(--text-muted); }
.contact-comment__attachments { display: flex; gap: 6px; margin-top: 8px; flex-wrap: wrap; }
.contact-comment__attachments img {
  width: 80px; height: 80px; border-radius: 6px; object-fit: cover; cursor: pointer;
}
.contact-comment__actions { display: flex; gap: 12px; margin-top: 8px; }
.contact-comment__actions button {
  background: none; border: none; font-size: 12px; color: var(--text-muted);
  cursor: pointer; padding: 2px 0; font-family: inherit;
}
.contact-comment__actions button:hover { color: var(--text); }
.contact-replies { margin-left: 24px; margin-top: 4px; }
.contact-comment--reply { padding: 12px 0; border-top: 1px solid rgba(0,0,0,.04); }
body.dark .contact-comment--reply { border-top-color: rgba(255,255,255,.06); }
.contact-reply-form { margin-top: 10px; margin-left: 24px; display: none; }
.contact-reply-form.open { display: block; }
.contact-reply-form textarea {
  width: 100%; padding: 8px 10px; border: 1.5px solid rgba(0,0,0,.08); border-radius: 8px;
  background: rgba(0,0,0,.02); color: var(--text); font: inherit; font-size: 13px;
  resize: none; min-height: 56px; box-sizing: border-box;
}
body.dark .contact-reply-form textarea { border-color: rgba(255,255,255,.10); background: rgba(255,255,255,.06); }
.contact-reply-form textarea:focus { outline: none; border-color: var(--accent); }
.contact-reply-form__toolbar { display: flex; align-items: center; gap: 8px; margin-top: 6px; }
.contact-reply-form__previews { display: flex; gap: 6px; margin-top: 6px; flex-wrap: wrap; }
.contact-comment__edit-area {
  width: 100%; min-height: 60px; padding: 8px 10px; border: 1.5px solid var(--accent);
  border-radius: 8px; background: var(--bg); color: var(--text); font: inherit; font-size: 14px;
  resize: none; box-sizing: border-box;
}
.contact-comment__edit-toolbar { display: flex; align-items: center; gap: 10px; margin-top: 6px; }
.contact-comment__edit-actions { display: flex; gap: 8px; margin-top: 6px; }
.contact-comment__edit-actions button {
  padding: 4px 12px; font-size: 12px; font-weight: 500; border-radius: 6px;
  border: 1px solid var(--border); background: var(--bg); color: var(--text);
  cursor: pointer; font-family: inherit;
}
.contact-comment__edit-actions button:first-child {
  background: var(--text); color: var(--bg); border-color: var(--text);
}
.contact-empty { padding: 60px 16px; text-align: center; color: var(--text-muted); font-size: 14px; }
.contact-sentinel { height: 1px; flex-shrink: 0; }
.contact-loading { text-align: center; padding: 16px; }

/* ── 반응형 ── */
@media (max-width: 768px) {
  .container { padding: 0 16px; }
  .navbar-title { font-size: 16px; }
}
