/* 홈 화면: 검색, 최근 본 단지, 단지 한 장 요약 */
.home-hero { padding: 8px 0 18px; }
.home-hero h1 { font-size: 22px; margin: 0 0 12px; letter-spacing: -0.01em; }
.home-search { position: relative; }
#home-search {
  font-family: inherit; font-size: 16px; color: var(--ink); width: 100%;
  border: 1.5px solid var(--border); border-radius: 12px; padding: 14px 16px; background: #fff;
}
#home-search:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-tint); }
#home-suggest {
  position: absolute; left: 0; right: 0; top: calc(100% + 6px); z-index: 20;
  background: #fff; border: 1px solid var(--border); border-radius: 12px; box-shadow: 0 8px 24px rgba(15, 23, 42, .12);
  max-height: 60vh; overflow-y: auto;
}
.suggest-item { display: flex; flex-direction: column; gap: 2px; width: 100%; text-align: left; background: none; border: 0; border-bottom: 1px solid var(--border); padding: 12px 16px; cursor: pointer; font-family: inherit; }
.suggest-item:last-child { border-bottom: 0; }
.suggest-item:hover, .suggest-item:focus { background: var(--brand-tint); outline: none; }
.suggest-item b { font-size: 15px; color: var(--ink); }
.suggest-item span { font-size: 12.5px; color: var(--muted); }
.suggest-empty { padding: 14px 16px; font-size: 13px; color: var(--muted); }
#home-recent { margin-top: 12px; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
#home-recent .recent-label { font-size: 12px; color: var(--muted); margin-right: 2px; }
.chip-btn { font-family: inherit; font-size: 13px; font-weight: 600; padding: 6px 12px; border-radius: 999px; background: #fff; color: var(--ink); border: 1px solid var(--border); cursor: pointer; }
.chip-btn:hover { border-color: var(--brand); color: var(--brand); }
.chip-btn.on { background: var(--brand); border-color: var(--brand); color: #fff; }

.shortcuts { margin-top: 26px; }
.shortcuts h2 { font-size: 13px; font-weight: 700; color: var(--muted); margin: 0 0 8px; }
.shortcut-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.shortcut { text-align: left; font-family: inherit; background: var(--card); border: 1px solid var(--border); border-radius: 10px; padding: 12px; cursor: pointer; }
.shortcut:hover { border-color: var(--brand); }
.shortcut b { display: block; font-size: 14px; color: var(--ink); }
.shortcut span { font-size: 12px; color: var(--muted); }

/* 단지 한 장 요약 */
.pf { background: var(--card); border: 1px solid var(--border); border-radius: 14px; padding: 18px; margin-top: 4px; }
.pf-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; }
.pf-head h2 { margin: 0; font-size: 22px; letter-spacing: -0.01em; }
.pf-sub { font-size: 13px; color: var(--muted); margin: 4px 0 0; }
.pf-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.pf-facts { display: flex; flex-wrap: wrap; gap: 6px; margin: 12px 0 4px; }
.pf-fact { font-size: 12.5px; background: #f1f5f9; color: #334155; border-radius: 999px; padding: 4px 10px; }
.pf-areas { display: flex; flex-wrap: wrap; gap: 6px; margin: 14px 0; }
.pf-kpis { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.pf-kpi { background: #f8fafc; border: 1px solid var(--border); border-radius: 12px; padding: 12px; min-width: 0; }
.pf-kpi .k { font-size: 12px; color: var(--muted); }
.pf-kpi .v { font-size: 24px; font-weight: 800; letter-spacing: -0.02em; margin: 2px 0; }
.pf-kpi .s { font-size: 11.5px; color: var(--muted); line-height: 1.4; }
.pf-kpi .v.up { color: #dc2626; }
.pf-kpi .v.down { color: #2563eb; }
.pf-signals { list-style: none; padding: 0; margin: 14px 0 0; display: flex; flex-direction: column; gap: 6px; }
.pf-signal { font-size: 13.5px; line-height: 1.5; padding: 9px 12px; border-radius: 10px; }
.pf-signal.good { background: #f0fdf4; color: #166534; }
.pf-signal.warn { background: #fffbeb; color: #92400e; }
.pf-signal.info { background: #eff6ff; color: #1e40af; }
.pf-sec { margin-top: 18px; }
.pf-sec h3 { font-size: 13px; font-weight: 700; color: var(--muted); margin: 0 0 8px; }
.pf-range { position: relative; height: 22px; margin: 6px 0 2px; background: #f1f5f9; border-radius: 6px; }
.pf-range .bar { position: absolute; top: 5px; height: 12px; border-radius: 6px; }
.pf-range .bar.trade { background: #94a3b8; }
.pf-range .bar.ask { background: #fca5a5; }
.pf-range .dot { position: absolute; top: 2px; width: 4px; height: 18px; background: var(--ink); border-radius: 2px; }
.pf-range-label { display: flex; justify-content: space-between; font-size: 11.5px; color: var(--muted); margin-bottom: 8px; }
.pf-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.pf-table th, .pf-table td { padding: 7px 4px; border-bottom: 1px solid var(--border); text-align: left; }
.pf-table th { font-size: 12px; color: var(--muted); font-weight: 600; }
.pf-table td.num, .pf-table th.num { text-align: right; }
.pf-lease { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.pf-lease .box { border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; font-size: 13px; line-height: 1.6; }
.pf-lease .box b { font-size: 15px; }
.pf-temp { font-size: 13.5px; }
.pf-foot { margin-top: 16px; font-size: 11.5px; color: var(--muted); line-height: 1.5; }
.pf-loading { padding: 22px; color: var(--muted); font-size: 14px; }
.pf-cands { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; }

@media (max-width: 640px) {
  .home-hero h1 { font-size: 20px; }
  .pf { padding: 14px; }
  .pf-kpis { grid-template-columns: 1fr; }
  .pf-kpi { display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; column-gap: 12px; align-items: baseline; }
  .pf-kpi .k { grid-column: 1; }
  .pf-kpi .v { grid-column: 2; grid-row: 1 / span 2; text-align: right; font-size: 26px; align-self: center; }
  .pf-kpi .s { grid-column: 1; }
  .pf-lease { grid-template-columns: 1fr; }
}

/* 내 관할 */
.area-head h1 { font-size: 22px; margin: 0 0 4px; }
.area-add { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 12px 0; }
.area-add select { font-family: inherit; font-size: 14px; border: 1px solid var(--border); border-radius: 10px; padding: 8px 12px; background: #fff; }
#area-msg { font-size: 12.5px; }
.asummary { background: var(--brand-tint); color: var(--ink); border-radius: 10px; padding: 10px 14px; font-size: 14px; margin-bottom: 12px; }
.acard { background: var(--card); border: 1px solid var(--border); border-radius: 14px; padding: 16px; margin-bottom: 12px; }
.ahead { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 10px; }
.aname { font-size: 18px; }
.grade { font-size: 12.5px; font-weight: 700; padding: 3px 10px; border-radius: 999px; }
.g-hot { background: #fee2e2; color: #b91c1c; } .g-warm { background: #ffedd5; color: #c2410c; } .g-mid { background: #f1f5f9; color: #475569; }
.g-cool { background: #dbeafe; color: #1d4ed8; } .g-cold { background: #e0e7ff; color: #3730a3; } .g-na { background: #f1f5f9; color: #94a3b8; }
.astats { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 8px; margin-bottom: 12px; }
.astat { background: #f8fafc; border: 1px solid var(--border); border-radius: 10px; padding: 8px 10px; }
.astat span { display: block; font-size: 11.5px; color: var(--muted); }
.astat b { font-size: 17px; }
.acard .pf-table { margin-bottom: 10px; }
.acard small { color: var(--muted); }
.aactions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.area-add select { width: auto; min-width: 120px; }

/* 조건 찾기 · 비교 */
.finder { background: var(--card); border: 1px solid var(--border); border-radius: 12px; margin-top: 14px; }
.finder > summary { cursor: pointer; padding: 14px 16px; font-weight: 700; font-size: 15px; list-style: none; }
.finder > summary::-webkit-details-marker { display: none; }
.finder > summary span { font-weight: 400; font-size: 12.5px; color: var(--muted); margin-left: 8px; }
.finder-form { display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: end; padding: 0 16px 12px; }
.finder-form label { display: grid; gap: 4px; font-size: 12.5px; color: var(--muted); }
.finder-form select, .finder-form input { font-family: inherit; font-size: 14px; border: 1px solid var(--border); border-radius: 8px; padding: 8px 10px; background: #fff; width: auto; min-width: 90px; }
.finder-form input[type=number] { width: 84px; min-width: 0; }
.finder-form .prange { display: flex; align-items: center; gap: 6px; }
#fd-result { padding: 0 16px 14px; }
.fd-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 4px; }
.fd-head select { font-family: inherit; font-size: 13px; border: 1px solid var(--border); border-radius: 8px; padding: 5px 8px; width: auto; }
.fd-row { display: grid; grid-template-columns: 1fr auto; gap: 6px 12px; padding: 10px 0; border-top: 1px solid var(--border); }
.fd-main { display: flex; flex-direction: column; min-width: 0; }
.fd-main .sub { font-size: 12.5px; color: var(--muted); }
.fd-price { text-align: right; display: flex; flex-direction: column; }
.fd-price b { font-size: 18px; }
.fd-price .sub { font-size: 11.5px; color: var(--muted); }
.fd-gap { font-size: 12px; font-weight: 700; }
.fd-gap.up { color: #dc2626; } .fd-gap.down { color: #2563eb; }
.fd-act { grid-column: 1 / -1; display: flex; gap: 6px; flex-wrap: wrap; }
#compare-tray {
  position: fixed; right: 14px; bottom: 14px; z-index: 60; display: flex; gap: 6px; align-items: center; flex-wrap: wrap;
  background: #fff; border: 1px solid var(--border); border-radius: 14px; padding: 8px 10px; box-shadow: 0 6px 20px rgba(15,23,42,.18); max-width: min(92vw, 520px);
}
#compare-tray[hidden] { display: none; }
#compare-tray .ct-names { font-size: 12.5px; color: var(--muted); max-width: 200px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 640px) { #compare-tray { bottom: 76px; left: 12px; right: 12px; max-width: none; } }

/* 도구 화면: 선택한 도구 바 + 조건 입력을 한 카드로 */
.tool-card { margin-bottom: 20px; }
.tool-card[hidden] { display: none; }
.tool-bar { display: flex; align-items: center; gap: 12px; padding: 12px 14px; background: var(--brand-tint); border: 1px solid var(--border); border-bottom: 0; border-radius: 14px 14px 0 0; }
.tool-back { font-family: inherit; font-size: 13px; font-weight: 600; color: var(--brand); background: #fff; border: 1px solid var(--border); border-radius: 999px; padding: 6px 12px; cursor: pointer; white-space: nowrap; }
.tool-back:hover { border-color: var(--brand); }
.tool-bar-icon { width: 36px; height: 36px; border-radius: 9px; background: var(--brand); color: #fff; display: flex; align-items: center; justify-content: center; flex: none; }
.tool-bar-text { min-width: 0; display: flex; flex-direction: column; }
.tool-bar-text b { font-size: 17px; }
.tool-bar-text span { font-size: 12.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tool-card #panel { border-radius: 0 0 14px 14px; box-shadow: none; }
#panel-section { margin: 0; }
@media (max-width: 640px) {
  .tool-bar { flex-wrap: wrap; }
  .tool-bar-text span { white-space: normal; }
}

/* 표의 행에서 다른 도구로 이동하는 선택 창 */
.action-list { display: grid; gap: 8px; padding: 12px 14px 16px; background: #fff; }
.action-item { display: flex; flex-direction: column; gap: 2px; text-align: left; font-family: inherit; background: #fff; border: 1px solid var(--border); border-radius: 10px; padding: 11px 14px; cursor: pointer; }
.action-item:hover { border-color: var(--brand); background: var(--brand-tint); }
.action-item b { font-size: 14.5px; color: var(--ink); }
.action-item span { font-size: 12.5px; color: var(--muted); }
