/* 집챙이 (Zipchangi) Style - Matching Olchangi Suite Common UI/UX */
.snapshot-panel[hidden], .snapshot-panel [hidden], #target-refresh-snapshot[hidden] { display: none !important; }
.snapshot-panel { padding: 24px; margin-bottom: 24px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); scroll-margin-top: 80px; }
.snapshot-heading-row, .snapshot-input-row, .snapshot-actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.snapshot-heading-row { justify-content: space-between; }
.snapshot-heading-row h2 { margin: 0; font-size: 20px; }
.snapshot-panel p { max-width: 72ch; overflow-wrap: anywhere; }
.snapshot-panel label { display: block; font-weight: 600; margin: 16px 0 8px; }
.snapshot-input-row input { flex: 1; min-width: 200px; }
.snapshot-panel input, .snapshot-panel select { box-sizing: border-box; max-width: 100%; padding: 10px 12px; color: var(--ink); background: var(--canvas); border: 1px solid var(--line-strong); border-radius: 6px; font: inherit; }
.snapshot-panel select { width: 100%; }
.snapshot-panel input[type=file] { width: 100%; }
.snapshot-panel a { color: var(--brand); text-decoration: underline; text-underline-offset: 3px; }
.snapshot-note, .snapshot-setup { font-size: 13px; color: var(--ink-soft); }
.snapshot-setup { border-top: 1px solid var(--line); padding-top: 12px; }
.snapshot-setup summary { cursor: pointer; color: var(--ink); }
.snapshot-setup li { margin: 8px 0; }
.snapshot-prices { margin: 16px 0; }
.snapshot-prices > div { display: grid; grid-template-columns: 100px 1fr; padding: 10px 0; border-bottom: 1px solid var(--line); }
.snapshot-prices dt { color: var(--ink-soft); }
.snapshot-prices dd { margin: 0; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.snapshot-entry { margin: 0 0 20px; }
#snapshot-status { min-height: 1.5em; font-weight: 600; }
#snapshot-status.is-error { color: var(--danger); }
.snapshot-panel :focus-visible { outline: 2px solid var(--brand); outline-offset: 3px; }
.snapshot-panel button:disabled { opacity: .6; cursor: wait; }
.watch-source-note { margin: 12px 0 0; font-size: 12px; color: var(--ink-soft); }
@media (max-width: 600px) {
  .snapshot-panel { padding: 16px; }
  .snapshot-input-row > * { width: 100%; }
  .snapshot-prices > div { grid-template-columns: 1fr; gap: 6px; }
  .snapshot-actions .btn { flex: 1 1 160px; }
  .topbar-right { flex-wrap: wrap; }
}
:root {
  --sidebar-w: var(--sidebar-w, 224px);
}

body[data-agent="zipchangi"] {
  margin: 0;
  padding: 0;
  background-color: var(--canvas, #f7f9fb);
  color: var(--ink, #1f2937);
  font-family: var(--font-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif);
  line-height: 1.5;
}

#app-layout {
  display: flex;
  min-height: calc(100dvh - var(--shell-h, 56px));
}

/* ─── LNB 좌측 사이드바 ────────────────────────── */
.sidebar {
  width: var(--sidebar-w);
  position: fixed;
  left: 0;
  top: var(--shell-h, 56px);
  bottom: 0;
  height: calc(100dvh - var(--shell-h, 56px));
  background: var(--surface-subtle, #ffffff);
  border-right: 1px solid var(--line, #e5e7eb);
  display: flex;
  flex-direction: column;
  z-index: 100;
  box-sizing: border-box;
}

.sidebar-header {
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid var(--line, #e5e7eb);
  min-height: 64px;
  box-sizing: border-box;
}

.sidebar-logo {
  color: var(--brand, #10b981);
  display: flex;
  align-items: center;
  justify-content: center;
}

.sidebar-title-wrap {
  display: flex;
  flex-direction: column;
}

.sidebar-app-name {
  font-size: 17px;
  font-weight: 700;
  color: var(--ink, #111827);
  line-height: 1.2;
}

.sidebar-tagline {
  font-size: 11px;
  color: var(--ink-muted, #6b7280);
  line-height: 1.2;
}

.sidebar-nav {
  flex: 1;
  padding: 12px 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  overflow-y: auto;
}

.sidebar-nav::-webkit-scrollbar {
  width: 4px;
}
.sidebar-nav::-webkit-scrollbar-thumb {
  background: var(--line, #303d50);
  border-radius: 4px;
}

.nav-section {
  padding: 14px 12px 6px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-muted, #9baac0);
  user-select: none;
}
.nav-section:first-child {
  padding-top: 4px;
}

.nav-item {
  width: 100%;
  min-height: 40px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 8px;
  color: var(--ink-soft, #4b5563);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  text-align: left;
  transition: background 0.16s, color 0.16s, border-color 0.16s;
  box-sizing: border-box;
}

.nav-item:hover {
  background: var(--surface-hover, rgba(0,0,0,0.04));
  color: var(--ink, #111827);
}

.nav-item.active {
  background: var(--accent-soft, rgba(16, 185, 129, 0.12));
  color: var(--brand, #10b981);
  border-color: rgba(140, 192, 208, 0.25);
  font-weight: 600;
}

.nav-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  flex-shrink: 0;
}

.sidebar-footer {
  margin-top: auto;
  min-height: 70px;
  padding: 14px 16px;
  border-top: 1px solid var(--line, #e5e7eb);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  box-sizing: border-box;
}

.user-info {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
}

.user-avatar {
  font-size: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

#user-name {
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-soft, #111827);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.logout-btn {
  background: transparent;
  border: 1px solid var(--line, #e5e7eb);
  color: var(--ink-muted, #6b7280);
  border-radius: 8px;
  padding: 6px 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: all 0.16s ease;
}

.logout-btn:hover {
  background: var(--surface-hover, rgba(0,0,0,0.06));
  color: var(--ink, #111827);
}

.sidebar-footer #cache-info {
  flex: 0 0 100% !important;
  width: 100% !important;
  min-width: 0 !important;
  margin: 6px 0 0 !important;
  font-size: 11px !important;
  line-height: 1.4 !important;
  color: var(--ink-muted, #6b7280) !important;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ─── 우측 메인 영역 ──────────────────────────── */
.main-content {
  flex: 1;
  margin-left: var(--sidebar-w);
  width: calc(100% - var(--sidebar-w));
  min-height: calc(100dvh - var(--shell-h, 56px));
  box-sizing: border-box;
  background: var(--canvas, #f7f9fb);
}

.topbar {
  min-height: 76px;
  padding: 16px 32px;
  background: var(--surface, #ffffff);
  border-bottom: 1px solid var(--line, #e5e7eb);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  box-sizing: border-box;
}

.page-title {
  margin: 0;
  font-size: 22px;
  font-weight: 750;
  color: var(--ink, #111827);
  letter-spacing: -0.5px;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.content-body {
  padding: 28px 32px 60px;
  max-width: 1200px;
  margin: 0 auto;
  box-sizing: border-box;
}

/* 요약 카드 그리드 */
.summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
  margin-bottom: 28px;
}

.summary-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg, 12px);
  padding: 22px 24px;
  box-shadow: none;
  transition: border-color 0.16s ease;
}

.summary-card:hover {
  border-color: var(--line-strong);
}

.summary-card.highlight-green { border-left: 3.5px solid var(--success); }
.summary-card.highlight-red { border-left: 3.5px solid var(--danger); }
.summary-card.highlight-blue { border-left: 3.5px solid var(--brand); }

.summary-card.highlight-green .card-value { color: var(--success); }
.summary-card.highlight-red .card-value { color: var(--danger); }
.summary-card.highlight-blue .card-value { color: var(--brand); }

.card-label {
  font-size: 13px;
  color: var(--ink-muted);
  font-weight: 550;
  margin-bottom: 8px;
}

.card-value {
  font-size: 26px;
  font-weight: 750;
  color: var(--ink);
  letter-spacing: -0.6px;
}

.card-sub {
  font-size: 12.5px;
  color: var(--ink-muted);
  margin-top: 6px;
}

.section-title-wrap {
  margin-bottom: 16px;
}

.section-title-wrap h2 {
  font-size: 18px;
  font-weight: 700;
  margin: 0 0 4px;
  color: var(--ink);
}

.section-title-wrap .hint {
  font-size: 13px;
  color: var(--ink-muted);
}

/* 그리드 & 카드 */
.property-grid, .maintenance-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 16px;
}

.prop-card, .maint-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg, 12px);
  padding: 22px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: none;
  transition: border-color 0.16s ease;
}

.prop-card:hover, .maint-card:hover {
  border-color: var(--line-strong);
}

.prop-title {
  font-size: 17px;
  font-weight: 700;
  margin-bottom: 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--ink);
}

.prop-detail-row {
  display: flex;
  justify-content: space-between;
  font-size: 13.5px;
  margin-bottom: 7px;
}

.prop-detail-row .label { color: var(--ink-muted); }
.prop-detail-row .value { font-weight: 600; color: var(--ink); }

.loan-progress-container {
  margin-top: 10px;
  background: var(--surface-hover);
  border-radius: 4px;
  height: 6px;
  overflow: hidden;
}

.loan-progress-bar {
  background: var(--success);
  height: 100%;
  border-radius: 4px;
  transition: width 0.3s ease;
}

.card-actions {
  margin-top: 16px;
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

/* 버튼 */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 42px;
  padding: 9px 16px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.16s ease;
  box-sizing: border-box;
}

.btn-primary {
  background: var(--brand);
  color: var(--on-accent, #ffffff);
  border-color: var(--brand);
}
.btn-primary:hover { filter: brightness(0.92); }

.btn-secondary {
  background: var(--surface);
  border: 1px solid var(--line-strong);
  color: var(--ink-soft);
}
.btn-secondary:hover { background: var(--surface-subtle); color: var(--ink); }

.btn-ghost {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--ink-soft);
}
.btn-ghost:hover { background: var(--surface-subtle); color: var(--ink); }

.btn-danger {
  background: rgba(176, 57, 57, 0.08);
  border: 1px solid rgba(176, 57, 57, 0.25);
  color: var(--danger);
}
.btn-danger:hover { background: rgba(176, 57, 57, 0.16); }

.empty-state {
  grid-column: 1 / -1;
  text-align: center;
  padding: 48px 24px;
  background: var(--surface);
  border: 1px dashed var(--line);
  border-radius: 12px;
  color: var(--ink-muted);
}

/* 모달 */
.modal-overlay {
  position: fixed;
  inset: 0;
  box-sizing: border-box;
  padding: 16px;
  background: rgba(0,0,0,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 500;
  backdrop-filter: blur(4px);
}
.modal-overlay.hidden { display: none; }

.modal-card {
  background: var(--surface, #ffffff);
  border: 1px solid var(--line, #e5e7eb);
  border-radius: 14px;
  padding: 24px;
  box-sizing: border-box;
  width: 100%;
  max-width: 480px;
  max-height: calc(100vh - 32px);
  max-height: calc(100dvh - 32px);
  overflow-y: auto;
  overscroll-behavior: contain;
  box-shadow: 0 10px 30px rgba(0,0,0,0.15);
}

.modal-card h3 {
  margin: 0 0 16px;
  color: var(--ink, #111827);
  font-size: 18px;
}

.form-group {
  margin-bottom: 12px;
}
.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 4px;
  color: var(--ink-soft, #4b5563);
}
.form-group input, .form-group select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--line, #e5e7eb);
  border-radius: 8px;
  font-size: 14px;
  box-sizing: border-box;
  background: var(--surface, #ffffff);
  color: var(--ink, #111827);
}

.form-row {
  display: flex;
  gap: 10px;
}
.form-row .form-group { flex: 1; }

#target-quick-select,
#target-modal .form-row .form-group { min-width: 0; }
#target-form-memo { box-sizing: border-box; }

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 18px;
}

/* 모바일 반응형 */
@media (max-width: 860px) {
  .sidebar {
    transform: translateX(-100%);
    width: 272px !important;
  }
  .sidebar.open, .sidebar.active {
    transform: translateX(0);
  }
  .sidebar-close-btn {
    display: inline-flex !important;
  }
  .main-content {
    margin-left: 0;
    width: 100%;
  }
  .topbar {
    padding: 12px 16px;
    gap: 12px;
  }
  .topbar-left {
    display: flex;
    align-items: center;
    gap: 12px;
  }
  .topbar-left .sidebar-toggle-btn {
    display: inline-flex !important;
  }
  .content-body {
    padding: 20px 16px 50px;
  }
}

@media (max-width: 560px) {
  .modal-overlay { padding: 8px; }
  .modal-card {
    padding: 16px;
    max-height: calc(100vh - 16px);
    max-height: calc(100dvh - 16px);
  }
  #target-modal .form-row { flex-direction: column; gap: 0; }
  #target-modal #target-open-map-btn { white-space: normal !important; }
}

/* ─── 다음 목표집 (Target House) ─────────────────── */
.target-house-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg, 12px);
  padding: 28px;
  box-shadow: none;
}

.target-header {
  margin-bottom: 24px;
}

.target-badge {
  display: inline-block;
  background: var(--accent-soft);
  color: var(--brand);
  font-size: 12px;
  font-weight: 650;
  padding: 3px 10px;
  border-radius: 6px;
  margin-bottom: 12px;
}

.target-header h2 {
  font-size: 24px;
  font-weight: 750;
  color: var(--ink);
  margin: 0 0 6px;
  letter-spacing: -0.5px;
}

.target-loc {
  font-size: 13.5px;
  color: var(--ink-muted);
  margin: 0;
}

.target-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 28px;
}

.target-details-grid { margin-bottom: 16px; }

.target-funding-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

@media (max-width: 1100px) {
  .target-funding-grid { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 680px) {
  .target-grid { grid-template-columns: minmax(0, 1fr); }
}

.target-stat-box {
  background: var(--surface-subtle);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.target-stat-box .label {
  font-size: 12px;
  color: var(--ink-muted);
  font-weight: 550;
  line-height: 1.45;
  word-break: keep-all;
  overflow-wrap: break-word;
}

.target-stat-box .value {
  min-width: 0;
  font-size: clamp(16px, 1.4vw, 20px);
  font-weight: 750;
  color: var(--ink);
  line-height: 1.45;
  word-break: keep-all;
  overflow-wrap: break-word;
}

.target-stat-box .value.highlight-blue { color: var(--brand); }
.target-stat-box .value.highlight-green { color: var(--success); }
.target-stat-box .value.highlight-red { color: var(--danger); }

.target-gap-note {
  color: var(--ink-soft);
  font-size: 13px;
  line-height: 1.45;
}

.target-plan-box {
  background: var(--surface-subtle);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 20px;
}

.target-plan-box h3 {
  font-size: 15px;
  font-weight: 700;
  margin: 0 0 12px;
  color: var(--ink);
}

.plan-list {
  margin: 0 0 20px;
  padding-left: 18px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 13.5px;
  color: var(--ink-soft);
  line-height: 1.6;
}

.target-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.btn-naver {
  background: var(--accent-soft) !important;
  color: var(--brand) !important;
  border: 1px solid var(--line-strong) !important;
  text-decoration: none;
  font-weight: 600 !important;
}
.btn-naver:hover {
  background: var(--surface-hover) !important;
  color: var(--ink) !important;
}

/* ─── 관심 단지 (Watchlist) ──────────────────────── */
.watchlist-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 360px), 1fr));
  gap: 16px;
}

.watch-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg, 12px);
  padding: 20px 22px;
  display: flex;
  flex-direction: column;
  min-width: 0;
  gap: 24px;
  box-shadow: none;
  transition: border-color 0.16s ease;
}

.watch-card:hover {
  border-color: var(--line-strong);
}

.watch-badge {
  display: inline-block;
  align-self: flex-start;
  font-size: 11.5px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 4px;
  background: var(--accent-soft);
  color: var(--brand);
  margin-bottom: 10px;
}

.watch-badge.target {
  background: rgba(176, 57, 57, 0.08);
  color: var(--danger);
  border: 1px solid rgba(176, 57, 57, 0.2);
}

.watch-title {
  font-size: 17px;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 4px;
}

.watch-loc {
  font-size: 12.5px;
  color: var(--ink-muted);
  margin-bottom: 14px;
  word-break: keep-all;
  overflow-wrap: anywhere;
}

.watch-info-row {
  display: grid;
  grid-template-columns: 5.5em minmax(0, 1fr);
  align-items: baseline;
  gap: 12px;
  font-size: 13.5px;
  margin-bottom: 7px;
}

.watch-info-row .label { color: var(--ink-muted); white-space: nowrap; }
.watch-info-row .value { min-width: 0; text-align: right; font-weight: 650; color: var(--ink); word-break: keep-all; overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
.watch-size-main, .watch-trade-value { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 4px 8px; }
.watch-value-part { white-space: nowrap; }
.watch-size-detail { display: flex; flex-direction: column; margin-top: 4px; color: var(--ink-soft); font-size: 12.5px; font-weight: 400; }

.watch-memo {
  background: var(--surface-subtle);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 10px 12px;
  font-size: 12.5px;
  color: var(--ink-soft);
  margin: 10px 0 16px;
}

.watch-actions {
  display: grid;
  margin-top: auto;
  gap: 8px;
}
.watch-actions-main { display: grid; grid-template-columns: 1fr 1fr 1.25fr; gap: 8px; }
.watch-actions-bottom { display: flex; gap: 8px; }
body[data-agent="zipchangi"] .watch-card .watch-actions .btn {
  min-width: 0;
  min-height: 44px;
  padding: 10px 8px;
  font-size: 14px;
  line-height: 1.5;
  font-weight: 500;
  white-space: nowrap;
  background: var(--surface);
  color: var(--ink-soft);
  border: 1px solid var(--line-strong);
}
body[data-agent="zipchangi"] .watch-card .watch-actions .btn:hover { background: var(--surface-hover); color: var(--ink); filter: none; }
body[data-agent="zipchangi"] .watch-card .watch-actions .watch-refresh { flex: 1; background: var(--brand); color: var(--on-accent); border-color: var(--brand); font-weight: 600; }
body[data-agent="zipchangi"] .watch-card .watch-actions .watch-refresh:hover { filter: brightness(.92); }
body[data-agent="zipchangi"] .watch-card .watch-actions .watch-delete { margin-left: auto; min-width: 56px; color: var(--danger); }
@media (max-width: 600px) { .watch-card { padding: 20px 16px; } }

/* ─── 부동산 MAP (네이버 부동산 스타일 2단 뷰) ───────────────── */
.naver-map-header {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg, 12px);
  padding: 16px 20px;
  margin-bottom: 14px;
}

.map-search-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.map-search-input-wrap {
  position: relative;
  flex: 1;
  min-width: 280px;
}

.map-search-input-wrap .search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--ink-muted);
  width: 18px;
  height: 18px;
  pointer-events: none;
}

#map-search-input {
  width: 100%;
  padding-left: 38px !important;
  padding-right: 32px !important;
  min-height: 42px !important;
  border-radius: 8px !important;
  font-size: 14px !important;
}

.search-clear-btn {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: none;
  color: var(--ink-muted);
  font-size: 14px;
  cursor: pointer;
  padding: 4px;
}

.map-layer-toggles {
  display: flex;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  overflow: hidden;
}

.layer-toggle-btn {
  background: var(--surface);
  color: var(--ink-soft);
  border: none;
  padding: 9px 14px;
  font-size: 12.5px;
  font-weight: 550;
  cursor: pointer;
  transition: all 0.15s ease;
}

.layer-toggle-btn.active {
  background: var(--brand);
  color: var(--on-accent, #ffffff);
  font-weight: 650;
}

.map-naver-direct-btn {
  font-size: 12.5px !important;
  min-height: 40px !important;
  padding: 8px 14px !important;
}

.btn-naver-api-setting {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px !important;
  min-height: 40px !important;
  padding: 8px 12px !important;
  background: var(--surface) !important;
  color: var(--ink-soft) !important;
  border: 1px solid var(--line-strong) !important;
}

.btn-naver-api-setting.connected {
  border-color: var(--brand) !important;
  color: var(--brand) !important;
  background: var(--accent-soft) !important;
  font-weight: 600;
}

.naver-api-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: var(--accent-soft);
  border: 1px solid var(--brand);
  border-radius: 8px;
  padding: 10px 14px;
  margin-top: 12px;
  font-size: 12.5px;
  color: var(--ink);
}

.naver-api-banner.hidden {
  display: none !important;
}

.naver-api-banner .banner-icon {
  font-size: 18px;
  flex-shrink: 0;
}

.naver-api-banner .banner-content {
  flex: 1;
  line-height: 1.4;
}

.btn-naver-sm {
  background: #03c75a;
  color: #ffffff;
  border: none;
  border-radius: 6px;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: opacity 0.15s ease;
  flex-shrink: 0;
}

.btn-naver-sm:hover {
  opacity: 0.9;
}

.map-filter-bar {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.filter-group {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.filter-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-muted);
  margin-right: 2px;
}

.filter-chip, .region-chip {
  padding: 5px 11px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 500;
  border: 1px solid var(--line);
  background: var(--surface-subtle);
  color: var(--ink-soft);
  cursor: pointer;
  transition: all 0.15s ease;
}

.filter-chip:hover, .region-chip:hover {
  background: var(--surface-hover);
  color: var(--ink);
}

.filter-chip.active, .region-chip.active {
  background: var(--accent-soft);
  color: var(--brand);
  border-color: var(--brand);
  font-weight: 650;
}

.map-pick-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  padding-top: 10px;
  border-top: 1px solid var(--line);
  color: var(--ink-muted);
  font-size: 12px;
}
.map-pick-toolbar .btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

/* 2단 분할 레이아웃 */
.naver-map-layout {
  display: flex;
  height: 700px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg, 12px);
  overflow: hidden;
  background: var(--surface);
  position: relative;
}

/* 좌측 단지 상세 & 매물 드로어 */
.naver-complex-drawer {
  width: 390px;
  flex-shrink: 0;
  border-right: 1px solid var(--line);
  background: var(--surface);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  z-index: 10;
}

.drawer-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--line);
}
.drawer-header h3 {
  margin: 0 0 4px;
  font-size: 15px;
  font-weight: 700;
  color: var(--ink);
}
.drawer-header .hint {
  display: block;
  font-size: 12px;
  color: var(--ink-muted);
}

.complex-mini-list {
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.complex-mini-card {
  display: flex;
  flex-direction: column;
  gap: 4px;
  width: 100%;
  text-align: left;
  font: inherit;
  overflow-wrap: anywhere;
  padding: 14px;
  background: var(--surface-subtle);
  border: 1px solid var(--line);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.15s ease;
}
.complex-mini-card:hover {
  border-color: var(--brand);
  background: var(--surface);
  transform: translateY(-1px);
}
.complex-mini-card.selected {
  border-color: var(--brand);
  background: var(--accent-soft);
}
.complex-mini-card.is-target {
  border-color: var(--danger);
}
.mini-title-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 4px;
}
.mini-name {
  font-size: 14.5px;
  font-weight: 700;
  color: var(--ink);
}
.mini-price {
  font-size: 14px;
  font-weight: 750;
  color: var(--brand);
}
.complex-mini-card.is-target .mini-price {
  color: var(--danger);
}
.mini-meta {
  font-size: 12px;
  color: var(--ink-muted);
}

.mini-source, .drawer-source-note {
  font-size: 12px;
  line-height: 1.6;
  color: var(--ink-soft);
}
.complex-list-empty {
  padding: 20px 12px;
  color: var(--ink);
}
.complex-list-empty p { margin: 0 0 12px; }
.complex-mini-card:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}

/* 단지 상세 뷰 */
.drawer-detail-header {
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--surface-subtle);
}
.btn-drawer-back {
  background: transparent;
  border: none;
  font-size: 13px;
  font-weight: 600;
  color: var(--brand);
  cursor: pointer;
}
.drawer-target-tag {
  font-size: 11px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 4px;
  background: rgba(176, 57, 57, 0.1);
  color: var(--danger);
  border: 1px solid rgba(176, 57, 57, 0.25);
}

.complex-main-info {
  padding: 18px 20px 14px;
  border-bottom: 1px solid var(--line);
}
.complex-main-info h2 {
  font-size: 20px;
  font-weight: 750;
  color: var(--ink);
  margin: 0 0 6px;
}
.complex-meta {
  font-size: 12.5px;
  color: var(--ink-muted);
  margin: 0 0 4px;
}
.complex-address {
  font-size: 12px;
  color: var(--ink-soft);
  margin: 0;
}

.drawer-actions-row {
  padding: 12px 20px;
  display: flex;
  gap: 8px;
  border-bottom: 1px solid var(--line);
}
.drawer-actions-row .btn {
  flex: 1;
  font-size: 12.5px;
  min-height: 38px;
  padding: 6px 10px;
}

.drawer-section {
  padding: 16px 20px;
  border-bottom: 1px solid var(--line);
}
.drawer-section h3 {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--ink);
  margin: 0 0 10px;
}

/* 평형별 시세 탭 */
.pyeong-tab-bar {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  margin-bottom: 10px;
  padding-bottom: 4px;
}
.pyeong-tab {
  padding: 5px 10px;
  border-radius: 6px;
  font-size: 11.5px;
  font-weight: 550;
  border: 1px solid var(--line);
  background: var(--surface-subtle);
  color: var(--ink-soft);
  cursor: pointer;
  white-space: nowrap;
}
.pyeong-tab.active {
  background: var(--accent-soft);
  color: var(--brand);
  border-color: var(--brand);
  font-weight: 650;
}

.pyeong-price-card {
  background: var(--surface-subtle);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px 14px;
}
.price-row {
  display: flex;
  justify-content: space-between;
  font-size: 12.5px;
  margin-bottom: 6px;
}
.price-row:last-child { margin-bottom: 0; }
.price-row .label { color: var(--ink-muted); }
.price-row .val { font-weight: 650; color: var(--ink); }

/* 매물 리스트 */
.listing-items-wrap {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.listing-item-card {
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
}
.listing-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 4px;
}
.listing-type {
  font-size: 11px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 4px;
  background: var(--accent-soft);
  color: var(--brand);
}
.listing-price {
  font-size: 13.5px;
  font-weight: 750;
  color: var(--ink);
}
.listing-desc {
  font-size: 12px;
  color: var(--ink-soft);
  margin-bottom: 3px;
}
.listing-agency {
  font-size: 11px;
  color: var(--ink-muted);
}

.infra-info-box {
  background: var(--surface-subtle);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 12.5px;
}
.infra-row {
  margin-bottom: 6px;
  color: var(--ink-soft);
}
.infra-row:last-child { margin-bottom: 0; }
.infra-row b { color: var(--ink); }

.external-links-row {
  display: flex;
  gap: 8px;
}

/* 우측 지도 캔버스 */
.naver-map-canvas-wrap {
  flex: 1;
  height: 100%;
  position: relative;
}

.naver-map-box {
  width: 100%;
  height: 100%;
  z-index: 1;
}
.naver-map-box.map-pick-active { cursor: crosshair; }
.map-pick-status {
  position: absolute;
  z-index: 1000;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 12px;
  max-width: calc(100% - 24px);
  padding: 8px 10px 8px 14px;
  border: 1px solid var(--brand);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 5px 20px rgba(0,0,0,.2);
  font-size: 12px;
}
.map-pick-status.hidden { display: none; }
.map-pick-status .btn { min-height: 30px; padding: 4px 9px; flex-shrink: 0; white-space: nowrap; }
.picked-location-pin {
  display: flex;
  align-items: center;
  flex-direction: column;
  font-size: 24px;
  filter: drop-shadow(0 2px 2px rgba(0,0,0,.35));
  white-space: nowrap;
}
.picked-location-pin span {
  margin-top: -2px;
  padding: 2px 6px;
  border: 1px solid var(--brand);
  border-radius: 5px;
  background: var(--surface);
  color: var(--ink);
  font-size: 10px;
  font-weight: 700;
}

/* 네이버 부동산 스타일 말풍선 마커 */
.naver-pin-marker {
  background: var(--surface);
  color: var(--ink);
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  padding: 4px 8px;
  box-shadow: 0 4px 14px rgba(0,0,0,0.14);
  font-family: var(--font-ui);
  cursor: pointer;
  transition: transform 0.16s ease, box-shadow 0.16s ease;
  white-space: nowrap;
  text-align: center;
}
.naver-pin-marker:hover, .naver-pin-marker.selected {
  transform: translateY(-4px) scale(1.03);
  box-shadow: 0 8px 22px rgba(0,0,0,0.22);
  border-color: var(--brand);
  z-index: 9999 !important;
}
.naver-pin-marker.is-target {
  border-color: var(--danger);
  border-width: 1.5px;
}
.pin-top {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}
.pin-badge {
  font-size: 10px;
  font-weight: 700;
  padding: 1px 4px;
  border-radius: 3px;
  background: var(--accent-soft);
  color: var(--brand);
}
.naver-pin-marker.is-target .pin-badge {
  background: rgba(176, 57, 57, 0.12);
  color: var(--danger);
}
.pin-name {
  font-size: 11.5px;
  font-weight: 700;
  color: var(--ink);
  max-width: 110px;
  overflow: hidden;
  text-overflow: ellipsis;
}
.pin-price {
  font-size: 12px;
  font-weight: 800;
  color: var(--brand);
}
.naver-pin-marker.is-target .pin-price {
  color: var(--danger);
}

@media (max-width: 860px) {
  .naver-map-layout {
    flex-direction: column;
    height: auto;
  }
  .naver-complex-drawer {
    width: 100%;
    max-height: 380px;
    border-right: none;
    border-bottom: 1px solid var(--line);
  }
  .naver-map-canvas-wrap {
    height: 480px;
  }
}


/* 평수 선택 칩 */
.pyeong-chip {
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 500;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink-soft);
  cursor: pointer;
  transition: all 0.15s ease;
}
.pyeong-chip:hover {
  background: var(--surface-hover);
  color: var(--ink);
}
.pyeong-chip.active {
  background: var(--accent-soft);
  color: var(--brand);
  border-color: var(--brand);
  font-weight: 650;
}
.pyeong-chip small {
  display: block;
  margin-top: 3px;
  font-size: 11px;
  font-weight: 500;
  color: var(--ink-muted);
}
.target-size-source-note,
.target-size-empty {
  display: block;
  margin: 0 0 8px;
  font-size: 11px;
  line-height: 1.45;
  color: var(--ink-muted);
}

