:root {
  color-scheme: dark;
  --ink: #000;
  --paper: #f4f6fa;
  --mint: #64e6af;
  --panel: #111514;
  --surface: #1d2220;
  --surface-light: #272d2a;
  --line: #363d39;
  --muted: #a4ada8;
  --outer: 26px;
  --sidebar: 352px;
  --brand-height: 80px;
  --edge-shadow: 0 12px 40px rgb(0 0 0 / 16%), 0 2px 6px rgb(0 0 0 / 8%);
  font-family:
    -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  font-synthesis: none;
}
*,
*::before,
*::after {
  box-sizing: border-box;
}
html,
body {
  margin: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  overscroll-behavior: none;
}
body {
  color: var(--paper);
  background: #e3e7e5;
}
button,
select,
input {
  font: inherit;
}
button {
  border: 0;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
button,
a,
input,
select {
  touch-action: manipulation;
}
button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 2px solid var(--mint);
  outline-offset: 3px;
}
button:disabled {
  opacity: 0.46;
  cursor: default;
}
button[aria-pressed="true"] {
  --selected: var(--mint);
}
a {
  color: inherit;
}
svg {
  display: block;
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.65;
  stroke-linecap: round;
  stroke-linejoin: round;
  overflow: visible;
  flex: 0 0 auto;
  pointer-events: none;
}
.icon-sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}
.hidden,
[hidden] {
  display: none !important;
}
#atlas {
  isolation: isolate;
  position: relative;
  width: 100%;
  height: 100%;
  height: 100dvh;
  overflow: hidden;
}
#map {
  position: absolute;
  inset: 0;
  z-index: 0;
  touch-action: none;
  background: #e5e9e5;
  color-scheme: light;
}
#map canvas {
  display: block;
}
.brandbar,
.panels {
  position: absolute;
  left: max(var(--outer), env(safe-area-inset-left));
  width: var(--sidebar);
}
.brandbar {
  z-index: 5;
  top: max(var(--outer), env(safe-area-inset-top));
  height: var(--brand-height);
  display: flex;
  padding: 14px 21px 13px 24px;
  align-items: center;
  justify-content: space-between;
  background: var(--panel);
  border: 1px solid #252b28;
  border-bottom: 1px solid var(--line);
  border-radius: 21px 21px 0 0;
}
.brandmark {
  display: block;
  width: 164px;
  height: 52px;
  object-fit: contain;
  object-position: left center;
}
.icon-btn {
  width: 44px;
  height: 44px;
  display: inline-grid;
  place-items: center;
  background: transparent;
  color: var(--paper);
  border-radius: 12px;
}
.brand-info {
  color: var(--muted);
  margin-right: -6px;
}
.brand-info svg {
  width: 19px;
  height: 19px;
}
.panels {
  z-index: 4;
  top: calc(max(var(--outer), env(safe-area-inset-top)) + var(--brand-height));
  filter: drop-shadow(0 9px 16px rgb(0 0 0 / 12%));
}
.sheet {
  padding: 21px 22px 22px;
  background: var(--panel);
  color: var(--paper);
  border: 1px solid #252b28;
  border-top: 0;
  border-radius: 0 0 21px 21px;
  box-shadow: 0 1px 2px rgb(0 0 0 / 7%);
}
.section-title {
  display: flex;
  align-items: center;
  gap: 12px;
  justify-content: space-between;
  min-height: 33px;
  margin-bottom: 18px;
}
.section-title h1,
.section-title h2 {
  margin: 0;
  font-size: clamp(26px, 2.3vw, 32px);
  line-height: 1.12;
  letter-spacing: -0.055em;
  font-weight: 640;
}
.section-title .sheet-close {
  color: var(--muted);
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  margin: -4px -3px -4px 0;
}
.trip-fields {
  display: grid;
  grid-template-columns: 19px minmax(0, 1fr) 35px;
  grid-template-rows: 1fr 1fr;
  padding: 0 5px 0 13px;
  align-items: stretch;
  position: relative;
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: 13px;
}
.trip-fields:focus-within {
  border-color: #6e9382;
}
.trip-track {
  display: flex;
  align-items: center;
  flex-direction: column;
  justify-content: center;
  grid-column: 1;
  grid-row: 1 / 3;
  margin-right: 7px;
}
.trip-track i:first-child {
  width: 10px;
  height: 10px;
  border: 1.8px solid var(--paper);
  border-radius: 50%;
}
.trip-track i:last-child {
  width: 9px;
  height: 9px;
  border-radius: 2px;
  background: var(--mint);
}
.trip-track b {
  height: 40px;
  margin: 3px 0;
  width: 1px;
  background: repeating-linear-gradient(
    to bottom,
    #88958d 0 2px,
    transparent 2px 5px
  );
}
.trip-entry {
  grid-column: 2;
  min-width: 0;
  padding: 10px 0 9px 6px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 2px;
}
.trip-entry:nth-of-type(3) {
  border-top: 1px solid var(--line);
}
.trip-entry label {
  font-size: 11px;
  line-height: 1.1;
  color: var(--muted);
  font-weight: 550;
  letter-spacing: 0.01em;
}
.trip-entry input {
  color: var(--paper);
  font-size: 16px;
  height: 22px;
  line-height: 22px;
  font-weight: 520;
  min-width: 0;
  width: 100%;
  background: transparent;
  border: 0;
  padding: 0;
  outline: none;
  text-overflow: ellipsis;
  border-radius: 2px;
}
.trip-entry input:focus-visible {
  outline: none;
}
.trip-entry input::placeholder {
  color: var(--muted);
  opacity: 1;
  font-weight: 400;
}
.swap-control {
  grid-column: 3;
  grid-row: 1 / 3;
  align-self: center;
  justify-self: center;
  color: #b7c1bb;
  width: 36px;
  height: 44px;
}
.swap-control svg {
  width: 17px;
  height: 17px;
}
.route-heading {
  margin: 21px 0 11px;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
}
.route-heading h2 {
  font-size: 14px;
  letter-spacing: -0.014em;
  line-height: 18px;
  margin: 0;
  font-weight: 600;
}
.count-note {
  font-size: 12px;
  color: var(--muted);
}
.routes {
  display: grid;
  gap: 6px;
}
.route-option {
  position: relative;
  isolation: isolate;
  display: grid;
  grid-template-columns: 15px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  width: 100%;
  min-height: 52px;
  padding: 9px 11px;
  color: var(--paper);
  font-size: 14px;
  text-align: left;
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 10px;
}
.route-option[aria-pressed="true"],
.route-option[aria-selected="true"],
.route-option.selected,
.route-option.active {
  background: #1d3028;
  border-color: #4a8269;
}
.route-radio {
  display: inline-block;
  flex: 0 0 auto;
  width: 13px;
  height: 13px;
  border-radius: 100%;
  border: 1.4px solid #88928a;
}
:is(
    .route-option[aria-selected="true"],
    .route-option[aria-pressed="true"],
    .route-option.selected,
    .route-option.active
  )
  .route-radio {
  border-color: var(--mint);
  background: radial-gradient(circle, var(--mint) 0 39%, transparent 44%);
}
.route-content {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
  gap: 3px;
}
.route-content strong,
.route-content small {
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.route-content strong {
  font-size: 14px;
  font-weight: 600;
  line-height: 1.19;
}
.route-content small,
.route-option .route-sub {
  font-size: 12px;
  line-height: 1.19;
  color: #b2bcb5;
  font-weight: 450;
}
.route-time {
  text-align: right;
  font-weight: 650;
  letter-spacing: -0.035em;
  font-size: 18px;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
:is(
    .route-option[aria-selected="true"],
    .route-option[aria-pressed="true"],
    .route-option.selected,
    .route-option.active
  )
  .route-time {
  color: var(--mint);
}
.route-status,
.route-delta {
  color: var(--muted);
  margin: 9px 0 0;
  line-height: 1.35;
  font-size: 12px;
}
.route-status:empty,
.route-delta:empty {
  display: none;
}
.primary {
  width: 100%;
  min-height: 47px;
  margin-top: 17px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  background: var(--mint);
  color: var(--ink);
  font-size: 15px;
  letter-spacing: -0.012em;
  font-weight: 700;
  border-radius: 12px;
}
.primary svg {
  width: 18px;
  height: 18px;
}
.map-region {
  position: absolute;
  top: max(var(--outer), env(safe-area-inset-top));
  right: calc(max(var(--outer), env(safe-area-inset-right)) + 53px);
  display: inline-flex;
  gap: 7px;
  align-items: center;
  z-index: 2;
  padding: 0 11px;
  height: 35px;
  border-radius: 11px;
  background: #f4f6faf5;
  color: #202522;
  font-size: 13px;
  font-weight: 600;
  box-shadow: 0 2px 9px rgb(0 0 0 / 9%);
  border: 1px solid #d1d7d2;
}
.map-region svg {
  width: 15px;
  height: 15px;
  stroke-width: 1.8;
}
.map-tools {
  z-index: 2;
  position: absolute;
  right: max(var(--outer), env(safe-area-inset-right));
  top: max(var(--outer), env(safe-area-inset-top));
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
  pointer-events: none;
}
.map-btn,
.map-btn-pair {
  background: #f4f6fa;
  color: #242a26;
  border-radius: 13px;
  box-shadow: 0 3px 12px rgb(0 0 0 / 10%);
  border: 1px solid #cdd3ce;
  pointer-events: auto;
}
.map-btn {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  padding: 0;
}
.map-btn svg {
  width: 19px;
  height: 19px;
}
.map-btn:focus-visible,
.drawing-dock button:focus-visible {
  outline-color: #275a43;
  z-index: 1;
}
.map-btn-pair {
  overflow: hidden;
}
.map-btn-pair .map-btn {
  position: relative;
  width: 42px;
  height: 43px;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}
.map-btn-pair .map-btn + .map-btn::after {
  content: "";
  position: absolute;
  top: 0;
  left: 10px;
  right: 10px;
  height: 1px;
  background: #d3d9d4;
}
.map-btn-pair .map-btn:focus-visible {
  outline-offset: -3px;
}
.compass-btn {
  border-radius: 50%;
}
.compass-btn svg {
  width: 24px;
  height: 24px;
  transform: rotate(0deg);
}
.drawing-dock {
  z-index: 3;
  display: flex;
  align-items: center;
  position: absolute;
  left: calc(50% + (var(--sidebar) + var(--outer)) / 2);
  bottom: max(34px, calc(env(safe-area-inset-bottom) + 10px));
  transform: translateX(-50%);
  padding: 5px;
  background: var(--paper);
  color: var(--ink);
  border-radius: 17px;
  border: 1px solid #cad1ca;
  box-shadow: var(--edge-shadow);
}
.drawing-dock button {
  display: flex;
  min-height: 45px;
  justify-content: center;
  align-items: center;
  gap: 9px;
  white-space: nowrap;
  background: transparent;
  color: #252a27;
  border-radius: 11px;
  font-weight: 625;
  font-size: 14px;
  letter-spacing: -0.015em;
}
#open-draw {
  padding: 0 12px 0 0;
}
#open-saved {
  padding: 0 10px;
}
.dock-glyph {
  width: 40px;
  height: 40px;
  display: inline-grid;
  place-items: center;
  color: var(--mint);
  background: var(--panel);
  border-radius: 10px;
}
.dock-glyph svg {
  width: 20px;
  height: 20px;
}
#open-saved > svg {
  width: 19px;
  height: 19px;
}
.dock-rule {
  width: 1px;
  height: 23px;
  background: #d3dad4;
}
#closure-count {
  background: #e1e6e2;
  color: #323933;
  min-width: 21px;
  padding: 2px 5px;
  border-radius: 6px;
  font:
    600 12px/16px -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
  font-variant-numeric: tabular-nums;
}
body:not([data-mode="plan"]) .drawing-dock {
  display: none;
}
.map-footer {
  position: absolute;
  right: max(8px, env(safe-area-inset-right));
  bottom: max(1px, env(safe-area-inset-bottom));
  max-width: calc(100% - 12px);
  z-index: 1;
  align-items: end;
  display: flex;
  gap: 8px;
  color: #333c35;
  font-size: 10px;
}
.map-footer a {
  text-underline-offset: 2px;
}
.scale {
  display: flex;
  align-items: center;
  flex-direction: column;
  gap: 1px;
  padding: 0 2px 3px;
  text-shadow:
    0 0 3px var(--paper),
    0 0 2px var(--paper);
  font-variant-numeric: tabular-nums;
}
.scale:has(span:empty) {
  display: none;
}
.scale i {
  display: block;
  width: 58px;
  height: 5px;
  border: solid currentColor;
  border-width: 0 1px 1px;
}
.search-popover {
  z-index: 8;
  position: absolute;
  top: 175px;
  left: 12px;
  right: 12px;
  padding: 5px;
  border-radius: 13px;
  border: 1px solid #4d5750;
  box-shadow: var(--edge-shadow);
  background: #202622;
}
#search-results {
  display: grid;
}
.search-hit,
#search-results > button,
.pick-map {
  width: 100%;
  text-align: left;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px 11px;
  min-height: 42px;
  border-radius: 8px;
  background: transparent;
  color: var(--paper);
  font-size: 14px;
}
.search-hit svg,
#search-results > button > svg {
  width: 17px;
  height: 17px;
  color: var(--muted);
}
.search-hit strong,
.search-hit small {
  display: block;
}
.search-hit small {
  color: var(--muted);
  font-size: 12px;
}
.pick-map {
  margin-top: 4px;
  border-top: 1px solid var(--line);
  color: var(--mint);
  font-weight: 600;
}
.panel-copy {
  margin: 16px 0;
  color: #c1c9c4;
  font-size: 14px;
  line-height: 1.49;
}
.small-copy {
  font-size: 13px;
}
.mode-pills {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 4px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 4px;
}
.mode-pills button {
  --btn-fill: var(--surface);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  background: transparent;
  min-height: 37px;
  border-radius: 8px;
  color: #b4beb7;
  font-size: 13px;
  font-weight: 550;
}
.mode-pills button svg {
  width: 16px;
  height: 16px;
}
.mode-pills button.active,
.mode-pills button[aria-pressed="true"] {
  --btn-fill: var(--mint);
  background: var(--mint);
  color: var(--ink);
}
.select-row,
.data-row {
  padding: 11px 0;
  min-height: 42px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  border-block: 1px solid var(--line);
  font-size: 13px;
  color: var(--muted);
}
.select-row select {
  max-width: 65%;
  color: var(--paper);
  border: 0;
  background: var(--surface);
  border-radius: 6px;
  padding: 6px;
  font-size: 13px;
}
.data-row + .data-row {
  border-top: 0;
}
.data-row a,
.data-row strong {
  text-decoration: none;
  color: var(--paper);
  font-size: 14px;
  font-weight: 550;
}
.data-row a {
  text-decoration: underline;
  text-underline-offset: 2px;
}
.draw-edit,
.nav-tools,
.file-actions {
  display: flex;
  gap: 6px;
  margin-top: 14px;
}
.secondary {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  color: var(--paper);
  padding: 0 13px;
  font-weight: 550;
  font-size: 13px;
}
.secondary svg {
  width: 17px;
  height: 17px;
}
.draw-edit .secondary {
  min-width: 42px;
}
#draw-magnet {
  flex: 1;
  justify-content: flex-start;
  text-align: left;
  min-height: 44px;
  padding-inline: 8px;
}
#draw-magnet > span {
  display: grid;
  gap: 1px;
  line-height: 1.1;
}
#draw-magnet small {
  color: var(--muted);
  font-size: 10px;
  font-weight: 500;
}
#draw-magnet[aria-pressed="true"] {
  border-color: var(--mint);
}
#draw-magnet[aria-pressed="true"] svg {
  color: var(--mint);
}
#draw-magnet.hidden {
  display: none;
}
.file-actions .secondary {
  flex: 1;
}
.nav-hero {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 57px;
}
.nav-symbol {
  width: 55px;
  height: 55px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border-radius: 14px;
  color: var(--mint);
  background: #20342b;
}
.nav-symbol svg {
  width: 32px;
  height: 32px;
  stroke-width: 1.95;
}
.nav-hero h2 {
  font-size: 18px;
  line-height: 1.2;
  margin: 0;
  letter-spacing: -0.03em;
}
.nav-distance {
  color: var(--mint);
  font-size: 27px;
  font-weight: 690;
  letter-spacing: -0.05em;
}
.nav-metrics {
  padding-top: 15px;
  margin-top: 15px;
  border-top: 1px solid var(--line);
  font-size: 14px;
  font-weight: 550;
  line-height: 1.4;
  font-variant-numeric: tabular-nums;
}
.nav-tools .stop-btn {
  margin-left: auto;
}
.njp-credit {
  width: 112px;
  min-height: 44px;
  margin-top: 24px;
  display: flex;
  align-items: center;
}
.njp-credit img {
  width: 112px;
  height: auto;
  display: block;
}
.saved-list {
  display: grid;
  gap: 6px;
}
.saved-list p {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.4;
}
.saved-row {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 9px 0;
  border-block-end: 1px solid var(--line);
}
.saved-row > span,
.saved-row > div {
  flex: 1;
  min-width: 0;
}
.saved-row button {
  color: var(--paper);
  background: var(--surface);
  border-radius: 6px;
  padding: 8px;
}
.notice {
  position: absolute;
  top: max(var(--outer), env(safe-area-inset-top));
  left: calc(50% + var(--sidebar) / 2);
  transform: translateX(-50%);
  max-width: min(390px, 48%);
  padding: 11px 15px;
  border-radius: 13px;
  background: var(--panel);
  color: var(--paper);
  font-size: 13px;
  font-weight: 500;
  line-height: 1.4;
  box-shadow: var(--edge-shadow);
  z-index: 7;
}
.noscript {
  position: absolute;
  inset: 30% 20% auto;
  padding: 24px;
  background: var(--paper);
  color: var(--ink);
}
@media (hover: hover) {
  .icon-btn:hover,
  .secondary:hover,
  .search-hit:hover,
  #search-results > button:hover {
    background: var(--surface-light);
  }
  .primary:not(:disabled):hover {
    background: #85ecc1;
  }
  .route-option:not(.selected):hover {
    border-color: #78877c;
  }
  .map-btn:hover,
  .drawing-dock button:hover {
    background: #e4e9e4;
  }
  .data-row a:hover {
    color: var(--mint);
  }
}
@media (max-width: 960px) and (min-width: 701px) {
  :root {
    --sidebar: 314px;
    --outer: 18px;
  }
  .sheet {
    padding: 18px;
  }
  .brandbar {
    padding-left: 19px;
  }
  .drawing-dock {
    bottom: 24px;
  }
  .saved-label {
    display: none;
  }
}
@media (max-width: 700px) {
  :root {
    --outer: 12px;
    --sidebar: min(100% - 24px, 460px);
  }
  .brandbar {
    top: max(9px, calc(env(safe-area-inset-top) + 5px));
    left: max(11px, env(safe-area-inset-left));
    width: auto;
    height: 53px;
    padding: 5px 4px 5px 12px;
    border: 1px solid var(--line);
    border-radius: 14px;
    gap: 4px;
    box-shadow: var(--edge-shadow);
  }
  .brandmark {
    width: 108px;
    height: 38px;
  }
  .brand-info {
    width: 33px;
    height: 38px;
    margin: 0;
  }
  .brand-info svg {
    width: 16px;
    height: 16px;
  }
  .panels {
    position: absolute;
    z-index: 4;
    width: var(--sidebar);
    left: 50%;
    top: auto;
    bottom: max(9px, calc(env(safe-area-inset-bottom) + 4px));
    transform: translateX(-50%);
  }
  .sheet {
    border: 1px solid var(--line);
    border-radius: 19px;
    padding: 14px;
    box-shadow: var(--edge-shadow);
  }
  .section-title {
    margin-bottom: 10px;
    min-height: 27px;
  }
  .section-title h1,
  .section-title h2 {
    font-size: 23px;
  }
  .trip-fields {
    grid-template-columns: 14px minmax(0, 1fr) 38px;
    border-radius: 10px;
    padding-left: 12px;
  }
  .trip-track {
    margin-right: 4px;
  }
  .trip-track b {
    height: 23px;
  }
  .trip-entry {
    flex-direction: row;
    align-items: center;
    justify-content: start;
    gap: 6px;
    padding: 5px 2px 5px 5px;
  }
  .trip-entry label {
    font-size: 11px;
    min-width: 28px;
  }
  .trip-entry input {
    font-size: 16px;
    line-height: 22px;
  }
  .swap-control {
    width: 37px;
    height: 44px;
  }
  .route-heading {
    margin: 12px 0 6px;
  }
  .route-heading h2 {
    font-size: 13px;
    line-height: 1.2;
  }
  .routes {
    display: flex;
    gap: 5px;
  }
  .route-option {
    display: flex;
    flex: 1;
    min-width: 0;
    flex-direction: column-reverse;
    gap: 3px;
    align-items: flex-start;
    justify-content: center;
    padding: 6px 8px;
    min-height: 46px;
  }
  .route-option:only-child {
    flex-direction: row;
    justify-content: flex-start;
    align-items: center;
    gap: 8px;
  }
  .route-option:only-child .route-time {
    margin-left: auto;
  }
  .route-radio {
    display: none;
  }
  .route-option:only-child .route-radio {
    display: block;
  }
  .route-content {
    max-width: 100%;
    gap: 2px;
  }
  .route-content strong {
    font-size: 11px;
    line-height: 1.15;
  }
  .route-content small {
    display: none;
  }
  .route-option:only-child .route-content small {
    display: block;
  }
  .route-time {
    font-size: 17px;
  }
  .route-option:is(
      [aria-pressed="true"],
      [aria-selected="true"],
      .active,
      .selected
    ):not(:only-child)::after {
    content: "";
    position: absolute;
    top: 7px;
    right: 6px;
    height: 5px;
    width: 5px;
    border-radius: 50%;
    background: var(--mint);
  }
  .primary {
    margin-top: 10px;
    min-height: 43px;
  }
  .route-status,
  .route-delta {
    font-size: 11px;
    margin-top: 5px;
  }
  .route-status:has(+ .route-delta:not(:empty)) {
    margin: 5px 0 0;
  }
  .map-region {
    display: none;
  }
  .map-tools {
    top: max(74px, calc(env(safe-area-inset-top) + 67px));
    right: max(12px, env(safe-area-inset-right));
    gap: 6px;
  }
  .map-btn {
    width: 39px;
    height: 39px;
  }
  .map-btn-pair .map-btn {
    width: 37px;
    height: 39px;
  }
  .map-btn-pair,
  .map-btn {
    border-radius: 11px;
  }
  .map-btn-pair .map-btn {
    border-radius: 0;
  }
  .compass-btn {
    border-radius: 50%;
  }
  .drawing-dock {
    left: auto;
    right: max(11px, env(safe-area-inset-right));
    top: max(10px, calc(env(safe-area-inset-top) + 6px));
    bottom: auto;
    transform: none;
    padding: 4px;
    border-radius: 14px;
  }
  .drawing-dock button {
    min-height: 41px;
    gap: 5px;
    font-size: 12px;
  }
  .dock-glyph {
    width: 34px;
    height: 34px;
    border-radius: 9px;
  }
  .dock-glyph svg {
    width: 17px;
    height: 17px;
  }
  #open-draw {
    padding-right: 6px;
  }
  #open-saved {
    padding: 0 4px 0 6px;
  }
  #open-saved > svg {
    width: 17px;
  }
  .saved-label {
    display: none;
  }
  #closure-count {
    min-width: 16px;
    padding: 0 2px;
    font-size: 10px;
  }
  .map-footer {
    right: max(7px, env(safe-area-inset-right));
  }
  .map-footer .scale {
    display: none;
  }
  .draw-edit,
  .file-actions,
  .nav-tools {
    margin-top: 10px;
  }
  .panel-copy {
    margin: 11px 0;
  }
  .search-popover {
    top: auto;
    bottom: calc(100% + 6px);
    left: 0;
    right: 0;
  }
  .notice {
    width: max-content;
    max-width: calc(100% - 90px);
    top: max(90px, calc(env(safe-area-inset-top) + 85px));
    left: 12px;
    transform: none;
  }
  .njp-credit {
    margin-top: 12px;
  }
}
@media (max-width: 389px) {
  .brandmark {
    width: 92px;
  }
  .brandbar {
    padding-left: 9px;
    gap: 0;
  }
  .draw-label {
    max-width: 54px;
    white-space: normal;
    text-align: left;
    line-height: 1.05;
  }
  .sheet {
    padding: 11px;
  }
  .route-heading {
    margin-top: 9px;
  }
}
@media (min-width: 701px) and (max-height: 650px) {
  :root {
    --outer: 12px;
    --brand-height: 57px;
    --sidebar: 310px;
  }
  .brandbar {
    padding: 4px 14px;
  }
  .brandmark {
    width: 135px;
    height: 44px;
  }
  .sheet {
    padding: 13px 15px;
  }
  .section-title {
    margin-bottom: 9px;
    min-height: 27px;
  }
  .section-title h1,
  .section-title h2 {
    font-size: 24px;
  }
  .trip-entry {
    flex-direction: row;
    align-items: center;
    gap: 6px;
    padding: 4px;
  }
  .trip-track b {
    height: 21px;
  }
  .route-heading {
    margin: 9px 0 6px;
  }
  .routes {
    gap: 4px;
  }
  .route-option {
    padding: 5px 8px;
    min-height: 37px;
  }
  .route-content {
    gap: 1px;
  }
  .primary {
    margin-top: 8px;
    min-height: 40px;
  }
}
@media (max-height: 480px) and (orientation: landscape) {
  :root {
    --outer: 6px;
    --brand-height: 0px;
    --sidebar: min(35vw, 278px);
  }
  .brandbar {
    top: max(6px, env(safe-area-inset-top));
    left: auto;
    right: max(68px, calc(env(safe-area-inset-right) + 60px));
    width: auto;
    height: 39px;
    padding: 3px 5px 3px 9px;
    border-radius: 11px;
    gap: 4px;
  }
  .brandmark {
    width: 87px;
    height: 31px;
  }
  .brand-info {
    width: 30px;
    height: 30px;
    margin: 0;
  }
  .panels {
    left: max(7px, env(safe-area-inset-left));
    top: max(6px, env(safe-area-inset-top));
    bottom: auto;
    width: var(--sidebar);
    transform: none;
  }
  .sheet {
    border: 1px solid var(--line);
    border-radius: 15px;
    padding: 10px;
  }
  .section-title {
    margin-bottom: 6px;
    min-height: 23px;
  }
  .section-title h1,
  .section-title h2 {
    font-size: 20px;
  }
  .route-option {
    min-height: 31px;
  }
  .route-heading {
    margin: 7px 0 5px;
  }
  .route-content small {
    display: none;
  }
  .route-status,
  .route-delta {
    margin-top: 3px;
  }
  .primary {
    min-height: 34px;
    margin-top: 7px;
  }
  .map-region {
    display: none;
  }
  .map-tools {
    top: max(6px, env(safe-area-inset-top));
  }
  .drawing-dock {
    top: auto;
    bottom: max(15px, env(safe-area-inset-bottom));
    right: max(55px, calc(env(safe-area-inset-right) + 50px));
    left: auto;
    transform: none;
  }
  .drawing-dock button {
    min-height: 36px;
  }
  .dock-glyph {
    width: 32px;
    height: 32px;
  }
  .map-footer {
    bottom: max(1px, env(safe-area-inset-bottom));
    top: auto;
    left: auto;
    right: max(4px, env(safe-area-inset-right));
  }
  .search-popover {
    top: 100px;
    bottom: auto;
  }
}
@media (prefers-reduced-motion: no-preference) {
  button {
    transition:
      background 0.14s,
      border-color 0.14s,
      opacity 0.14s;
  }
  .sheet:not(.hidden) {
    animation: sheet-appear 0.16s ease-out;
  }
  @keyframes sheet-appear {
    from {
      opacity: 0.78;
    }
    to {
      opacity: 1;
    }
  }
}
.theme-button {
  margin-bottom: 12px;
}
.theme-button[aria-pressed="true"] {
  border-color: #609b7e;
  color: var(--mint);
  background: #20342b;
}
#draw-info {
  overflow-wrap: anywhere;
}
.quiet-button {
  min-height: 36px;
  padding: 6px 9px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  background: var(--surface);
  color: var(--paper);
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 13px;
  font-weight: 550;
}
.saved-list strong,
.saved-list small {
  display: block;
  overflow-wrap: anywhere;
}
.saved-list small {
  color: var(--muted);
  line-height: 1.4;
  font-size: 12px;
  font-weight: 450;
}
.pick-map + .pick-map {
  margin-top: 0;
  border-top: 0;
}
@media (max-width: 700px) {
  .map-btn {
    width: 44px;
    height: 44px;
  }
  .map-btn-pair .map-btn {
    height: 44px;
    width: 42px;
  }
}
.route-time strong,
.route-time small {
  display: block;
}
.route-time strong {
  font: inherit;
}
.route-time small {
  color: #b2bcb5;
  font-weight: 450;
  font-size: 11px;
  margin-top: 3px;
  letter-spacing: 0;
}
#draw-info > span,
#draw-info > small {
  display: block;
}
#draw-info > span {
  font-weight: 620;
  color: var(--paper);
}
#draw-info > small {
  color: var(--muted);
  font-size: 12px;
  margin: 3px 0;
}
.match-choice {
  color: var(--paper);
  background: var(--surface);
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 7px;
  width: 100%;
  margin-top: 4px;
  font-size: 14px;
}
.saved-row {
  flex-direction: column;
  align-items: stretch;
  gap: 7px;
}
.saved-row .saved-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}
.saved-row .saved-actions .quiet-button {
  min-height: 31px;
  font-size: 12px;
  padding: 5px 8px;
}
.saved-row .saved-name {
  display: inline-block;
  line-height: 32px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--paper);
  width: 60%;
  padding: 0 8px;
  border-radius: 6px;
}
.saved-list > .saved-actions {
  display: flex;
  justify-content: flex-end;
  gap: 5px;
}
.search-popover .empty-message {
  color: var(--muted);
  font-size: 13px;
  padding: 0 8px;
  line-height: 1.4;
}
@media (max-width: 700px) and (orientation: portrait) {
  #atlas {
    display: grid;
    grid-template-rows: minmax(0, 1fr) max-content;
  }
  .panels {
    grid-row: 1 / 2;
    bottom: 4px;
  }
  .map-footer {
    grid-row: 2;
    position: relative;
    justify-self: end;
    right: auto;
    bottom: auto;
    margin-right: max(7px, env(safe-area-inset-right));
    margin-bottom: max(1px, env(safe-area-inset-bottom));
  }
  .panels:has(#search-popover:not(.hidden)) {
    top: max(72px, calc(env(safe-area-inset-top) + 60px));
    bottom: auto;
  }
  .panels:has(#search-popover:not(.hidden)) #planner {
    border-radius: 15px 15px 0 0;
    padding: 8px;
  }
  .panels:has(#search-popover:not(.hidden)) #planner > :not(.trip-fields) {
    display: none;
  }
  .search-popover {
    position: relative;
    top: auto;
    bottom: auto;
    margin: 0;
    border-top: 0;
    border-radius: 0 0 15px 15px;
  }
  .search-popover .search-hit {
    min-height: 38px;
    padding-block: 4px;
  }
  .search-popover .pick-map {
    min-height: 36px;
  }
  .route-time {
    display: flex;
    align-items: baseline;
    gap: 5px;
  }
  .route-time small {
    margin-top: 0;
    font-size: 10px;
  }
  .route-option:not(:only-child) .route-time {
    display: grid;
    gap: 2px;
    text-align: left;
    max-width: 100%;
  }
  .route-option:not(:only-child) .primary-route-name {
    font-size: 0;
  }
  .route-option:not(:only-child) .primary-route-name::after {
    content: attr(data-compact);
    font-size: 11px;
  }
}
@media (min-width: 701px) and (max-height: 480px) {
  .saved-row {
    gap: 3px;
    padding: 3px 0;
  }
  .saved-row .saved-actions .quiet-button {
    min-height: 25px;
    padding: 2px 6px;
  }
  .search-popover {
    top: 0;
    left: calc(100% + 6px);
    right: auto;
    width: min(250px, 42vw);
  }
  .search-popover .search-hit,
  .search-popover .pick-map {
    min-height: 34px;
    padding-block: 3px;
  }
}
#draw-info:has(> span) {
  background: #1c3025;
  border: 1px solid #47755b;
  padding: 9px 10px 9px 26px;
  border-radius: 9px;
  position: relative;
}
#draw-info:has(> span)::before {
  content: "";
  position: absolute;
  top: 16px;
  left: 10px;
  height: 7px;
  width: 7px;
  border-radius: 2px;
  background: var(--mint);
}
#draw-info .match-choice {
  margin-top: 6px;
}
body[data-theme="dark"] {
  --panel: #0c100e;
  --surface: #181e1b;
  --surface-light: #222b26;
  --line: #343e38;
  --muted: #a9b5af;
  --edge-shadow: 0 7px 25px rgb(0 0 0 / 40%);
  background: #050a07;
}
body[data-theme="dark"] #map {
  color-scheme: dark;
  background: #050a07;
}
body[data-theme="dark"] .sheet,
body[data-theme="dark"] .brandbar {
  border-color: #39433d;
}
body[data-theme="dark"] .route-option[aria-pressed="true"] {
  border-color: #46775f;
  background: #14261d;
}
body[data-theme="dark"] .nav-symbol {
  color: var(--mint);
  background: #15291f;
  box-shadow: inset 0 0 0 1px rgb(100 230 175 / 28%);
}
body[data-theme="dark"] .map-footer .scale {
  text-shadow: 0 1px 3px #000, 0 0 4px #000;
}
body[data-theme="dark"] .map-region,
body[data-theme="dark"] .map-btn,
body[data-theme="dark"] .map-btn-pair,
body[data-theme="dark"] .drawing-dock {
  background: #141a17;
  color: var(--paper);
  border-color: #3a453e;
}
body[data-theme="dark"] .map-btn-pair .map-btn + .map-btn::after,
body[data-theme="dark"] .dock-rule {
  background: #424a45;
}
body[data-theme="dark"] .compass-art {
  --paper: #222825;
}
body[data-theme="dark"] .drawing-dock button {
  color: var(--paper);
}
body[data-theme="dark"] .dock-glyph {
  color: #000;
  background: var(--mint);
}
body[data-theme="dark"] #closure-count {
  background: #374139;
  color: var(--paper);
}
body[data-theme="dark"] .map-footer {
  color: var(--paper);
}
.mode-pills {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 2px;
  padding: 3px;
}
.mode-pills button {
  gap: 3px;
  font-size: 12px;
  padding: 0 3px;
  min-height: 38px;
}
@media (max-width: 390px), (max-height: 480px) and (orientation: landscape) {
  .mode-pills button {
    gap: 2px;
  }
  .mode-pills button svg {
    width: 14px;
    height: 14px;
  }
}
svg.brandmark,
:not(svg).brandmark > svg {
  fill: initial;
  stroke: none;
  flex-shrink: 0;
  overflow: visible;
}
:not(svg).brandmark > svg {
  width: 100%;
  height: 100%;
}
svg.brandmark svg,
:not(svg).brandmark > svg svg {
  width: 109px;
  height: 38px;
  fill: initial;
  stroke: none;
  overflow: hidden;
}

