:root {
  --bg: #f6f7f9;
  --panel: #ffffff;
  --text: #1f2933;
  --muted: #667085;
  --line: #d9dee7;
  --blue: #2367d1;
  --green: #16805f;
  --red: #c24132;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.app-shell {
  max-width: none;
  min-height: 100vh;
  margin: 0 auto;
  padding: 12px;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: 28px;
  line-height: 1.2;
}

h2 {
  font-size: 17px;
}

.panel-head span,
.status-line {
  color: var(--muted);
  font-size: 13px;
}

.primary-btn,
.toolbar button,
.tabs a,
.tabs button,
.tabs summary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 36px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--text);
  border-radius: 6px;
  padding: 0 12px;
  cursor: pointer;
  font-weight: 600;
  text-decoration: none;
}

.tabs summary {
  list-style: none;
}

.tabs summary::-webkit-details-marker {
  display: none;
}

.tab-more-menu {
  position: relative;
}

.tab-more-menu summary::after {
  content: "";
  width: 6px;
  height: 6px;
  margin-left: 8px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: translateY(-2px) rotate(45deg);
}

.tab-more-menu[open] summary::after {
  transform: translateY(1px) rotate(225deg);
}

.tab-more-list {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  z-index: 40;
  display: grid;
  min-width: 160px;
  gap: 6px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 12px 28px rgb(15 23 42 / 14%);
}

.tab-more-list a {
  width: 100%;
  justify-content: flex-start;
}

.primary-btn {
  background: var(--blue);
  border-color: var(--blue);
  color: #fff;
}

.toolbar {
  display: grid;
  grid-template-columns: minmax(120px, 160px) minmax(120px, 160px) minmax(140px, 170px) minmax(140px, 170px) 1fr;
  gap: 12px;
  align-items: end;
  margin-bottom: 12px;
  padding: 16px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.embedded-toolbar {
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  margin: 0;
}

.formula-toolbar {
  margin: 0;
  border: 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  border-radius: 0;
}

label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

select,
input {
  width: 100%;
  height: 36px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0 10px;
  color: var(--text);
  background: #fff;
}

.quick-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.quick-buttons button.active,
.period-buttons button.active,
.tabs a.active,
.tabs button.active,
.tab-more-menu.active summary {
  border-color: var(--blue);
  background: #e8f0ff;
  color: var(--blue);
}

.period-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.period-buttons button {
  height: 32px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--text);
  cursor: pointer;
  font-size: 12px;
  font-weight: 800;
  padding: 0 10px;
}

.ranking-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  padding: 12px 16px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: #fbfcfe;
}

.segmented-buttons {
  display: inline-flex;
  gap: 4px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
}

.segmented-buttons button {
  height: 30px;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 12px;
  font-weight: 900;
  padding: 0 10px;
}

.segmented-buttons button.active {
  background: #e8f0ff;
  color: var(--blue);
}

.page-size-control {
  display: flex;
  grid-template-columns: none;
  align-items: center;
  gap: 6px;
  margin-left: auto;
}

.page-size-control select {
  width: 92px;
}

.pagination {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
  padding: 12px 16px 16px;
}

.pagination button,
.pagination span {
  min-width: 32px;
  height: 32px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--text);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 800;
  padding: 0 9px;
}

.pagination button {
  cursor: pointer;
}

.pagination button.active {
  border-color: var(--blue);
  background: #e8f0ff;
  color: var(--blue);
}

.pagination button:disabled {
  cursor: not-allowed;
  opacity: 0.42;
}

.pagination span {
  border-color: transparent;
  background: transparent;
  color: var(--muted);
}

.price-band-summary {
  display: grid;
  gap: 10px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  background: #fff;
}

.price-band-row {
  display: grid;
  grid-template-columns: 82px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
}

.price-band-row-label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.price-band-chip-row {
  display: flex;
  gap: 8px;
  min-width: 0;
  overflow-x: auto;
  padding-bottom: 2px;
}

.price-band-chip {
  display: grid;
  min-width: 116px;
  gap: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  cursor: pointer;
  padding: 10px 12px;
  text-align: left;
}

.price-band-chip:hover {
  border-color: #b8c6dc;
  background: #f8fafc;
}

.price-band-chip.active {
  border-color: var(--blue);
  background: #e8f0ff;
  box-shadow: inset 0 0 0 1px rgba(35, 103, 209, 0.18);
}

.price-band-chip strong {
  font-size: 14px;
}

.price-band-chip span,
.price-band-chip em {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
  font-weight: 800;
}

