@import url("https://fonts.googleapis.com/css2?family=DM+Mono:wght@400;500&family=Manrope:wght@400;500;600;700&family=Playfair+Display:ital,wght@0,600;1,600&display=swap");
:root {
  --ink: #15231c;
  --muted: #68736d;
  --paper: #f5f2ea;
  --card: #fffefa;
  --line: #d9ddd4;
  --lime: #c8f05c;
  --lime-dark: #94bd21;
  --forest: #20492e;
  --shadow: 0 16px 45px rgba(31, 44, 35, 0.14);
}
* {
  box-sizing: border-box;
}
html,
body {
  margin: 0;
  height: 100%;
  overflow: hidden;
}
body {
  font-family: Manrope, system-ui, sans-serif;
  color: var(--ink);
  background: var(--paper);
}
button,
input,
select {
  font: inherit;
}
button {
  color: inherit;
}
.topbar {
  height: 68px;
  display: flex;
  align-items: center;
  padding: 0 26px;
  border-bottom: 1px solid var(--line);
  background: #fbfaf5;
  position: relative;
  z-index: 1001;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font: 700 16px/1 DM Mono;
  text-decoration: none;
  color: var(--ink);
  letter-spacing: 0.1em;
}
.brand-mark {
  width: 28px;
  height: 25px;
  display: block;
  background: repeating-linear-gradient(
    0deg,
    transparent 0 4px,
    var(--forest) 5px 6px
  );
  clip-path: polygon(50% 0, 100% 100%, 0 100%);
}
.stepper {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #9ba39e;
}
.stepper .step {
  display: flex;
  gap: 7px;
  align-items: center;
  white-space: nowrap;
}
.stepper b {
  width: 21px;
  height: 21px;
  border: 1px solid #bec4bf;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font: 500 10px DM Mono;
}
.stepper i {
  height: 1px;
  width: 40px;
  background: #d8dcd7;
}
.stepper .active {
  color: var(--ink);
}
.stepper .active b {
  background: var(--ink);
  color: white;
  border-color: var(--ink);
}
.text-button {
  margin-left: auto;
  border: 0;
  background: none;
  text-transform: uppercase;
  font: 500 11px DM Mono;
  letter-spacing: 0.06em;
  cursor: pointer;
}
.workspace {
  height: calc(100vh - 68px);
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(390px, 0.8fr);
}
.map-pane {
  position: relative;
  min-width: 0;
}
.map-pane:after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  box-shadow: inset -15px 0 35px rgba(30, 50, 37, 0.06);
}
#map {
  height: 100%;
  background: #dce2d8;
}
.leaflet-tile-pane {
  filter: saturate(0.62) sepia(0.12) brightness(1.06);
}
.leaflet-control-zoom {
  border: 0 !important;
  box-shadow: var(--shadow) !important;
}
.leaflet-control-zoom a {
  color: var(--ink) !important;
}
.panel-float {
  background: rgba(255, 254, 250, 0.95);
  box-shadow: 0 7px 24px rgba(29, 48, 36, 0.15);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.8);
}
.map-tools {
  position: absolute;
  z-index: 500;
  top: 24px;
  left: 24px;
  display: flex;
  border-radius: 7px;
  overflow: hidden;
}
.tool {
  width: 45px;
  height: 42px;
  border: 0;
  border-right: 1px solid var(--line);
  background: transparent;
  display: grid;
  place-items: center;
  cursor: pointer;
}
.tool:last-child {
  border: 0;
}
.tool:hover,
.tool.active {
  background: var(--ink);
  color: #fff;
}
.tool svg,
.map-search svg,
.privacy svg,
.download-button svg {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.map-search {
  position: absolute;
  z-index: 500;
  top: 24px;
  right: 24px;
  width: min(315px, 40%);
  height: 43px;
  border-radius: 7px;
  display: flex;
  align-items: center;
  padding-left: 13px;
}
.map-search input {
  border: 0;
  background: transparent;
  outline: 0;
  min-width: 0;
  flex: 1;
  padding: 0 10px;
  font-size: 13px;
}
.map-search button {
  align-self: stretch;
  border: 0;
  border-left: 1px solid var(--line);
  background: transparent;
  padding: 0 14px;
  font: 500 10px DM Mono;
  cursor: pointer;
}
.search-results {
  position: absolute;
  z-index: 550;
  top: 73px;
  right: 24px;
  width: min(315px, 40%);
  border-radius: 7px;
  padding: 6px;
}
.search-results button {
  display: block;
  width: 100%;
  border: 0;
  background: none;
  text-align: left;
  padding: 9px;
  border-radius: 5px;
  font-size: 12px;
  cursor: pointer;
}
.search-results button:hover {
  background: #eef1e8;
}
.map-hint {
  position: absolute;
  z-index: 500;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%);
  padding: 10px 15px;
  border-radius: 5px;
  font-size: 12px;
  white-space: nowrap;
}
.map-hint span {
  display: inline-block;
  width: 7px;
  height: 7px;
  background: var(--lime-dark);
  border-radius: 50%;
  margin-right: 7px;
}
.map-credit {
  position: absolute;
  z-index: 500;
  bottom: 5px;
  right: 8px;
  font-size: 8px;
  background: rgba(255, 255, 255, 0.7);
  padding: 2px 4px;
}
.route-line {
  filter: drop-shadow(0 2px 2px rgba(0, 0, 0, 0.22));
}
.route-dot {
  background: var(--lime);
  border: 2px solid var(--ink);
  width: 13px !important;
  height: 13px !important;
  margin: -6px !important;
  border-radius: 50%;
  box-shadow: 0 2px 5px #31473955;
}
.control-pane {
  overflow: auto;
  padding: clamp(30px, 4vh, 48px) clamp(28px, 3.2vw, 52px);
  background: var(--paper);
  border-left: 1px solid var(--line);
}
.intro {
  margin-bottom: 28px;
}
.eyebrow {
  font: 500 10px DM Mono;
  letter-spacing: 0.17em;
  color: #6c786f;
  margin: 0 0 10px;
}
.intro h1 {
  font:
    600 clamp(34px, 3.3vw, 50px) / 0.98 Playfair Display,
    serif;
  letter-spacing: -0.035em;
  margin: 0 0 15px;
}
.intro h1::first-line {
  font-style: italic;
}
.intro > p:last-child {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
  margin: 0;
  max-width: 390px;
}
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 20px;
  margin-bottom: 14px;
  transition: 0.3s;
}
.card-heading {
  display: flex;
  gap: 14px;
  align-items: flex-start;
}
.number {
  font: 500 10px DM Mono;
  border: 1px solid #acb4ad;
  border-radius: 50%;
  min-width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
}
.card h2 {
  font-size: 14px;
  margin: 1px 0 3px;
}
.card-heading p {
  font-size: 11px;
  color: var(--muted);
  margin: 0;
}
.stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  margin: 18px 0;
  border: 1px solid var(--line);
  border-width: 1px 0;
}
.route-mode {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3px;
  margin-top: 18px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #f1f2ec;
}
.route-mode button {
  height: 32px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: var(--muted);
  font: 500 9px DM Mono;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  cursor: pointer;
}
.route-mode button.active {
  color: var(--ink);
  background: white;
  box-shadow: 0 1px 5px #20352818;
}
.route-mode svg {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  vertical-align: -3px;
  margin-right: 4px;
}
.stats div {
  padding: 12px 6px;
  border-right: 1px solid var(--line);
}
.stats div:last-child {
  border: 0;
}
.stats span,
.two-up label > span {
  font: 500 8px DM Mono;
  letter-spacing: 0.12em;
  color: #839087;
  display: block;
  margin-bottom: 4px;
}
.stats strong {
  font: 600 14px DM Mono;
}
.range-row {
  display: block;
}
.range-row > span {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  margin-bottom: 9px;
}
.range-row output {
  font: 500 11px DM Mono;
  color: var(--forest);
}
input[type="range"] {
  appearance: none;
  width: 100%;
  height: 3px;
  background: linear-gradient(to right, var(--forest) 0 28%, #d8ddd6 28%);
  border-radius: 4px;
  display: block;
  margin: 0 0 8px;
}
input[type="range"]::-webkit-slider-thumb {
  appearance: none;
  width: 15px;
  height: 15px;
  background: var(--lime);
  border: 2px solid var(--forest);
  border-radius: 50%;
  cursor: pointer;
}
.range-row small {
  font-size: 9px;
  color: #8b948e;
}
.relief-card .range-row {
  padding: 18px 0;
  border-bottom: 1px solid var(--line);
}
.two-up {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 14px;
}
.input-suffix {
  height: 38px;
  border: 1px solid var(--line);
  display: flex;
  align-items: center;
  background: white;
  border-radius: 4px;
}
.input-suffix input {
  border: 0;
  background: none;
  min-width: 0;
  width: 100%;
  padding: 0 10px;
  outline: 0;
  font: 500 12px DM Mono;
}
.input-suffix i {
  font: normal 9px DM Mono;
  color: #8d9690;
  padding-right: 9px;
}
.two-up select {
  width: 100%;
  height: 38px;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 4px;
  padding: 0 9px;
  font-size: 11px;
  outline: 0;
}
.primary-button,
.download-button {
  width: 100%;
  border: 0;
  cursor: pointer;
}
.primary-button {
  height: 46px;
  background: var(--ink);
  color: #fff;
  border-radius: 5px;
  margin-top: 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  font: 600 11px DM Mono;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.primary-button svg {
  width: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
}
.primary-button:hover:not(:disabled) {
  background: var(--forest);
}
.primary-button:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}
.disabled {
  opacity: 0.56;
}
.privacy {
  text-align: center;
  color: #89928c;
  font-size: 9px;
}
.privacy svg {
  width: 12px;
  height: 12px;
  vertical-align: -2px;
  margin-right: 5px;
}
.preview-drawer {
  position: fixed;
  z-index: 2000;
  inset: 68px 0 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 370px;
  background: #edf0e8;
  transform: translateY(110%);
  transition: transform 0.55s cubic-bezier(0.7, 0, 0.2, 1);
}
.preview-drawer.open {
  transform: none;
}
.preview-stage {
  position: relative;
  overflow: hidden;
  background: radial-gradient(circle at 50% 45%, #f7f7f1 0, #e4e9df 70%);
}
.preview-stage canvas {
  display: block;
}
.preview-label {
  position: absolute;
  z-index: 2;
  left: 26px;
  top: 24px;
}
.preview-label span {
  display: block;
  font: 500 9px DM Mono;
  letter-spacing: 0.16em;
}
.preview-label small {
  font-size: 9px;
  color: #7b857f;
}
.close-preview {
  position: absolute;
  z-index: 3;
  right: 22px;
  top: 20px;
  border: 1px solid #cad0c8;
  background: #fafbf6;
  border-radius: 50%;
  width: 34px;
  height: 34px;
  font-size: 21px;
  cursor: pointer;
}
.loading {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 7px;
  background: #e8ece4;
}
.loading.hidden {
  display: none;
}
.loading strong {
  font: 600 15px Playfair Display;
}
.loading span {
  font-size: 10px;
  color: var(--muted);
}
.loader {
  width: 46px;
  height: 46px;
  border: 2px solid #ccd4c9;
  border-top-color: var(--forest);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-bottom: 8px;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}
.export-panel {
  padding: 64px 38px;
  background: var(--ink);
  color: white;
}
.export-panel .eyebrow {
  color: var(--lime);
}
.export-panel h2 {
  font: 600 37px/1.06 Playfair Display;
  margin: 0 0 15px;
}
.export-copy {
  font-size: 11px;
  line-height: 1.6;
  color: #b7c1ba;
}
.export-panel dl {
  margin: 28px 0;
  border-top: 1px solid #ffffff24;
}
.export-panel dl div {
  display: flex;
  justify-content: space-between;
  padding: 12px 0;
  border-bottom: 1px solid #ffffff24;
}
.export-panel dt {
  font-size: 9px;
  color: #9ca9a0;
}
.export-panel dd {
  font: 500 10px DM Mono;
  margin: 0;
}
.download-button {
  height: 65px;
  border-radius: 5px;
  background: var(--lime);
  color: var(--ink);
  display: flex;
  align-items: center;
  padding: 0 18px;
  text-align: left;
  gap: 14px;
}
.download-button:hover {
  background: #d8ff70;
}
.download-button svg {
  width: 23px;
}
.download-button span {
  display: flex;
  flex-direction: column;
}
.download-button b {
  font-size: 12px;
}
.download-button small {
  font-size: 8px;
  margin-top: 2px;
}
.print-tip {
  text-align: center;
  color: #8f9c93;
  font-size: 8px;
}
dialog {
  border: 0;
  border-radius: 12px;
  padding: 34px;
  width: min(460px, calc(100% - 32px));
  box-shadow: 0 25px 80px #0005;
  background: var(--paper);
}
dialog::backdrop {
  background: #102219aa;
  backdrop-filter: blur(4px);
}
dialog > button {
  position: absolute;
  right: 16px;
  top: 12px;
  border: 0;
  background: none;
  font-size: 25px;
  cursor: pointer;
}
dialog h2 {
  font: 600 32px Playfair Display;
  margin: 0 0 20px;
}
dialog ol {
  list-style: none;
  padding: 0;
  margin: 0;
}
dialog li {
  display: grid;
  grid-template-columns: 70px 1fr;
  padding: 13px 0;
  border-top: 1px solid var(--line);
  font-size: 12px;
}
dialog li span {
  color: var(--muted);
}
.dialog-note {
  font-size: 10px;
  line-height: 1.6;
  color: var(--muted);
  margin-top: 20px;
}
@media (max-width: 850px) {
  html,
  body {
    overflow: auto;
  }
  .topbar {
    position: sticky;
    top: 0;
  }
  .stepper {
    display: none;
  }
  .workspace {
    height: auto;
    display: flex;
    flex-direction: column;
  }
  .map-pane {
    height: 58vh;
    min-height: 430px;
  }
  .control-pane {
    overflow: visible;
    padding: 30px 20px;
  }
  .preview-drawer {
    inset: 0;
    grid-template-columns: 1fr;
    grid-template-rows: minmax(360px, 58vh) auto;
    overflow: auto;
  }
  .export-panel {
    padding: 35px 28px;
  }
  .close-preview {
    position: fixed;
  }
  .map-search {
    width: 55%;
    right: 12px;
  }
  .map-tools {
    left: 12px;
  }
  .search-results {
    width: 55%;
    right: 12px;
  }
}
