/* yoonlab — 색·칸 모양은 arborhome과 같은 계열(2026-11-05 거기서 부동산 화면을 옮겨 옴) */
:root {
  color-scheme: light dark;
  --bg: #f5f6f8; --surface: #fff; --ink: #1b1d21; --muted: #6b7079; --line: #e3e5ea; --hover: #eef0f4; --accent: #2f6fde; --blue: #2f6fde; --danger: #c93b3b; --radius: 10px;
  --safe-t: env(safe-area-inset-top, 0px); --safe-b: env(safe-area-inset-bottom, 0px);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) { --bg: #16181c; --surface: #1f2228; --ink: #eceef2; --muted: #9aa0aa; --line: #30343c; --hover: #272a31; --accent: #6c9ef5; --blue: #6c9ef5; --danger: #ef6b6b; }
}
:root[data-theme="dark"] { --bg: #16181c; --surface: #1f2228; --ink: #eceef2; --muted: #9aa0aa; --line: #30343c; --hover: #272a31; --accent: #6c9ef5; --blue: #6c9ef5; --danger: #ef6b6b; }

*, *::before, *::after { box-sizing: border-box; }
[hidden]:not([popover]) { display: none !important; }
html, body { margin: 0; min-height: 100%; background: var(--bg); color: var(--ink); }
body {
  font: 15px/1.45 -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Pretendard", "Noto Sans KR", "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent;
}
svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; flex: none; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; }

.top {
  display: flex; align-items: center; gap: 16px; height: calc(56px + var(--safe-t));
  padding: var(--safe-t) max(16px, env(safe-area-inset-right)) 0 max(16px, env(safe-area-inset-left));
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 18px; }
.nav { margin-right: auto; display: flex; gap: 2px; }
.nav a { padding: 5px 10px; border-radius: 99px; font-size: 13.5px; color: var(--muted); white-space: nowrap; }
.nav a:hover { background: var(--hover); color: var(--ink); }
.nav a[aria-current="page"] { color: var(--ink); font-weight: 650; background: var(--hover); }
.brand img { width: 26px; height: 26px; border-radius: 7px; }
.icon-btn { display: grid; place-items: center; width: 38px; height: 38px; border: 0; border-radius: 50%; background: none; cursor: pointer; color: var(--muted); }
.icon-btn:hover { background: var(--hover); color: var(--ink); }


/* 칸 공통 — 머리줄 + 안에서만 스크롤되는 몸통 */
.panel { display: flex; flex-direction: column; min-height: 0; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); padding: 6px 6px 8px; }
.panel > header { display: flex; align-items: center; gap: 6px; padding: 4px 4px 4px 10px; min-height: 42px; flex: none; }
.panel h2 { display: flex; align-items: center; gap: 7px; margin: 0; font-size: 14px; font-weight: 650; color: var(--muted); white-space: nowrap; }
.panel h2 svg { width: 16px; height: 16px; }
.panel > header h2 { margin-right: auto; }   /* 제목 왼쪽, 나머지 단추는 오른쪽 */

.panel > header .icon-btn { width: 32px; height: 32px; }
.panel .scroll {
  flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain;
  scrollbar-width: thin; scrollbar-color: color-mix(in srgb, var(--muted) 30%, transparent) transparent;   /* 얇게, 바탕 칸 없이 */
}
.panel .scroll:hover { scrollbar-color: color-mix(in srgb, var(--muted) 60%, transparent) transparent; }

.err { margin: 0; color: var(--danger); font-size: 13px; }

