* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Arial, sans-serif;
  background: #eef0f4;
  color: #1f2937;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

header {
  padding: 8px 0;
  margin: 0;
  border: none;
  background-color: rgba(65, 105, 225, 0.92);
  color: #fff;
}

.site-header-inner {
  position: relative;
  z-index: 1;
  width: 94vw;
  max-width: none;
  margin: 0 auto;
  padding-left: 14px;
  padding-right: 14px;
  box-sizing: border-box;
}

.site-header-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 20px;
}

.site-header-logo {
  display: block;
  width: auto;
  height: auto;
  max-height: 68px;
  max-width: none;
  object-fit: contain;
  object-position: right center;
  margin: 0;
  padding: 0;
  border: none;
  outline: none;
  box-shadow: none;
  transition: filter 0.15s ease;
}

.site-header-titles {
  min-width: 0;
  flex: 1 1 200px;
  text-align: left;
  font-family: "Montserrat", system-ui, -apple-system, "Segoe UI", sans-serif;
}

header h1 {
  margin: 0 0 2px;
  font-size: clamp(2.2rem, 6.2vw, 3.45rem);
  line-height: 1.02;
  font-weight: 800;
  letter-spacing: -0.03em;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.75);
}

.site-header-title-link {
  color: inherit;
  text-decoration: none;
  border-radius: 4px;
  transition: color 0.15s ease;
}

.site-header-title-link:hover {
  color: #d4af37;
  text-decoration: none;
}

.site-header-title-link:focus-visible {
  outline: 2px solid #7dd3fc;
  outline-offset: 3px;
}

.site-header-logo-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 0;
  flex-shrink: 0;
  border-radius: 0;
  padding: 0;
  background: transparent;
  border: none;
  backdrop-filter: none;
  box-shadow: none;
  transition: opacity 0.15s ease;
}

.site-header-logo-link:hover {
  opacity: 0.96;
}

.site-header-logo-link:hover .site-header-logo {
  filter: brightness(1.12);
}

.site-header-logo-link:focus-visible {
  outline: 2px solid #7dd3fc;
  outline-offset: 4px;
}

header .site-header-titles p {
  margin: 0;
  font-size: clamp(0.7rem, 1.5vw, 0.8rem);
  line-height: 1.15;
  font-weight: 600;
  opacity: 0.95;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.7);
}

main {
  width: 94vw;
  max-width: none;
  margin: 0 auto;
  padding: 16px 0 22px;
  display: grid;
  gap: 12px;
  flex: 1;
}

.kpi-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(7, minmax(0, 1fr));
}

.kpi-card {
  font-family: "Montserrat", system-ui, -apple-system, "Segoe UI", sans-serif;
  display: flex;
  flex-direction: row;
  align-items: stretch;
  gap: 10px;
  min-width: 0;
  background: linear-gradient(145deg, #ffffff, #f8fbff);
  border: 1px solid #dbe4f0;
  border-radius: 12px;
  padding: 9px 9px;
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.06);
}

.kpi-card__body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.kpi-card__icon-cell {
  flex: 0 0 clamp(38px, 18%, 60px);
  width: clamp(38px, 18%, 60px);
  align-self: stretch;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: center;
  gap: 3px;
  min-height: 0;
}

.kpi-card__icon-cell .kpi-card__icon {
  display: block;
  width: 100%;
  flex: 1 1 0;
  min-height: 0;
  object-fit: contain;
  object-position: left center;
  opacity: 0.8;
}

.kpi-card h3 {
  margin: 0;
  font-size: clamp(11px, 1.2vw, 13px);
  font-weight: 700;
  letter-spacing: -0.02em;
  text-transform: none;
  color: #64748b;
}

.kpi-card p {
  margin: 7px 0 0;
  font-size: clamp(16px, 1.9vw, 26px);
  font-weight: 700;
  color: #1d4ed8;
  line-height: 1.15;
  word-break: break-word;
}

.kpi-variation {
  margin-top: 4px;
  font-size: 11px;
  font-weight: 700;
}

.kpi-variation.variation-positive {
  color: #166534;
  background: transparent;
  padding: 0;
}

