.page { padding: 0; }

.price-map-layout {
  display: flex;
  height: calc(100vh - 52px);
  min-height: 0;
}

.map-panel {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  min-width: 0;
  border-right: 1px solid var(--line);
  background: var(--surface);
}

.map-toolbar {
  flex: 0 0 auto;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--line-soft);
}
.map-toolbar-main { min-width: 0; }
.map-toolbar .hint { max-width: 60ch; margin: 0; }
.map-toolbar-actions { display: flex; gap: 6px; flex: 0 0 auto; }
.map-toolbar-actions .btn-outline {
  width: 30px;
  padding: 6px 0;
  text-align: center;
  font-weight: 600;
}

.country-toggle { display: flex; gap: 2px; margin-bottom: 8px; }
.country-btn {
  font: inherit;
  font-size: 12.5px;
  font-weight: 500;
  padding: 4px 10px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink-2);
  cursor: pointer;
}
.country-btn:first-child { border-radius: var(--r) 0 0 var(--r); }
.country-btn:last-child { border-radius: 0 var(--r) var(--r) 0; border-left: none; }
.country-btn.is-current { background: var(--ink); border-color: var(--ink); color: #fff; font-weight: 600; }

.map-breadcrumb { margin-bottom: 6px; }
.map-breadcrumb-crumb {
  font: inherit;
  font-size: 13px;
  font-weight: 500;
  padding: 2px 4px;
  border: none;
  background: none;
  color: var(--ink-2);
  cursor: pointer;
  border-radius: 3px;
}
.map-breadcrumb-crumb:not(.is-current):hover { background: var(--line-soft); text-decoration: underline; }
.map-breadcrumb-crumb.is-current { color: var(--ink); font-weight: 600; cursor: default; }
.map-breadcrumb-sep { color: var(--ink-3); margin: 0 2px; }

.map-viewport {
  flex: 1 1 auto;
  overflow: hidden;
  position: relative;
  cursor: grab;
  background: var(--paper);
}
.map-viewport.grabbing { cursor: grabbing; }

.map-loading {
  position: absolute;
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
  margin: 0;
  padding: 5px 12px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  font-size: 12px;
  color: var(--ink-2);
  box-shadow: 0 2px 8px rgba(20, 32, 43, 0.1);
}

#regionMap { display: block; width: 100%; height: 100%; }

.province-path {
  fill: #DCE2E8;
  stroke: var(--surface);
  stroke-width: 1;
  cursor: pointer;
  transition: fill 0.1s;
}
.province-path:hover { fill: #C7D0DA; }
.province-path.has-data { fill: var(--ai-bg); }
.province-path.has-data:hover { fill: #D9DFEE; }
.province-path.selected { fill: var(--ai); stroke: var(--ink); }

.canary-box-outline {
  fill: none;
  stroke: var(--line);
  stroke-dasharray: 4 4;
}

/* ---- Right-hand price panel ---- */
.price-panel {
  flex: 0 0 360px;
  overflow-y: auto;
  padding: 16px;
  background: var(--surface);
}

.price-panel-empty { padding-top: 40px; text-align: center; }

.price-panel-content h2 { font-size: 18px; margin: 0 0 2px; }
#ppSub { margin: 0 0 16px; }

.price-figure {
  padding: 14px;
  margin-bottom: 14px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--r);
}
.price-figure-value {
  font-family: PlexM, monospace;
  font-size: 26px;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 4px;
}
.price-figure .hint { margin: 4px 0 0; }
.price-figure-secondary { background: var(--surface); }
.price-figure-value-small { font-size: 18px; color: var(--ink-2); }

.price-figure-empty {
  padding: 12px 14px;
  margin-bottom: 14px;
  background: var(--watch-bg);
  border: 1px solid var(--line);
  border-radius: var(--r);
}
.price-figure-empty .hint { color: var(--watch); margin: 0; }
.price-figure-empty code { font-family: PlexM, monospace; font-size: 11px; }

.ppmuni-list { margin-bottom: 18px; }

.pp-districts { margin-bottom: 18px; }
.pp-districts h3 { font-size: 14px; margin: 0 0 4px; }
.pp-districts .hint { margin: 0 0 8px; }
.ppmuni-row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-size: 12.5px;
  padding: 5px 0;
  border-bottom: 1px solid var(--line-soft);
}
.ppmuni-row:last-child { border-bottom: none; }
.ppmuni-name { color: var(--ink-2); }
.ppmuni-value { font-family: PlexM, monospace; color: var(--ink); white-space: nowrap; }
.ppmuni-n { color: var(--ink-3); font-size: 11px; }

.price-history-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 4px;
}
.price-history h3 { font-size: 14px; margin: 0; }

.year-picker { display: flex; gap: 2px; }
.year-btn {
  font: inherit;
  font-size: 11.5px;
  font-weight: 500;
  padding: 4px 8px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink-2);
  cursor: pointer;
}
.year-btn:first-child { border-radius: var(--r) 0 0 var(--r); }
.year-btn:last-child { border-radius: 0 var(--r) var(--r) 0; }
.year-btn + .year-btn { border-left: none; }
.year-btn.selected { background: var(--ink); border-color: var(--ink); color: #fff; font-weight: 600; }

#historyChartWrap { margin-top: 8px; }
#historyChartWrap svg { width: 100%; height: auto; display: block; }

@media (max-width: 900px) {
  .price-map-layout { flex-direction: column; height: auto; }
  .map-panel { border-right: none; border-bottom: 1px solid var(--line); }
  .map-viewport { height: 60vh; }
  .price-panel { flex: 1 1 auto; }
}
