/* NEARLY 프론트엔드 — 기존 앱 방향(진한 초록 포인트, 카드 16px)을 대략 따름 */
:root {
  --accent: #14532d;
  --accent-bright: #166534;
  --text: #1a1a1a;
  --muted: #666;
  --border: #e3e3e3;
  --bg-soft: #f6f7f6;
  --danger: #b91c1c;
  --radius: 16px;
  --shadow: 0 2px 10px rgba(0, 0, 0, 0.06);
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  color: var(--text);
  background: #fff;
}
a { color: var(--accent); text-decoration: none; }

/* 헤더 */
header.site {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 12px 20px;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}
.logo { font-weight: 800; font-size: 20px; color: var(--accent); letter-spacing: 0.5px; }
nav.main-nav { display: flex; gap: 14px; font-size: 14px; flex-wrap: wrap; }
nav.main-nav a { color: var(--text); }
nav.main-nav a.active { color: var(--accent); font-weight: 700; }
.auth-area { margin-left: auto; display: flex; gap: 8px; align-items: center; font-size: 14px; }

main { max-width: 1080px; margin: 0 auto; padding: 24px 20px 64px; }
h1 { font-size: 24px; margin: 0 0 16px; }
h2 { font-size: 17px; margin: 24px 0 10px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }

/* 버튼 */
.btn {
  display: inline-block;
  border: 1px solid var(--border);
  background: #fff;
  color: var(--text);
  border-radius: 10px;
  padding: 8px 14px;
  font-size: 14px;
  cursor: pointer;
}
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 700; }
.btn.primary:hover { background: var(--accent-bright); }
.btn:disabled { opacity: 0.5; cursor: default; }

/* 검색 버튼: 조건이 바뀌면 맥박 표시로 "눌러야 적용됨"을 알린다 */
@keyframes pulse-ring {
  0% { box-shadow: 0 0 0 0 rgba(20, 83, 45, 0.45); }
  70% { box-shadow: 0 0 0 9px rgba(20, 83, 45, 0); }
  100% { box-shadow: 0 0 0 0 rgba(20, 83, 45, 0); }
}
.btn.search-btn { margin-left: auto; }
.btn.search-btn.dirty { background: var(--accent); color: #fff; border-color: var(--accent); animation: pulse-ring 1.4s infinite; font-weight: 700; }

/* 필터 */
.filter-panel {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow);
  margin-bottom: 20px;
}
.filter-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 14px; }
.filter-group label.title { display: block; font-size: 13px; font-weight: 700; margin-bottom: 6px; }
.checks { display: flex; flex-wrap: wrap; gap: 6px 12px; font-size: 14px; }
.filter-actions { display: flex; align-items: center; gap: 10px; margin-top: 14px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--bg-soft); border: 1px solid var(--border);
  border-radius: 999px; padding: 4px 10px; font-size: 13px;
}
.chip button { border: none; background: none; cursor: pointer; color: var(--muted); font-size: 14px; padding: 0; }

/* 폼 */
form.stack { display: grid; gap: 12px; max-width: 560px; }
form.stack label { display: grid; gap: 5px; font-size: 14px; font-weight: 600; }
form.stack label .req { color: var(--danger); font-weight: 700; }
input[type="text"], input[type="email"], input[type="password"], input[type="number"],
input[type="date"], select, textarea {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 9px 11px;
  font-size: 14px;
  font-family: inherit;
  width: 100%;
}
textarea { min-height: 110px; resize: vertical; }
.error-box {
  background: #fef2f2; border: 1px solid #fecaca; color: var(--danger);
  border-radius: 10px; padding: 10px 12px; font-size: 14px;
}

/* 매물 카드 */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; }
.listing-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  background: #fff;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.listing-card:hover { transform: translateY(-2px); box-shadow: 0 6px 18px rgba(0, 0, 0, 0.09); }
.listing-card .photo { height: 150px; background: var(--bg-soft); display: flex; align-items: center; justify-content: center; color: var(--muted); font-size: 13px; }
.listing-card .photo img { width: 100%; height: 100%; object-fit: cover; }
.listing-card .body { padding: 12px 14px; }
.listing-card .price { font-size: 18px; font-weight: 800; }
.listing-card .title { font-size: 15px; font-weight: 600; margin: 4px 0; }
.badge {
  display: inline-block; font-size: 11px; font-weight: 700;
  background: #ecfdf5; color: var(--accent);
  border: 1px solid #bbf7d0; border-radius: 999px; padding: 2px 8px;
}
.badge.gray { background: var(--bg-soft); color: var(--muted); border-color: var(--border); }
.seq { font-size: 12px; color: var(--muted); font-weight: 700; }

