:root {
  color-scheme: light;
  --paper: #fff;
  --ink: #171717;
  --muted: #686868;
  --line: #e4e4e4;
  --field: #f7f7f7;
  --selected: #eee;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font:
    14px/1.45 -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
}
body[data-dark="true"],
:root[data-map-theme="dark"] {
  color-scheme: dark;
  --paper: #171717;
  --ink: #f3f3f3;
  --muted: #aaa;
  --line: #363636;
  --field: #222;
  --selected: #333;
}
button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}
button {
  cursor: pointer;
  min-height: 44px;
  padding: 9px 12px;
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 3px;
}
button:hover {
  background: var(--selected);
}
button:disabled {
  cursor: default;
  opacity: 0.5;
}
input,
select,
textarea {
  background: var(--field);
  border: 1px solid var(--line);
  border-radius: 3px;
  min-height: 44px;
  padding: 10px;
  width: 100%;
  min-width: 0;
}
textarea {
  min-height: 92px;
  resize: vertical;
}
input[type="checkbox"] {
  width: 18px;
  min-height: 18px;
  margin: 0 8px 0 0;
  vertical-align: middle;
}
label {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin: 12px 0;
}
label input,
label textarea {
  display: block;
  margin-top: 5px;
  color: var(--ink);
  font-size: 14px;
}
label input[type="checkbox"] {
  display: inline-block;
}
a {
  color: inherit;
}
:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 3px;
}
[hidden] {
  display: none !important;
}
#map {
  position: fixed;
  inset: 0 0 0 320px;
}
#workspace {
  position: fixed;
  inset: 0 auto 0 0;
  width: 320px;
  background: var(--paper);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  z-index: 2;
}
header {
  padding: 24px 20px 20px;
}
.brand {
  text-decoration: none;
  font-weight: 650;
  font-size: 24px;
  letter-spacing: -1px;
}
#navigation {
  display: flex;
  padding: 0 12px;
  border-bottom: 1px solid var(--line);
}
#navigation button {
  flex: 1;
  border: 0;
  border-radius: 0;
  color: var(--muted);
  padding: 12px 8px;
}
#navigation button[aria-current="page"] {
  color: var(--ink);
  box-shadow: inset 0 -2px var(--ink);
}
#search-dock {
  padding: 20px 16px 12px;
  flex-shrink: 0;
}
.search-row {
  display: flex;
  gap: 6px;
}
.search-row button {
  border: 0;
  padding: 8px;
}
h2 {
  font-size: 16px;
  font-weight: 600;
  margin: 0;
}
h3 {
  font-size: 14px;
  margin: 16px 0 6px;
}
p {
  margin: 12px 0;
  color: var(--muted);
}
small {
  font-size: 11px;
  color: var(--muted);
}
.panel-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  gap: 10px;
}
.panel-top button {
  font-size: 12px;
  padding: 6px 0;
  border: 0;
  min-height: 36px;
}
#panel {
  padding: 12px 20px 24px;
  overflow: auto;
  flex: 1;
  min-height: 0;
}
#search-results {
  padding-top: 6px;
  max-height: 34dvh;
  overflow: auto;
}
#search-status {
  font-size: 13px;
}
#results button,
.plain-row {
  display: block;
  border: 0;
  border-bottom: 1px solid var(--line);
  padding: 14px 0;
  width: 100%;
  text-align: left;
  font-weight: 400;
  border-radius: 0;
}
#results strong,
.plain-row strong {
  display: block;
  font-size: 14px;
  font-weight: 500;
}
#results small,
.plain-row small {
  display: block;
  margin-top: 3px;
  font-size: 12px;
}
.subdued {
  font-size: 12px;
  color: var(--muted);
  border: 0;
  padding: 4px 0;
  min-height: 36px;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.row > * {
  flex: 1;
}
.row select {
  flex-basis: 100%;
}
.primary {
  background: var(--ink);
  color: var(--paper);
  border-color: var(--ink);
}
.primary:hover {
  opacity: 0.85;
  background: var(--ink);
}
.full {
  width: 100%;
  margin: 10px 0;
}
article {
  border-bottom: 1px solid var(--line);
  padding: 16px 0;
}
article p {
  margin: 5px 0 12px;
}
.danger {
  border-left: 2px solid currentColor;
  padding-left: 10px;
}
progress {
  width: 100%;
  height: 3px;
  accent-color: var(--ink);
}
#sidebar-bottom {
  margin-top: auto;
  padding: 12px 16px;
  flex-shrink: 0;
  border-top: 1px solid var(--line);
}
#notice:empty {
  display: none;
}
#notice {
  font-size: 12px;
}
#download-progress {
  width: 100%;
  text-align: left;
  font-size: 12px;
  margin-bottom: 6px;
  border: 0;
  padding: 6px 0;
}
#route-workspace {
  padding: 12px 16px 24px;
  overflow: auto;
  min-height: 0;
  flex: 1;
}
#routing label {
  margin: 8px 0;
}
#routing .row button {
  font-size: 12px;
  padding: 8px;
}
#route-output {
  margin-top: 16px;
}
#route-output p {
  font-size: 13px;
}
.saved-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 16px;
}
.saved-tabs button {
  flex: 1;
  padding: 8px;
  font-size: 12px;
}
.saved-tabs button[aria-current="true"] {
  border-color: var(--ink);
}
#map-controls {
  position: fixed;
  z-index: 4;
  top: 16px;
  right: 16px;
  display: flex;
  flex-direction: column;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 4px;
  overflow: hidden;
}
#map-controls button {
  min-width: 48px;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  font-size: 12px;
  padding: 8px;
}
#map-controls button:last-child {
  border-bottom: 0;
}
#map-controls svg {
  width: 24px;
  height: 24px;
  display: block;
  margin: auto;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
