@font-face {
  font-family: 'DM Sans';
  src: url(fonts/dm-sans-400.woff2) format('woff2');
  font-weight: 100 1000;
  font-display: swap;
}
@font-face {
  font-family: Spectral;
  src: url(fonts/spectral.woff2) format('woff2');
  font-weight: 500;
  font-display: swap;
}
:root {
  --ink: #172f28;
  --forest: #224e3c;
  --green: #497753;
  --soft: #eaf0e4;
  --muted: #506257;
  --line: #d6dfd3;
  --panel: #fbfcf7;
  --white: #fffefa;
  --serif: Spectral, Georgia, serif;
  --sans: 'DM Sans', Arial, sans-serif;
  font: 14px/1.45 var(--sans);
  color: var(--ink);
  background: var(--panel);
  color-scheme: light;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
}
p,
h1,
h2,
h3,
dl,
dd,
fieldset {
  margin: 0;
}
button,
input,
select {
  font: inherit;
  color: inherit;
}
button,
select,
summary {
  cursor: pointer;
}
button {
  border: 0;
  background: transparent;
}
button:disabled {
  opacity: 0.55;
  cursor: default;
}
button:focus-visible,
input:focus-visible,
select:focus-visible,
a:focus-visible,
summary:focus-visible {
  outline: 3px solid #ca8733;
  outline-offset: 2px;
}
[hidden] {
  display: none !important;
}
.sr {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
}
.icon {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
  width: 17px;
  height: 17px;
  flex: none;
}
button:has(.icon),
.section-label,
.brand,
.brand-mark,
.header-end,
.app-header,
.workflow,
.method-row,
.select-box,
.numeric,
.actions,
.metrics dt,
.metrics > div,
.active-area,
.search-input,
.map-key,
.dialog-head {
  display: flex;
  align-items: center;
}
button:has(.icon) {
  justify-content: center;
  gap: 7px;
}
a {
  color: var(--forest);
  text-underline-offset: 3px;
}
.app-header {
  height: 61px;
  background: #193a30;
  color: #f6f8ee;
  justify-content: space-between;
  padding: 0 clamp(15px, 2vw, 32px);
  gap: 10px;
}
.brand {
  gap: 4px;
  font-size: 21px;
  letter-spacing: -0.055em;
}
.brand strong {
  font-weight: 660;
}
.brand-mark {
  justify-content: center;
  border: 1px solid #8baf95;
  border-radius: 8px;
  color: #d9e9b8;
  width: 32px;
  height: 32px;
  margin-right: 6px;
  background: #265341;
}
.brand-mark .icon {
  width: 21px;
  height: 21px;
}
.header-end {
  gap: 19px;
  font-size: 13px;
}
.prototype {
  color: #c6d4c9;
}
.header-end button {
  color: #f5f8ed;
  border-left: 1px solid #557165;
  padding: 3px 0 3px 17px;
}
.atlas {
  display: grid;
  grid-template-columns: clamp(310px, 26vw, 383px) minmax(0, 1fr);
  height: calc(100vh - 61px);
  height: calc(100dvh - 61px);
  min-height: 400px;
}
.rail {
  display: flex;
  flex-direction: column;
  min-height: 0;
  min-width: 0;
  border-right: 1px solid #c3d0c2;
  background: var(--panel);
  z-index: 3;
  box-shadow: 2px 0 10px #16342110;
}
.workflow {
  border-bottom: 1px solid var(--line);
  padding: 0 20px;
  gap: 20px;
  flex: none;
}
.workflow button {
  position: relative;
  color: var(--muted);
  font-size: 13px;
  font-weight: 550;
  padding: 16px 2px 14px;
}
.workflow button[aria-current='step'] {
  color: var(--forest);
  font-weight: 700;
}
.workflow button[aria-current='step']:after {
  position: absolute;
  content: '';
  bottom: -1px;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--forest);
  border-radius: 3px 3px 0 0;
}
.workflow .icon {
  width: 16px;
}
.panel {
  min-height: 0;
  overflow-y: auto;
  padding: 23px clamp(17px, 1.9vw, 29px);
  scrollbar-gutter: stable;
  scrollbar-width: thin;
  scrollbar-color: #c5d0c2 transparent;
}
.panel h1,
.profile h2,
dialog h2 {
  font: 500 36px/1.08 var(--serif);
  letter-spacing: -0.048em;
}
.methods {
  border: 0;
  padding: 0;
  margin: 18px 0;
}
.field-title,
.input-group label {
  font-size: 13px;
  font-weight: 650;
}
.field-title {
  display: block;
  padding: 0;
  margin-bottom: 7px;
}
.method-row {
  gap: 6px;
}
.method-row button {
  flex: 1;
  min-width: 0;
  border-radius: 7px;
  border: 1px solid var(--line);
  min-height: 38px;
  font-size: 13px;
  font-weight: 550;
  padding: 6px;
}
.method-row button[aria-pressed='true'] {
  background: var(--soft);
  border-color: #879f80;
  color: #254c33;
}
.method-row button .icon {
  width: 15px;
  height: 15px;
}
.select-box,
.numeric {
  border: 1px solid #bdccbd;
  border-radius: 7px;
  background: var(--white);
  min-height: 42px;
  padding: 0 12px;
  gap: 6px;
}
.select-box select {
  appearance: none;
  width: 100%;
  min-width: 0;
  outline: 0;
  background: transparent;
  border: 0;
  padding: 9px 0;
  font-size: 14px;
  font-weight: 520;
}
.select-box:focus-within,
.numeric:focus-within,
.search-input:focus-within {
  outline: 2px solid var(--green);
  outline-offset: 0;
}
.select-box .icon:last-child {
  width: 15px;
  pointer-events: none;
}
.actions button {
  border: 1px solid #c6d3c0;
  background: var(--soft);
  border-radius: 5px;
  padding: 4px 9px;
  line-height: 1.4;
  color: var(--forest);
  font-weight: 600;
  font-size: 12px;
}
.hint {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.48;
  margin-top: 8px;
}
.draw-tools {
  padding: 10px;
  border-radius: 7px;
  border: 1px dashed #a8b99f;
}
.actions {
  gap: 5px;
  flex-wrap: wrap;
  margin-top: 5px;
}
.actions button {
  background: var(--white);
}
.actions .icon {
  width: 13px;
}
.actions .small-primary {
  background: var(--forest);
  color: white;
}
.draw-tools > span {
  color: var(--muted);
  font-size: 12px;
}
#map-hint:empty,
#profile-note:empty,
#result-note:empty {
  display: none;
}
#boundary-list {
  margin-top: 8px;
  color: var(--muted);
  font-size: 13px;
}
#boundary-list summary {
  width: fit-content;
  color: var(--forest);
  font-weight: 550;
}
.list-scroll {
  block-size: 9.5rem;
  overflow-y: auto;
  scrollbar-gutter: stable;
  overscroll-behavior: contain;
  margin-top: 7px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--white);
  padding: 3px;
}
#boundary-options label {
  display: flex;
  gap: 9px;
  align-items: center;
  padding: 6px 8px;
  border-radius: 4px;
  cursor: pointer;
}
#boundary-options label:has(:checked) {
  background: var(--soft);
  color: var(--forest);
  font-weight: 600;
}
#boundary-options input {
  accent-color: var(--forest);
  flex: none;
}
#list-empty {
  padding: 0 7px;
}
.empty-area .area-swatch {
  border-color: var(--muted);
  background: transparent;
}
.profile {
  border-top: 1px solid var(--line);
  padding-top: 20px;
  margin-top: 23px;
}
.section-label {
  color: #566a58;
  font-size: 10px;
  letter-spacing: 0.095em;
  text-transform: uppercase;
  font-weight: 700;
  gap: 7px;
}
.area-swatch {
  display: inline-block;
  width: 13px;
  height: 11px;
  flex: none;
  border: 2px solid #2d664c;
  border-radius: 3px;
  background: #b9d7ac;
}
.profile h2 {
  font-size: 28px;
  margin-top: 7px;
}
.type-tag {
  font-size: 12px;
  color: var(--muted);
  margin-top: 2px;
}
.metrics {
  margin-top: 12px;
}
.metrics > div {
  padding: 6px 0;
  justify-content: space-between;
  gap: 8px;
}
.metrics dt {
  color: var(--muted);
  font-size: 13px;
  gap: 8px;
}
.metrics dt .icon {
  width: 15px;
  height: 15px;
  color: #60785f;
}
.metrics dd {
  font-size: 17px;
  font-weight: 620;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.035em;
}
.metrics small {
  font-size: 12px;
  font-weight: 490;
}
.profile .hint {
  font-size: 11px;
}
.primary {
  width: 100%;
  justify-content: space-between !important;
  background: var(--forest);
  color: white;
  font-size: 14px;
  font-weight: 580;
  border-radius: 7px;
  padding: 12px 14px;
}
.primary:hover {
  background: #173d2e;
}
.advance {
  margin-top: 19px;
}
.active-area {
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--soft);
  margin: 11px 0 23px;
  padding: 7px 10px;
  max-width: 100%;
  font-size: 13px;
}
.active-area .icon {
  width: 13px;
  height: 13px;
}
.input-group {
  display: grid;
  gap: 13px;
  margin: 18px 0;
}
.input-group label {
  display: block;
}
.numeric {
  margin-top: 6px;
}
.numeric input {
  width: 100%;
  min-width: 0;
  background: transparent;
  border: 0;
  outline: 0;
  padding: 7px 0;
  font-weight: 580;
  font-size: 18px;
}
.numeric span,
.result small {
  font: 500 12px var(--sans);
  white-space: nowrap;
  color: var(--muted);
}
.result {
  border: 1px solid #d4e0cb;
  border-radius: 8px;
  padding: 16px;
  background: var(--soft);
  margin-top: 22px;
}
.result #output {
  font: 500 34px/1.3 var(--serif);
  letter-spacing: -0.05em;
}
.result #result-note {
  color: var(--muted);
  font-size: 12px;
}
.map-frame {
  min-width: 0;
  min-height: 0;
  position: relative;
  isolation: isolate;
  overflow: hidden;
  background: #e5ebe1;
}
#map {
  position: absolute;
  inset: 0;
  background: #e6eae0;
  z-index: 0;
  font-family: var(--sans);
}
.map-frame {
  --map-surface: #fffefa;
  --map-ring: #c7d1c4;
  --map-shadow: 0 2px 8px #18312520;
  --map-gap: 15px;
}
#map,
#map button,
#map input {
  font-family: var(--sans);
}
#map .maplibregl-ctrl-top-left {
  width: min(340px, calc(100% - 84px));
  z-index: 5;
}
#map .maplibregl-ctrl-top-left .search-wrap {
  float: none;
  margin: var(--map-gap) 0 0 var(--map-gap);
}
#map .maplibregl-ctrl-top-right .maplibregl-ctrl-group {
  margin: var(--map-gap) var(--map-gap) 0 0;
}
#map .maplibregl-ctrl-bottom-left .maplibregl-ctrl {
  margin: 0 0 23px var(--map-gap);
}
#map .maplibregl-ctrl-group,
.search-input,
#base-trigger,
#base-panel,
.map-key,
#matches {
  border: 1px solid var(--map-ring);
  border-radius: 7px;
  background: var(--map-surface);
  box-shadow: var(--map-shadow);
}
.search-wrap {
  position: relative;
}
#map .maplibregl-ctrl-group button {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  color: var(--forest);
}
#map .maplibregl-ctrl-group button + button {
  border-top: 1px solid var(--line);
}
#map .maplibregl-ctrl-group button:hover,
#base-trigger:hover {
  background-color: var(--soft);
}
#map .maplibregl-ctrl-group button span {
  opacity: 0.83;
}
#map .maplibregl-ctrl-attrib {
  margin: 0;
  padding: 1px 6px 2px;
  background: #fffefae8;
  border-radius: 4px 0 0;
  font: 10px/1.45 var(--sans);
  text-align: right;
  max-width: 100%;
}
#map .maplibregl-ctrl-attrib a {
  color: var(--forest);
}
.search-input {
  gap: 9px;
  padding: 0 12px;
  min-height: 41px;
}
.search-input .icon {
  color: var(--muted);
}
.search-input input {
  background: transparent;
  border: 0;
  outline: 0;
  min-width: 0;
  width: 100%;
  font-size: 14px;
}
.search-input input::placeholder {
  color: #596c5c;
}
.search-input input:focus-visible {
  outline: 0;
}
#matches {
  margin-top: 4px;
  max-height: 285px;
  overflow: auto;
  padding: 4px;
}
.match {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 7px;
  padding: 8px 9px;
  font-size: 14px;
  cursor: pointer;
  border-radius: 5px;
}
.match span {
  color: var(--muted);
  font-size: 11px;
  text-align: right;
}
.match[aria-selected='true'],
.match:hover {
  background: var(--soft);
}
.no-match {
  padding: 8px;
  color: var(--muted);
  font-size: 13px;
}

