:root {
  --ink: #173d2d;
  --paper: #f6f3e9;
  --green: #215f43;
  --lime: #cbe66b;
  --gold: #f0b323;
  --line: rgba(23, 61, 45, .17);
  --serif: "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  --sans: "Avenir Next", Avenir, sans-serif;
}

* { box-sizing: border-box; }
html, body, .map-shell, #parcel-map { width: 100%; height: 100%; }
body { margin: 0; color: var(--ink); background: #d8d9d2; font-family: var(--sans); overflow: hidden; }
button, a { color: inherit; font: inherit; }
button { cursor: pointer; }

.map-shell { position: relative; isolation: isolate; overflow: hidden; }
#parcel-map { z-index: 0; background: #d6d9d2; }
#parcel-map .leaflet-overlay-pane path { vector-effect: non-scaling-stroke; }

.leaflet-container { font-family: var(--sans); }
.leaflet-tile-pane { filter: saturate(.86) contrast(.98); }
.leaflet-control-zoom { margin: 0 20px 24px 0 !important; border: 0 !important; box-shadow: 0 12px 34px rgba(23,61,45,.18) !important; }
.leaflet-control-zoom a { width: 44px !important; height: 44px !important; line-height: 42px !important; border: 0 !important; border-radius: 0 !important; color: var(--ink) !important; background: rgba(246,243,233,.94) !important; font-size: 22px !important; }
.leaflet-control-zoom-in { border-bottom: 1px solid var(--line) !important; }
.leaflet-control-attribution { padding: 4px 8px !important; color: #405b50 !important; background: rgba(246,243,233,.78) !important; font-size: 10px !important; }
.leaflet-control-attribution img,
.leaflet-control-attribution svg {
  width: auto !important;
  max-width: 28px !important;
  height: auto !important;
  max-height: 20px !important;
  vertical-align: middle;
}

.map-header {
  position: absolute;
  z-index: 500;
  top: 20px;
  left: 20px;
  right: 20px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  pointer-events: none;
}
.map-brand { display: flex; align-items: baseline; padding: 13px 16px; color: var(--ink); background: rgba(246,243,233,.92); box-shadow: 0 12px 34px rgba(23,61,45,.12); backdrop-filter: blur(16px); text-decoration: none; pointer-events: auto; }
.map-brand strong { font-family: var(--serif); font-size: 22px; letter-spacing: -.035em; }
.map-brand span { color: #6d776f; font-size: 12px; font-weight: 600; }
.fullscreen-button { width: 50px; height: 50px; display: grid; place-items: center; border: 0; color: var(--paper); background: rgba(23,61,45,.94); box-shadow: 0 12px 34px rgba(23,61,45,.18); pointer-events: auto; }
.fullscreen-button svg { width: 20px; fill: none; stroke: currentColor; stroke-width: 1.7; }

.layer-switch {
  position: absolute;
  z-index: 500;
  top: 20px;
  left: 50%;
  display: flex;
  padding: 5px;
  transform: translateX(-50%);
  border: 1px solid rgba(246,243,233,.72);
  border-radius: 14px;
  background: rgba(15,38,29,.92);
  box-shadow: 0 12px 34px rgba(23,61,45,.18);
  backdrop-filter: blur(16px);
}
.layer-switch button { width: 44px; min-width: 44px; height: 44px; display: grid; place-items: center; padding: 0; border: 0; border-radius: 10px; color: #edf3ef; background: transparent; transition: color .2s, background .2s; cursor: pointer; }
.layer-switch button.active { color: var(--ink); background: var(--lime); }
.layer-switch svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.5; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; }

.map-summary {
  position: absolute;
  z-index: 500;
  left: 20px;
  bottom: 54px;
  width: min(760px, calc(100% - 160px));
  min-height: 92px;
  display: grid;
  grid-template-columns: minmax(180px, .9fr) minmax(300px, 1.35fr) auto;
  gap: 20px;
  align-items: center;
  padding: 17px 20px;
  background: rgba(246,243,233,.94);
  box-shadow: 0 18px 55px rgba(23,61,45,.19);
  backdrop-filter: blur(18px);
}
.summary-address { display: flex; flex-direction: column; }
.summary-address span { color: #66716a; font-size: 13px; }
.summary-address strong { margin-top: 3px; font-family: var(--serif); font-size: 27px; letter-spacing: -.035em; }
.map-summary dl { display: grid; grid-template-columns: repeat(3, 1fr); margin: 0; border-left: 1px solid var(--line); }
.map-summary dl div { min-width: 0; padding-left: 17px; }
.map-summary dt { color: #747e77; font-size: 11px; }
.map-summary dd { margin: 5px 0 0; font-size: 14px; font-weight: 700; white-space: nowrap; }
.summary-links { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; }
.summary-links a { padding-bottom: 4px; border-bottom: 1px solid currentColor; color: var(--green); font-size: 12px; font-weight: 700; text-decoration: none; white-space: nowrap; }
.summary-links small { max-width: 185px; color: #6f7871; font-size: 11px; line-height: 1.35; }

.measurement-label { width: max-content !important; height: auto !important; color: var(--paper); background: transparent; border: 0; }
.measurement-label span { display: block; padding: 8px 11px; border: 1px solid rgba(246,243,233,.24); border-radius: 7px; background: rgba(23,61,45,.95); box-shadow: 0 8px 24px rgba(23,61,45,.22); font-size: 12px; font-weight: 750; letter-spacing: .02em; white-space: nowrap; transform: translate(-50%, -50%); }
.measurement-label.frontage span { color: #342900; background: var(--gold); }

body.is-embedded .map-header { display: none; }
body.is-embedded .map-summary { display: none; }
body.is-hero .map-header { display: none; }
body.is-hero .layer-switch {
  top: auto;
  right: 22px;
  bottom: 22px;
  left: auto;
  transform: none;
}
body.is-ambient .map-header,
body.is-ambient .layer-switch { display: none; }
body.is-ambient .measurement-label { display: none; }
body.is-embedded .leaflet-control-zoom { margin: 0 14px 14px 0 !important; }
body.is-hero .leaflet-control-zoom { margin-bottom: 82px !important; }
body.is-embedded .leaflet-control-zoom a { width: 40px !important; height: 40px !important; line-height: 38px !important; }

@media (max-width: 760px) {
  .map-header { top: 12px; left: 12px; right: 12px; }
  .map-brand { padding: 11px 13px; }
  .map-brand strong { font-size: 19px; }
  .fullscreen-button { width: 46px; height: 46px; }
  .layer-switch { top: 70px; right: 12px; left: auto; transform: none; }
  .layer-switch button { width: 42px; min-width: 42px; height: 42px; }
  .map-summary { left: 10px; right: 10px; bottom: 28px; width: auto; min-height: 0; grid-template-columns: 1fr auto; gap: 12px; padding: 14px 15px; }
  .summary-address span { font-size: 12px; }
  .summary-address strong { font-size: 24px; }
  .map-summary dl { display: none; }
  .summary-links a { font-size: 12px; }
  .summary-links small { display: block; max-width: 132px; font-size: 11px; }
  .measurement-label span { padding: 6px 9px; font-size: 13px; }
  body:not(.is-embedded) .leaflet-control-zoom { display: none; }
  .leaflet-control-attribution { max-width: 100%; font-size: 8px !important; }
  body.is-embedded .map-summary { bottom: 12px; }
  body.is-hero .layer-switch {
    top: auto;
    right: 12px;
    bottom: 12px;
    left: auto;
  }
}

@media (max-height: 620px) and (min-width: 761px) {
  .map-summary { bottom: 20px; min-height: 80px; }
}
