.topbar {
  align-items: center;
  background: var(--bg-primary);
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  height: 56px;
  padding: 0 20px;
  position: sticky;
  top: 0;
  z-index: 50;
}

.brand {
  align-items: center;
  color: var(--text-primary);
  display: flex;
  font-size: 14px;
  font-weight: 700;
  gap: 10px;
  text-decoration: none;
}

.brand-mark {
  align-items: center;
  background: var(--bg-secondary);
  border-radius: var(--radius-sm);
  display: flex;
  height: 22px;
  justify-content: center;
  overflow: hidden;
  width: 22px;
}

.brand-mark img {
  display: block;
  height: 18px;
  width: 18px;
}

.brand-sep {
  background: var(--border-subtle);
  height: 18px;
  margin: 0 14px;
  width: 1px;
}

.brand-sub {
  color: var(--text-tertiary);
  font-size: 13px;
  font-weight: 500;
}

.preset-tabs {
  display: flex;
  gap: 2px;
  margin-left: 24px;
}

.preset-tab {
  align-items: center;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  display: inline-flex;
  font-size: 13px;
  font-weight: 500;
  gap: 6px;
  height: 32px;
  padding: 0 12px;
}

.preset-tab:hover {
  background: var(--bg-secondary);
}

.preset-tab.active {
  background: var(--accent-bg);
  color: var(--accent);
  font-weight: 600;
}

.preset-tab .kbd {
  background: var(--bg-tertiary);
  border-radius: 3px;
  color: var(--text-tertiary);
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 500;
  padding: 1px 4px;
}

.preset-index {
  align-items: baseline;
  border-left: 1px solid var(--border-subtle);
  color: var(--text-tertiary);
  display: flex;
  gap: 8px;
  margin-left: 14px;
  padding-left: 14px;
  white-space: nowrap;
}

.preset-index strong {
  color: var(--text-secondary);
  font-size: 12px;
}

.preset-index span {
  font-size: 11px;
}

.topbar-spacer {
  flex: 1;
}

.proto-nav {
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  display: flex;
  height: 32px;
  overflow: hidden;
}

.proto-nav a {
  align-items: center;
  border-right: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  display: inline-flex;
  font-size: 12px;
  font-weight: 500;
  gap: 6px;
  padding: 0 12px;
  text-decoration: none;
}

.proto-nav a:last-child {
  border-right: 0;
}

.proto-nav a.active,
.proto-nav a:hover {
  background: var(--text-primary);
  color: #fff;
}

.proto-nav .num {
  font-family: var(--font-mono);
  font-size: 10px;
  opacity: 0.6;
}

.filter-strip {
  align-items: center;
  background: var(--bg-primary);
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  gap: 20px;
  height: 56px;
  padding: 0 20px;
}

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

.filter-label {
  color: var(--text-tertiary);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: uppercase;
}

.filter-value {
  color: var(--text-primary);
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
}

.filter-divider {
  background: var(--border-subtle);
  height: 24px;
  width: 1px;
}

.filter-slider {
  accent-color: var(--accent);
  height: 24px;
  width: 160px;
}

.filter-slider.short {
  width: 120px;
}

.filter-number {
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  height: 30px;
  padding: 0 8px;
  width: 74px;
}

.result-count {
  color: var(--text-secondary);
  font-size: 12px;
  margin-left: auto;
}

.result-count strong {
  color: var(--text-primary);
}

.filter-reset {
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  flex: 0 0 auto;
  font-size: 12px;
  height: 30px;
  padding: 0 10px;
}

.filter-reset:hover {
  background: var(--bg-secondary);
  color: var(--text-primary);
}

.filter-check {
  align-items: center;
  color: var(--text-secondary);
  display: inline-flex;
  flex: 0 0 auto;
  font-size: 12px;
  font-weight: 600;
  gap: 7px;
  white-space: nowrap;
}

.filter-check input {
  accent-color: var(--accent);
  height: 14px;
  width: 14px;
}

.filter-slider:disabled {
  cursor: not-allowed;
  filter: grayscale(1);
  opacity: 0.36;
}