#location-chip {
  display: flex;
  align-items: center;
  gap: 7px;
  margin: 0 var(--map-gap) 4px 0;
  padding: 7px 10px;
  max-width: min(360px, 63vw);
  font: 550 12px/1.15 var(--sans);
  pointer-events: none;
}
#map-location {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}
#location-chip .maplibregl-ctrl-scale {
  position: relative;
  float: none;
  clear: none;
  flex: none;
  margin: 0 0 0 4px;
  padding: 0 0 4px;
  border: 0;
  border-bottom: 1.5px solid var(--forest);
  color: var(--forest);
  background: transparent;
  text-align: center;
  font: 600 10px/1.05 var(--sans);
  font-variant-numeric: tabular-nums;
}
#location-chip .maplibregl-ctrl-scale::before,
#location-chip .maplibregl-ctrl-scale::after {
  content: '';
  position: absolute;
  bottom: -1px;
  height: 5px;
  width: 1.5px;
  background: var(--forest);
}
#location-chip .maplibregl-ctrl-scale::before {
  left: 0;
}
#location-chip .maplibregl-ctrl-scale::after {
  right: 0;
}
#base-control {
  position: relative;
}
#base-trigger {
  min-height: 36px;
  gap: 7px;
  padding: 7px 11px;
  font-size: 13px;
  font-weight: 600;
}
#base-trigger .icon:last-child {
  width: 13px;
  transform: rotate(180deg);
}
#base-trigger[aria-expanded='true'] .icon:last-child {
  transform: none;
}
#base-panel {
  position: absolute;
  bottom: calc(100% + 6px);
  left: 0;
  width: 220px;
  padding: 10px;
}
.base-title {
  font: 650 13px var(--sans);
  margin: 0 0 7px;
}
.base-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 7px;
}
.base-options button {
  background: var(--white);
  padding: 3px 3px 4px;
  border: 1px solid var(--line);
  border-radius: 6px;
  text-align: left;
  font-size: 12px;
}
.base-options button[aria-pressed='true'] {
  outline: 2px solid var(--green);
  outline-offset: -1px;
}
.preview {
  display: block;
  height: 43px;
  margin-bottom: 4px;
  border-radius: 3px;
  background-size: cover;
  background-position: center;
}
.road-preview {
  background-image: url(data/road-preview.jpg);
}
.sat-preview {
  background-image: url(data/satellite-preview.jpg);
}
#map.crosshair-map canvas {
  cursor: crosshair;
}
.vertex-icon {
  width: 15px;
  height: 15px;
  padding: 0;
  background: var(--white);
  border: 2.5px solid #91601e;
  border-radius: 50%;
  box-shadow: 0 0 0 1px white;
  cursor: grab;
}
.vertex-icon.start {
  width: 18px;
  height: 18px;
  background: #f9d791;
  border-width: 3px;
}
.vertex-icon:active {
  cursor: grabbing;
}
.crossing-mark {
  display: grid;
  place-content: center;
  width: 21px;
  height: 21px;
  border-radius: 50%;
  background: #a32c24;
  border: 2px solid white;
  color: white;
  font: 700 16px/1 var(--sans);
  pointer-events: none;
}
.draw-message {
  z-index: 1;
  pointer-events: none;
}
.draw-message .maplibregl-popup-content,
.unit-tooltip .maplibregl-popup-content {
  font: 13px/1.35 var(--sans);
  background: var(--map-surface);
  border: 1px solid var(--map-ring);
  border-radius: 7px;
  box-shadow: var(--map-shadow);
  color: var(--ink);
  padding: 9px 11px;
  pointer-events: none;
}
.draw-message strong {
  display: block;
  margin-bottom: 3px;
  color: #8e2922;
  font-weight: 680;
}
.draw-message button {
  padding: 2px 0;
  font-weight: 650;
  color: var(--forest);
  text-decoration: underline;
  text-underline-offset: 2px;
  pointer-events: auto;
}
.unit-tooltip {
  pointer-events: none;
}
.unit-tooltip .maplibregl-popup-content {
  padding: 5px 8px;
}
dialog {
  max-width: min(505px, 93vw);
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--panel);
  color: var(--ink);
  padding: 24px;
  box-shadow: 0 18px 70px #17281c44;
}
dialog::backdrop {
  background: #13271f64;
}
.dialog-head {
  justify-content: space-between;
}
.dialog-head h2 {
  font-size: 29px;
}
.dialog-head button {
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: 6px;
}
dialog h3 {
  font-size: 14px;
  margin: 17px 0 5px;
}
dialog p,
dialog a {
  font-size: 14px;
}
dialog p {
  color: var(--muted);
}
@media (max-height: 770px) and (min-width: 741px) {
  .panel {
    padding-top: 16px;
    padding-bottom: 14px;
  }
  .panel h1 {
    font-size: 30px;
  }
  .methods {
    margin-bottom: 11px;
  }
  .profile {
    margin-top: 15px;
    padding-top: 13px;
  }
  .metrics {
    margin-top: 6px;
  }
  .metrics > div {
    padding: 4px 0;
  }
  .advance {
    margin-top: 13px;
  }
}
@media (max-width: 740px) {
  .atlas {
    height: auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
  }
  .app-header {
    height: 52px;
  }
  .brand {
    font-size: 18px;
  }
  .brand-mark {
    width: 29px;
    height: 29px;
  }
  .prototype {
    display: none;
  }
  .header-end button {
    border: 0;
    padding: 3px;
    font-size: 12px;
  }
  .map-frame {
    order: -1;
    height: clamp(250px, 42dvh, 440px);
    flex: none;
    border-bottom: 1px solid var(--line);
  }
  .rail {
    border: 0;
  }
  .panel {
    overflow: visible;
    padding: 17px 18px 23px;
  }
  .workflow {
    padding: 0 16px;
  }
  .workflow button {
    padding: 11px 2px 9px;
  }
  .panel h1 {
    font-size: 29px;
  }
  .map-frame {
    --map-gap: 9px;
  }
  .search-input {
    min-height: 36px;
  }
  .search-input input {
    font-size: 16px;
  }
  #map .maplibregl-ctrl-group button {
    width: 33px;
    height: 33px;
  }
  #location-chip {
    max-width: calc(100vw - 145px);
    font-size: 11px;
    padding: 5px 7px;
    gap: 4px;
  }
  .profile {
    margin-top: 17px;
    padding-top: 16px;
  }
  #matches {
    max-height: 185px;
  }
  .rail .metrics {
    max-width: 380px;
  }
}
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
