/* ============================================================
   지역별 시세 — SnowUI 하이파이 클론
   디자인: 시세페이지 하이파이/모바일.dc.html (9d09d7ce)
   네임스페이스: mp- (공용 컴포넌트 충돌 방지)
   ============================================================ */

:root {
  --mp-blue: #4C98FD;
  --mp-blue-600: #3771C8;
  --mp-ink: #1B1D25;
  --mp-text-2: rgba(27, 29, 37, 0.62);
  --mp-text-mut: rgba(27, 29, 37, 0.4);
  --mp-border: rgba(27, 29, 37, 0.08);
  --mp-fill-150: #EEF1F5;
  --mp-fill-200: #E4EAF0;
  --mp-fill-300: #CBD4DE;
  --mp-subtle: #F7F9FB;
  --mp-white: #fff;
  --mp-shadow-card: 0 2px 12px rgba(27, 29, 37, 0.06), 0 1px 3px rgba(27, 29, 37, 0.05);
  --mp-shadow-xs: 0 1px 3px rgba(27, 29, 37, 0.08);
  --mp-green: #0A9E66;
  --mp-red: #E0492F;
  --mp-font: 'Pretendard', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
}

.mp-stage { background: var(--mp-white); min-height: 60vh; }
.mp-main {
  max-width: 1240px; margin: 0 auto; padding: 36px 40px 80px;
  font-family: var(--mp-font); color: var(--mp-ink); -webkit-font-smoothing: antialiased;
}
.mp-main *, .mp-main *::before, .mp-main *::after { box-sizing: border-box; }
.mp-main button { font-family: inherit; cursor: pointer; }

/* 로딩/빈 상태 */
.mp-loading { display: flex; align-items: center; justify-content: center; padding: 120px 20px; color: var(--mp-text-mut); font-size: 14px; gap: 10px; }
.mp-spin {
  width: 22px; height: 22px; border-radius: 50%;
  border: 3px solid var(--mp-fill-150); border-top-color: var(--mp-blue);
  animation: mpSpin 0.8s linear infinite;
}
@keyframes mpSpin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .mp-spin { animation-duration: 2s; } }
.mp-empty { text-align: center; padding: 80px 20px; color: var(--mp-text-mut); font-size: 14px; }

/* ── 페이지 헤더 ── */
.mp-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 26px; }
.mp-head h1 { margin: 0; font-size: 28px; font-weight: 700; letter-spacing: -0.02em; }
.mp-head p { margin: 8px 0 0; font-size: 15px; color: var(--mp-text-2); }
.mp-head p b { color: var(--mp-ink); font-weight: 600; }
.mp-live {
  display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 12px; flex: none;
  border-radius: 999px; background: rgba(10, 207, 131, 0.12); color: var(--mp-green);
  font-size: 13px; font-weight: 600; white-space: nowrap;
}
.mp-live i { font-size: 14px; }

/* ── 칩 ── */
.mp-chips { margin-bottom: 18px; }
.mp-chips-label { font-size: 12.5px; font-weight: 600; color: var(--mp-text-mut); letter-spacing: 0.02em; margin-bottom: 9px; }
.mp-chip-row { display: flex; flex-wrap: wrap; gap: 8px; }
.mp-chip {
  display: inline-flex; align-items: center; gap: 4px; height: 36px; padding: 0 16px;
  border-radius: 999px; white-space: nowrap; font-size: 14px; font-weight: 600;
  background: var(--mp-white); color: var(--mp-text-2); border: 1px solid var(--mp-border);
  transition: background 0.15s cubic-bezier(0.4, 0, 0.2, 1);
}
.mp-chip:hover { background: var(--mp-subtle); }
.mp-chip.active {
  background: var(--mp-blue); color: #fff; border-color: var(--mp-blue);
  box-shadow: 0 2px 8px rgba(76, 152, 253, 0.28);
}
.mp-chip-count { font-size: 12px; font-weight: 500; color: var(--mp-text-mut); }
.mp-chip.active .mp-chip-count { color: rgba(255, 255, 255, 0.75); }