.kpi-variation.variation-negative {
  color: #991b1b;
  background: transparent;
  padding: 0;
}

.kpi-variation.variation-neutral {
  color: #1e3a8a;
  background: transparent;
  padding: 0;
}

.kpi-variation.variation-na {
  color: #64748b;
  background: transparent;
  padding: 0;
}

.kpi-footnote {
  margin: 0;
  font-size: 11px;
  color: #94a3b8;
  line-height: 1.2;
}

.panel {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  padding: 10px 12px;
}

/* Filter strip: thin light-gray edge + soft shadow when any filter active */
section.panel:has(.filters):has(.clear-filters-btn--filtered) {
  border-color: #e8ecf1;
  box-shadow: 0 1px 3px rgba(148, 163, 184, 0.1);
}

.viz-grid {
  display: grid;
  grid-template-columns: 54% 46%;
  grid-auto-rows: minmax(0, 1fr);
  gap: 16px;
  align-items: stretch;
}

.viz-grid > .panel {
  min-width: 0;
}

.panel--map {
  grid-column: 2;
  grid-row: 1 / span 2;
  display: flex;
  flex-direction: column;
}

.panel--map .map-shell {
  flex: 1 1 auto;
  min-height: 0;
  height: 100%;
}

.panel--sales {
  grid-column: 1;
  grid-row: 2;
  min-width: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.panel h2 {
  margin-top: 0;
}

.chart-panel-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  margin-bottom: 8px;
}

.chart-panel-head h2 {
  margin: 0;
  flex: 1 1 200px;
  min-width: 0;
  font-size: 1rem;
}

.chart-type-select-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
  pointer-events: none;
}

.chart-type-segment {
  position: relative;
  display: inline-flex;
  margin-left: auto;
  border-radius: 10px;
  border: 1px solid #e2e8f0;
  background: #f1f5f9;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.08);
  overflow: hidden;
  flex-shrink: 0;
}

