.areas-explorer {
  max-width: 72rem;
}

.areas-viz {
  display: grid;
  gap: 1.25rem;
  margin: 0 0 1.75rem;
}

.areas-map-panel {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.areas-metric-toggle {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  align-items: center;
}

.areas-metric-btn,
.areas-view-btn {
  border: 1px solid #d9d0c2;
  background: #fffdf8;
  color: #314039;
  border-radius: 999px;
  padding: 0.4rem 0.85rem;
  font-size: 0.88rem;
  font-weight: 600;
  line-height: 1.2;
  min-height: 2.1rem;
  cursor: pointer;
}

.areas-metric-btn:hover,
.areas-view-btn:hover {
  border-color: var(--rp-teal, #1a5f4a);
  color: var(--rp-teal-dark, #0d3d2e);
}

.areas-metric-btn.is-active,
.areas-view-btn.is-active {
  background: var(--rp-teal, #1a5f4a);
  border-color: var(--rp-teal, #1a5f4a);
  color: #fff;
}

.areas-map-shell {
  position: relative;
  border: 1px solid #e4ddd0;
  border-radius: 16px;
  overflow: hidden;
  background:
    linear-gradient(160deg, rgba(26, 95, 74, 0.06), transparent 42%),
    linear-gradient(340deg, rgba(201, 162, 39, 0.08), transparent 40%),
    #f7f3ea;
  min-height: 22rem;
}

.areas-map {
  width: 100%;
  height: min(62vh, 34rem);
  min-height: 22rem;
  background: transparent;
}

.areas-map-empty {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  padding: 1.5rem;
  text-align: center;
  background: rgba(247, 243, 234, 0.82);
  color: #314039;
  z-index: 500;
  pointer-events: none;
}

.areas-map-empty p {
  margin: 0;
  max-width: 22rem;
}

.areas-legend {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.55rem 0.85rem;
  font-size: 0.82rem;
  color: #3d4742;
  font-variant-numeric: tabular-nums;
}

.areas-legend-scale {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.areas-legend-bar {
  width: 8.5rem;
  height: 0.55rem;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--rp-teal, #1a5f4a), var(--rp-accent, #c9a227));
}

.areas-legend-swatch {
  width: 0.85rem;
  height: 0.85rem;
  border-radius: 3px;
  background: #c8c2b6;
  border: 1px solid #b5aea0;
}

.areas-charts {
  display: grid;
  gap: 1rem;
  grid-template-columns: 1fr;
  align-items: stretch;
}

.areas-chart-card {
  display: flex;
  flex-direction: column;
  border: 1px solid #e4ddd0;
  border-radius: 14px;
  background: #fffdf8;
  padding: 0.9rem 1rem 0.85rem;
  min-height: 100%;
}

.areas-chart-card h2 {
  margin: 0 0 0.55rem;
  font-size: 1rem;
  line-height: 1.3;
  color: var(--rp-teal-dark, #0d3d2e);
}

.areas-chart-card canvas {
  display: block;
  width: 100% !important;
  height: 14rem !important;
  flex: 1 1 auto;
}

.areas-chart-wide canvas {
  height: 15.5rem !important;
}

.areas-list-toolbar {
  margin: 0 0 1rem;
}

.areas-list-filters {
  flex: 1 1 auto;
  min-width: 0;
}

.areas-filter-group {
  min-width: 0;
}

.areas-filter-label {
  font-size: 0.82rem;
  font-weight: 650;
  color: var(--rp-teal-dark, #0d3d2e);
  white-space: nowrap;
  line-height: 1.2;
  padding-top: 0;
  padding-bottom: 0;
}

.areas-region-filter,
.areas-sort {
  /* Keep Bootstrap form-select chevron: set colour only, not shorthand background */
  background-color: #fffdf8;
  border-color: #d9d0c2;
  color: #17211c;
  border-radius: 999px;
  min-height: 2.1rem;
  height: 2.1rem;
  padding-top: 0.25rem;
  padding-bottom: 0.25rem;
  padding-left: 0.9rem;
  padding-right: 2.15rem;
  box-shadow: none;
  font-size: 0.88rem;
  font-weight: 600;
  line-height: 1.2;
}

.areas-region-filter {
  width: 220px;
  max-width: 100%;
}

.areas-sort {
  width: 180px;
  max-width: 100%;
}

.areas-region-filter:focus,
.areas-sort:focus {
  border-color: var(--rp-teal, #1a5f4a);
  box-shadow: 0 0 0 0.2rem rgba(26, 95, 74, 0.2);
}

.areas-view-toggle {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  align-items: center;
  flex: 0 0 auto;
}

.areas-card-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.9rem;
  margin-bottom: 1rem;
  align-items: stretch;
}

.areas-card {
  display: flex;
  flex-direction: column;
  height: 100%;
  border: 1px solid #e4ddd0;
  border-radius: 14px;
  background:
    linear-gradient(180deg, rgba(255, 253, 248, 0.95), #fffdf8),
    #fffdf8;
  padding: 1rem 1.05rem 0.9rem;
  transition: border-color 0.18s ease, transform 0.18s ease;
}

.areas-card:hover {
  border-color: rgba(26, 95, 74, 0.45);
  transform: translateY(-1px);
}

.areas-card.is-highlight {
  border-color: var(--rp-accent, #c9a227);
  box-shadow: 0 0 0 2px rgba(201, 162, 39, 0.25);
}

.areas-card-top {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  align-items: flex-start;
}

.areas-card-title {
  margin: 0;
  font-size: 1.05rem;
  line-height: 1.25;
}

.areas-card-title a {
  color: var(--rp-teal-dark, #0d3d2e);
  text-decoration: none;
}

.areas-card-title a:hover {
  text-decoration: underline;
  text-decoration-color: var(--rp-accent, #c9a227);
}

.areas-card-region {
  margin: 0.2rem 0 0;
  color: #4a544e;
  font-size: 0.86rem;
}

.areas-yield-badge {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  padding: 0.28rem 0.55rem;
  border-radius: 999px;
  background: rgba(201, 162, 39, 0.16);
  color: #5c4808;
  font-weight: 700;
  font-size: 0.82rem;
  font-variant-numeric: tabular-nums;
}

.areas-card-price {
  margin: 0.7rem 0 0.15rem;
  font-size: 1.55rem;
  font-weight: 700;
  color: var(--rp-teal, #1a5f4a);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
}

.areas-card-meta {
  margin: 0;
  color: #3d4742;
  font-size: 0.9rem;
}

.areas-change {
  font-weight: 650;
  font-variant-numeric: tabular-nums;
}

.areas-change.is-up {
  color: #146c43;
}

.areas-change.is-down {
  color: #b02a37;
}

.areas-change.is-flat {
  color: #3d4742;
}

.areas-card-spark {
  margin: 0.65rem 0 0.55rem;
  height: 2rem;
}

.areas-card-spark svg {
  width: 100%;
  height: 100%;
  display: block;
}

.areas-card-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  font-size: 0.9rem;
  margin-top: auto;
  padding-top: 0.35rem;
}

.areas-card-links a {
  color: var(--rp-teal, #1a5f4a);
  font-weight: 600;
}

.areas-sources {
  margin-top: 1.5rem;
  color: #3d4742;
  line-height: 1.45;
}

.areas-sources a {
  color: var(--rp-teal-dark, #0d3d2e);
  font-weight: 600;
}

.areas-seo-links {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.ask-areas {
  max-height: min(70vh, 36rem);
  overflow: auto;
  border: 1px solid #e4ddd0;
  border-radius: 12px;
  background: #fffdf8;
}

.ask-areas .table {
  margin-bottom: 0;
  color: #17211c;
}

.ask-areas thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #f3efe6;
  color: var(--rp-teal-dark, #0d3d2e);
  border-bottom-color: #d9d0c2;
  box-shadow: 0 1px 0 #d9d0c2;
  white-space: nowrap;
  font-size: 0.86rem;
}

.ask-areas tbody td {
  vertical-align: middle;
}

.ask-areas .num {
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.leaflet-tooltip.areas-map-tip {
  background: #fffdf8;
  border: 1px solid #d9d0c2;
  border-radius: 10px;
  box-shadow: 0 10px 24px rgba(20, 40, 32, 0.12);
  color: #314039;
  padding: 0.55rem 0.7rem;
  font-size: 0.82rem;
  line-height: 1.35;
}

.leaflet-tooltip.areas-map-tip strong {
  display: block;
  margin-bottom: 0.2rem;
  color: var(--rp-teal-dark, #0d3d2e);
}

@media (min-width: 720px) {
  .areas-card-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .areas-charts {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .areas-chart-wide {
    grid-column: span 2;
  }
}

@media (min-width: 1080px) {
  .areas-viz {
    grid-template-columns: minmax(0, 1.35fr) minmax(18rem, 0.9fr);
    align-items: start;
  }

  .areas-charts {
    grid-template-columns: 1fr;
  }

  .areas-chart-wide {
    grid-column: auto;
  }

  .areas-card-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 575.98px) {
  .areas-map {
    height: 18rem;
    min-height: 18rem;
  }

  .areas-list-toolbar {
    flex-direction: column;
    align-items: stretch !important;
  }

  .areas-list-filters {
    width: 100%;
    flex-direction: column;
    align-items: stretch !important;
  }

  .areas-filter-group {
    width: 100%;
    flex-direction: column;
    align-items: stretch !important;
  }

  .areas-filter-label {
    margin-bottom: 0.2rem;
  }

  .areas-region-filter,
  .areas-sort {
    width: 100%;
    border-radius: 0.5rem;
  }

  .areas-view-toggle {
    width: 100%;
  }

  .areas-view-btn {
    flex: 1 1 auto;
    text-align: center;
  }

  .areas-metric-btn {
    flex: 1 1 auto;
    text-align: center;
  }
}