.price-band-chip.active span,
.price-band-chip.active em {
  color: #315ca7;
}

.price-band-empty {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.status-line {
  min-height: 24px;
  margin: 10px 0 16px;
}

.crawl-panel,
.info-panel {
  margin-bottom: 16px;
}

.crawl-body {
  padding: 16px;
}

.collection-summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  padding: 16px;
}

.collection-summary-grid div {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfe;
}

.collection-summary-grid strong {
  display: block;
  overflow: hidden;
  font-size: 20px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.collection-summary-grid span {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.progress-track {
  height: 14px;
  background: #edf1f7;
  border-radius: 999px;
  overflow: hidden;
  border: 1px solid var(--line);
}

.progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--blue), #16805f);
  transition: width 240ms ease;
}

.crawl-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-top: 14px;
}

.formula-grid {
  padding: 0 16px 16px;
}

.crawl-grid div {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfe;
}

.crawl-grid strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 16px;
}

.crawl-grid span,
.crawl-logs {
  color: var(--muted);
  font-size: 12px;
}

.crawl-job-progress {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-top: 12px;
}

.crawl-job-card {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.crawl-job-card-head,
.crawl-job-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.crawl-job-card-head strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 14px;
}

.crawl-job-percent {
  margin-top: 10px;
  font-size: 24px;
  font-weight: 800;
  color: var(--text);
}

.crawl-job-track {
  height: 8px;
  margin-top: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: #edf1f7;
}

.crawl-job-track span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: #2367d1;
}

.crawl-job-meta {
  margin-top: 8px;
  color: var(--muted);
  font-size: 12px;
}

.crawl-job-activity {
  display: grid;
  gap: 4px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
  color: var(--text);
  font-size: 12px;
  line-height: 1.35;
}

.crawl-job-activity span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.crawl-job-current {
  overflow: hidden;
  margin-top: 8px;
  color: var(--muted);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.crawl-job-empty {
  grid-column: 1 / -1;
  padding: 28px 16px;
}

.completion-list {
  display: grid;
  gap: 10px;
}

.completion-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfe;
}

.completion-item strong {
  font-size: 16px;
}

.crawl-logs {
  display: grid;
  gap: 4px;
  max-height: 110px;
  overflow: auto;
  margin-top: 12px;
  padding: 10px;
  background: #101828;
  color: #d0d5dd;
  border-radius: 8px;
}

.info-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--line);
}

.info-grid div {
  background: #fff;
  padding: 16px;
}

.info-grid h3 {
  margin: 0 0 8px;
  font-size: 15px;
}

.info-grid p {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
}

.top-tabs {
  margin-bottom: 12px;
}

.crawl-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: #fbfcfe;
}

.crawl-section-head strong {
  font-size: 14px;
}

.crawl-section-head span {
  color: var(--muted);
  font-size: 12px;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border-radius: 999px;
  padding: 0 8px;
  font-size: 12px;
  font-weight: 800;
}

.status-pill.completed {
  background: #e8f6ef;
  color: var(--green);
}

.status-pill.failed {
  background: #fdeceb;
  color: var(--red);
}

.status-pill.running {
  background: #e8f0ff;
  color: var(--blue);
}

.status-pill.pending {
  background: #f2f4f7;
  color: var(--muted);
}

.error-cell {
  max-width: 280px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.muted-code {
  color: var(--muted);
  font-size: 11px;
}

.growth-map {
  height: 560px;
  min-height: 420px;
  background: #eef2f7;
}

.map-canvas-wrap {
  flex: 1;
  min-height: 0;
  position: relative;
}

.map-apartment-ranking {
  position: absolute;
  top: 14px;
  left: 14px;
  z-index: 610;
  display: grid;
  grid-template-rows: auto;
  width: 330px;
  max-height: calc(100% - 28px);
  overflow: hidden;
  border: 1px solid rgba(16, 24, 40, 0.14);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 18px 42px rgba(16, 24, 40, 0.22);
  backdrop-filter: blur(8px);
}

.map-apartment-ranking.ranking-active {
  bottom: 14px;
  grid-template-rows: auto minmax(0, 1fr);
}

.map-apartment-ranking[hidden] {
  display: none;
}

.map-search-panel {
  display: grid;
  gap: 8px;
  padding: 12px;
}

.map-search-panel label {
  color: #475467;
  font-size: 12px;
  font-weight: 900;
}

.map-search-panel input {
  height: 38px;
  border-color: #cdd5df;
  border-radius: 6px;
  background: #fff;
  font-size: 14px;
  font-weight: 700;
}

.map-search-panel input:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(35, 103, 209, 0.14);
  outline: 0;
}