.chart-type-segment__btn {
  margin: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 32px;
  padding: 0;
  font: inherit;
  border: none;
  background: transparent;
  color: #64748b;
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

.chart-type-segment__btn:hover:not(.chart-type-segment__btn--active) {
  color: #334155;
  background: #e2e8f0;
}

.chart-type-segment__btn:focus-visible {
  outline: 2px solid #2563eb;
  outline-offset: 2px;
  z-index: 1;
}

.chart-type-segment__btn--active {
  background: #2563eb;
  color: #fff;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

.chart-type-segment__btn--active:hover {
  background: #1d4ed8;
  color: #fff;
}

.chart-type-segment__btn + .chart-type-segment__btn {
  border-left: 1px solid #e2e8f0;
}

.chart-type-glyph {
  display: block;
  pointer-events: none;
}

.chart-type-glyph--bar {
  display: inline-flex;
  align-items: flex-end;
  justify-content: center;
  gap: 2px;
  height: 12px;
}

.chart-type-glyph--bar i {
  display: block;
  width: 3px;
  border-radius: 1px;
  background: currentColor;
}

.chart-type-glyph--bar i:nth-child(1) {
  height: 5px;
}

.chart-type-glyph--bar i:nth-child(2) {
  height: 9px;
}

.chart-type-glyph--bar i:nth-child(3) {
  height: 7px;
}

.chart-type-glyph--line svg {
  display: block;
}

.section-toolbar {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  margin-bottom: 8px;
}

.section-toolbar h2 {
  margin: 0;
}

.sales-panel-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px 14px;
  margin: 0 0 10px;
}

.sales-title-tab {
  margin: 0;
  padding: 0 0 4px;
  font-size: 1.25rem;
  font-weight: 700;
  font-family: inherit;
  line-height: 1.25;
  color: #94a3b8;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  transition: color 0.15s ease, border-color 0.15s ease;
}

.sales-title-tab:hover {
  color: #475569;
}

.sales-title-tab--active {
  color: #1d4ed8;
  border-bottom-color: #2563eb;
}

.sales-title-tab:focus-visible {
  outline: 2px solid #2563eb;
  outline-offset: 3px;
  border-radius: 2px;
}

.sales-title-tab-sep {
  color: #cbd5e1;
  font-size: 1.25rem;
  font-weight: 400;
  user-select: none;
}

.property-table-panel {
  display: flex;
  flex-direction: column;
  gap: 0;
  min-width: 0;
}

.property-table-panel > .table-wrap {
  flex: 1 1 auto;
  min-height: 0;
}

.table-wrap--properties table {
  min-width: 1360px;
}

.table-wrap:not(.table-wrap--properties) table {
  min-width: 0;
}

/* Deterministic widths for Suburbs table */
#suburbTableWrap col.suburb-col-suburb { width: 20%; }
#suburbTableWrap col.suburb-col-sales { width: 8%; }
#suburbTableWrap col.suburb-col-median { width: 8%; }
#suburbTableWrap col.suburb-col-variation { width: 8%; }
#suburbTableWrap col.suburb-col-growth { width: 8%; }
#suburbTableWrap col.suburb-col-prediction { width: 8%; }
#suburbTableWrap col.suburb-col-m2 { width: 8%; }
#suburbTableWrap col.suburb-col-room { width: 8%; }
#suburbTableWrap col.suburb-col-highest { width: 8%; }
#suburbTableWrap col.suburb-col-lowest { width: 8%; }
#suburbTableWrap col.suburb-col-distance { width: 8%; }

/* Deterministic widths for Properties table (physical columns grouped) */
#propertyTableWrap col.prop-col-address { width: 15%; }
#propertyTableWrap col.prop-col-type { width: 7.5%; }
#propertyTableWrap col.prop-col-beds { width: 5%; }
#propertyTableWrap col.prop-col-baths { width: 5%; }
#propertyTableWrap col.prop-col-parking { width: 5%; }
#propertyTableWrap col.prop-col-land { width: 5%; }
#propertyTableWrap col.prop-col-sales { width: 5%; }
#propertyTableWrap col.prop-col-variation { width: 7.5%; }
#propertyTableWrap col.prop-col-growth { width: 7.5%; }
#propertyTableWrap col.prop-col-prediction { width: 7.5%; }
#propertyTableWrap col.prop-col-m2 { width: 7.5%; }
#propertyTableWrap col.prop-col-highest { width: 7.5%; }
#propertyTableWrap col.prop-col-lowest { width: 7.5%; }
#propertyTableWrap col.prop-col-date { width: 7.5%; }
#propertyTableWrap col.prop-col-distance { width: 7.5%; }

.table-wrap--properties table th:first-child,
.table-wrap--properties table td:first-child {
  white-space: normal;
  max-width: 300px;
  word-break: break-word;
}

.property-table-pager {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 8px 12px;
  padding: 6px 2px 2px;
  margin-top: 2px;
}

.property-table-pager-meta {
  font-size: 11px;
  color: #94a3b8;
  font-variant-numeric: tabular-nums;
}

.property-table-pager-nav {
  display: inline-flex;
  align-items: center;
  gap: 2px;
}

.property-table-pager-btn {
  margin: 0;
  padding: 2px 8px;
  min-width: 28px;
  font-size: 14px;
  line-height: 1.2;
  font-family: inherit;
  color: #64748b;
  background: transparent;
  border: 1px solid #e2e8f0;
  border-radius: 4px;
  cursor: pointer;
  transition: background-color 0.12s ease, color 0.12s ease, border-color 0.12s ease;
}

.property-table-pager-btn:hover:not(:disabled) {
  background: #f1f5f9;
  color: #334155;
  border-color: #cbd5e1;
}

.property-table-pager-btn:disabled {
  opacity: 0.35;
  cursor: default;
}

.property-table-pager-btn:focus-visible {
  outline: 2px solid #2563eb;
  outline-offset: 1px;
}

.suburb-view-toggle {
  display: flex;
  align-items: stretch;
  gap: 8px;
  flex-wrap: wrap;
}

.suburb-menu-item {
  margin: 0;
  font-size: 22px;
  line-height: 1.2;
  font-weight: 700;
  color: #334155;
  padding: 8px 12px;
  border-radius: 10px;
  border: 1px solid #dbe4f0;
  background: #ffffff;
  cursor: pointer;
  transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
}

.suburb-menu-item:hover,
.suburb-menu-item:focus-visible {
  background: #eaf2ff;
  color: #0f172a;
  border-color: #93c5fd;
  box-shadow: 0 4px 14px rgba(29, 78, 216, 0.12);
  outline: none;
}

.suburb-menu-item.active {
  color: #0f172a;
  background: #dbeafe;
  border-color: #60a5fa;
}

.viz-grid .panel {
  min-height: 360px;
}

.filters {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 2px;
}

.filters label {
  font-size: 12px;
  color: #475569;
}

.filter-global-search {
  position: relative;
  flex: 0 0 clamp(168px, 19vw, 228px);
  width: clamp(168px, 19vw, 228px);
  max-width: 100%;
}

.filter-global-search__input {
  width: 100%;
  box-sizing: border-box;
  margin: 0;
  padding: 6px 9px;
  border-radius: 8px;
  border: 1px solid #d1d5db;
  font-size: 12px;
  color: #1e293b;
  background: #fff;
  min-height: 30px;
}

.filter-global-search__input::placeholder {
  color: #94a3b8;
}

.filter-global-search__input:hover {
  border-color: #cbd5e1;
}

.filter-global-search__input:focus {
  outline: none;
  border-color: #93c5fd;
  box-shadow: 0 0 0 2px rgba(147, 197, 253, 0.45);
}

.filter-global-search__dropdown {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 5px);
  z-index: 80;
  max-height: 260px;
  overflow-y: auto;
  overflow-x: hidden;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.12), 0 4px 10px rgba(15, 23, 42, 0.06);
  scrollbar-width: thin;
}