.app {
  display: flex;
  height: calc(100dvh - 112px);
  min-height: 680px;
  overflow: hidden;
}

.map-pane {
  background: var(--map-base);
  flex: 1;
  overflow: hidden;
  position: relative;
}

.naver-map,
.map-svg {
  height: 100%;
  inset: 0;
  position: absolute;
  width: 100%;
}

.naver-map {
  background: var(--map-base);
  height: 100% !important;
  inset: 0 !important;
  min-height: 100% !important;
  overflow: hidden !important;
  position: absolute !important;
  width: 100% !important;
}

.map-svg.hidden,
.naver-map.hidden {
  display: none;
}

.naver-map .apt-pin {
  align-items: center;
  background: #fff;
  border-radius: 999px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.18), 0 0 0 1.5px #fff;
  color: #fff;
  cursor: pointer;
  display: flex;
  font: 600 12px/1 var(--font-mono);
  height: 30px;
  justify-content: center;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  width: 30px;
}

.naver-map .apt-pin .core {
  align-items: center;
  border-radius: 999px;
  color: #fff;
  display: flex;
  font: 700 11px/1 var(--font-mono);
  height: 22px;
  justify-content: center;
  width: 22px;
}

.naver-map .apt-pin.lg {
  height: 36px;
  width: 36px;
}

.naver-map .apt-pin.lg .core {
  font-size: 12px;
  height: 28px;
  width: 28px;
}

.naver-map .apt-pin:hover,
.naver-map .apt-pin.is-active {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.22), 0 0 0 2px var(--accent);
  transform: translateY(-1px);
}

.naver-map .hotspot-pin {
  align-items: center;
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid var(--border-subtle);
  border-radius: 999px;
  box-shadow: var(--shadow-card);
  color: var(--text-secondary);
  display: flex;
  font: 500 11px/1 var(--font-sans);
  gap: 6px;
  padding: 4px 10px 4px 8px;
  pointer-events: none;
}

.naver-map .hotspot-pin::before {
  background: var(--map-hotspot);
  border-radius: 999px;
  content: "";
  height: 8px;
  width: 8px;
}

.naver-map .iso-label {
  background: #fff;
  border: 1px solid var(--accent);
  border-radius: 4px;
  box-shadow: var(--shadow-card);
  color: var(--accent);
  font: 600 10px/1 var(--font-sans);
  padding: 3px 8px;
  pointer-events: none;
}

.map-state {
  align-items: center;
  color: var(--text-secondary);
  display: flex;
  flex-direction: column;
  font-size: 13px;
  gap: 8px;
  inset: 0;
  justify-content: center;
  line-height: 1.6;
  padding: 24px;
  position: absolute;
  text-align: center;
  z-index: 5;
}

.map-state strong {
  color: var(--error);
  font-weight: 600;
}

.map-state code {
  background: var(--bg-tertiary);
  border-radius: 3px;
  padding: 1px 5px;
}

.map-overlay {
  display: flex;
  flex-direction: column;
  gap: 8px;
  left: 16px;
  position: absolute;
  top: 16px;
  z-index: 3;
}

.zoom-control,
.map-legend,
.context-card {
  background: var(--bg-primary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-card);
}

.zoom-control {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  width: 34px;
}

.zoom-control button {
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  height: 34px;
}

.zoom-control button:last-child {
  border-bottom: 0;
}

.map-legend {
  color: var(--text-secondary);
  font-size: 11px;
  padding: 10px 12px;
}

.area-search {
  background: var(--bg-primary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-card);
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
  min-height: 34px;
  padding: 0 12px;
}

.area-search:disabled {
  color: var(--text-tertiary);
  cursor: default;
  opacity: 0.72;
}

.map-legend-title {
  color: var(--text-tertiary);
  font-size: 10px;
  font-weight: 600;
  margin-bottom: 6px;
  text-transform: uppercase;
}

.legend-bar {
  background: linear-gradient(
    to right,
    #8A8F98 0%,
    #8A8F98 40%,
    #64748B 40%,
    #64748B 50%,
    #0E7C86 50%,
    #0E7C86 60%,
    #047857 60%,
    #047857 68%,
    #2563EB 68%,
    #2563EB 100%
  );
  border-radius: 4px;
  height: 8px;
  width: 160px;
}