/* ── 평결 히어로 ── */
.mp-hero { display: grid; grid-template-columns: 1fr 1.1fr; gap: 20px; margin-bottom: 32px; }
.mp-card { background: var(--mp-white); border-radius: 20px; box-shadow: var(--mp-shadow-card); }
.mp-hero-card { padding: 26px 28px; display: flex; flex-direction: column; }
.mp-hero-loc { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--mp-text-2); font-weight: 600; white-space: nowrap; }
.mp-hero-loc i { font-size: 16px; color: var(--mp-blue); }
.mp-hero-loc span { color: var(--mp-text-mut); font-weight: 400; }
.mp-hero-price { display: flex; align-items: flex-end; gap: 10px; margin-top: 14px; }
.mp-hero-price strong { font-size: 52px; font-weight: 700; letter-spacing: -0.03em; line-height: 0.9; }
.mp-hero-price em { font-style: normal; font-size: 19px; font-weight: 600; color: var(--mp-text-2); padding-bottom: 6px; }
.mp-hero-price em i { font-style: normal; font-size: 14px; color: var(--mp-text-mut); font-weight: 400; }
.mp-hero-pill-row { margin-top: 18px; }
.mp-pill {
  display: inline-flex; align-items: center; gap: 7px; height: 34px; padding: 0 15px;
  border-radius: 999px; font-size: 14.5px; font-weight: 600;
}
.mp-pill i { font-size: 15px; }
.mp-pill.up { background: rgba(255, 114, 98, 0.12); color: var(--mp-red); }
.mp-pill.down { background: rgba(10, 207, 131, 0.14); color: var(--mp-green); }
.mp-pill.flat { background: #EDF3FF; color: var(--mp-blue-600); }
.mp-pill.neutral { background: #F2F6FB; color: #707580; }
.mp-hero-spacer { flex: 1; min-height: 8px; }

.mp-range { margin-top: 22px; }
.mp-range-labels { display: flex; justify-content: space-between; font-size: 12.5px; color: var(--mp-text-mut); margin-bottom: 7px; }
.mp-range-labels .mid { color: var(--mp-text-2); font-weight: 600; }
.mp-range-track { position: relative; height: 8px; border-radius: 999px; background: var(--mp-fill-150); }
.mp-range-fill { position: absolute; top: 0; bottom: 0; border-radius: 999px; background: linear-gradient(90deg, #62B3FE, #4C98FD); }
.mp-range-dot {
  position: absolute; top: -4px; width: 16px; height: 16px; border-radius: 50%;
  background: var(--mp-white); border: 3px solid var(--mp-blue);
  box-shadow: var(--mp-shadow-xs); transform: translateX(-50%);
}
.mp-range-cap { text-align: center; font-size: 12px; color: var(--mp-text-mut); margin-top: 8px; }

/* 추이 카드 */
.mp-trend-card { padding: 22px 24px 18px; }
.mp-trend-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 4px; }
.mp-trend-head .tt { font-size: 15px; font-weight: 600; white-space: nowrap; }
.mp-trend-head .sub { font-size: 12.5px; color: var(--mp-text-mut); }
.mp-trend-legend { display: flex; gap: 16px; font-size: 12px; color: var(--mp-text-2); margin-bottom: 6px; }
.mp-trend-legend span { display: inline-flex; align-items: center; gap: 5px; }
.mp-leg-line { width: 14px; height: 3px; border-radius: 2px; background: var(--mp-blue); display: inline-block; }
.mp-leg-dash { width: 14px; height: 0; border-top: 2px dashed var(--mp-fill-300); display: inline-block; }
.mp-trend-card svg { width: 100%; height: auto; display: block; overflow: visible; }

/* ── 랭킹 ── */
.mp-rank-card { overflow: hidden; }
.mp-rank-head {
  padding: 22px 28px 16px; display: flex; align-items: baseline; gap: 12px;
  border-bottom: 1px solid var(--mp-border);
}
.mp-rank-head .tt { font-size: 18px; font-weight: 700; white-space: nowrap; }
.mp-rank-head .sub { font-size: 13px; color: var(--mp-text-mut); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mp-rank-head .spacer { flex: 1; }
.mp-rank-head .sort { font-size: 12.5px; color: var(--mp-text-2); font-weight: 600; display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; }
.mp-rank-head .sort i { font-size: 12px; }

.mp-row-wrap { border-bottom: 1px solid var(--mp-border); }
.mp-row-wrap.sel { background: #FAFCFF; }
.mp-row {
  display: grid; grid-template-columns: 34px 190px 1fr 136px 22px;
  align-items: center; gap: 16px; padding: 15px 28px; cursor: pointer;
  transition: background 0.15s cubic-bezier(0.4, 0, 0.2, 1);
}
.mp-row:hover { background: var(--mp-subtle); }
.mp-row.is-ref { cursor: default; }
.mp-rank {
  width: 26px; height: 26px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  font-size: 12.5px; font-weight: 700; background: var(--mp-fill-150); color: var(--mp-text-2);
}
.mp-rank.top { background: var(--mp-blue); color: #fff; }
.mp-rank.ref { background: var(--mp-fill-150); color: var(--mp-text-mut); }
.mp-row-name .nm { font-size: 15.5px; font-weight: 600; display: flex; align-items: center; gap: 7px; white-space: nowrap; }
.mp-row-name .ct { font-size: 12.5px; color: var(--mp-text-mut); margin-top: 3px; }
.mp-ref-badge {
  font-size: 10.5px; font-weight: 600; color: #946B00; background: rgba(255, 194, 37, 0.18);
  padding: 1px 7px; border-radius: 999px;
}
.mp-bar-track { height: 16px; border-radius: 999px; background: var(--mp-fill-150); position: relative; }
.mp-bar-fill {
  position: absolute; left: 0; top: 0; bottom: 0; border-radius: 999px; background: var(--mp-blue);
  transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}
.mp-bar-fill.sel { background: linear-gradient(90deg, #62B3FE, #4C98FD); }
.mp-bar-fill.ref { background: var(--mp-fill-300); }
.mp-row-price { text-align: right; }
.mp-row-price .pr { font-size: 17px; font-weight: 700; }
.mp-row-price .pr span { font-size: 12px; color: var(--mp-text-mut); font-weight: 500; }
.mp-row-price .rg { font-size: 11.5px; color: var(--mp-text-mut); margin-top: 2px; }
.mp-row > i { font-size: 16px; color: var(--mp-text-mut); justify-self: center; }

/* 확장 패널 */
.mp-exp { overflow: hidden; max-height: 0; opacity: 0; transition: max-height 0.35s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.25s ease; }
.mp-exp.open { max-height: 420px; opacity: 1; }
@media (prefers-reduced-motion: reduce) { .mp-exp, .mp-bar-fill, .mp-chip { transition: none; } }
.mp-exp-in { padding: 4px 28px 24px; }
.mp-exp-grid {
  display: grid; grid-template-columns: 230px 1fr; gap: 20px;
  background: var(--mp-subtle); border-radius: 14px; padding: 18px 20px;
}
.mp-exp-trend { border-right: 1px solid var(--mp-border); padding-right: 20px; }
.mp-exp-trend .lbl { font-size: 12.5px; color: var(--mp-text-2); font-weight: 600; margin-bottom: 6px; }
.mp-exp-trend svg { width: 100%; height: auto; display: block; }
.mp-exp-trend .mt { font-size: 12.5px; color: var(--mp-text-2); margin-top: 8px; }
.mp-trendtag { font-weight: 600; }
.mp-trendtag.up { color: var(--mp-red); }
.mp-trendtag.down { color: var(--mp-green); }
.mp-trendtag.flat { color: #707580; }

.mp-exp-list-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 10px; }
.mp-exp-list-head .lbl { font-size: 12.5px; color: var(--mp-text-2); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mp-exp-list-head .lbl span { color: var(--mp-text-mut); font-weight: 400; }
.mp-exp-list-head a {
  font-size: 13px; font-weight: 600; color: var(--mp-blue); text-decoration: none;
  display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; flex-shrink: 0; margin-left: 12px;
}
.mp-exp-list-head a i { font-size: 12px; }
.mp-match-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.mp-match {
  text-decoration: none; color: inherit; background: var(--mp-white); border-radius: 10px;
  overflow: hidden; box-shadow: var(--mp-shadow-xs); display: block;
  transition: transform 0.15s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.15s cubic-bezier(0.4, 0, 0.2, 1);
}
.mp-match:hover { transform: translateY(-2px); box-shadow: 0 10px 28px rgba(27, 29, 37, 0.1); }
.mp-match-img { height: 70px; position: relative; overflow: hidden; }
.mp-match-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.mp-match-seats {
  position: absolute; left: 7px; top: 7px; font-size: 10.5px; font-weight: 600; color: #fff;
  background: rgba(27, 29, 37, 0.52); backdrop-filter: blur(4px); padding: 2px 7px; border-radius: 999px;
}
.mp-match-body { padding: 8px 9px 10px; }
.mp-match-body .tt { font-size: 12px; font-weight: 600; line-height: 1.3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mp-match-body .pp { font-size: 13px; font-weight: 700; margin-top: 4px; color: var(--mp-blue-600); }
.mp-match-body .pp span { font-size: 10.5px; color: var(--mp-text-mut); font-weight: 500; }
.mp-exp-cta { display: none; }

/* 참고 지역 토글 */
.mp-ref-toggle {
  width: 100%; padding: 14px 28px; text-align: center; cursor: pointer; border: none;
  border-top: 1px solid var(--mp-border); background: transparent;
  font-size: 13.5px; color: var(--mp-text-2); font-weight: 600;
  transition: background 0.15s cubic-bezier(0.4, 0, 0.2, 1);
}
.mp-ref-toggle:hover { background: var(--mp-subtle); }
.mp-ref-toggle i { font-size: 13px; margin-right: 5px; }

/* 면책 */
.mp-disclaimer {
  margin-top: 22px; background: var(--mp-subtle); border-radius: 14px; padding: 16px 20px;
  display: flex; gap: 12px; font-size: 12.5px; line-height: 1.6; color: var(--mp-text-2);
}
.mp-disclaimer i { font-size: 17px; color: var(--mp-text-mut); flex-shrink: 0; margin-top: 1px; }
.mp-disclaimer b { font-weight: 600; color: var(--mp-ink); }

/* ============ 모바일 (≤ 768px) — 시세페이지 모바일.dc.html ============ */
@media (max-width: 768px) {
  .mp-main { padding: 14px 0 40px; }
  .mp-head { padding: 0 20px; margin-bottom: 2px; align-items: center; }
  .mp-head h1 { font-size: 21px; }
  .mp-head p { display: none; }
  .mp-live { height: 28px; padding: 0 11px; font-size: 12px; }
  .mp-sub-m { display: block; padding: 4px 20px 12px; font-size: 13px; color: var(--mp-text-2); }

  .mp-chips { margin-bottom: 14px; }
  .mp-chips-label { display: none; }
  .mp-chip-row {
    flex-wrap: nowrap; overflow-x: auto; padding: 2px 20px;
    scrollbar-width: none; -webkit-overflow-scrolling: touch;
  }
  .mp-chip-row::-webkit-scrollbar { display: none; }
  .mp-chip { height: 34px; padding: 0 14px; font-size: 13.5px; flex: none; }

  /* 히어로: 세로 스택 + subtle 카드 */
  .mp-hero { display: flex; flex-direction: column; gap: 12px; margin: 0 20px 20px; }
  .mp-card { box-shadow: none; background: var(--mp-subtle); border-radius: 16px; }
  .mp-hero-card { padding: 18px 20px; }
  .mp-hero-price strong { font-size: 42px; }
  .mp-hero-price em { font-size: 16px; padding-bottom: 4px; }
  .mp-pill { height: 31px; padding: 0 13px; font-size: 13px; }
  .mp-range { margin-top: 18px; }
  .mp-trend-card { padding: 16px 18px 12px; }

  /* 랭킹: 플랫 리스트 (카드 해제) */
  .mp-rank-card { background: transparent; border-radius: 0; box-shadow: none; }
  .mp-rank-head { padding: 0 20px 6px; border-bottom: none; }
  .mp-rank-head .tt { font-size: 17px; }
  .mp-rank-head .sort { display: none; }
  .mp-row {
    display: grid;
    grid-template-columns: 24px auto auto 1fr auto 14px;
    grid-template-areas: "rank name count . price caret" "bar bar bar bar rg rg";
    gap: 9px 10px; padding: 14px 20px 15px;
  }
  .mp-rank { grid-area: rank; width: 24px; height: 24px; font-size: 11.5px; }
  .mp-row-name { grid-area: name; display: flex; align-items: center; gap: 6px; min-width: 0; }
  .mp-row-name .nm { font-size: 15px; }
  .mp-row-name .ct { display: none; }
  .mp-row-count-m { grid-area: count; font-size: 12px; color: var(--mp-text-mut); white-space: nowrap; align-self: center; }
  .mp-row-price { grid-area: price; display: flex; align-items: baseline; gap: 2px; }
  .mp-row-price .pr { font-size: 16px; }
  .mp-row-price .rg { display: none; }
  .mp-row-range-m { grid-area: rg; font-size: 11px; color: var(--mp-text-mut); white-space: nowrap; text-align: right; align-self: center; }
  .mp-row > i { grid-area: caret; font-size: 14px; align-self: center; }
  .mp-bar-track { grid-area: bar; height: 12px; align-self: center; }
  .mp-exp-in { padding: 0 20px 18px; }
  .mp-exp-grid { display: block; padding: 14px 16px; }
  .mp-exp-trend { border-right: none; padding-right: 0; display: flex; align-items: center; gap: 12px; }
  .mp-exp-trend .lbl { display: none; }
  .mp-exp-trend svg { width: 120px; height: 36px; flex: none; }
  .mp-exp-trend .mt { margin-top: 0; }
  .mp-exp-list { margin-top: 12px; }
  .mp-exp-list-head a { display: none; }
  .mp-match-grid {
    display: flex; gap: 9px; overflow-x: auto;
    scrollbar-width: none; -webkit-overflow-scrolling: touch;
  }
  .mp-match-grid::-webkit-scrollbar { display: none; }
  .mp-match { width: 132px; flex: none; }
  .mp-match-img { height: 64px; }
  .mp-exp-cta {
    display: flex; align-items: center; justify-content: center; gap: 6px; height: 40px; margin-top: 12px;
    border-radius: 10px; background: var(--mp-blue); color: #fff;
    font-size: 13.5px; font-weight: 600; text-decoration: none;
  }
  .mp-exp-cta i { font-size: 13px; }
  .mp-ref-toggle { border-top: none; padding: 15px 20px; }
  .mp-disclaimer { margin: 4px 20px 0; font-size: 11.5px; }
}
@media (min-width: 769px) {
  .mp-sub-m { display: none; }
  .mp-row-count-m { display: none; }
  .mp-row-range-m { display: none; }
}