.filter-global-search__dropdown[hidden] {
  display: none !important;
}

.filter-global-search__group-label {
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #94a3b8;
  padding: 8px 10px 4px;
  background: #f8fafc;
  border-bottom: 1px solid #f1f5f9;
}

.filter-global-search__opt {
  display: block;
  width: 100%;
  text-align: left;
  border: none;
  background: transparent;
  padding: 7px 10px;
  font-size: 11px;
  font-weight: 500;
  color: #334155;
  cursor: pointer;
  line-height: 1.25;
}

.filter-global-search__opt--suburb {
  font-weight: 600;
  color: #1e293b;
}

.filter-global-search__opt:hover,
.filter-global-search__opt:focus-visible {
  background: #f1f5f9;
  outline: none;
}

.filter-global-search__addr-main {
  display: inline;
}

.filter-global-search__addr-sub {
  font-size: 10px;
  font-weight: 600;
  color: #64748b;
}

.filter-global-search__empty {
  padding: 12px 10px;
  font-size: 11px;
  color: #94a3b8;
  text-align: center;
}

.range-filter {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 0;
  border: none;
  border-radius: 0;
  background: transparent;
}

.range-filter label {
  font-size: 12px;
  color: #475569;
}

.dual-range {
  --min-pct: 0%;
  --max-pct: 100%;
  --track-h: 28px;
  width: min(320px, 42vw);
  min-width: 220px;
  height: var(--track-h);
  position: relative;
  border-radius: 999px;
  border: 1px solid #d1d5db;
  background: #e8ecf4;
  background-image: linear-gradient(
    to right,
    transparent 0%,
    transparent var(--min-pct),
    rgba(37, 99, 235, 0.2) var(--min-pct),
    rgba(37, 99, 235, 0.2) var(--max-pct),
    transparent var(--max-pct),
    transparent 100%
  );
}

.dual-range input[type="range"] {
  position: absolute;
  inset: 0;
  width: 100%;
  margin: 0;
  background: transparent;
  -webkit-appearance: none;
  appearance: none;
  pointer-events: none;
}

.dual-range input[type="range"]::-webkit-slider-runnable-track {
  height: var(--track-h);
  background: transparent;
}

.dual-range input[type="range"]::-moz-range-track {
  height: var(--track-h);
  background: transparent;
}

#minPriceRange::-webkit-slider-thumb,
#maxPriceRange::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  pointer-events: auto;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #3b82f6;
  border: 2px solid #ffffff;
  box-shadow: 0 1px 4px rgba(15, 23, 42, 0.25);
  cursor: pointer;
  margin-top: 6px;
}