.legend-scale {
  color: var(--text-tertiary);
  display: flex;
  font-family: var(--font-mono);
  font-size: 10px;
  justify-content: space-between;
  margin-top: 4px;
  width: 160px;
}

.context-card {
  bottom: 16px;
  left: 16px;
  min-width: 260px;
  padding: 12px 14px;
  position: absolute;
  z-index: 3;
}

.context-title {
  color: var(--text-tertiary);
  font-size: 11px;
  font-weight: 600;
  margin-bottom: 6px;
  text-transform: uppercase;
}

.context-row {
  align-items: baseline;
  color: var(--text-secondary);
  display: flex;
  font-size: 12px;
  justify-content: space-between;
  padding: 3px 0;
}

.panel {
  background: var(--bg-primary);
  border-left: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  min-height: 0;
  overflow: hidden;
  width: 420px;
}

.panel-header {
  align-items: center;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  justify-content: space-between;
  padding: 14px 16px;
}

.panel-title {
  font-size: 13px;
  font-weight: 600;
}

.panel-meta {
  color: var(--text-tertiary);
  font-size: 12px;
}

.sort {
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 12px;
  height: 26px;
  padding: 0 8px;
}

#apt-list {
  display: flex;
  flex: 1;
  min-height: 0;
}

.panel-list {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 8px;
  overscroll-behavior: contain;
}

.apt-card {
  align-items: flex-start;
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  cursor: pointer;
  display: flex;
  gap: 12px;
  padding: 12px 14px;
}

.apt-card:hover,
.apt-card.active {
  background: var(--bg-secondary);
}

.apt-card.active {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}

.score-num {
  align-items: center;
  border-radius: var(--radius-md);
  color: #fff;
  display: flex;
  flex-shrink: 0;
  font-size: 18px;
  font-weight: 700;
  height: 42px;
  justify-content: center;
  width: 42px;
}

.apt-meta {
  flex: 1;
  min-width: 0;
}

.apt-name {
  align-items: center;
  color: var(--text-primary);
  display: flex;
  font-size: 14px;
  font-weight: 600;
  gap: 6px;
}

.fav {
  color: var(--text-tertiary);
  font-size: 11px;
}

.fav.on {
  color: var(--warning);
}

.apt-addr {
  color: var(--text-tertiary);
  font-size: 12px;
  line-height: 16px;
  margin-top: 1px;
}

.apt-stats {
  color: var(--text-secondary);
  display: flex;
  font-size: 12px;
  gap: 10px;
  margin-top: 8px;
}

.apt-stats .lbl {
  color: var(--text-tertiary);
  font-size: 11px;
  margin-right: 4px;
}

.apt-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 8px;
}

.tag {
  background: var(--bg-tertiary);
  border-radius: 4px;
  color: var(--text-secondary);
  font-size: 10px;
  font-weight: 500;
  line-height: 14px;
  padding: 2px 6px;
}

.tag.pos {
  background: #ecfdf5;
  color: var(--success);
}

.tag.warn {
  background: #fef3c7;
  color: #92400e;
}

.marker-dot {
  cursor: pointer;
}

.marker-dot.active circle:last-child {
  stroke: var(--text-primary);
  stroke-width: 3;
}

.map-badge {
  align-items: center;
  border: 2px solid #fff;
  border-radius: 999px;
  box-shadow: var(--shadow-card);
  color: #fff;
  display: flex;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  height: 32px;
  justify-content: center;
  width: 32px;
}

.drawer-backdrop {
  background: rgba(15, 23, 42, 0.18);
  inset: 0;
  opacity: 0;
  pointer-events: none;
  position: fixed;
  transition: opacity 0.18s;
  z-index: 90;
}

.drawer-backdrop.show {
  opacity: 1;
  pointer-events: auto;
}