.map-search-results {
  max-height: 268px;
  overflow: auto;
  border: 1px solid #e4e9f1;
  border-radius: 6px;
  background: #fff;
}

.map-search-results[hidden] {
  display: none;
}

.map-search-result {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 9px;
  align-items: center;
  width: 100%;
  min-height: 54px;
  border: 0;
  border-bottom: 1px solid #eef1f5;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  padding: 8px 10px;
  text-align: left;
}

.map-search-result:last-child {
  border-bottom: 0;
}

.map-search-result:hover {
  background: #f3f7ff;
}

.map-search-result.active {
  background: #e8f0ff;
  box-shadow: inset 3px 0 0 var(--blue);
}

.map-search-result.active .map-search-type {
  background: var(--blue);
  color: #fff;
}

.map-search-type {
  display: grid;
  place-items: center;
  min-width: 34px;
  height: 24px;
  border-radius: 999px;
  background: #e8f0ff;
  color: var(--blue);
  font-size: 11px;
  font-weight: 900;
}

.map-search-main {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.map-search-main strong,
.map-search-main em {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.map-search-main strong {
  color: #1d2939;
  font-size: 13px;
  line-height: 1.25;
}

.map-search-main em {
  color: var(--muted);
  font-size: 11px;
  font-style: normal;
}

.map-search-empty {
  padding: 12px;
  color: var(--muted);
  font-size: 12px;
}

.map-ranking-section {
  display: grid;
  min-height: 0;
  border-top: 1px solid var(--line);
  grid-template-rows: auto minmax(0, 1fr);
}

.map-ranking-section[hidden] {
  display: none;
}

.map-ranking-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 48px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
}

.map-ranking-head strong {
  font-size: 15px;
}

.map-ranking-head span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.map-ranking-rows {
  overflow: auto;
  padding: 8px;
}

.map-ranking-row {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) 72px;
  gap: 8px;
  align-items: center;
  width: 100%;
  min-height: 58px;
  border: 0;
  border-bottom: 1px solid #eef1f5;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  padding: 8px 6px;
  text-align: left;
}

.map-ranking-row:hover {
  background: #f3f7ff;
}

.map-ranking-rank {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  background: #edf1f7;
  color: #475467;
  font-size: 12px;
  font-weight: 900;
}