#minPriceRange::-moz-range-thumb,
#maxPriceRange::-moz-range-thumb {
  pointer-events: auto;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #3b82f6;
  border: 2px solid #ffffff;
  box-shadow: 0 1px 4px rgba(15, 23, 42, 0.25);
  cursor: pointer;
}

#priceRangeValue {
  min-width: 88px;
  text-align: right;
  font-size: 12px;
  font-weight: 700;
  color: #1e3a8a;
}

select {
  padding: 6px 8px;
  border-radius: 8px;
  border: 1px solid #d1d5db;
  min-width: 120px;
  font-size: 12px;
}

.clear-filters-btn {
  border: 1px solid #d1d5db;
  background: #fff;
  color: #1f2937;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  padding: 6px 10px;
  cursor: pointer;
}

.clear-filters-btn:hover,
.clear-filters-btn:focus-visible {
  background: #f9fafb;
  border-color: #cbd5e1;
  outline: none;
}

.clear-filters-btn.clear-filters-btn--filtered {
  background: rgba(253, 224, 71, 0.45);
  border: 2px solid #ca8a04;
  box-shadow: 0 2px 10px rgba(202, 138, 4, 0.4);
}

.clear-filters-btn.clear-filters-btn--filtered:hover,
.clear-filters-btn.clear-filters-btn--filtered:focus-visible {
  background: rgba(253, 224, 71, 0.58);
  border-color: #a16207;
  box-shadow: 0 3px 14px rgba(161, 98, 7, 0.38);
}

.filter-active-chips {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  flex: 1 1 auto;
  min-width: 0;
}

.filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 2px 6px 2px 4px;
  margin: 0;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.03em;
  background: rgba(248, 250, 252, 0.98);
  border: none;
  border-radius: 5px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.05);
  max-width: 100%;
}

.filter-chip__x {
  flex-shrink: 0;
  margin: 0;
  padding: 0 1px;
  border: none;
  background: transparent;
  color: #dc2626;
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
  cursor: pointer;
  border-radius: 2px;
}

.filter-chip__x:hover,
.filter-chip__x:focus-visible {
  color: #b91c1c;
  outline: none;
}

.filter-chip__x:focus-visible {
  box-shadow: 0 0 0 2px rgba(220, 38, 38, 0.35);
}

.filter-chip__label {
  line-height: 1.2;
  padding-top: 1px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: min(200px, 28vw);
  color: #a89494;
  font-weight: 600;
}

.map-panel-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 12px;
  margin-bottom: 8px;
}

.map-panel-head h2 {
  margin: 0;
  flex: 1 1 200px;
  min-width: 0;
  font-size: 1rem;
}

.map-layer-toggles {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  flex: 0 1 auto;
}

.map-layer-tick {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 2px 6px 2px 4px;
  margin: 0;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.03em;
  color: #64748b;
  background: rgba(248, 250, 252, 0.98);
  border: 1px solid rgba(148, 163, 184, 0.4);
  border-radius: 5px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.05);
  cursor: pointer;
  user-select: none;
}

.map-layer-tick:hover {
  color: #475569;
  border-color: rgba(100, 116, 139, 0.5);
}

.map-layer-tick input {
  width: 11px;
  height: 11px;
  margin: 0;
  cursor: pointer;
  flex-shrink: 0;
  accent-color: #64748b;
}

.map-layer-tick span {
  line-height: 1.2;
  padding-top: 1px;
  white-space: nowrap;
}

.map-layer-metric {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 6px;
  margin: 0;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.03em;
  color: #64748b;
  background: rgba(248, 250, 252, 0.98);
  border: 1px solid rgba(148, 163, 184, 0.4);
  border-radius: 5px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.05);
}

.map-layer-metric select {
  min-width: 180px;
  padding: 3px 6px;
  border-radius: 6px;
  border: 1px solid #d1d5db;
  font-size: 11px;
}

.map-shell {
  position: relative;
  height: 100%;
  width: 100%;
}