.drawer {
  background: var(--bg-primary);
  border-left: 1px solid var(--border-subtle);
  bottom: 0;
  box-shadow: var(--shadow-drawer);
  display: flex;
  flex-direction: column;
  position: fixed;
  right: 0;
  top: 0;
  transform: translateX(100%);
  transition: transform 0.22s cubic-bezier(0.2, 0.8, 0.2, 1);
  width: 520px;
  z-index: 100;
}

.drawer.show {
  transform: translateX(0);
}

.drawer-head {
  border-bottom: 1px solid var(--border-subtle);
  padding: 18px 20px 14px;
  position: relative;
}

.drawer-close {
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 15px;
  height: 28px;
  position: absolute;
  right: 14px;
  top: 14px;
  width: 28px;
}

.drawer-eyebrow,
.section-title {
  color: var(--text-tertiary);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
}

.drawer-name {
  font-size: 22px;
  font-weight: 700;
  line-height: 28px;
}

.drawer-addr,
.drawer-meta,
.section-meta {
  color: var(--text-secondary);
  font-size: 12px;
}

.drawer-meta {
  display: flex;
  gap: 14px;
  margin-top: 10px;
}

.drawer-meta .lbl {
  color: var(--text-tertiary);
  font-size: 11px;
  margin-right: 3px;
}

.drawer-body {
  flex: 1;
  overflow-y: auto;
}

.section {
  border-bottom: 1px solid var(--border-subtle);
  padding: 18px 20px;
}

.section-head,
.headline-score,
.bar-head,
.line-stat {
  align-items: baseline;
  display: flex;
  justify-content: space-between;
}

.headline-num {
  font-size: 36px;
  font-weight: 700;
  line-height: 44px;
}

.headline-suffix {
  color: var(--text-tertiary);
  font-size: 14px;
  margin-left: 4px;
}

.percentile {
  color: var(--text-secondary);
  font-size: 12px;
  text-align: right;
}

.percentile strong {
  color: var(--accent);
}

.radar-wrap {
  display: flex;
  justify-content: center;
  padding: 8px 0 4px;
}

.summary-line {
  background: var(--bg-secondary);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 12px;
  line-height: 18px;
  margin-top: 14px;
  padding: 10px 12px;
}

.bar-row {
  border-top: 1px solid var(--border-subtle);
  padding: 10px 0;
}

.bar-row:first-child {
  border-top: 0;
}

.bar-name {
  color: var(--text-primary);
  font-size: 13px;
  font-weight: 600;
}

.bar-score {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 600;
}

.bar-score .denom {
  color: var(--text-tertiary);
  font-weight: 400;
}

.bar {
  background: var(--bg-tertiary);
  border-radius: 3px;
  height: 6px;
  overflow: hidden;
}

.bar-fill {
  border-radius: 3px;
  height: 100%;
}

.line-chart {
  margin-top: 8px;
}

.line-stat .num {
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-weight: 600;
}

.raw-table {
  border-collapse: collapse;
  font-size: 12px;
  width: 100%;
}

.raw-table tr {
  border-top: 1px solid var(--border-subtle);
}

.raw-table tr:first-child {
  border-top: 0;
}

.raw-table td {
  color: var(--text-secondary);
  padding: 7px 0;
}

.raw-table td:last-child {
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-weight: 500;
  text-align: right;
}

.drawer-actions {
  align-items: center;
  background: var(--bg-primary);
  border-top: 1px solid var(--border-subtle);
  display: flex;
  gap: 8px;
  padding: 14px 20px;
}

.btn {
  align-items: center;
  border-radius: var(--radius-sm);
  display: inline-flex;
  flex: 1;
  font-size: 13px;
  font-weight: 500;
  height: 36px;
  justify-content: center;
  padding: 0 14px;
}

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

.drawer-action-status {
  color: var(--text-secondary);
  flex: 0 0 auto;
  font-size: 12px;
}

.drawer-action-status a {
  color: var(--accent);
  font-weight: 600;
  text-decoration: none;
}

.btn.secondary {
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
}

@media (max-width: 900px) {
  .brand-sub,
  .preset-tabs {
    display: none;
  }

  .app {
    flex-direction: column;
    height: auto;
  }

  .map-pane {
    min-height: 420px;
  }

  .panel,
  .drawer {
    width: 100%;
  }
}