#north-lock[aria-pressed="true"] .north-lock-slash {
  display: none;
}
.cta-legend {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin: 12px 0;
  font-size: 12px;
}
.cta-legend i {
  display: inline-block;
  width: 20px;
  border-top: 3px solid;
  margin-right: 6px;
}
#map-credit {
  position: fixed;
  z-index: 5;
  bottom: 4px;
  right: 8px;
  padding: 4px 8px;
  background: var(--paper);
  color: var(--muted);
  font-size: 11px;
  max-width: calc(100vw - 340px);
}
#map-credit a {
  text-decoration: none;
}
dialog {
  background: var(--paper);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 20px;
  max-width: calc(100vw - 32px);
  width: 380px;
}
dialog::backdrop {
  background: #0004;
}
#consent-question {
  color: var(--ink);
  font-size: 16px;
  margin: 0 0 20px;
}
#online-consent button {
  flex-basis: 100%;
  text-align: left;
}
#online-consent form {
  margin: 0;
}
.maplibregl-marker {
  cursor: pointer;
}
.maplibregl-canvas:focus-visible {
  outline-offset: -3px;
}
@media (max-width: 700px) {
  #map {
    inset: 0;
  }
  #workspace {
    inset: 0;
    width: 100%;
    border: 0;
    background: transparent;
    pointer-events: none;
    display: block;
  }
  #workspace > * {
    pointer-events: auto;
  }
  header {
    display: none;
  }
  #navigation {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 0 12px env(safe-area-inset-bottom);
    height: calc(58px + env(safe-area-inset-bottom));
    background: var(--paper);
    border-top: 1px solid var(--line);
    border-bottom: 0;
  }
  #navigation button[aria-current="page"] {
    box-shadow: inset 0 2px var(--ink);
  }
  #search-dock {
    position: absolute;
    top: calc(12px + env(safe-area-inset-top));
    left: 12px;
    right: 76px;
    padding: 0;
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: 6px;
    overflow: hidden;
  }
  #search {
    padding: 5px;
  }
  #query {
    border: 0;
    background: transparent;
  }
  .search-row {
    gap: 0;
  }
  .search-row button {
    font-size: 12px;
    padding: 8px;
  }
  #search-results {
    padding: 0 14px 8px;
    max-height: 30dvh;
  }
  #results button {
    padding: 10px 0;
  }
  #panel,
  #route-workspace {
    position: absolute;
    bottom: calc(58px + env(safe-area-inset-bottom));
    left: 0;
    right: 0;
    background: var(--paper);
    border-top: 1px solid var(--line);
    border-radius: 12px 12px 0 0;
    max-height: 54dvh;
    padding: 12px 20px 20px;
    overflow: auto;
  }
  #route-workspace {
    max-height: 64dvh;
  }
  body[data-tab="saved"] #panel,
  body[data-tab="settings"] #panel {
    max-height: 66dvh;
  }
  #routing input {
    min-height: 40px;
    padding: 7px;
  }
  #routing label {
    font-size: 11px;
    margin: 5px 0;
  }
  #routing .row select {
    flex-basis: auto;
    width: 120px;
    font-size: 12px;
    min-height: 40px;
    padding: 7px;
  }
  #routing .row button {
    min-height: 40px;
  }
  #route-workspace #search-results {
    max-height: 24dvh;
    padding: 0;
  }
  #sidebar-bottom {
    position: absolute;
    bottom: calc(58px + env(safe-area-inset-bottom));
    left: 0;
    right: 0;
    padding: 0;
    margin: 0;
    border: 0;
    pointer-events: none;
  }
  #sidebar-bottom #show-downloads {
    display: none;
  }
  #notice {
    background: var(--paper);
    padding: 8px 12px;
    display: inline-block;
    max-width: 85%;
    margin: 4px 12px;
    pointer-events: auto;
  }
  #download-progress {
    pointer-events: auto;
    margin: 0;
    padding: 10px 16px;
    background: var(--paper);
    border-top: 1px solid var(--line);
  }
  body:has(#panel:not([hidden])) #sidebar-bottom,
  body[data-routing="true"] #sidebar-bottom {
    display: none;
  }
  #map-controls {
    top: calc(12px + env(safe-area-inset-top));
    right: 12px;
  }
  #map-credit {
    top: calc(72px + env(safe-area-inset-top));
    bottom: auto;
    left: 12px;
    right: auto;
    max-width: calc(100vw - 100px);
    font-size: 10px;
  }
  body[data-routing="true"] #map-credit {
    top: calc(12px + env(safe-area-inset-top));
  }
}
#guidance-status {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--paper);
  color: var(--ink);
  font-weight: 600;
  padding: 10px 0;
  margin: 0 0 8px;
  border-bottom: 1px solid var(--line);
}
.city-label {
  border: 0;
  background: var(--paper);
  color: var(--ink);
  border-radius: 0;
  padding: 3px 5px;
  min-height: 28px;
  font-size: 12px;
  font-weight: 600;
}
.city-label[hidden] {
  display: none;
}
#route-output li {
  margin-bottom: 10px;
  color: var(--muted);
}
#route-output summary {
  padding: 10px 0;
  cursor: pointer;
}