.map-shell--fullscreen {
  position: fixed;
  inset: 10px;
  z-index: 1200;
  height: auto;
  width: auto;
  background: rgba(255, 255, 255, 0.06);
}

.map-shell #map {
  height: 100%;
  width: 100%;
  border-radius: 10px;
  border: 1px solid #e5e7eb;
}

.map-fullscreen-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 1300;
  width: 24px;
  height: 24px;
  border: 1px solid rgba(148, 163, 184, 0.65);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.72);
  color: #334155;
  font-size: 12px;
  line-height: 1;
  cursor: pointer;
  padding: 0;
}

.map-fullscreen-btn:hover {
  background: rgba(255, 255, 255, 0.88);
}

.map-heat-legend {
  padding: 3px 4px;
  min-width: 138px;
  background: rgba(255, 255, 255, 0.72);
  color: #0f172a;
  border: 1px solid rgba(15, 23, 42, 0.18);
  border-radius: 6px;
  box-shadow: 0 3px 10px rgba(15, 23, 42, 0.14);
  font-size: 10px;
  line-height: 1.1;
}

.table-wrap {
  overflow-x: auto;
  overflow-y: scroll;
  height: 420px;
  scrollbar-width: thin;
  scrollbar-color: rgba(100, 116, 139, 0.45) transparent;
}

.panel--sales .table-wrap {
  height: auto;
  flex: 1 1 auto;
  min-height: 0;
  width: 100%;
  max-width: 100%;
}

.panel--sales .property-table-panel,
.panel--sales #propertyTableWrap {
  min-width: 0;
  width: 100%;
  max-width: 100%;
}

.panel--sales .property-table-panel {
  flex: 1 1 auto;
  min-height: 0;
}

.panel--sales .sales-title-tab {
  font-size: 1.06rem;
}

.panel--sales th,
.panel--sales td {
  font-size: 11px;
  padding-top: 4px;
  padding-bottom: 4px;
}

.distribution-wrap {
  height: 420px;
  overflow-y: auto;
  overflow-x: auto;
  position: relative;
  width: 100%;
  max-width: 100%;
  scrollbar-width: thin;
  scrollbar-color: rgba(100, 116, 139, 0.45) transparent;
}

.distribution-inner {
  position: relative;
  min-height: 420px;
  width: 100%;
  max-width: 100%;
}

.distribution-wrap canvas,
.distribution-wrap #suburbDistributionChart {
  width: 100% !important;
  height: 100% !important;
}

.distribution-wrap::-webkit-scrollbar {
  width: 6px;
}

.distribution-wrap::-webkit-scrollbar-track {
  background: transparent;
}

.distribution-wrap::-webkit-scrollbar-thumb {
  background: rgba(100, 116, 139, 0.45);
  border-radius: 10px;
}

.distribution-axis-tooltip {
  position: absolute;
  top: 8px;
  transform: translateX(-50%);
  background: rgba(15, 23, 42, 0.88);
  color: #f8fafc;
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 11px;
  font-weight: 600;
  pointer-events: none;
  z-index: 15;
  white-space: nowrap;
  display: none;
}

.hidden {
  display: none;
}

.table-wrap::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

.table-wrap::-webkit-scrollbar-track {
  background: transparent;
}

.table-wrap::-webkit-scrollbar-thumb {
  background: rgba(100, 116, 139, 0.45);
  border-radius: 10px;
}

.table-wrap::-webkit-scrollbar-thumb:hover {
  background: rgba(100, 116, 139, 0.7);
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 1220px;
}

th,
td {
  text-align: left;
  border-bottom: 1px solid #e5e7eb;
  padding: 7px 6px;
  font-size: 12px;
  white-space: nowrap;
  vertical-align: middle;
}

th {
  background: #f9fafb;
}

th.sortable {
  cursor: pointer;
  user-select: none;
}

th.sortable:hover {
  background: #eef2f7;
}

/* Sticky header while scrolling body (Suburbs + Properties sales tables) */
#suburbTableWrap thead th,
#propertyTableWrap thead th {
  position: sticky;
  top: 0;
  z-index: 4;
  background: #f9fafb;
  box-shadow: 0 1px 0 #e5e7eb;
  white-space: normal;
  line-height: 1.15;
  word-break: break-word;
}