.map-ranking-main {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.map-ranking-main strong {
  overflow: hidden;
  color: #1d2939;
  font-size: 13px;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.map-ranking-main em {
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  font-style: normal;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.map-ranking-rate {
  justify-self: end;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 900;
  padding: 5px 8px;
  white-space: nowrap;
}

.map-ranking-rate.positive {
  background: #e9f7f1;
  color: #087443;
}

.map-ranking-rate.negative {
  background: #e8f0ff;
  color: var(--blue);
}

.map-ranking-rate.no-data {
  background: #f2f4f7;
  color: var(--muted);
  font-size: 11px;
}

.map-ranking-empty {
  padding: 14px;
  color: var(--muted);
  font-size: 13px;
}

.leaflet-popup-content {
  line-height: 1.55;
}

.apartment-map-marker-shell {
  background: transparent;
  border: 0;
}

.apartment-map-marker {
  align-items: center;
  background: color-mix(in srgb, var(--marker-color) 88%, white);
  border: 2px solid #ffffff;
  border-radius: 999px;
  box-shadow: 0 8px 18px rgba(16, 24, 40, 0.2);
  color: #ffffff;
  display: flex;
  flex-direction: column;
  gap: var(--marker-line-gap, 3px);
  min-height: 30px;
  min-width: 44px;
  padding: 5px 9px;
  font-size: 12px;
  font-weight: 800;
  justify-content: center;
  line-height: 1.1;
  pointer-events: auto;
  text-align: center;
  white-space: nowrap;
}

.apartment-map-marker .marker-rate {
  color: #ffffff;
  font-size: 12px;
  font-weight: 900;
}

.apartment-map-marker small {
  color: rgba(255, 255, 255, 0.9);
  font-size: 9px;
  font-weight: 900;
  line-height: 1;
}

.apartment-map-marker .marker-rank-line {
  align-items: center;
  display: inline-flex;
  gap: 3px;
  justify-content: center;
}

.apartment-map-marker .marker-rank-phrase {
  gap: 2px;
}

.apartment-map-marker .marker-dong {
  overflow: hidden;
  max-width: 42px;
  text-overflow: ellipsis;
}

.apartment-map-marker .marker-rank-line b {
  font-size: 9px;
  font-weight: 1000;
  line-height: 1;
}

.apartment-map-marker.no-data {
  background: #667085;
}

.apartment-map-marker.no-data .marker-rate {
  color: #ffffff;
  font-size: 10px;
}

.apartment-map-marker.marker-size-sentence {
  min-width: 96px;
  padding: 5px 8px;
}

.apartment-map-marker.marker-size-sentence .marker-dong {
  max-width: 38px;
}

.apartment-map-marker.marker-shape-card {
  border-radius: 8px;
}

.apartment-map-marker.marker-tone-soft {
  background: color-mix(in srgb, var(--marker-color) 18%, white);
  border-color: color-mix(in srgb, var(--marker-color) 72%, white);
}

.apartment-map-marker.marker-tone-soft .marker-rate,
.apartment-map-marker.marker-tone-soft small {
  color: color-mix(in srgb, var(--marker-color) 84%, #101828);
}

.apartment-map-marker.marker-tone-outline,
.apartment-map-marker.marker-tone-white {
  background: #ffffff;
  border-color: var(--marker-color);
}

.apartment-map-marker.marker-tone-outline .marker-rate,
.apartment-map-marker.marker-tone-outline small,
.apartment-map-marker.marker-tone-white .marker-rate,
.apartment-map-marker.marker-tone-white small {
  color: var(--marker-color);
}

.apartment-map-marker.marker-rank-box .marker-rank-line b {
  border: 1px solid currentColor;
  border-radius: 4px;
  padding: 2px 4px;
}

.apartment-map-marker.marker-rank-circle .marker-rank-line b {
  align-items: center;
  background: var(--marker-color);
  border-radius: 999px;
  color: #ffffff;
  display: inline-flex;
  height: 18px;
  justify-content: center;
  min-width: 18px;
  padding: 0 4px;
}

.apartment-hover-tooltip {
  border: 1px solid rgba(16, 24, 40, 0.16);
  border-radius: 8px;
  box-shadow: 0 10px 24px rgba(16, 24, 40, 0.18);
  color: #1d2939;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.45;
  padding: 8px 10px;
  white-space: nowrap;
}

.map-design-panel {
  position: absolute;
  right: 14px;
  bottom: 14px;
  z-index: 580;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  width: min(360px, calc(100% - 28px));
  height: auto;
  max-height: min(620px, calc(100% - 28px));
  overflow: hidden;
  border: 1px solid rgba(16, 24, 40, 0.16);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 18px 42px rgba(16, 24, 40, 0.22);
  backdrop-filter: blur(10px);
}

.map-design-panel.collapsed {
  width: auto;
}

.map-design-toggle {
  height: 38px;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: #ffffff;
  color: var(--text);
  cursor: pointer;
  font-size: 13px;
  font-weight: 900;
}

.map-design-panel.collapsed .map-design-toggle {
  border-bottom: 0;
  min-width: 118px;
}

.map-design-body {
  display: grid;
  gap: 12px;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 12px;
  -webkit-overflow-scrolling: touch;
}

.map-design-panel.collapsed .map-design-body {
  display: none;
}

.map-design-section {
  display: grid;
  gap: 8px;
}

.map-design-section-head {
  align-items: center;
  display: flex;
  justify-content: space-between;
  gap: 8px;
}

.map-design-section-head strong {
  font-size: 13px;
}

.map-design-section-head span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.map-graph-design-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}

.map-design-option {
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #ffffff;
  color: var(--text);
  cursor: pointer;
  font-size: 12px;
  font-weight: 900;
}

.map-design-option.active {
  border-color: var(--blue);
  background: #e8f0ff;
  color: var(--blue);
}

.map-marker-design-grid {
  display: grid;
  gap: 10px;
}

.map-marker-line-gap-control {
  align-items: center;
  display: grid;
  grid-template-columns: 1fr 70px;
  gap: 8px;
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #ffffff;
  padding: 6px 8px;
}

.map-marker-line-gap-control span {
  color: #344054;
  font-size: 12px;
  font-weight: 900;
}

.map-marker-line-gap-control input {
  width: 100%;
  height: 28px;
  border: 1px solid #d0d5dd;
  border-radius: 6px;
  color: var(--text);
  font-size: 12px;
  font-weight: 900;
  padding: 0 6px;
  text-align: right;
}

.map-marker-design-group {
  display: grid;
  gap: 6px;
}

.map-marker-design-group > strong {
  color: #667085;
  font-size: 11px;
  font-weight: 900;
}

.map-marker-design-group-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}

.map-marker-design-option {
  display: grid;
  gap: 6px;
  min-height: 78px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #ffffff;
  color: var(--text);
  cursor: pointer;
  font: inherit;
  padding: 8px;
  text-align: left;
}

.map-marker-design-option.active {
  border-color: var(--blue);
  background: #f5f8ff;
  box-shadow: inset 0 0 0 1px rgba(35, 103, 209, 0.18);
}

.map-marker-design-option > span {
  overflow: hidden;
  color: #344054;
  font-size: 11px;
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.map-marker-design-option > em {
  align-items: center;
  display: flex;
  justify-content: center;
  min-height: 40px;
  overflow: visible;
  font-style: normal;
}

.map-marker-design-option .apartment-map-marker {
  pointer-events: none;
}

.map-apartment-popup {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 600;
  display: flex;
  flex-direction: column;
  width: min(720px, calc(100% - 28px));
  max-height: calc(100% - 28px);
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  background: #ffffff;
  border: 1px solid rgba(16, 24, 40, 0.16);
  border-radius: 8px;
  box-shadow: 0 18px 42px rgba(16, 24, 40, 0.24);
}

.map-apartment-popup[hidden] {
  display: none;
}

.map-popup-head {
  flex: 0 0 auto;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
}

.map-popup-head h3 {
  margin: 0 0 4px;
  font-size: 16px;
}

.map-popup-title-row {
  align-items: flex-start;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 10px;
}

.map-popup-pyeong-growth {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  min-height: 22px;
}

.map-popup-pyeong-growth:empty {
  display: none;
}

.map-popup-pyeong-growth span,
.map-popup-pyeong-growth em {
  border-radius: 999px;
  font-size: 11px;
  font-style: normal;
  font-weight: 900;
  line-height: 1;
  padding: 5px 7px;
}

.map-popup-pyeong-growth span {
  background: #f2f4f7;
  color: #475467;
}

.map-popup-pyeong-growth em {
  background: #f8fafc;
  border: 1px solid #e4e7ec;
}

.map-popup-pyeong-growth em.no-data {
  color: #98a2b3;
}

.map-popup-head span {
  color: var(--muted);
  font-size: 12px;
}

.map-popup-ranks {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 7px;
}

.map-popup-ranks:empty {
  display: none;
}

.map-popup-ranks span {
  align-items: center;
  background: #f8fafc;
  border: 1px solid #e4e7ec;
  border-radius: 999px;
  color: #344054;
  display: inline-flex;
  font-size: 11px;
  font-weight: 900;
  gap: 4px;
  line-height: 1;
  padding: 5px 7px;
}

.map-popup-ranks b {
  color: #667085;
  font-weight: 900;
}

.map-popup-head button {
  width: 30px;
  height: 30px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--text);
  cursor: pointer;
  font-size: 20px;
  line-height: 1;
}

.map-popup-stats {
  flex: 0 0 auto;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  background: #fbfcfe;
}

.map-popup-area-picker {
  align-items: end;
  display: grid;
  grid-column: 1 / -1;
  grid-template-columns: minmax(220px, 320px) minmax(0, 1fr);
  gap: 10px;
}

.map-popup-area-picker label {
  min-width: 0;
}

.map-popup-area-picker em {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
  font-weight: 800;
  padding: 0 0 8px;
}

.map-popup-stat {
  display: grid;
  gap: 3px;
  min-width: 0;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  font-size: 12px;
}

.map-popup-stat > strong,
.map-popup-stat > span,
.map-popup-stat > em {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.map-popup-stat > strong {
  display: flex;
  align-items: center;
  gap: 6px;
}

.map-popup-stat i {
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  flex: 0 0 auto;
}

.map-popup-stat > em,
.map-popup-change-row em {
  font-style: normal;
  font-weight: 800;
}

.map-popup-stat-wide {
  grid-column: 1 / -1;
  gap: 7px;
}

.map-popup-change-list {
  display: grid;
  gap: 5px;
}

.map-popup-change-row {
  align-items: center;
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) auto;
  gap: 7px;
  min-width: 0;
  border-radius: 5px;
  background: #f8fafc;
  padding: 5px 6px;
}

.map-popup-change-row span,
.map-popup-change-row strong,
.map-popup-change-row em {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.map-popup-change-row span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.map-popup-change-row strong {
  color: #344054;
  font-size: 11px;
}

.map-popup-change-row.no-data {
  grid-template-columns: 44px minmax(0, 1fr);
  color: var(--muted);
}

.map-popup-change-row.no-data strong {
  color: #98a2b3;
}

.map-apartment-popup.loading .map-popup-stats {
  align-items: stretch;
}

.map-popup-loading-card {
  min-height: 58px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: linear-gradient(90deg, #eef2f7 25%, #f8fafc 37%, #eef2f7 63%);
  background-size: 400% 100%;
  animation: map-loading-shimmer 1.2s ease-in-out infinite;
}

.map-popup-loading {
  display: grid;
  place-items: center;
  align-content: center;
  gap: 8px;
  min-height: 240px;
  color: var(--muted);
  text-align: center;
}

.map-popup-loading strong {
  color: #1d2939;
  font-size: 14px;
}

.map-popup-loading em {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
}

.map-popup-spinner {
  width: 28px;
  height: 28px;
  border: 3px solid #dbe4f0;
  border-top-color: var(--blue);
  border-radius: 999px;
  animation: map-popup-spin 780ms linear infinite;
}

@keyframes map-popup-spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes map-loading-shimmer {
  0% {
    background-position: 100% 0;
  }

  100% {
    background-position: 0 0;
  }
}

.map-popup-chart-wrap {
  flex: 0 0 auto;
  position: relative;
  min-height: 320px;
  overflow-x: auto;
  overflow-y: visible;
  padding: 14px 14px 18px;
  background:
    linear-gradient(180deg, #ffffff 0%, #fbfcfe 100%);
}

.map-popup-chart svg {
  width: 680px;
  max-width: none;
  height: 300px;
  display: block;
}

.map-popup-plot-bg {
  fill: #fbfdff;
  stroke: #eef2f7;
}

.map-popup-grid-line {
  stroke: #e7edf5;
  stroke-dasharray: 3 5;
  stroke-width: 1;
}

.map-popup-axis-line {
  stroke: #cfd7e3;
  stroke-width: 1.15;
}

.map-popup-axis-label {
  fill: #667085;
  font-size: 11px;
  font-weight: 700;
}

.map-popup-area {
  pointer-events: none;
}

.map-popup-line {
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 3;
  filter: drop-shadow(0 2px 2px rgba(16, 24, 40, 0.12));
}

.map-popup-point {
  stroke-width: 2.5;
}

.map-popup-pyeong-line {
  fill: none;
  pointer-events: none;
}

.map-popup-period-marker {
  pointer-events: none;
}

.map-popup-period-marker line {
  stroke: rgba(71, 84, 103, 0.5);
  stroke-dasharray: 3 6;
  stroke-width: 1.4;
}

.map-popup-period-marker text {
  fill: #98a2b3;
  font-size: 10px;
  font-weight: 900;
  paint-order: stroke;
  stroke: rgba(255, 255, 255, 0.82);
  stroke-width: 3;
}

.map-popup-period-dot {
  stroke-width: 2;
  filter: drop-shadow(0 1px 3px rgba(16, 24, 40, 0.28));
}

.map-popup-pyeong-axis-line {
  stroke: rgba(102, 112, 133, 0.28);
  stroke-dasharray: 3 5;
  stroke-width: 1;
}

.map-popup-pyeong-axis-label,
.map-popup-pyeong-axis-title {
  fill: #98a2b3;
  font-size: 10px;
  font-weight: 800;
}

.map-popup-pyeong-axis-help {
  cursor: help;
  pointer-events: all;
}

.map-popup-end-label {
  dominant-baseline: middle;
  font-size: 11px;
  font-weight: 900;
  paint-order: stroke;
  stroke: #ffffff;
  stroke-linejoin: round;
  stroke-width: 4px;
}

.naver-info-window {
  background: #ffffff;
  border: 1px solid rgba(16, 24, 40, 0.16);
  border-radius: 8px;
  box-shadow: 0 14px 30px rgba(16, 24, 40, 0.22);
  color: #1d2939;
  font-size: 13px;
  line-height: 1.55;
  padding: 10px 12px;
  white-space: nowrap;
}

.zoom-cluster-marker {
  background: transparent;
  border: 0;
}

.zoom-cluster-marker > div {
  align-items: center;
  background: color-mix(in srgb, var(--zoom-color) 86%, white);
  border: 2px solid rgba(255, 255, 255, 0.96);
  border-radius: 999px;
  box-shadow: 0 12px 28px rgba(16, 24, 40, 0.24);
  color: #ffffff;
  display: flex;
  flex-direction: column;
  font-weight: 800;
  justify-content: center;
  line-height: 1.05;
  height: 100%;
  text-align: center;
  width: 100%;
}

.zoom-cluster-marker .level-dong {
  gap: 1px;
  padding: 6px 5px;
}

.zoom-cluster-marker .level-sigungu {
  gap: 2px;
  padding: 6px 5px;
}

.zoom-cluster-marker strong {
  display: block;
  font-size: 12px;
  max-width: 74px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.zoom-cluster-marker span {
  font-size: 15px;
}

.zoom-cluster-rank {
  display: grid;
  gap: 1px;
  margin-top: 1px;
  max-width: 92px;
}

.zoom-cluster-rank b {
  color: rgba(255, 255, 255, 0.94);
  display: block;
  font-size: 8px;
  font-weight: 900;
  line-height: 1.04;
  overflow: hidden;
  text-overflow: ellipsis;
  text-shadow: 0 1px 2px rgba(16, 24, 40, 0.22);
  white-space: nowrap;
}

.level-sigungu .zoom-cluster-rank {
  max-width: 84px;
}

.view {
  display: none;
}

.view.active {
  display: grid;
  gap: 16px;
}

.map-view.active {
  display: block;
  height: calc(100vh - 64px);
}

.map-panel {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.map-panel .growth-map {
  height: 100%;
  min-height: 0;
}

.map-head {
  gap: 16px;
}

.map-head-meta {
  align-items: center;
  color: var(--muted);
  display: flex;
  flex-wrap: wrap;
  font-size: 13px;
  gap: 10px;
  justify-content: flex-end;
}

.detail-panel[hidden] {
  display: none;
}

.detail-body {
  position: relative;
  padding: 14px 0 16px;
}

.detail-chart {
  min-height: 430px;
}

.detail-chart-scroll {
  overflow-x: auto;
  overflow-y: hidden;
  padding: 0 16px 8px;
  -webkit-overflow-scrolling: touch;
}

.detail-chart-scroll svg {
  width: 1120px;
  max-width: none;
  height: 380px;
  display: block;
}

.detail-point {
  cursor: crosshair;
}

.chart-tooltip {
  position: absolute;
  z-index: 10;
  display: grid;
  gap: 4px;
  min-width: 180px;
  max-width: 260px;
  padding: 10px;
  border: 1px solid #344054;
  border-radius: 8px;
  background: #101828;
  color: #f9fafb;
  font-size: 12px;
  pointer-events: none;
  box-shadow: 0 12px 28px rgba(16, 24, 40, 0.2);
}

.chart-tooltip strong {
  font-size: 13px;
}

.chart-tooltip span {
  color: #d0d5dd;
}

.detail-panel .legend {
  padding: 0 16px;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}

.panel-head {
  min-height: 54px;
  padding: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
}

.terms-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  padding: 16px;
}

.term-card {
  display: grid;
  gap: 12px;
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfe;
}

.term-card-head {
  display: grid;
  gap: 4px;
}

.term-card-head span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.term-card-head strong {
  font-size: 20px;
}

.term-card p {
  color: #475467;
  font-size: 13px;
  line-height: 1.55;
}

.term-card ol {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px 18px;
  margin: 0;
  padding-left: 20px;
  color: #344054;
  font-size: 13px;
  font-weight: 700;
}

.chart {
  position: relative;
  min-height: 360px;
  padding: 16px;
}

.chart svg {
  width: 100%;
  height: 320px;
  display: block;
}

.chart-hover-hit {
  cursor: crosshair;
}

.chart-hover-line {
  stroke: #344054;
  stroke-width: 1.5;
  stroke-dasharray: 4 4;
  pointer-events: none;
}

.design-panel {
  margin-bottom: 16px;
}

.graph-design-grid,
.marker-design-group > .marker-design-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 12px;
  padding: 16px;
}

#markerDesignGrid.marker-design-grid {
  display: grid;
  gap: 16px;
  padding: 16px;
}

.marker-design-group {
  display: grid;
  gap: 10px;
}

.marker-design-group h3 {
  margin: 0;
  color: #344054;
  font-size: 14px;
}

.marker-design-group > .marker-design-grid {
  padding: 0;
}

.graph-design-card,
.marker-design-card {
  display: grid;
  gap: 10px;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--text);
  cursor: pointer;
  font: inherit;
  padding: 12px;
  text-align: left;
  transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.graph-design-card:hover,
.marker-design-card:hover {
  border-color: #9db7ea;
  box-shadow: 0 10px 22px rgba(16, 24, 40, 0.08);
  transform: translateY(-1px);
}

.graph-design-card.active,
.marker-design-card.active {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(35, 103, 209, 0.12);
}

.graph-design-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
}

.graph-design-card-head strong {
  overflow: hidden;
  font-size: 14px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.graph-design-card-head em {
  flex: 0 0 auto;
  border-radius: 999px;
  background: #f2f4f7;
  color: var(--muted);
  font-size: 11px;
  font-style: normal;
  font-weight: 800;
  padding: 4px 8px;
}

.graph-design-card.active .graph-design-card-head em,
.marker-design-card.active .graph-design-card-head em {
  background: #e8f0ff;
  color: var(--blue);
}

.graph-design-preview {
  display: block;
  overflow: hidden;
  border: 1px solid #edf1f7;
  border-radius: 8px;
  background: #ffffff;
}

.graph-design-preview svg {
  display: block;
  width: 100%;
  height: auto;
}

.marker-design-preview {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  min-height: 78px;
  overflow: hidden;
  border: 1px solid #edf1f7;
  border-radius: 8px;
  background:
    linear-gradient(90deg, rgba(152, 162, 179, 0.16) 1px, transparent 1px),
    linear-gradient(180deg, rgba(152, 162, 179, 0.16) 1px, transparent 1px),
    #f8fafc;
  background-size: 24px 24px;
  padding: 14px;
}

.marker-design-preview .apartment-map-marker {
  pointer-events: none;
}

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  margin-top: 8px;
  color: var(--muted);
  font-size: 12px;
}

.legend i {
  display: inline-block;
  width: 10px;
  height: 10px;
  margin-right: 6px;
  border-radius: 50%;
}

.table-wrap {
  overflow: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

th,
td {
  padding: 11px 12px;
  border-bottom: 1px solid var(--line);
  text-align: right;
  white-space: nowrap;
}

th {
  color: var(--muted);
  background: #fbfcfe;
  font-size: 12px;
}

th:nth-child(2),
td:nth-child(2),
th:nth-child(3),
td:nth-child(3),
th:nth-child(4),
td:nth-child(4) {
  text-align: left;
}

.price-band-table th:nth-child(4),
.price-band-table td:nth-child(4) {
  text-align: right;
}

.clickable-row {
  cursor: pointer;
}

.clickable-row:hover {
  background: #f6f8fb;
}

.table-main {
  display: block;
  margin-bottom: 3px;
  color: var(--text);
}

.muted-cell {
  color: var(--muted);
  font-size: 12px;
}

.table-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 6px;
  font-size: 12px;
  font-weight: 800;
}

.table-links a {
  color: var(--blue);
  text-decoration: none;
}

.table-links a:hover {
  text-decoration: underline;
}

.positive {
  color: var(--red);
  font-weight: 700;
}

.negative {
  color: var(--green);
  font-weight: 700;
}

.empty {
  padding: 48px 16px;
  color: var(--muted);
  text-align: center;
}

@media (max-width: 820px) {
  .app-shell {
    padding: 10px;
  }

  .toolbar {
    grid-template-columns: 1fr;
  }

  .collection-summary-grid,
  .crawl-grid,
  .crawl-job-progress,
  .graph-design-grid,
  .marker-design-grid,
  .info-grid,
  .terms-grid,
  .term-card ol,
  .map-popup-area-picker {
    grid-template-columns: 1fr;
  }

  th,
  td {
    padding: 10px;
  }

  .detail-body {
    padding-top: 10px;
  }

  .detail-chart {
    min-height: 400px;
  }

  .detail-chart-scroll {
    padding: 0 12px 8px;
  }

  .detail-chart-scroll svg {
    width: 980px;
    height: 350px;
  }

  .chart-tooltip {
    max-width: min(240px, calc(100vw - 40px));
    font-size: 11px;
  }

  .growth-map {
    height: 460px;
  }

  .map-view.active {
    height: calc(100vh - 58px);
  }

  .map-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .map-head-meta {
    justify-content: flex-start;
  }

  .map-apartment-popup {
    left: 10px;
    right: 10px;
    top: 10px;
    width: auto;
    max-height: calc(100% - 20px);
  }

  .map-apartment-ranking {
    top: 10px;
    right: 10px;
    bottom: auto;
    left: 10px;
    width: auto;
    max-height: calc(100% - 20px);
  }

  .map-apartment-ranking.ranking-active {
    top: auto;
    bottom: 10px;
    max-height: 42%;
  }

  .map-design-panel {
    right: 10px;
    bottom: 10px;
    left: 10px;
    width: auto;
    max-height: min(520px, calc(100% - 20px));
  }

  .map-design-panel.collapsed {
    left: auto;
  }

  .map-ranking-row {
    grid-template-columns: 30px minmax(0, 1fr) 68px;
  }

  .map-popup-stats {
    grid-template-columns: 1fr;
  }
}
