:root {
  --land-max-width: 1180px;
}

html[data-land-supply] {
  scroll-behavior: auto;
}

* {
  box-sizing: border-box;
}

body.land-page {
  margin: 0;
  background: var(--background-subtle);
  color: var(--foreground);
  font-size: var(--fs-body);
  line-height: var(--lh-body);
}

body.land-page main {
  padding-top: var(--block-site-header-height, 56px);
}

body.land-page main .hz-icon {
  flex: none;
  overflow: hidden;
  font-family: inherit;
}

body.land-page main .hz-icon:not([data-symbol-ready="1"]) {
  visibility: hidden;
}

.land-workspace .hz-icon {
  font-size: var(--control-icon-s);
}

.land-workspace .btn {
  min-height: var(--control-h-s);
}

.land-container {
  width: min(calc(100% - var(--space-10)), var(--land-max-width));
  margin-inline: auto;
}

.land-hero {
  background: var(--background-subtle);
}

.land-hero .land-container {
  padding-block: var(--space-6);
}

.land-hero h1 {
  max-width: 720px;
  margin: 0;
  font-size: var(--fs-h1);
  line-height: var(--lh-h1);
  letter-spacing: 0;
}

.land-workspace {
  padding-bottom: var(--space-12);
}

.land-purpose-nav {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--gap-xs) var(--gap-md);
  margin-top: var(--space-3);
}

.land-purpose-tabs {
  display: inline-flex;
  max-width: 100%;
  gap: var(--gap-2xs);
  overflow-x: auto;
  padding: 0 var(--space-1);
  border-radius: var(--radius-md);
  background: var(--muted);
  scrollbar-width: none;
}

.land-location-details {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  gap: var(--space-2) var(--space-4);
  margin: var(--space-4) 0 0;
  font-size: var(--fs-sm);
}

.land-location-details dt { color: var(--muted-foreground); }
.land-location-details dd { margin: 0; overflow-wrap: anywhere; }
.land-location-details[hidden], #land-location-map[hidden] { display: none; }
#land-location-message { margin: 0; overflow-wrap: anywhere; }

.land-purpose-tabs button {
  min-height: var(--control-h-s);
  flex: none;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--muted-foreground);
  padding: 0 var(--space-3);
  font: inherit;
  font-size: var(--fs-xs);
  font-weight: 700;
  cursor: pointer;
}

.land-purpose-tabs button[aria-pressed="true"],
.land-supply-button[aria-pressed="true"],
.land-supply-button[aria-pressed="true"]:hover {
  border-color: var(--foreground);
  background: var(--foreground);
  color: var(--background);
}

.land-supply-button {
  flex: none;
  gap: var(--space-2);
  min-height: var(--control-h-s);
  padding-inline: var(--space-3);
  font-size: var(--fs-xs);
  font-weight: 700;
  white-space: nowrap;
}

.land-supply-count {
  min-width: 6ch;
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.land-controls {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(170px, 240px) minmax(170px, 220px);
  gap: var(--space-3);
  scroll-margin-top: calc(var(--block-site-header-height, 56px) + var(--space-4));
}

html[data-land-supply="true"] .land-controls {
  grid-template-columns: minmax(0, 1fr) minmax(170px, 240px);
}

html[data-land-supply="true"] .land-policy,
.land-policy[hidden] {
  display: none;
}

.land-controls label {
  display: grid;
  gap: var(--space-2);
  color: var(--muted-foreground);
  font-size: var(--fs-xs);
  font-weight: 700;
}

.land-controls input,
.land-controls select {
  width: 100%;
  min-height: var(--control-h-s);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--background);
  color: var(--foreground);
  padding: 0 var(--control-px-s);
  font-family: inherit;
  font-size: var(--control-font-s);
}

.land-policy-badge {
  color: var(--muted-foreground);
  font-size: var(--fs-xs);
  font-weight: 700;
}

.land-policy-badge::before {
  content: '·';
  margin-right: var(--space-2);
  color: var(--muted-foreground);
}

.land-controls input:focus,
.land-controls select:focus,
.land-purpose-tabs button:focus-visible,
.land-supply-button:focus-visible,
.land-result a:focus-visible {
  outline: 2px solid var(--ring);
  outline-offset: 2px;
}

.land-controls .block-search-select__input {
  height: var(--control-h-s);
  padding-right: var(--space-10);
  font-weight: 400;
}

.land-results-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  min-height: var(--control-h-s);
  margin-top: var(--space-2);
  padding-bottom: var(--space-2);
  border-bottom: 1px solid var(--border-strong);
  scroll-margin-top: calc(var(--block-site-header-height, 56px) + var(--space-4));
}