#suburbTableWrap thead th.sortable:hover,
#propertyTableWrap thead th.sortable:hover {
  background: #eef2f7;
}

/* Keep numeric columns visually aligned */
th:nth-child(n + 2),
td:nth-child(n + 2) {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

/* Variation (+ suburb avg growth) badge columns centered per table */
#suburbTableWrap th:nth-child(4),
#suburbTableWrap td:nth-child(4),
#suburbTableWrap th:nth-child(5),
#suburbTableWrap td:nth-child(5) {
  text-align: center;
}

#propertyTableWrap th:nth-child(8),
#propertyTableWrap td:nth-child(8),
#propertyTableWrap th:nth-child(9),
#propertyTableWrap td:nth-child(9) {
  text-align: center;
}

#propertyTableWrap th:nth-child(2),
#propertyTableWrap td:nth-child(2),
#propertyTableWrap th:nth-child(3),
#propertyTableWrap td:nth-child(3),
#propertyTableWrap th:nth-child(4),
#propertyTableWrap td:nth-child(4),
#propertyTableWrap th:nth-child(5),
#propertyTableWrap td:nth-child(5),
#propertyTableWrap th:nth-child(6),
#propertyTableWrap td:nth-child(6),
#propertyTableWrap th:nth-child(14),
#propertyTableWrap td:nth-child(14) {
  text-align: left;
}

/* Balanced spacing for Suburbs table columns */
#suburbTableWrap th:nth-child(1),
#suburbTableWrap td:nth-child(1) {
  min-width: 0;
}

#suburbTableWrap th:nth-child(2),
#suburbTableWrap td:nth-child(2) {
  min-width: 0;
}

#suburbTableWrap th:nth-child(3),
#suburbTableWrap td:nth-child(3) {
  min-width: 0;
}

#suburbTableWrap th:nth-child(4),
#suburbTableWrap td:nth-child(4),
#suburbTableWrap th:nth-child(5),
#suburbTableWrap td:nth-child(5) {
  min-width: 0;
}

#suburbTableWrap th:nth-child(6),
#suburbTableWrap td:nth-child(6) {
  min-width: 0;
}

#suburbTableWrap th:nth-child(7),
#suburbTableWrap td:nth-child(7),
#suburbTableWrap th:nth-child(8),
#suburbTableWrap td:nth-child(8),
#suburbTableWrap th:nth-child(9),
#suburbTableWrap td:nth-child(9) {
  min-width: 0;
}

#suburbTableWrap th:nth-child(10),
#suburbTableWrap td:nth-child(10) {
  min-width: 0;
}

#suburbTableWrap th:nth-child(11),
#suburbTableWrap td:nth-child(11) {
  min-width: 0;
}

/* Properties table: keep physical columns visually grouped */
#propertyTableWrap th:nth-child(1),
#propertyTableWrap td:nth-child(1) {
  min-width: 0;
}

#propertyTableWrap th:nth-child(2),
#propertyTableWrap td:nth-child(2) {
  min-width: 0;
}

#propertyTableWrap th:nth-child(3),
#propertyTableWrap td:nth-child(3),
#propertyTableWrap th:nth-child(4),
#propertyTableWrap td:nth-child(4),
#propertyTableWrap th:nth-child(5),
#propertyTableWrap td:nth-child(5),
#propertyTableWrap th:nth-child(6),
#propertyTableWrap td:nth-child(6),
#propertyTableWrap th:nth-child(7),
#propertyTableWrap td:nth-child(7) {
  min-width: 62px;
  padding-left: 2px;
  padding-right: 2px;
}

#propertyTableWrap th:nth-child(10),
#propertyTableWrap td:nth-child(10) {
  min-width: 0;
}

#propertyTableWrap th:nth-child(14),
#propertyTableWrap td:nth-child(14) {
  min-width: 0;
}

#propertyTableWrap th:nth-child(15),
#propertyTableWrap td:nth-child(15) {
  min-width: 0;
}

.variation-badge {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-weight: 700;
  font-size: 11px;
  padding: 2px 6px;
  border-radius: 999px;
}