/* 위: 관심 지역 한눈에(카드 열하나) · 아래: 실거래가 자세히 | 청약. PC는 한 화면(칸 안에서 스크롤), 휴대폰은 위아래로 */
.market {
  --fit: calc(100dvh - 56px - var(--safe-t) - 32px - 34px);   /* 머리줄·여백·아래 출처 줄 뺀 높이 */
  display: grid; gap: 16px; padding: 16px max(16px, env(safe-area-inset-right)) calc(16px + var(--safe-b)) max(16px, env(safe-area-inset-left));
  grid-template-columns: minmax(0, 1fr) 380px; grid-template-areas: "over over" "rt subs"; grid-template-rows: auto minmax(0, 1fr);
  height: var(--fit); max-width: 1800px; margin: 0 auto; box-sizing: content-box;
}
.rt-over { grid-area: over; } .market .rt { grid-area: rt; min-height: 0; } .market .subs { grid-area: subs; min-height: 0; }
@media (width < 1280px) { .market { grid-template-columns: minmax(0, 1fr) 320px; } }
@media (width < 900px) {
  .market { display: flex; flex-direction: column; height: auto; gap: 12px; padding-top: 12px; }
  .market .panel { max-height: none; }
  .market .panel .scroll { overflow: visible; }
}

/* 청약 — 줄 = 지역·단지명·지금 단계 / 시·구·세대수 / 단계 칩. 띠는 할 일과 같게(3일 안 옅은 파랑 · 오늘·접수 중 파랑) */
.subs .count { font-weight: 600; font-variant-numeric: tabular-nums; }
.subs .count:not(:empty)::before { content: "· "; }
.subs-areas { display: flex; gap: 4px; padding: 0 8px 6px; flex-wrap: wrap; flex: none; }
.subs-areas .chip { border: 1px solid var(--line); background: none; color: var(--muted); border-radius: 99px; padding: 3px 10px; font: inherit; font-size: 12px; cursor: pointer; font-variant-numeric: tabular-nums; }
.subs-areas .chip[aria-pressed="true"] { color: #fff; background: var(--accent); border-color: var(--accent); }
.subs-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.sub-in { display: grid; gap: 3px; padding: 8px 10px; border-radius: 10px; color: inherit; text-decoration: none; }
a.sub-in:hover { background: var(--hover); }
.sub.r-soon .sub-in { background: color-mix(in srgb, var(--accent) 7%, transparent); box-shadow: inset 3px 0 0 color-mix(in srgb, var(--accent) 55%, transparent); }
.sub.r-today .sub-in { background: color-mix(in srgb, var(--accent) 15%, transparent); box-shadow: inset 3px 0 0 var(--accent); }
.sub .s1 { display: flex; align-items: center; gap: 6px; min-width: 0; }
.sub .nm { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; font-weight: 600; }
.sub .area { flex: none; font-size: 10.5px; font-weight: 700; padding: 1px 5px; border-radius: 5px; color: var(--muted); background: var(--hover); }
.sub .area[data-area="서울"] { color: #d64545; background: color-mix(in srgb, #d64545 12%, transparent); }
.sub .area[data-area="경기"] { color: #23915a; background: color-mix(in srgb, #23915a 12%, transparent); }
.sub .area[data-area="인천"] { color: #1f9ea3; background: color-mix(in srgb, #1f9ea3 12%, transparent); }
.sub .st { flex: none; font-size: 11.5px; font-weight: 650; color: var(--muted); font-variant-numeric: tabular-nums; }
.sub .st.soon { color: var(--accent); }
.sub .st.today { color: #fff; background: var(--accent); padding: 1px 6px; border-radius: 99px; }
.sub .s2 { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sub .steps { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 3px 8px; font-size: 12px; font-variant-numeric: tabular-nums; }
.sub .steps .lb { color: var(--muted); margin-right: 3px; }
.sub .steps .past { opacity: .45; }
.sub .steps .cur { color: var(--accent); font-weight: 700; }
.sub .steps .cur .lb { color: inherit; }
.subs-empty, .subs-foot { margin: 8px 10px 2px; font-size: 12px; color: var(--muted); }
.subs .err { margin: 6px 10px 0; font-size: 12px; }

/* 부동산 실거래가 — 칩(지역·종류) · 요약 칸 셋 · 선 그래프 둘 · 최고가 · 최근 거래. 계열 색: 59 파랑 · 84 주황 · 평당 청록(검사 통과) */
.market { --s59: #2a78d6; --s84: #eb6834; --spy: #1baf7a; --up: #d64545; --down: var(--ink); }   /* 하락은 파랑이면 59타입과 헷갈려서 글자색 + ▼ */
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .market { --s59: #3987e5; --s84: #d95926; --spy: #199e70; --up: #ef6b6b; --down: var(--ink); } }
:root[data-theme="dark"] .market { --s59: #3987e5; --s84: #d95926; --spy: #199e70; --up: #ef6b6b; --down: var(--ink); }
.rt-over .chips { display: flex; gap: 4px; flex-wrap: wrap; }
.rt-over .chip { border: 1px solid var(--line); background: none; color: var(--muted); border-radius: 99px; padding: 3px 12px; font: inherit; font-size: 12.5px; cursor: pointer; }
.rt-over .chip[aria-pressed="true"] { color: #fff; background: var(--accent); border-color: var(--accent); }
.over-note { font-weight: 400; font-size: 12px; margin-left: 4px; }
/* 관심 지역 카드(열하나) — 넓으면 한 줄, 좁으면 칸 폭 150px 넘게 줄바꿈(휴대폰은 가로로 밀어서) */
.over-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; padding: 2px 6px 4px; }
@media (width < 600px) { .over-cards { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; } .over-card { flex: 0 0 62%; scroll-snap-align: start; } }
.over-card { display: grid; gap: 2px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: none; text-align: left; cursor: pointer; min-width: 0; font: inherit; color: inherit; }
.over-card:hover { background: var(--hover); }
.over-card[aria-pressed="true"] { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); background: color-mix(in srgb, var(--accent) 6%, transparent); }
.over-card .nm { font-size: 13px; font-weight: 650; display: flex; justify-content: space-between; gap: 6px; }
.over-card .nm small { font-weight: 400; color: var(--muted); font-size: 11px; }
.over-card .big { font-size: 18px; font-weight: 750; font-variant-numeric: tabular-nums; white-space: nowrap; }
.over-card .big small { font-size: 11px; font-weight: 500; color: var(--muted); margin-right: 4px; }
.over-card .sm { font-size: 11.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-variant-numeric: tabular-nums; }
.over-card .dl { font-weight: 650; } .over-card .dl.up { color: var(--up); } .over-card .dl.down { color: var(--down); }
.rt-spark { display: block; width: 100%; height: 30px; stroke: none; margin-top: 2px; }
.rt-spark path { fill: none; stroke-width: 1.8; stroke-linejoin: round; stroke-linecap: round; }
.rt-spark[data-s="84"] path { stroke: var(--s84); } .rt-spark[data-s="py"] path { stroke: var(--spy); }
#rtBody { display: grid; gap: 6px; padding: 0 8px; min-width: 0; container-type: inline-size; }
.rt-charts, .rt-bests { display: grid; gap: 6px; min-width: 0; }
.rt-charts > div { min-width: 0; }
@container (width >= 620px) {
  .rt-charts { grid-template-columns: 1fr 1fr; gap: 20px; }
  .rt-bests { grid-template-columns: 1fr 1fr; gap: 20px; }
  .rt-list { grid-template-columns: 1fr 1fr; column-gap: 20px; }
  .rt-more { grid-column: 1 / -1; }
}
.rt .scroll { overflow-x: hidden; }
.rt-tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.rt-tile { display: grid; gap: 1px; padding: 7px 8px; border-radius: 10px; background: var(--hover); min-width: 0; }
.rt-tile .lb { font-size: 11px; color: var(--muted); display: flex; align-items: center; gap: 4px; white-space: nowrap; }
.rt-tile.s59 .lb::before, .rt-tile.s84 .lb::before, .rt-tile.py .lb::before { content: ""; width: 8px; height: 3px; border-radius: 2px; background: var(--s59); }
.rt-tile.s84 .lb::before { background: var(--s84); } .rt-tile.py .lb::before { background: var(--spy); }
.rt-tile .v { font-size: 16px; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rt-tile .v.none { font-size: 12px; font-weight: 500; color: var(--muted); padding: 3px 0; }
.rt-tile .sub { font-size: 11px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-variant-numeric: tabular-nums; }
.rt-tile .dl { font-size: 11px; font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-variant-numeric: tabular-nums; }
.rt-tile .dl .vs { font-weight: 400; color: var(--muted); } .rt-tile .dl.up { color: var(--up); } .rt-tile .dl.down { color: var(--down); }
.rt-h { margin: 8px 0 0; font-size: 12px; font-weight: 600; color: var(--muted); }
.rt-chart { display: block; width: 100%; max-width: 100%; height: auto; overflow: visible; touch-action: pan-y; stroke: none; stroke-width: 1; }   /* 전역 svg(아이콘) 선 규칙을 끊음 */
.rt-chart .grid { stroke: var(--line); stroke-width: 1; }
.rt-chart .ax { fill: var(--muted); font-size: 9.5px; font-variant-numeric: tabular-nums; }
.rt-chart .ln { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.rt-chart .pt { stroke: var(--surface); stroke-width: 1.5; }
.rt-chart .mx { fill: none; stroke-width: 1.3; opacity: .55; }
.rt-chart g[data-s="59"] .ln, .rt-chart g[data-s="59"] .mx { stroke: var(--s59); } .rt-chart g[data-s="59"] .pt { fill: var(--s59); }
.rt-chart g[data-s="84"] .ln, .rt-chart g[data-s="84"] .mx { stroke: var(--s84); } .rt-chart g[data-s="84"] .pt { fill: var(--s84); }
.rt-chart g[data-s="py"] .ln { stroke: var(--spy); } .rt-chart g[data-s="py"] .pt { fill: var(--spy); }
.rt-chart .hit { fill: transparent; }
.rt-chart .cross { stroke: var(--muted); stroke-width: 1; stroke-dasharray: 2 2; pointer-events: none; }
.rt-chart .tip { fill: var(--ink); font-size: 9.5px; font-weight: 600; pointer-events: none; paint-order: stroke; stroke: var(--surface); stroke-width: 3px; }
.rt-legend { display: flex; gap: 12px; font-size: 11px; color: var(--muted); }
.rt-legend span { display: inline-flex; align-items: center; gap: 4px; }
.rt-legend span::before { content: ""; width: 10px; height: 3px; border-radius: 2px; background: var(--s59); }
.rt-legend span[data-s="84"]::before { background: var(--s84); }
.rt-best { margin-top: 2px; font-size: 12px; color: var(--muted); display: grid; gap: 1px; min-width: 0; }
.rt-best .b1 { display: flex; gap: 6px; align-items: baseline; } .rt-best b { color: var(--ink); font-size: 13px; font-variant-numeric: tabular-nums; }
.rt-best .b2 { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rt-more { margin: 4px 0 2px; width: 100%; padding: 7px; border: 1px dashed var(--line); border-radius: 8px; background: none; color: var(--muted); font: inherit; font-size: 12px; cursor: pointer; }
.rt-more:hover { background: var(--hover); color: var(--ink); }
.rt-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 1px; }
.rt-row { padding: 6px 4px; border-radius: 8px; display: grid; gap: 1px; }
.rt-row:hover { background: var(--hover); }
.rt-row .r1 { display: flex; align-items: center; gap: 5px; min-width: 0; }
.rt-row .nm { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; font-weight: 550; }
.rt-row .amt { flex: none; font-size: 13px; font-variant-numeric: tabular-nums; }
.rt-row .r2 { font-size: 11.5px; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rt-row .tag { flex: none; font-size: 10px; font-weight: 700; padding: 1px 5px; border-radius: 5px; color: var(--muted); background: var(--hover); }
.rt-row .tag.rec { color: var(--up); background: color-mix(in srgb, var(--up) 12%, transparent); }
.rt-row.cancel .nm, .rt-row.cancel .amt { text-decoration: line-through; opacity: .55; }
.rt-none { font-size: 12px; color: var(--muted); padding: 6px 4px; list-style: none; }

/* 관심 지역 머리줄 — 좁으면 종류 칩을 아랫줄로(칩 글자가 세로로 꺾이던 것) */
.rt-over > header { flex-wrap: wrap; row-gap: 4px; }
.rt-over .chip, .subs-areas .chip { white-space: nowrap; }
@media (width < 600px) { .over-note { display: none; } }

/* 아래 출처 줄 */
.foot { max-width: 1800px; margin: 0 auto; padding: 0 16px calc(12px + var(--safe-b)); font-size: 11.5px; color: var(--muted); }