.land-list-actions {
  display: flex;
  align-items: center;
  flex: none;
  gap: var(--gap-xs);
}

.land-list-actions .btn {
  flex: none;
  width: var(--control-h-s);
  padding: 0;
}

.land-list-actions .btn[hidden] {
  display: none;
}

.land-view-switch {
  display: inline-flex;
  gap: var(--gap-2xs);
  padding: 0 var(--space-1);
  background: var(--muted);
  border-radius: var(--radius-md);
}

.land-view-switch button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-1);
  min-height: var(--control-h-s);
  padding: 0 var(--space-2);
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--foreground);
  font: inherit;
  font-size: var(--fs-xs);
  cursor: pointer;
}

.land-view-switch button[aria-pressed="true"] {
  background: var(--foreground);
  color: var(--background);
}

.land-view-switch[hidden],
.land-map[hidden],
.land-results[hidden],
.land-map [hidden] {
  display: none;
}

.land-map-key {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-2) var(--space-4);
  padding-block: var(--space-3);
}

.land-map-basis,
.land-map-coverage {
  color: var(--muted-foreground);
  font-size: var(--fs-sm);
}

.land-map-legend {
  display: flex;
  flex-wrap: wrap;
  min-height: var(--control-h-s);
  gap: var(--space-1) var(--space-3);
}

.land-map-legend-item {
  display: inline-flex;
  flex: none;
  align-items: center;
  gap: var(--space-2);
  min-height: var(--control-h-s);
  padding: var(--space-1) 0;
  border: 0;
  border-bottom: 2px solid transparent;
  background: transparent;
  color: var(--foreground);
  font: inherit;
  font-size: var(--fs-sm);
  cursor: pointer;
}

.land-map-legend-item[aria-pressed="true"] {
  border-bottom-color: var(--foreground);
  font-weight: 700;
}

.land-height--all { --height-color: var(--foreground); }
.land-height--low { --height-color: var(--success); }
.land-height--medium { --height-color: var(--primary); }
.land-height--high { --height-color: var(--warning); }
.land-height--very-high { --height-color: var(--accent); }
.land-height--other { --height-color: var(--destructive); }
.land-height--unknown { --height-color: var(--muted-foreground); }

.land-map-swatch {
  flex: none;
  width: 12px;
  height: 12px;
  background: var(--height-color);
  border: 1px solid var(--foreground);
}

.land-map-stage {
  position: relative;
  height: 480px;
  width: 100%;
  overflow: hidden;
  background: var(--muted);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
}

.land-map-stage svg {
  display: block;
  width: 100%;
  height: 100%;
  touch-action: none;
  cursor: grab;
}

.land-map-stage svg:active { cursor: grabbing; }

.land-map-background { pointer-events: none; }

.land-map-background path {
  vector-effect: non-scaling-stroke;
  stroke-linejoin: round;
  stroke-linecap: round;
}

.land-map-base-land {
  fill: var(--background);
  stroke: none;
}

.land-map-base-water {
  fill: color-mix(in srgb, var(--primary) 12%, var(--background));
  stroke: none;
}

.land-map-base-border,
.land-map-base-subdivision {
  fill: none;
  stroke: var(--border-strong);
  stroke-width: 1.5px;
}

.land-map-base-subdivision { stroke-dasharray: 4 3; }

.land-map-base-water-line {
  fill: none;
  stroke: color-mix(in srgb, var(--primary) 35%, var(--background));
  stroke-width: 2px;
}

.land-map-parcel {
  fill: color-mix(in srgb, var(--height-color) 25%, var(--background));
  stroke: color-mix(in srgb, var(--height-color) 60%, var(--foreground));
  stroke-width: 2px;
  vector-effect: non-scaling-stroke;
  cursor: pointer;
}

.land-map-parcel[aria-pressed="true"],
.land-map-parcel:focus-visible {
  fill: color-mix(in srgb, var(--height-color) 45%, var(--background));
  stroke: var(--foreground);
  stroke-width: 4px;
  outline: none;
}

.land-map-labels {
  fill: var(--foreground);
  font-size: var(--fs-2xs);
  text-anchor: middle;
  dominant-baseline: middle;
  pointer-events: none;
}

.land-map-tools {
  position: absolute;
  display: grid;
  gap: var(--gap-xs);
  top: var(--space-3);
  right: var(--space-3);
}

.land-map-tools .btn {
  width: var(--control-h-s);
  height: var(--control-h-s);
  padding: 0;
}

.land-map-north,
.land-map-scale {
  position: absolute;
  padding: var(--space-1) var(--space-2);
  background: var(--background);
  color: var(--foreground);
  font-size: var(--fs-xs);
  pointer-events: none;
}