.variation-badge:hover::after {
  content: attr(data-tooltip);
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  white-space: nowrap;
  z-index: 20;
  background: #f8fafc;
  color: #0f172a;
  border: 1px solid #dbe4f0;
  border-radius: 8px;
  padding: 5px 8px;
  font-size: 11px;
  font-weight: 500;
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.1);
}

.variation-positive {
  color: #166534;
  background: #dcfce7;
}

.variation-negative {
  color: #991b1b;
  background: #fee2e2;
}

.variation-neutral {
  color: #1e3a8a;
  background: #dbeafe;
}

.variation-na {
  color: #64748b;
  background: #e2e8f0;
}

tbody tr:hover td {
  background: #eaf2ff;
}

tbody tr.table-row--clickable {
  cursor: pointer;
}

.table-focus-btn {
  appearance: none;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: inherit;
  font: inherit;
  padding: 1px 4px;
  margin: 0;
  cursor: pointer;
  text-align: left;
  text-decoration: none;
  box-shadow: inset 0 0 0 rgba(0, 0, 0, 0);
  transition: background-color 0.12s ease, box-shadow 0.12s ease, border-color 0.12s ease;
}

.table-focus-btn:hover {
  background: rgba(15, 23, 42, 0.04);
  border-color: rgba(148, 163, 184, 0.4);
  box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.12);
}

.table-focus-btn:active {
  background: rgba(15, 23, 42, 0.06);
  box-shadow: inset 0 2px 3px rgba(15, 23, 42, 0.16);
}

.table-focus-btn:focus-visible {
  outline: 2px solid #60a5fa;
  outline-offset: 2px;
  border-radius: 2px;
}

.table-focus-btn--address {
  white-space: normal;
  word-break: break-word;
}

.table-physical-cell {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
}

.table-physical-cell__icon {
  width: 14px;
  height: 14px;
  object-fit: contain;
  opacity: 0.95;
}

/* User preference: center-align both sales tables */
#suburbTableWrap th,
#suburbTableWrap td,
#propertyTableWrap th,
#propertyTableWrap td {
  text-align: center !important;
}

/* Keep first column left-aligned as before */
#suburbTableWrap th:first-child,
#suburbTableWrap td:first-child,
#propertyTableWrap th:first-child,
#propertyTableWrap td:first-child {
  text-align: left !important;
}

/* Keep CBD distance values visually under their header */
#suburbTableWrap th:nth-child(11),
#suburbTableWrap td:nth-child(11),
#propertyTableWrap th:nth-child(15),
#propertyTableWrap td:nth-child(15) {
  text-align: center !important;
  white-space: nowrap;
}

tbody tr.table-row--active-filter td {
  background: #dbeafe;
  box-shadow: inset 0 1px 0 #bfdbfe, inset 0 -1px 0 #bfdbfe;
}

tbody tr.table-row--active-filter:hover td {
  background: #cfe4ff;
}

.leaflet-tooltip {
  pointer-events: none !important;
}

.leaflet-control-zoom {
  box-shadow: none !important;
}

.leaflet-control-zoom a {
  width: 24px !important;
  height: 24px !important;
  line-height: 24px !important;
  font-size: 14px !important;
  background: rgba(255, 255, 255, 0.68) !important;
  color: #0f172a !important;
}

.chart-wrap {
  height: 400px;
}

.viz-grid > .panel:not(.panel--map):not(.panel--sales) {
  display: flex;
  flex-direction: column;
}

.viz-grid > .panel:not(.panel--map):not(.panel--sales) .chart-wrap {
  flex: 1;
  min-height: 0;
  height: auto;
}

.chart-wrap--clickable {
  cursor: pointer;
}

.site-footer {
  width: 100%;
  margin: 0;
  padding: 16px 0 18px;
  background: rgba(65, 105, 225, 0.92);
}

.site-footer .kpi-footnote {
  width: 94vw;
  margin: 0 auto;
  color: rgba(255, 255, 255, 0.92);
}

#yearlyChart {
  width: 100% !important;
  height: 100% !important;
}

@media (max-width: 980px) {
  .kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
