/* ========== 어디가? 기본 스타일 ========== */
* { box-sizing: border-box; }
:root {
  --primary: #ff5a3c;      /* 포인트 색(주황) */
  --primary-d: #e8452a;
  --ink: #222;
  --muted: #888;
  --line: #eee;
  --bg: #f6f7f9;
}
html, body { margin: 0; height: 100%; }
body {
  font-family: -apple-system, "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
  color: var(--ink);
  background: var(--bg);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}
a { color: inherit; }

/* 상단 바 */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 18px; background: #fff; border-bottom: 1px solid var(--line);
  gap: 12px; flex-wrap: wrap;
}
.brand { display: flex; align-items: baseline; gap: 10px; }
.logo { font-size: 24px; font-weight: 900; color: var(--primary); letter-spacing: -1px; }
.logo .q { color: var(--ink); }
.tagline { font-size: 13px; color: var(--muted); }
.top-actions { display: flex; gap: 8px; align-items: center; }
.search {
  width: 260px; max-width: 50vw; padding: 9px 12px;
  border: 1px solid var(--line); border-radius: 20px; font-size: 14px;
}
.btn-report {
  background: var(--primary); color: #fff; border: 0; border-radius: 20px;
  padding: 9px 16px; font-size: 14px; font-weight: 700; cursor: pointer;
}
.btn-report:hover { background: var(--primary-d); }

/* 탭 */
.tabs { display: flex; gap: 6px; padding: 10px 18px; background: #fff;
  border-bottom: 1px solid var(--line); overflow-x: auto; }
.tab {
  border: 1px solid var(--line); background: #fff; border-radius: 18px;
  padding: 7px 14px; font-size: 14px; cursor: pointer; white-space: nowrap;
}
.tab.active { background: var(--ink); color: #fff; border-color: var(--ink); }

/* 레이아웃 */
.layout { flex: 1; display: grid; grid-template-columns: 300px 1fr 280px;
  gap: 12px; padding: 12px; min-height: 0; }
.side { display: flex; flex-direction: column; gap: 12px; overflow-y: auto; }
.panel { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 14px; }
.panel-title { font-size: 15px; margin: 0 0 10px; }
.panel-title small { color: var(--muted); font-weight: 400; font-size: 12px; }

/* 지도 */
.map-wrap { border-radius: 12px; overflow: hidden; border: 1px solid var(--line); min-height: 420px; }
#map { width: 100%; height: 100%; min-height: 420px; }

/* 랭킹 */
.rank-list { list-style: none; margin: 0; padding: 0; }
.rank-item { display: flex; gap: 10px; padding: 9px 4px; border-bottom: 1px solid var(--line);
  cursor: pointer; align-items: center; }
.rank-item:hover { background: #fafafa; }
.rank-num { font-weight: 800; color: var(--primary); width: 22px; text-align: center; }
.rank-body { flex: 1; min-width: 0; }
.rank-name { font-weight: 700; font-size: 14px; }
.rank-meta { font-size: 12px; color: var(--muted); }
.rank-score { font-size: 13px; color: #f5a623; white-space: nowrap; }

/* 쿠팡 */
.coupang-list { display: flex; flex-direction: column; gap: 8px; }
.coupang-card { display: flex; gap: 10px; padding: 8px; border: 1px solid var(--line);
  border-radius: 10px; text-decoration: none; align-items: center; }
.coupang-card:hover { border-color: var(--primary); }
.coupang-card .thumb { width: 46px; height: 46px; border-radius: 8px; background: #f0f0f0;
  display: flex; align-items: center; justify-content: center; font-size: 22px; }
.coupang-card .c-name { font-size: 13px; font-weight: 600; }
.coupang-card .c-price { font-size: 13px; color: var(--primary); font-weight: 700; }
.coupang-note { font-size: 11px; color: var(--muted); margin: 10px 0 0; line-height: 1.4; }

/* 광고 자리 */
.ad-placeholder {
  border: 2px dashed #cfd4da; border-radius: 10px; color: #9aa0a6;
  text-align: center; padding: 24px 10px; font-size: 13px; background: #fbfbfc;
}
.ad-placeholder.wide { padding: 16px; }
.ad-bottom { padding: 0 12px 12px; }

/* 최근 제보 */
.recent-list { list-style: none; margin: 0; padding: 0; }
.recent-list li { padding: 7px 0; border-bottom: 1px solid var(--line); font-size: 13px; }
.recent-list .tag { font-size: 11px; color: var(--primary); }

/* 푸터 */
.footer { background: #fff; border-top: 1px solid var(--line); padding: 16px 18px; text-align: center; }
.footer-links { font-size: 13px; margin-bottom: 6px; }
.footer-links a { text-decoration: none; color: #555; }
.footer-links a:hover { color: var(--primary); }
.disclosure { font-size: 12px; color: var(--muted); margin: 6px 0; }
.copy { font-size: 12px; color: #aaa; margin: 4px 0 0; }

/* 모달 */
.modal-back { position: fixed; inset: 0; background: rgba(0,0,0,.45);
  display: flex; align-items: center; justify-content: center; z-index: 9999; }
.modal-back[hidden] { display: none; }   /* 닫혀 있을 땐 숨김 */
.modal { background: #fff; border-radius: 14px; padding: 22px; width: 380px; max-width: 92vw;
  max-height: 90vh; overflow-y: auto; }
.modal h3 { margin: 0 0 6px; }
.modal-help { font-size: 13px; color: var(--muted); margin: 0 0 14px; }
.modal label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 10px; }
.modal input, .modal select { width: 100%; margin-top: 4px; padding: 9px 10px;
  border: 1px solid var(--line); border-radius: 8px; font-size: 14px; font-weight: 400; }
.pin-info { font-size: 13px; background: #fff6f4; padding: 8px 10px; border-radius: 8px; }
.modal-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 8px; }
.btn-primary { background: var(--primary); color: #fff; border: 0; border-radius: 8px;
  padding: 9px 16px; font-weight: 700; cursor: pointer; }
.btn-ghost { background: #f1f1f1; border: 0; border-radius: 8px; padding: 9px 16px; cursor: pointer; }

/* 반응형: 좁은 화면에선 세로로 */
@media (max-width: 960px) {
  .layout { grid-template-columns: 1fr; }
  .map-wrap { order: -1; height: 50vh; }
  .search { width: 160px; }
}

/* 정적 문서 페이지(약관 등) */
.doc { max-width: 760px; margin: 0 auto; background: #fff; padding: 40px;
  border-radius: 12px; line-height: 1.7; }
.doc h1 { color: var(--primary); }
.doc h2 { margin-top: 28px; }
.doc a { color: var(--primary); }
.doc-wrap { padding: 24px 16px; }