.land-map-north { top: var(--space-3); left: var(--space-3); }
.land-map-scale { bottom: var(--space-3); left: var(--space-3); }
.land-map-scale::after {
  display: block;
  width: var(--scale-width);
  height: 5px;
  content: '';
  border: 1px solid var(--foreground);
  border-top: 0;
}

.land-map-empty {
  display: grid;
  height: 100%;
  place-items: center;
  padding: var(--space-6);
  color: var(--muted-foreground);
  font-size: var(--fs-sm);
}

.land-map-coverage { margin-block: var(--space-2); }

.land-map-selection:empty { display: none; }

.land-view-switch button:focus-visible,
.land-map-legend-item:focus-visible,
.land-map-stage svg:focus-visible {
  outline: 2px solid var(--ring);
  outline-offset: 2px;
}

@media (max-width: 760px) {
  .land-map-stage { height: 360px; }
  .land-view-switch button { padding-inline: var(--space-1); }
  .land-map-key { display: grid; }
  .land-map-legend {
    min-width: 0;
    max-width: 100%;
    flex-wrap: nowrap;
    overflow-x: auto;
  }
}

.land-results-head h2,
.land-results-head p {
  margin: 0;
}

.land-results-head p {
  color: var(--muted-foreground);
  font-size: var(--fs-sm);
}

.land-results {
  margin: 0;
  padding: 0;
  list-style: none;
}

.land-result {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: var(--space-2) var(--space-3);
  padding-block: var(--space-3);
  border-bottom: 1px solid var(--border);
}

.land-result-body {
  min-width: 0;
}

.land-result-heading {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: var(--space-2) var(--space-3);
}

.land-result-flags,
.land-result-meta,
.land-result-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.land-kind,
.land-location {
  font-size: var(--fs-xs);
  font-weight: 700;
}

.land-kind {
  color: var(--foreground);
}

.land-location {
  color: var(--muted-foreground);
}

.land-location::before {
  content: '·';
  margin-right: var(--space-2);
}

.land-result-title {
  margin: 0;
  font-size: var(--fs-h4);
  line-height: var(--lh-h4);
  letter-spacing: 0;
  overflow-wrap: anywhere;
}

.land-result-title a {
  color: inherit;
  text-decoration: none;
  text-underline-offset: var(--space-1);
}

.land-result-title a:hover,
.land-result-title a:focus-visible {
  text-decoration: underline;
}

.land-result-meta {
  gap: var(--space-1) var(--space-3);
  margin-top: var(--space-1);
  color: var(--muted-foreground);
  font-size: var(--fs-xs);
}

.land-result-summary {
  max-width: 760px;
  margin: var(--space-3) 0 0;
  color: var(--muted-foreground);
  line-height: var(--lh-body);
  overflow-wrap: anywhere;
}

.land-result-actions {
  gap: var(--gap-xs);
  align-content: center;
  justify-content: flex-end;
  max-width: 310px;
}

.land-result-actions .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  white-space: nowrap;
}

.land-map-link {
  width: var(--control-h-s);
  padding: 0;
}

.land-empty {
  padding-block: var(--space-12);
  text-align: center;
}

.land-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-1);
  margin-top: var(--space-4);
}

.land-pagination[hidden] {
  display: none;
}

.land-pagination .btn {
  flex: none;
  width: var(--control-h-s);
  height: var(--control-h-s);
  padding: 0;
  text-decoration: none;
  font-variant-numeric: tabular-nums;
}

.land-pagination [aria-current="page"],
.land-pagination [aria-current="page"]:hover {
  background: var(--foreground);
  color: var(--background);
  font-weight: 700;
}

.land-pagination .land-page-unavailable,
.land-pagination .land-page-unavailable:hover {
  background: transparent;
  color: var(--muted-foreground);
  cursor: default;
}

.land-pagination a:focus-visible {
  outline: 2px solid var(--ring);
  outline-offset: 2px;
}

@media (max-width: 760px) {
  .land-container {
    width: min(calc(100% - var(--space-8)), var(--land-max-width));
  }

  .land-purpose-tabs {
    width: fit-content;
  }

  .land-purpose-tabs button {
    padding-inline: var(--space-2);
    white-space: nowrap;
  }

  .land-controls {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  html[data-land-supply="true"] .land-controls {
    grid-template-columns: minmax(0, 1fr);
  }

  .land-search {
    grid-column: 1 / -1;
  }

  .land-pagination {
    gap: 0;
  }
}

@media (max-width: 640px) {
  .land-result {
    grid-template-columns: minmax(0, 1fr);
  }

  .land-result-actions {
    justify-content: flex-start;
    max-width: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .land-purpose-tabs,
  .land-results {
    scroll-behavior: auto;
  }
}