/* 상세 */
.detail-photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; margin-bottom: 16px; }
.detail-photos img { width: 100%; height: 180px; object-fit: cover; border-radius: 12px; }
.card-box { border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); }
.kv { display: grid; grid-template-columns: 110px 1fr; gap: 6px 12px; font-size: 14px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; }

.todo-box {
  border: 1px dashed var(--border); border-radius: var(--radius);
  padding: 28px 20px; text-align: center; color: var(--muted);
}
footer.site { border-top: 1px solid var(--border); padding: 18px 20px; color: var(--muted); font-size: 13px; text-align: center; }

/* 탭 */
.tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 16px; border-bottom: 1px solid var(--border); }
.tab { padding: 8px 14px; font-size: 14px; color: var(--text); border-bottom: 2px solid transparent; }
.tab.active { color: var(--accent); font-weight: 700; border-bottom-color: var(--accent); }

/* 배지 추가 종류 */
.badge.danger-badge { background: #fef2f2; color: var(--danger); border-color: #fecaca; }
.badge.unread { background: var(--danger); color: #fff; border-color: var(--danger); }
.btn.danger { color: var(--danger); border-color: #fecaca; }
.btn.small-btn { padding: 3px 8px; font-size: 12px; border-radius: 8px; }
.btn.link-btn { border: none; color: var(--accent); margin-top: 14px; }
.listing-card .photo { position: relative; }
.cam-badge { position: absolute; left: 8px; bottom: 8px; background: rgba(255,255,255,0.92); }
.listing-card .photo img.contain, .detail-photos img.contain { object-fit: contain; background: var(--bg-soft); }
.row-actions { margin-top: 10px; display: flex; gap: 6px; flex-wrap: wrap; }
.sel-check { font-size: 13px; font-weight: 600; }

/* 선택 바 (집 구해요 등) */
.select-bar {
  position: sticky; bottom: 12px; margin-top: 16px;
  background: #fff; border: 1px solid var(--border); border-radius: 999px;
  box-shadow: var(--shadow); padding: 8px 16px; display: flex; gap: 12px; align-items: center;
}

/* 체크박스 필드셋 */
.check-fieldset { border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; }
.check-fieldset legend { font-size: 13px; font-weight: 700; padding: 0 4px; }
.scroll-checks { max-height: 180px; overflow-y: auto; }

/* 댓글 */
.comment { border-top: 1px solid var(--border); padding: 10px 0; }
.comment:first-of-type { border-top: none; }

/* 공지 */
.announce-banner {
  background: #ecfdf5; border: 1px solid #bbf7d0; border-radius: 12px;
  padding: 10px 14px; margin-bottom: 10px; font-size: 14px;
}
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(0,0,0,0.45);
  display: flex; align-items: center; justify-content: center; z-index: 50; padding: 16px;
}
.modal { background: #fff; border-radius: var(--radius); padding: 22px; max-width: 420px; width: 100%; box-shadow: var(--shadow); }
.modal-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 14px; }

/* 메시지 */
.conv-row {
  display: flex; align-items: center; gap: 8px; padding: 12px 14px;
  border: 1px solid var(--border); border-radius: 12px; margin-bottom: 8px; color: var(--text);
}
.conv-row:hover { background: var(--bg-soft); }
.conv-name { font-weight: 700; }
.chat-box { display: flex; flex-direction: column; gap: 10px; max-height: 60vh; overflow-y: auto; padding: 6px 2px; }
.msg-row { display: flex; }
.msg-row.mine { justify-content: flex-end; }
.bubble {
  max-width: 78%; border: 1px solid var(--border); border-radius: 14px;
  padding: 9px 12px; background: #fff;
}
.msg-row.mine .bubble { background: #ecfdf5; border-color: #bbf7d0; }
.bubble-text { white-space: pre-wrap; font-size: 14px; }
.bubble-text.translated { color: var(--muted); border-top: 1px dashed var(--border); margin-top: 6px; padding-top: 6px; }
.msg-meta { margin-top: 5px; text-align: right; }
.card-msg { border: 1px solid var(--border); border-radius: 12px; padding: 10px 12px; background: var(--bg-soft); min-width: 200px; }
.card-msg.condition { background: #fff7ed; border-color: #fed7aa; }
.card-title { font-size: 12px; font-weight: 700; color: var(--muted); margin-bottom: 5px; }
.card-actions { margin-top: 8px; display: flex; gap: 6px; flex-wrap: wrap; }
.chat-form { display: flex; gap: 8px; margin-top: 12px; align-items: flex-start; }
.chat-form textarea { flex: 1; min-height: 48px; }
.card-send-box { margin-top: 12px; font-size: 14px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.card-send-box select { width: auto; }

/* 관리자 */
.admin-row {
  display: flex; justify-content: space-between; gap: 14px; flex-wrap: wrap;
  border: 1px solid var(--border); border-radius: 12px; padding: 12px 14px; margin-bottom: 10px;
}
.admin-actions { display: flex; gap: 6px; align-items: flex-start; flex-wrap: wrap; }
.admin-actions select { width: auto; }
.table-wrap { overflow-x: auto; }
table.tbl { border-collapse: collapse; width: 100%; font-size: 14px; }
table.tbl th, table.tbl td { border: 1px solid var(--border); padding: 7px 10px; text-align: left; }
table.tbl th { background: var(--bg-soft); }
.send-row {
  display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  border: 1px solid var(--border); border-radius: 12px; padding: 10px 12px; margin-bottom: 8px;
}
.photo-thumb { position: relative; display: inline-block; }
.photo-thumb img { width: 100%; height: 180px; object-fit: cover; border-radius: 12px; }
.photo-thumb .btn { position: absolute; right: 8px; bottom: 8px; }

/* 소개/온보딩 */
.hero { text-align: center; padding: 36px 10px 8px; }
.hero h1 { font-size: 30px; line-height: 1.3; }
.hero .btn { margin: 4px; }
.tagline { text-align: center; font-size: 19px; font-weight: 800; color: var(--accent); margin: 26px 0 6px; }
.benefit-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; }
.benefit-grid h3 { margin: 0 0 6px; font-size: 15px; }
.benefit-grid p { margin: 0; font-size: 14px; color: var(--muted); }
.onboard { max-width: 480px; margin: 0 auto; text-align: center; padding-top: 12px; }
.onboard-choices { display: grid; gap: 10px; margin: 18px 0; }
.btn.onboard-choice { padding: 14px; font-size: 16px; font-weight: 700; text-align: center; }
.btn.onboard-choice.primary { background: var(--accent); color: #fff; border-color: var(--accent); }
.onboard-benefits { text-align: left; margin: 16px 0; padding-left: 20px; display: grid; gap: 8px; font-size: 15px; }
.onboard-nav { display: flex; justify-content: space-between; margin-top: 18px; }

/* 보기 전환 (카드/리스트/표) */
.view-toggle { display: inline-flex; gap: 4px; margin-left: 8px; vertical-align: middle; }
.list-rows { display: grid; gap: 10px; }
.list-row {
  display: flex; align-items: center; gap: 12px;
  border: 1px solid var(--border); border-radius: 12px; padding: 10px 12px;
  box-shadow: var(--shadow); cursor: pointer; background: #fff;
}
.list-row:hover { background: var(--bg-soft); }
.list-row .list-row-main { flex: 1; min-width: 0; }
.list-row .title { font-size: 15px; font-weight: 600; }
.list-row .price { font-size: 16px; font-weight: 800; white-space: nowrap; }
.thumb-sm { width: 72px; height: 54px; object-fit: cover; border-radius: 8px; flex: none; }
.thumb-sm.thumb-empty {
  display: flex; align-items: center; justify-content: center;
  background: var(--bg-soft); color: var(--muted); font-size: 11px;
}
.thumb-md { width: 100%; max-width: 220px; height: 130px; object-fit: cover; border-radius: 10px; }
table.tbl th.sortable { cursor: pointer; user-select: none; }
table.tbl th.sortable:hover { background: #ecefec; }
.compare-table th { width: 92px; background: var(--bg-soft); }
.compare-table td { vertical-align: top; min-width: 180px; }

/* 저장 목록 */
.saved-item { display: flex; flex-direction: column; }
.saved-item .listing-card { flex: 1; }
.listing-card.unavailable { cursor: default; display: flex; align-items: center; justify-content: center; min-height: 120px; }

/* 번역 보기 */
.translation-box { margin: 10px 0; }
.translated-body {
  border-top: 1px dashed var(--border); margin-top: 8px; padding-top: 8px; color: var(--muted);
}

/* 인쇄/PDF — 화면에 보이는 것만 인쇄한다.
   비공개 주소·전화는 애초에 공개 DOM에 없으므로 인쇄물에도 나올 수 없다. */
@media print {
  header.site, footer.site, nav.main-nav,
  .btn, button, .filter-panel, .select-bar, .tabs, .view-toggle,
  .no-print, form, .modal-backdrop, .chat-form, .card-send-box {
    display: none !important;
  }
  main { max-width: none; margin: 0; padding: 0; }
  body { font-size: 12px; }
  .cards { grid-template-columns: 1fr 1fr; }
  .listing-card, .card-box, .list-row, .admin-row {
    box-shadow: none; break-inside: avoid; transform: none;
  }
  .detail-photos img { height: 120px; }
  a { color: inherit; }
}