.njp-credit > svg {
  width: 112px;
  height: auto;
  stroke: none;
  flex: none;
}
.panel-copy a {
  color: inherit;
}
.search-pages,
.lane-links {
  display: flex;
  gap: 6px;
  justify-content: space-between;
  margin: 4px 0;
}
.search-pages > button,
.lane-links > button {
  min-height: 32px;
  padding: 4px 8px;
  border-radius: 7px;
  color: var(--paper);
  background: var(--surface-light);
  font-size: 12px;
}
@media (max-width: 700px) {
  .map-btn,
  .map-btn-pair .map-btn {
    min-width: 44px;
    min-height: 44px;
  }
  .drawing-dock button,
  .primary {
    min-height: 44px;
  }
}

.sample-trip {
  display: block;
  margin-top: 8px;
  border: 1px solid currentColor;
  padding: 6px 10px;
  min-height: 36px;
  border-radius: 8px;
  background: transparent;
  color: inherit;
}

/* The national overview gives map exploration its own controls, separate from the route endpoints. */
.country-explorer {
  margin-top: 21px;
  padding-top: 17px;
  border-top: 1px solid var(--line);
}
.country-explorer h2 {
  margin: 0 0 11px;
  color: var(--paper);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -.025em;
}
.city-shortcuts {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 5px;
}
.city-shortcuts button {
  display: flex;
  min-height: 65px;
  padding: 8px 2px 6px;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 4px;
  color: var(--paper);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  font-size: 12px;
  font-weight: 560;
}
.city-shortcuts svg {
  width: 35px;
  height: 25px;
  color: var(--mint);
  stroke-width: 1.3;
}
.city-shortcuts button:active, .city-shortcuts button[aria-pressed="true"] {
  border-color: var(--mint);
  background: #20342b;
}
#planner:has(#plan-empty:not([hidden]):not(.hidden)) :is(.route-heading,#start-nav) {
  display: none;
}
.search-address {
  display: flex;
  width: 100%;
  min-height: 44px;
  align-items:center;
  gap: 10px;
  padding: 8px 10px;
  border: 1px solid #47755b;
  border-radius: 8px;
  color: var(--mint);
  background: #20342b;
  font-size: 14px;
  font-weight: 600;
  text-align: left;
}
.search-address svg { width: 16px; height: 16px; }
.map-attribution {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: baseline;
  column-gap: 6px;
  padding: 0 5px;
  border-radius: 3px;
  font-size: 10px;
  line-height: 20px;
  color: #39413d;
  background: rgb(244 246 250 / 90%);
}
.map-attribution > * { white-space: nowrap; }
.map-attribution a {
  display: inline-block;
  color: inherit;
  text-decoration-color: currentColor;
}
.map-attribution a:focus-visible { outline: 2px solid currentColor; outline-offset: -1px; }
body[data-theme="dark"] .map-attribution { background: rgb(17 21 20 / 92%); color: #d3dbd7; }
@media (hover: hover) {
  .city-shortcuts button:hover, .search-address:hover { background:#283831; border-color:#64a68a; }
  .map-region:hover { border-color:#7e9c90; }
}
@media (max-width: 700px) {
  .country-explorer { margin-top: 10px; padding-top: 10px; }
  .country-explorer h2 { font-size: 13px; margin-bottom: 6px; }
  .city-shortcuts { gap: 5px; }
  .city-shortcuts button { min-height: 48px; gap: 1px; padding: 4px 2px; }
  .city-shortcuts svg { width: 30px; height: 21px; }
  #country-view {
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    padding: 0;
    right: max(12px,env(safe-area-inset-right));
    top: max(74px,calc(env(safe-area-inset-top) + 67px));
  }
  #country-view svg { width:18px; height:18px; }
  #country-view #map-place { display:none; }
  .map-tools { top:max(125px,calc(env(safe-area-inset-top) + 118px)); }
}
@media (max-height: 480px) and (orientation: landscape) {
  .country-explorer { margin-top: 7px; padding-top: 8px; }
  .country-explorer h2 { font-size: 12px; margin-bottom: 3px; }
  .city-shortcuts button { min-height: 43px; padding: 2px; gap: 0; font-size: 11px; }
  .city-shortcuts svg { width: 25px; height: 18px; }
  #country-view {
    display: grid;
    place-items: center;
    top: max(6px,env(safe-area-inset-top));
    right: max(6px,env(safe-area-inset-right));
    width: 44px; height:44px; padding:0;
  }
  #country-view #map-place {display:none;}
  .map-tools { top:max(56px,calc(env(safe-area-inset-top) + 50px)); }
}

.info-tabs {
  display:flex;
  gap:3px;
  padding:3px;
  border:1px solid var(--line);
  border-radius:11px;
  background:var(--surface);
}
.info-tabs label {
  position:relative;
  display:grid;
  place-items:center;
  flex:1;
  min-height:36px;
  padding:2px 6px;
  font-size:12px;
  font-weight:600;
  color:var(--muted);
  border-radius:8px;
  cursor:pointer;
}
.info-tabs input {
  position:absolute;
  opacity:0;
  inset:0;
  width:100%;
  height:100%;
  margin:0;
  cursor:pointer;
}
.info-tabs label:has(input:checked) {background:var(--mint);color:var(--ink);}
.info-tabs label:has(input:focus-visible) {outline:2px solid var(--paper);outline-offset:1px;}
.info-content {display:none;margin-top:12px;}
#info-panel:has(#info-map-tab:checked) .info-map,
#info-panel:has(#info-data-tab:checked) .info-data,
#info-panel:has(#info-privacy-tab:checked) .info-privacy {display:block;}
.source-list {margin:0;line-height:1.45;font-size:13px;}
.source-list dt {color:var(--paper);font-weight:620;margin:8px 0 2px;}
.source-list dd {color:var(--muted);margin:0;}
.source-list a {text-underline-offset:2px;}
@media (max-height:480px) and (orientation:landscape) {
  #info-panel .njp-credit {margin-top:5px;height:30px;min-height:30px;}
  #info-panel .info-tabs label {min-height:29px;}
  #info-panel .info-content {margin-top:4px;}
  .source-list {font-size:11px;line-height:1.25;}
  .source-list dt {margin:4px 0 0;}
}


.magnet-attribution {
  display: none;
}
body[data-mode="draw"]:has(#draw-line[aria-pressed="true"]):has(#draw-magnet[aria-pressed="true"]) .magnet-attribution {
  display: inline;
}
