* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: -apple-system, "Segoe UI", "Malgun Gothic", sans-serif;
  background: #f4f6fa;
  color: #1c2330;
}
header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 20px; background: #2b2f3a; color: #fff;
}
header h1 { font-size: 18px; margin: 0; }
.build { font-size: 11px; opacity: .6; font-weight: normal; margin-left: 8px; }
.subtitle { font-size: 12px; opacity: .75; font-weight: normal; margin-left: 6px; }
.status { font-size: 12px; opacity: .85; }
.status .dot { display:inline-block; width:8px; height:8px; border-radius:50%; margin-right:5px; background:#888; }
.status.ok .dot { background:#42d77d; }
.status.err .dot { background:#ff5d5d; }

.controls { padding: 14px 20px; background:#fff; border-bottom:1px solid #e3e7ee; }
.controls .row { display:flex; gap:12px; flex-wrap:wrap; align-items:flex-end; margin-bottom:10px; }
.controls .row:last-child { margin-bottom:0; }
label { font-size:12px; color:#5a6477; display:flex; flex-direction:column; gap:4px; }
label.chk { flex-direction:row; align-items:center; gap:6px; font-size:13px; color:#333; }
select, input[type=text] {
  padding:7px 9px; border:1px solid #cdd4e0; border-radius:7px; font-size:14px; background:#fff;
  min-width:120px;
}
button {
  padding:8px 16px; border:none; border-radius:7px; background:#4361ee; color:#fff;
  font-size:14px; cursor:pointer;
}
button.ghost { background:#eef1f8; color:#4361ee; }
button:hover { opacity:.9; }

.cheapest { margin:16px 20px; background:#fff; border-radius:12px; padding:16px; border:1px solid #e3e7ee; }
.cheapest h2 { margin:0 0 12px; font-size:16px; }
table { width:100%; border-collapse:collapse; font-size:14px; }
th, td { padding:8px 10px; text-align:left; border-bottom:1px solid #eef1f6; }
th { font-size:12px; color:#7a8499; font-weight:600; }
tr.best td { background:#fff8e1; }
.rank { font-weight:700; color:#4361ee; }
.price { font-weight:700; color:#e8590c; }
.half-note { font-weight:400; font-size:11px; color:#8a93a6; }
td.time { font-size:12px; color:#8a93a6; white-space:nowrap; }
.unit-head { font-size:13px; color:#4361ee; margin:16px 0 6px; padding-bottom:4px; border-bottom:2px solid #eef1f8; }
.unit-head:first-child { margin-top:0; }
#cheapest-groups table { margin-bottom:6px; }

.results { margin:16px 20px 40px; }
.meta { font-size:13px; color:#5a6477; margin-bottom:10px; }
.card {
  background:#fff; border:1px solid #e3e7ee; border-radius:10px;
  padding:12px 14px; margin-bottom:8px;
}
.card .top { display:flex; gap:8px; flex-wrap:wrap; align-items:center; margin-bottom:6px; }
.tag { font-size:11px; padding:2px 7px; border-radius:5px; background:#eef1f8; color:#4361ee; }
.tag.sell { background:#e6f7ee; color:#1a9e57; }
.tag.buy  { background:#fdeaea; color:#d64545; }
.tag.map  { background:#eae6fb; color:#6741d9; }
.tag.leech{ background:#fff3e0; color:#d9760c; }
.tag.job  { background:#e7f0fb; color:#2f6bd6; }
.tag.opt  { background:#f1f3f5; color:#667085; }
td.opt-cell { font-size:12px; color:#667085; max-width:180px; }
.card .content { white-space:pre-wrap; font-size:14px; line-height:1.45; }
.card .foot { font-size:12px; color:#8a93a6; margin-top:6px; display:flex; gap:10px; flex-wrap:wrap; }
.card .foot a { color:#4361ee; text-decoration:none; }
.price-badge { font-weight:700; color:#e8590c; }
.mobs-badge { color:#1a9e57; }
.empty { text-align:center; color:#9aa3b5; padding:40px; }

/* ---- 탭 ---- */
.tabs { display:flex; gap:6px; padding:10px 20px 0; background:#fff; border-bottom:1px solid #e3e7ee; }
.tab {
  background:#eef1f8; color:#5a6477; border-radius:8px 8px 0 0; padding:9px 18px;
  font-size:14px; font-weight:600;
}
.tab.active { background:#4361ee; color:#fff; }

/* ---- 후기 로그인 바 ---- */
.rv-authbar {
  margin:16px 20px 0; padding:12px 16px; background:#fff; border:1px solid #e3e7ee;
  border-radius:12px;
}
#rv-me { display:flex; align-items:center; gap:10px; flex-wrap:wrap; font-size:14px; }
.rv-avatar { width:28px; height:28px; border-radius:50%; background:#e3e7ee; object-fit:cover; }
.rv-login {
  display:inline-block; background:#5865F2; color:#fff; padding:8px 16px; border-radius:7px;
  text-decoration:none; font-size:14px; font-weight:600;
}
.rv-hint { font-size:12px; color:#8a93a6; }
.rv-verified { font-size:12px; background:#e6f7ee; color:#1a9e57; padding:2px 8px; border-radius:12px; font-weight:600; }
.rv-unverified { font-size:12px; background:#f1f3f5; color:#8a93a6; padding:2px 8px; border-radius:12px; }

/* ---- 후기 작성 폼 ---- */
.rv-writer {
  margin:16px 20px 0; padding:16px; background:#fff; border:1px solid #e3e7ee; border-radius:12px;
}
.rv-writer h2 { margin:0 0 12px; font-size:16px; }
.rv-form { display:flex; flex-direction:column; gap:10px; }
.rv-row { display:flex; gap:12px; flex-wrap:wrap; align-items:flex-end; }
.rv-form textarea {
  width:100%; padding:9px; border:1px solid #cdd4e0; border-radius:8px; font-size:14px;
  font-family:inherit; resize:vertical;
}
.rv-file { font-size:13px; color:#5a6477; }
.rv-preview { display:flex; gap:6px; flex-wrap:wrap; }
.rv-img { width:64px; height:64px; object-fit:cover; border-radius:8px; border:1px solid #e3e7ee; }
.rv-msg { font-size:13px; }
.rv-msg.ok { color:#1a9e57; }
.rv-msg.err { color:#d64545; }

/* ---- 후기 카드 ---- */
.rv-card .rv-head { display:flex; align-items:center; gap:8px; flex-wrap:wrap; margin-bottom:8px; }
.rv-stars { color:#f2a900; font-size:14px; letter-spacing:1px; }
.rv-time { font-size:12px; color:#8a93a6; margin-left:auto; }
.rv-imgs { display:flex; gap:8px; flex-wrap:wrap; margin-top:10px; }
.rv-imgs .rv-img { width:110px; height:110px; }

/* ---- 헤더 로그인 위젯 ---- */
.header-right { display:flex; align-items:center; gap:16px; }
.auth { display:flex; align-items:center; gap:8px; font-size:13px; }
.auth b { font-size:13px; }
.guest-name { padding:6px 9px; border:1px solid #cdd4e0; border-radius:6px; font-size:13px; min-width:110px; }
.av-ph {
  display:inline-flex; align-items:center; justify-content:center; width:28px; height:28px;
  border-radius:50%; background:#4361ee; color:#fff; font-size:13px; font-weight:700;
}
button.sm, .rv-login.sm { padding:5px 10px; font-size:12px; }
.rv-login.sm { display:inline-block; background:#5865F2; color:#fff; border-radius:6px; text-decoration:none; }

/* ---- 탭 배지 ---- */
.tab-badge {
  display:inline-block; min-width:16px; height:16px; line-height:16px; text-align:center;
  background:#ff5d5d; color:#fff; border-radius:8px; font-size:10px; margin-left:6px; padding:0 4px;
}

/* ---- 채팅 버튼 ---- */
.chat-btn {
  background:#e6f0ff; color:#2f6bd6; border:none; border-radius:6px; padding:3px 9px;
  font-size:12px; cursor:pointer;
}
.chat-btn.sm { padding:1px 6px; font-size:11px; }
.chat-btn:hover { background:#d4e4ff; }

/* ---- 채팅 화면 ---- */
.chat-wrap {
  display:flex; margin:16px 20px 40px; background:#fff; border:1px solid #e3e7ee;
  border-radius:12px; overflow:hidden; height:70vh; min-height:420px;
}
.chat-threads { width:270px; border-right:1px solid #e3e7ee; display:flex; flex-direction:column; overflow:hidden; }
.chat-threads-head { padding:12px 14px; font-weight:700; font-size:14px; border-bottom:1px solid #eef1f6; }
.chat-new { padding:8px 10px; border-bottom:1px solid #eef1f6; }
.chat-new input { width:100%; padding:8px 10px; border:1px solid #cdd4e0; border-radius:7px; font-size:13px; }
#chat-new-results { border-bottom:1px solid #eef1f6; }
#chat-new-results:empty { border-bottom:none; }
#chat-new-results .chat-thread { background:#f0fff4; }
#chat-thread-list { overflow-y:auto; flex:1; }
.chat-thread { display:flex; gap:10px; padding:10px 12px; cursor:pointer; border-bottom:1px solid #f2f4f8; }
.chat-thread:hover { background:#f7f9fc; }
.chat-thread.active { background:#eef3ff; }
.chat-thread-body { flex:1; min-width:0; }
.chat-thread-top { display:flex; align-items:center; gap:6px; }
.chat-thread-top b { font-size:13px; }
.chat-thread-last { font-size:12px; color:#8a93a6; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.chat-unread { background:#ff5d5d; color:#fff; border-radius:8px; font-size:10px; padding:0 5px; margin-left:auto; }

.chat-main { flex:1; display:flex; flex-direction:column; min-width:0; }
.chat-peer { padding:12px 16px; border-bottom:1px solid #eef1f6; font-size:14px; color:#5a6477; }
.chat-msgs { flex:1; overflow-y:auto; padding:16px; display:flex; flex-direction:column; gap:8px; background:#f7f9fc; }
.chat-msg { display:flex; flex-direction:column; max-width:70%; }
.chat-msg.mine { align-self:flex-end; align-items:flex-end; }
.chat-msg.theirs { align-self:flex-start; align-items:flex-start; }
.chat-bubble { padding:9px 13px; border-radius:14px; font-size:14px; line-height:1.4; white-space:pre-wrap; word-break:break-word; }
.chat-msg.mine .chat-bubble { background:#4361ee; color:#fff; border-bottom-right-radius:4px; }
.chat-msg.theirs .chat-bubble { background:#fff; border:1px solid #e3e7ee; border-bottom-left-radius:4px; }
.chat-mtime { font-size:10px; color:#a7afbf; margin-top:2px; }
.chat-input { display:flex; gap:8px; padding:12px; border-top:1px solid #eef1f6; }
.chat-input input { flex:1; padding:10px 12px; border:1px solid #cdd4e0; border-radius:8px; font-size:14px; }
.chat-empty { padding:30px 16px; text-align:center; color:#9aa3b5; font-size:13px; line-height:1.7; }

/* ---- 사기조회 ---- */
.scam-search {
  margin:16px 20px 0; padding:16px; background:#fff; border:1px solid #e3e7ee; border-radius:12px;
}
.scam-search h2 { margin:0 0 6px; font-size:16px; }
.scam-hint { margin:0 0 12px; font-size:13px; color:#8a93a6; }
.scam-bar { display:flex; gap:8px; }
.scam-bar input { flex:1; max-width:420px; padding:10px 12px; border:1px solid #cdd4e0; border-radius:8px; font-size:14px; }
.scam-bar button { background:#d64545; }
.scam-card { border-left:3px solid #ffb3b3; }
.scam-title { font-weight:700; font-size:14px; margin-bottom:4px; }
mark.scam-kw { background:#ffe3e3; color:#c92a2a; border-radius:3px; padding:0 2px; }
mark.scam-q { background:#fff3bf; color:#8a6d00; border-radius:3px; padding:0 2px; }

/* ---- 모집 게시판 ---- */
.bd-writer { margin:16px 20px 0; padding:16px; background:#fff; border:1px solid #e3e7ee; border-radius:12px; }
.bd-writer h2 { margin:0 0 12px; font-size:16px; }
.bd-form { display:flex; flex-direction:column; gap:10px; }
.bd-title-label { flex:1; }
.bd-title-label input { width:100%; min-width:260px; }
.bd-form textarea { width:100%; padding:9px; border:1px solid #cdd4e0; border-radius:8px; font-size:14px; font-family:inherit; resize:vertical; }
.bd-filter { display:flex; gap:6px; margin-bottom:10px; align-items:center; flex-wrap:wrap; }
.bd-map-filter { padding:6px 9px; border:1px solid #cdd4e0; border-radius:7px; font-size:13px; margin-left:6px; }
.bd-kind-btn { background:#eef1f8; color:#5a6477; font-size:13px; padding:6px 14px; }
.bd-kind-btn.active { background:#4361ee; color:#fff; }
.bd-card .bd-title { font-size:14px; margin-left:4px; }
.bd-card.closed { opacity:.55; }
.tag.done { background:#e6f7ee; color:#1a9e57; }

/* ---- 모달(회원가입) ---- */
.modal-overlay {
  position:fixed; inset:0; background:rgba(20,25,40,.45); z-index:100;
  display:flex; align-items:center; justify-content:center;
}
.modal {
  background:#fff; border-radius:14px; padding:24px 26px; width:340px; max-width:92vw;
  box-shadow:0 12px 40px rgba(0,0,0,.18);
}
.modal h2 { margin:0 0 16px; font-size:17px; }
.modal-form { display:flex; flex-direction:column; gap:12px; }
.modal-form label { font-size:12px; color:#5a6477; display:flex; flex-direction:column; gap:4px; }
.modal-form input { padding:10px 12px; border:1px solid #cdd4e0; border-radius:8px; font-size:14px; min-width:0; }
.modal-actions { display:flex; gap:8px; margin-top:4px; }
.modal-actions button { flex:1; }
