/* The map: the image, the canvas of loot markers, the SVG layer on top (route, key lines, places, you,
   names), and the floating controls: your location, Layers, zoom, Back to route, the mode banner, the
   New place popup, the marker preview, the route navigator and the empty-map card.
   Everything floating has the class .mui so clicks on it don't pan the map.
   Only one panel floats over the map at a time; on phones each one is short and leaves the map visible. */

.map {
  position: relative;
  overflow: hidden;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
  cursor: grab;
  background-color: #0d1619;
  background-image: radial-gradient(circle at 50% 40%, #13232a 0%, #0b1214 70%);
}
.map.panning {
  cursor: grabbing;
}
.map[data-cursor="pointer"] {
  cursor: pointer;
}
.map[data-cursor="move"],
.map.dragging-place {
  cursor: move;
}
.map[data-mode="addPlace"],
.map[data-mode="pickSpots"],
.map[data-mode="locate"],
.map[data-mode="move"],
.map[data-mode="spotPos"] {
  cursor: crosshair;
}
.map[data-mode][data-cursor="pointer"] {
  cursor: pointer;
}
.map[data-mode="locate"][data-cursor="move"] {
  cursor: move;
}
.stage {
  position: absolute;
  left: 0;
  top: 0;
  width: 1119px;
  height: 1016px;
  transform-origin: 0 0;
  will-change: transform;
}
.stage img {
  display: block;
  width: 100%;
  height: 100%;
  pointer-events: none;
  -webkit-user-drag: none;
  border-radius: 6px;
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, 0.6),
    0 20px 60px rgba(0, 0, 0, 0.55);
}
.mcanvas,
.ovl {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}
.ovl {
  overflow: visible;
}
.ovl text.ml {
  font: 600 13.5px var(--f-cond);
  letter-spacing: 0.02em;
  fill: #f1f4f2;
  stroke: #0b0f12;
  stroke-width: 3.6px;
  stroke-linejoin: round;
  paint-order: stroke;
}
.ovl text.ml.sel {
  font-size: 15px;
  fill: #ffd9a6;
}
.ovl text.ml.hover {
  font-size: 14.5px;
}
.ovl text.ml.gold {
  font-size: 12px;
  fill: #fbe3a6;
}
.ovl text.ml.door {
  font-size: 12.5px;
  fill: #f6c9bf;
}
.ovl text.ml.dim {
  fill: #c5ccc9;
  font-size: 12.5px;
}
.ovl text.ml.you {
  font: 700 12px var(--f);
  fill: #06223f;
  stroke: none;
}
.ovl text.mn {
  font: 600 12.5px var(--f-mono);
}
.ovl text.mn.sm {
  font-size: 10px;
}
.ovl text.grid {
  font: 600 13px var(--f-mono);
  fill: rgba(255, 255, 255, 0.75);
  stroke: rgba(0, 0, 0, 0.7);
  stroke-width: 3px;
  paint-order: stroke;
}
/* the way to the next stop: dashes flowing towards it */
.ovl .flow {
  fill: none;
  animation: flow 0.9s linear infinite;
}
@keyframes flow {
  to {
    stroke-dashoffset: -14;
  }
}
@media (prefers-reduced-motion: reduce) {
  .ovl .flow,
  .ovl .pulse {
    animation: none;
  }
}
.ovl .pulse {
  opacity: 0.25;
  transform-box: fill-box;
  transform-origin: center;
  animation: pulse 2.2s ease-out infinite;
}
@keyframes pulse {
  0% {
    transform: scale(0.6);
    opacity: 0.45;
  }
  100% {
    transform: scale(1.5);
    opacity: 0;
  }
}

/* ---------- floating controls ---------- */
.mui {
  position: absolute;
  z-index: 5;
}
.mtl {
  top: var(--s3);
  left: var(--s3);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
}
.mtr {
  top: var(--s3);
  right: var(--s3);
  display: flex;
  gap: var(--s2);
}
.mchip {
  display: inline-flex;
  align-items: center;
  gap: var(--s2);
  height: var(--tap);
  padding: 0 13px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(17, 23, 26, 0.9);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  color: var(--text);
  font-weight: 550;
  font-size: var(--t-sm);
  box-shadow: var(--shadow-sm);
  transition:
    background var(--fast),
    border-color var(--fast);
}
.mchip:hover {
  background: rgba(28, 38, 43, 0.96);
  border-color: rgba(255, 255, 255, 0.16);
}
.mchip[aria-expanded="true"] {
  border-color: var(--accent);
}
.mchip .n {
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 9px;
  font: 600 10.5px/18px var(--f-mono);
  text-align: center;
  background: var(--accent);
  color: var(--accent-ink);
}
.mchip .n:empty {
  display: none;
}
.mchip.filtered {
  border-color: var(--accent-line);
}
/* ---------- the map's own controls ----------
   Top left:   Back, while a page is open on the left (wide screens; on phones the sheet has its own)
   Top centre: your location (big), with a red ✕ beside it to clear it
   Top right:  Layers and Move pins */
.mback {
  height: 52px;
  padding: 0 22px 0 14px;
  gap: 8px;
  border-radius: 14px;
  font-size: 17px;
  font-weight: 700;
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-ink);
  box-shadow:
    var(--shadow-sm),
    0 4px 14px rgba(0, 0, 0, 0.35);
}
.mback:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
}
.mback[hidden] {
  display: none;
}

/* your location */
.mtc {
  top: 14px;
  left: 50%;
  transform: translateX(-50%);
  max-width: calc(100% - 24px);
}
.mtc[hidden] {
  display: none !important;
}
.locrow {
  display: flex;
  align-items: stretch;
  gap: 8px;
}
.loc {
  height: 84px;
  min-width: 400px;
  max-width: min(560px, calc(100vw - 140px));
  padding: 0 16px 0 14px;
  gap: 16px;
  border-radius: 22px;
  border: 2px solid var(--accent);
  background:
    linear-gradient(100deg, rgba(242, 163, 58, 0.2), rgba(242, 163, 58, 0.05) 70%),
    rgba(17, 23, 26, 0.94);
  box-shadow:
    var(--shadow-sm),
    0 0 0 3px rgba(242, 163, 58, 0.12);
  cursor: pointer;
  transition:
    transform 0.12s var(--ease),
    background var(--fast),
    border-color var(--fast);
}
/* once it's set, it's yours: blue, like your dot on the map (orange is the route's colour) */
.loc.set {
  border-color: #4da3ff;
  background:
    linear-gradient(100deg, rgba(77, 163, 255, 0.2), rgba(77, 163, 255, 0.05) 70%),
    rgba(17, 23, 26, 0.94);
  box-shadow:
    var(--shadow-sm),
    0 0 0 3px rgba(77, 163, 255, 0.14),
    0 6px 18px rgba(0, 0, 0, 0.4);
}
.loc.set:hover {
  background:
    linear-gradient(100deg, rgba(77, 163, 255, 0.28), rgba(77, 163, 255, 0.1) 70%),
    rgba(22, 30, 34, 0.96);
}
.loc:hover {
  transform: translateY(-1px);
  background:
    linear-gradient(100deg, rgba(242, 163, 58, 0.34), rgba(242, 163, 58, 0.12) 70%),
    rgba(22, 30, 34, 0.96);
}
.loc:active {
  transform: scale(0.97);
}
.loc .t {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  line-height: 1.2;
}
.loc .t small,
.loc .t b {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.loc .t small {
  color: var(--text-3);
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.loc.set .t small {
  color: #7dbcff;
}
.loc .t b {
  font-size: 22px;
  font-weight: 700;
}
.locdot {
  position: relative;
  flex: none;
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: 2px dashed var(--accent);
  color: var(--accent);
}
.locdot .ic {
  width: 26px;
  height: 26px;
}
.loc.set .locdot {
  border: 2.5px solid #fff;
  background: #4da3ff;
  color: #06223f;
  box-shadow: 0 0 0 3px rgba(77, 163, 255, 0.3);
}
/* a slow pulse on the dot, like the You pin on the map */
.loc.set .locdot::after {
  content: "";
  position: absolute;
  inset: -3px;
  border-radius: 50%;
  border: 2px solid #4da3ff;
  animation: locPulse 2.2s ease-out infinite;
  pointer-events: none;
}
@keyframes locPulse {
  0% {
    transform: scale(1);
    opacity: 0.9;
  }
  100% {
    transform: scale(1.55);
    opacity: 0;
  }
}
/* Set / Change */
.loc .chg {
  flex: none;
  padding: 12px 20px;
  border-radius: 12px;
  background: var(--accent);
  color: var(--accent-ink);
  font-size: 15px;
  font-weight: 700;
}
.loc:hover .chg {
  background: var(--accent-hover);
}
/* clear it */
.locx {
  height: auto;
  width: 84px;
  padding: 0;
  justify-content: center;
  border-radius: 22px;
  border: 2px solid rgba(239, 107, 94, 0.45);
  color: var(--danger);
  transition:
    transform 0.12s var(--ease),
    background var(--fast),
    border-color var(--fast);
}
.locx .ic {
  width: 28px;
  height: 28px;
}
.locx:hover {
  background: rgba(60, 22, 20, 0.95);
  border-color: var(--danger);
  color: #ff8a7e;
}
.locx:active {
  transform: scale(0.97);
}
.locx[hidden] {
  display: none;
}

/* Layers and Move pins: big, equal width, stacked */
.mtr {
  flex-direction: column;
  align-items: stretch;
  gap: 10px;
}
.mtr .mchip {
  position: relative;
  height: 60px;
  min-width: 190px;
  padding: 0 20px 0 16px;
  gap: 12px;
  border-radius: 18px;
  border-width: 1.5px;
  font-size: 16px;
  font-weight: 700;
  justify-content: flex-start;
  transition:
    transform 0.12s var(--ease),
    background var(--fast),
    border-color var(--fast);
}
.mtr .mchip .ic {
  width: 24px;
  height: 24px;
  flex: none;
}
.mtr .mchip .n {
  margin-left: auto;
  min-width: 24px;
  height: 24px;
  border-radius: 12px;
  font-size: 12px;
  line-height: 24px;
}
.mtr .mchip:hover {
  transform: translateY(-1px);
}
.mtr .mchip:active {
  transform: scale(0.97);
}
/* Move pins: off by default, so nothing moves by accident; blue while on */
.movebtn[hidden] {
  display: none;
}
.movebtn.on {
  background: #2f7de1;
  border-color: #7fb6ff;
  color: #fff;
  box-shadow:
    0 0 0 4px rgba(79, 157, 255, 0.28),
    var(--shadow-sm);
}
.movebtn.on:hover {
  background: #3b8af0;
  border-color: #a9cdff;
}
/* the map says it: a blue dashed edge while things can be moved */
.map.moving::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 4;
  pointer-events: none;
  border: 3px dashed rgba(127, 182, 255, 0.8);
  box-shadow: inset 0 0 70px rgba(79, 157, 255, 0.18);
}
@media (max-width: 899px) {
  /* the sheet has Back and ✕ of its own: the map's Back would only crowd the top */
  .mback {
    display: none;
  }
  .mtc {
    top: 10px;
    left: 10px;
    right: 80px;
    transform: none;
    max-width: none;
  }
  .loc {
    flex: 1;
    height: 68px;
    min-width: 0;
    max-width: none;
    gap: 12px;
    border-radius: 18px;
  }
  .locdot {
    width: 44px;
    height: 44px;
  }
  .loc .t b {
    font-size: 18px;
  }
  .loc .chg {
    display: none;
  }
  .locx {
    width: 68px;
    border-radius: 18px;
  }
  .mtr {
    top: 10px;
    right: 10px;
    gap: 8px;
  }
  /* icon over a short label */
  .mtr .mchip {
    width: 60px;
    min-width: 0;
    height: 60px;
    padding: 0;
    flex-direction: column;
    justify-content: center;
    gap: 3px;
    font-size: 10.5px;
  }
  .mtr .mchip .ic {
    width: 22px;
    height: 22px;
  }
  .mtr .mchip .n {
    position: absolute;
    top: -6px;
    right: -6px;
    margin: 0;
  }
}
@media (prefers-reduced-motion: reduce) {
  .loc.set .locdot::after {
    animation: none;
  }
}

/* ---------- Layers (layers.js) ----------
   A panel beside its buttons on wide screens, a sheet at the bottom of the map on phones. Top to bottom:
   marker style, tiles for what else shows, then the loot: a row per category with an eye (show / hide) and
   Only this. Nothing ever looks disabled: off tiles are normal buttons with a switch, and hidden loot keeps
   its colour and says so with a red crossed-out eye. */
.layers-panel {
  z-index: 7;
  top: 60px;
  right: var(--s3);
  width: 390px;
  max-height: min(82%, 760px);
  display: flex;
  flex-direction: column;
  border-radius: 20px;
  background: rgba(17, 23, 26, 0.97);
  backdrop-filter: blur(10px);
  border: 1px solid var(--line-2);
  box-shadow: var(--shadow);
  animation: pop-in 0.14s var(--ease);
  cursor: default;
}
.lp-top {
  flex: none;
  display: flex;
  align-items: center;
  gap: var(--s2);
  padding: 14px 10px 8px 18px;
}
.lp-top h4 {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  font-size: 19px;
  font-weight: 750;
}
.lp-top h4 .ic {
  color: var(--accent);
}
.lp-x {
  width: 44px;
  height: 44px;
}
.lp-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 0 16px 18px;
}
.lp-h {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin: 16px 0 8px;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-3);
}
.lp-h:first-child {
  margin-top: 4px;
}
.lp-count {
  letter-spacing: 0;
  text-transform: none;
  font-weight: 600;
  color: var(--text-2);
}
.lp-note {
  margin: 8px 0 0;
  font-size: var(--t-xs);
  color: var(--text-3);
}
/* marker style: two big halves */
.lp-style {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  margin: 0;
  padding: 4px;
  border-radius: 14px;
  background: var(--surface-3);
}
.lp-style button {
  height: 46px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 0;
  border-radius: 11px;
  background: none;
  color: var(--text-2);
  font: inherit;
  font-size: 14.5px;
  font-weight: 650;
  cursor: pointer;
}
.lp-style button:hover {
  color: var(--text);
}
.lp-style button[aria-checked="true"] {
  background: var(--accent);
  color: var(--accent-ink);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}
/* show on the map: tiles with a switch */
.lp-tiles {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.lp-tile {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  min-height: 78px;
  padding: 12px 12px 11px;
  border-radius: 14px;
  border: 1.5px solid var(--line-2);
  background: var(--surface-3);
  color: var(--text);
  font: inherit;
  font-size: 14px;
  font-weight: 650;
  text-align: left;
  cursor: pointer;
  transition:
    background var(--fast),
    border-color var(--fast),
    color var(--fast),
    transform 0.1s;
}
.lp-tile > .ic {
  color: var(--text-2);
}
.lp-tile:hover {
  border-color: var(--line-3);
  background: var(--surface-4);
}
.lp-tile:active {
  transform: scale(0.97);
}
.lp-tile.on {
  border-color: var(--accent);
  background: linear-gradient(140deg, rgba(242, 163, 58, 0.2), rgba(242, 163, 58, 0.05));
}
.lp-tile.on:hover {
  background: linear-gradient(140deg, rgba(242, 163, 58, 0.28), rgba(242, 163, 58, 0.08));
}
.lp-tile.on > .ic {
  color: var(--accent);
}
.lp-sw {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 36px;
  height: 20px;
  border-radius: 10px;
  background: var(--line-3);
  transition: background var(--fast);
}
.lp-sw::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
  transition: transform 0.18s var(--ease);
}
.lp-tile.on .lp-sw {
  background: var(--accent);
}
.lp-tile.on .lp-sw::after {
  transform: translateX(16px);
}
/* loot */
.lp-loothead {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 8px;
  margin-top: 18px;
}
.lp-loothead .lp-h {
  margin: 0 0 8px;
}
.lp-all {
  display: flex;
  gap: 6px;
  margin-bottom: 6px;
}
.lp-all .btn {
  height: 34px;
  gap: 5px;
}
.lp-search {
  position: relative;
  margin: 4px 0 10px;
}
.lp-search .ic {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-3);
}
.lp-search input {
  width: 100%;
  height: 46px;
  padding: 0 10px 0 38px;
  border-radius: 12px;
  border: 1px solid var(--line-2);
  background: var(--field);
  color: var(--text);
  font: inherit;
  font-size: 14.5px;
}
.lp-search input:focus {
  outline: none;
  border-color: var(--accent);
}
.lp-list,
.lp-sub,
.lp-items {
  list-style: none;
  margin: 0;
  padding: 0;
}
.lp-list > li {
  margin-bottom: 6px;
}
.lp-cat {
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--surface-2);
  overflow: hidden;
}
.lp-r {
  display: flex;
  align-items: center;
  gap: 4px;
  padding-right: 6px;
}
.lp-r:hover {
  background: rgba(255, 255, 255, 0.03);
}
.lp-open {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 60px;
  padding: 8px 6px 8px 12px;
  border: 0;
  background: none;
  color: var(--text);
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.lp-t {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.lp-t b {
  font-size: 15px;
  font-weight: 650;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.lp-t small {
  font-size: 12px;
  color: var(--text-3);
}
/* hidden loot says so in red */
.lp-cat.none .lp-t small,
.lp-sub > li.none .lp-t small,
li.none > .lp-item .lp-t small {
  color: var(--danger);
}
.lp-chev {
  flex: none;
  color: var(--text-3);
  transition: transform var(--fast) var(--ease);
}
.lp-open[aria-expanded="true"] .lp-chev {
  transform: rotate(90deg);
}
/* Only this: lit up while it's what the map shows */
.lp-only {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 34px;
  padding: 0 11px;
  border-radius: 9px;
  border: 1px solid var(--line-2);
  background: none;
  color: var(--text-2);
  font: inherit;
  font-size: 12.5px;
  font-weight: 650;
  cursor: pointer;
}
.lp-only:hover {
  border-color: var(--accent);
  color: var(--accent);
}
.lp-only.on {
  border-color: var(--accent);
  background: var(--accent);
  color: var(--accent-ink);
}
.lp-only.on:hover {
  background: var(--accent-hover);
  color: var(--accent-ink);
}
/* the eye: in the category's colour when shown, red and crossed out when hidden */
.lp-eye {
  flex: none;
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  border: 0;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  cursor: pointer;
}
button.lp-eye:hover {
  background: rgba(255, 255, 255, 0.12);
}
.lp-eye.all {
  color: var(--c, var(--accent));
  background: color-mix(in srgb, var(--c, var(--accent)) 16%, transparent);
}
.lp-eye.none {
  color: var(--danger);
  background: var(--danger-soft);
}
button.lp-eye.none:hover {
  background: rgba(239, 107, 94, 0.22);
}
/* groups and items inside an open category */
.lp-sub {
  border-top: 1px solid var(--line);
  padding: 4px 0 6px;
}
.lp-r.sub .lp-open {
  min-height: 50px;
  padding-left: 22px;
}
.lp-items {
  padding: 2px 0 6px;
}
.lp-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 11px;
  min-height: 50px;
  padding: 5px 6px 5px 34px;
  border: 0;
  background: none;
  color: var(--text);
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.lp-list > li > .lp-item {
  padding-left: 10px;
  border-radius: 12px;
  background: var(--surface-2);
}
.lp-item:hover {
  background: rgba(255, 255, 255, 0.04);
}
.lp-item .lp-t b {
  font-size: 14px;
}
.lp-item .lp-eye {
  width: 40px;
  height: 40px;
}
/* the Layers panel opens beside the buttons, so it never covers Move pins */
@media (min-width: 900px) {
  .layers-panel {
    top: var(--s3);
    right: calc(var(--s3) + 200px);
  }
}
@media (max-width: 899px) {
  .lp-tile {
    min-height: 64px;
  }
}
.lg-icon {
  flex: none;
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--c);
  color: #0b0f12;
  box-shadow: 0 0 0 2px #0b0f12;
}
.lg-icon.sm {
  width: 14px;
  height: 14px;
}
.lgd-row {
  display: flex;
  align-items: center;
  gap: 2px;
}
.lgd-row .tn-pick {
  min-height: 38px;
}
/* the shortcuts card: the keys that matter right now (wide screens only) */
.mkeys {
  right: var(--s3);
  bottom: calc(var(--nav-h, 0px) + 18px);
  width: 196px;
  border-radius: 12px;
  overflow: hidden;
  background: rgba(17, 23, 26, 0.9);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: var(--shadow-sm);
  font-size: var(--t-xs);
}
.mk-head,
.mk-all {
  display: flex;
  align-items: center;
  gap: 7px;
  width: 100%;
  min-height: 34px;
  padding: 0 12px;
  border: 0;
  background: none;
  color: var(--text-2);
  font: inherit;
  font-weight: 650;
  text-align: left;
}
.mk-head span {
  flex: 1;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.mk-head:hover,
.mk-all:hover {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
}
.mk-list {
  margin: 0;
  padding: 2px 12px 6px;
  list-style: none;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
}
.mk-list li {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 26px;
}
.mk-keys {
  display: flex;
  gap: 3px;
  min-width: 52px;
}
.mk-keys kbd {
  min-width: 20px;
  text-align: center;
  color: var(--text);
}
.mk-what {
  color: var(--text-2);
}
.mk-all {
  border-top: 1px solid rgba(255, 255, 255, 0.07);
  font-weight: 500;
}
.recenter {
  right: calc(var(--s3) + 206px);
  bottom: calc(var(--nav-h, 0px) + 18px);
  border-color: var(--accent-line);
}
/* the legend: categories shown, as icon + colour */
.legend {
  left: var(--s3);
  bottom: 18px;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  max-width: min(520px, calc(100% - 140px));
  pointer-events: none;
}
.lgd {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 26px;
  padding: 0 9px 0 4px;
  border-radius: 999px;
  background: rgba(17, 23, 26, 0.88);
  border: 1px solid var(--line-2);
  font-size: var(--t-xs);
  font-weight: 550;
  color: var(--text-2);
}
.lgd .lg-icon {
  width: 18px;
  height: 18px;
  box-shadow: none;
}
.banner {
  top: 64px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 14px;
  width: max-content;
  max-width: calc(100% - 24px);
  padding: 7px 7px 7px 16px;
  border-radius: 14px;
  background: var(--surface);
  border: 1px solid var(--accent);
  box-shadow:
    var(--shadow),
    0 0 0 4px rgba(242, 163, 58, 0.12);
  font-size: var(--t-sm);
  animation: drop-in var(--mid) var(--ease);
}
.banner b {
  color: var(--accent);
}
.bn-acts {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
@keyframes drop-in {
  from {
    opacity: 0;
    transform: translate(-50%, -8px);
  }
}
.mpop {
  width: 280px;
  padding: 12px;
  border-radius: 14px;
  background: var(--surface);
  border: 1px solid var(--line-2);
  box-shadow: var(--shadow);
  animation: pop-in 0.14s var(--ease);
  cursor: default;
}
/* Add loot here: search, results, the place it's filed under */
.mpop:has(.al-pop) {
  width: min(400px, calc(100vw - 24px));
  padding: 16px;
  border-radius: 18px;
  border: 2px solid var(--accent);
  box-shadow:
    0 0 0 4px rgba(242, 163, 58, 0.14),
    0 18px 44px rgba(0, 0, 0, 0.55);
}
.al-pop .mp-head {
  margin-bottom: 12px;
}
.al-pop .mp-head b {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 17px;
}
.al-pop .mp-acts {
  margin-top: 14px;
}
.al-q {
  position: relative;
  display: flex;
  align-items: center;
}
.al-q .ic {
  position: absolute;
  left: 11px;
  color: var(--text-3);
  pointer-events: none;
}
.al-q .ic {
  left: 13px;
}
.al-q .inp {
  min-height: 48px;
  padding-left: 40px;
  font-size: 16px;
}
.al-res {
  list-style: none;
  margin: 8px -4px 0;
  padding: 0;
  max-height: 290px;
  overflow-y: auto;
}
.al-row {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 52px;
  padding: 8px 10px;
  border: 0;
  border-radius: 9px;
  background: none;
  color: var(--text);
  text-align: left;
}
.al-row:hover,
.al-row.on {
  background: var(--surface-3);
}
.al-row.on {
  box-shadow: inset 0 0 0 1px var(--accent-line);
}
.al-row .catb {
  flex: none;
}
.al-t {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  line-height: 1.3;
}
.al-t b {
  font-size: 15px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.al-t small {
  font-size: 11.5px;
  color: var(--text-3);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.al-empty {
  padding: 12px 8px 4px;
  font-size: var(--t-sm);
  color: var(--text-3);
}
.al-new {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 8px;
  font-size: var(--t-xs);
  color: var(--text-2);
}
.al-new-row {
  display: flex;
  gap: 6px;
}
.al-new-row .sel {
  flex: 1;
  min-width: 0;
}
.al-at {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  font-size: var(--t-sm);
  color: var(--text-2);
}
.al-at .sel {
  min-height: 42px;
}
.al-at span {
  flex: none;
}
.al-at .sel {
  flex: 1;
  min-width: 0;
}

.mp-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}
.mp-head .mono {
  color: var(--text-3);
  font-size: var(--t-xs);
}
.mp-note {
  margin: 8px 0 0;
  font-size: var(--t-xs);
  color: var(--text-2);
}
.mp-acts {
  display: flex;
  justify-content: flex-end;
  gap: 6px;
  margin-top: 10px;
}
/* marker preview: what's here, with Details and Add to route */
.mprev {
  width: 300px;
  padding: 12px;
  border-radius: 14px;
  background: var(--surface);
  border: 1px solid var(--line-2);
  box-shadow: var(--shadow);
  animation: pop-in 0.14s var(--ease);
  cursor: default;
}
.mp-top {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}
.mp-top .catb {
  border-radius: 10px;
}
.mp-t {
  flex: 1;
  min-width: 0;
}
.mp-t b {
  display: block;
  font-size: 15px;
  line-height: 1.3;
  overflow-wrap: anywhere;
}
.mp-t small {
  display: block;
  color: var(--text-2);
  font-size: var(--t-xs);
}
.mp-x {
  margin: -6px -6px 0 0;
}
.mp-line {
  margin: 8px 0 0;
  font-size: var(--t-sm);
  color: var(--text-2);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.mprev .minis {
  margin-top: 8px;
  flex-wrap: wrap;
  gap: 6px;
}
.mprev .ph.mini {
  width: calc(50% - 3px);
  height: 84px;
}
.mprev .mp-acts {
  justify-content: stretch;
}
.mprev .mp-acts .btn {
  flex: 1;
}
/* a route stop's card */
.mps-num {
  flex: none;
  display: grid;
  place-items: center;
  min-width: 40px;
  height: 40px;
  padding: 0 8px;
  border-radius: 12px;
  background: #f2a33a;
  color: #1f1300;
  font: 700 17px/1 var(--f-mono);
}
.mps-num.door {
  background: #e0584a;
  color: #fff;
}
.mps-h {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 12px 0 4px;
  font-size: var(--t-xs);
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-2);
}
.mps-list {
  list-style: none;
  margin: 0 -6px;
  padding: 0;
  max-height: 260px;
  overflow-y: auto;
}
.mprev .mps-i {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 7px 6px;
  border: 0;
  border-radius: 10px;
  background: none;
  color: inherit;
  text-align: left;
  cursor: pointer;
}
.mprev .mps-i:hover,
.mprev .mps-i:focus-visible {
  background: var(--surface-2);
}
.mps-t {
  flex: 1;
  min-width: 0;
}
.mps-t b {
  display: block;
  font-size: 14px;
  line-height: 1.3;
  overflow-wrap: anywhere;
}
.mps-t b i {
  font-style: normal;
  color: var(--text-2);
  font-weight: 600;
}
.mps-t small {
  display: block;
  color: var(--text-2);
  font-size: var(--t-xs);
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.mps-i .chev {
  flex: none;
  color: var(--text-3);
}
.mp-more {
  max-height: 180px;
  overflow-y: auto;
  margin: 8px -4px 0;
  padding: 0 4px;
}
.mp-more .mpi {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-height: 40px;
  padding: 4px 6px;
  border: 0;
  border-radius: 8px;
  background: none;
  text-align: left;
  font-size: var(--t-sm);
}
.mp-more .mpi:hover {
  background: var(--surface-3);
}

.map-empty {
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: min(360px, calc(100% - 32px));
  padding: 26px 24px 24px;
  text-align: center;
  border-radius: var(--r-xl);
  background: rgba(17, 23, 26, 0.95);
  backdrop-filter: blur(10px);
  border: 1px solid var(--line-2);
  box-shadow: var(--shadow);
  cursor: default;
}
.me-ic {
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  margin: 0 auto 12px;
  border-radius: 15px;
  background: var(--accent-soft);
  color: var(--accent);
}
.map-empty h3 {
  margin: 0 0 6px;
  font-size: var(--t-lg);
}
.map-empty p {
  margin: 0 0 18px;
  color: var(--text-2);
}
.me-acts {
  display: flex;
  flex-direction: column;
  gap: var(--s2);
}

/* ---------- phones ---------- */
@media (max-width: 899px) {
  .map {
    position: absolute;
    inset: 0;
  }
  .mtl {
    top: 10px;
    left: 10px;
  }
  .mkeys,
  .legend {
    display: none;
  }
  /* everything at the bottom sits above the sheet */
  .layers-panel {
    top: auto;
    left: 0;
    right: 0;
    bottom: var(--sheet-h, 0px);
    width: auto;
    max-height: min(46%, 460px); /* most of the map stays in view; the list scrolls */
    border-radius: var(--r-xl) var(--r-xl) 0 0;
    animation: rise-in var(--mid) var(--ease);
  }
  .recenter {
    right: 10px;
    bottom: calc(var(--sheet-h, 0px) + var(--nav-h, 0px) + 10px);
  }
  .mprev {
    left: 8px !important;
    right: 8px;
    top: auto !important;
    bottom: calc(var(--sheet-h, 0px) + 8px);
    width: auto;
    animation: rise-in var(--mid) var(--ease);
  }
  .banner {
    top: 58px;
    font-size: var(--t-sm);
    padding-left: 12px;
  }
  /* centred in the part of the map above the bottom sheet, and more compact */
  .map-empty {
    top: calc(56px + (100% - 56px - var(--sheet-h, 50%)) / 2);
    padding: 18px;
  }
  .map-empty .me-ic {
    display: none;
  }
  .map-empty p {
    margin-bottom: 14px;
    font-size: var(--t-sm);
  }
}

/* ---------- the route navigator: one slim bar floating at the bottom of the map ---------- */
.nav {
  container: nav / inline-size;
  z-index: 8;
  left: 50%;
  bottom: 16px;
  transform: translateX(-50%);
  width: min(1480px, calc(100% - 32px));
  max-height: calc(100% - 90px);
  display: flex;
  flex-direction: column;
  border-radius: 14px;
  background: rgba(15, 19, 21, 0.96);
  backdrop-filter: blur(14px);
  border: 1px solid var(--line-2);
  box-shadow:
    0 18px 48px rgba(0, 0, 0, 0.55),
    0 0 0 1px rgba(0, 0, 0, 0.45);
  animation: nav-in var(--mid) var(--ease);
  cursor: default;
  overflow: hidden;
}
@keyframes nav-in {
  from {
    opacity: 0;
    transform: translate(-50%, 12px);
  }
}
/* the bottom edge fills up as you go */
.nv-line {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 3px;
  background: rgba(255, 255, 255, 0.05);
  pointer-events: none;
}
.nv-line i {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, color-mix(in srgb, var(--accent) 55%, transparent), var(--accent));
  box-shadow: 0 0 10px color-mix(in srgb, var(--accent) 70%, transparent);
  transition: width var(--mid) var(--ease);
}
.nav.door .nv-line i {
  background: linear-gradient(90deg, color-mix(in srgb, var(--door) 55%, transparent), var(--door));
  box-shadow: 0 0 10px color-mix(in srgb, var(--door) 70%, transparent);
}

/* the row */
.nv-row {
  display: flex;
  align-items: stretch;
  min-height: 118px;
}
.nv-sec {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 3px;
  min-width: 0;
  padding: 18px 22px;
}
.nv-row > .nv-sec + .nv-sec {
  border-left: 1px solid var(--line);
}
.nv-lbl {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 650;
  letter-spacing: 0.09em;
  line-height: 1.3;
  text-transform: uppercase;
  color: var(--text-3);
  white-space: nowrap;
}
.nv-sub {
  font-size: var(--t-xs);
  color: var(--text-2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.nv-meta {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font: 500 12.5px var(--f-mono);
  color: var(--text-2);
  white-space: nowrap;
}
.nv-meta > .ic {
  color: var(--text-3);
}
.nv-dir {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  margin-left: 4px;
  padding-left: 8px;
  border-left: 1px solid var(--line-2);
}
.nv-dir .arr {
  color: var(--accent);
}

/* progress */
.nv-prog {
  flex: 0 0 auto;
  width: 230px;
  flex-direction: row;
  align-items: center;
  gap: 14px;
}
.nv-ic {
  flex: none;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 11px;
  border: 1px solid color-mix(in srgb, var(--accent) 35%, transparent);
  background: var(--accent-soft);
  color: var(--accent);
}
.nv-ic.ok {
  border-color: transparent;
  background: var(--ok-soft);
  color: var(--ok);
}
.nv-ic.warn {
  border-color: transparent;
  background: var(--warn-soft);
  color: var(--warn);
}
.nv-pt {
  flex: 1;
  min-width: 0;
}
.nv-prog b,
.nv-end b {
  display: block;
  font-size: 16px;
  line-height: 1.3;
}
.nv-pbar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 6px;
}
.nv-bar {
  flex: 1;
  display: block;
  height: 5px;
  border-radius: 5px;
  background: var(--surface-4);
  overflow: hidden;
}
.nv-bar i {
  display: block;
  height: 100%;
  border-radius: 5px;
  background: var(--accent);
  transition: width var(--mid) var(--ease);
}
.nv-pct {
  font: 600 var(--t-xs) var(--f-mono);
  color: var(--text-2);
}

/* the stop you're heading to */
.nv-cur {
  flex: 1 1 auto;
  flex-direction: row;
  align-items: center;
  justify-content: flex-start;
  gap: 16px;
}
.nv-ct {
  flex: 0 0 auto;
  min-width: 0;
  max-width: calc(100% - 60px);
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.nv-cur:not(:has(.nv-items)) .nv-ct {
  max-width: 100%;
}
.nv-cur .nv-lbl {
  color: var(--accent);
}
.nav.door .nv-cur .nv-lbl {
  color: #f08a7e;
}
.nv-of {
  display: none;
  margin-left: 6px;
  padding-left: 7px;
  border-left: 1px solid var(--line-2);
  color: var(--text-3);
  font-family: var(--f-mono);
  letter-spacing: 0.02em;
}
.nv-stop {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.nv-stop b {
  min-width: 0;
  font-size: 19px;
  line-height: 1.25;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.nv-num {
  flex: none;
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--accent-ink);
  font: 700 13px var(--f-mono);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent);
}
.nav.door .nv-cur .nv-num {
  background: var(--door);
  color: #fff;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--door) 25%, transparent);
}
.nv-num.sm {
  width: 24px;
  height: 24px;
  font-size: 12px;
  background: var(--surface-3);
  color: var(--text);
  box-shadow: inset 0 0 0 1px var(--line-3);
}
.nv-num.sm.door {
  background: color-mix(in srgb, var(--door) 30%, var(--surface-3));
}
/* the loot here: shrinks before the stop's name does, down to just its picture */
.nv-items {
  flex: 0 1000 auto;
  min-width: 44px;
  max-width: 460px;
  max-height: 80px;
  overflow: hidden;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  align-content: center;
  gap: 6px;
}
.nv-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 44px;
  max-width: 220px;
  min-height: 36px;
  padding: 0 12px 0 6px;
  border-radius: 10px;
  border: 1px solid var(--line-2);
  background: var(--surface-2);
  font-size: var(--t-sm);
  font-weight: 550;
  text-align: left;
}
.nv-item:hover {
  border-color: var(--line-3);
  background: var(--surface-3);
}
.nv-item .catb {
  flex: none;
  border-radius: 7px;
}
.nv-item .nm {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.nv-item .x {
  flex: none;
  font: 500 11px var(--f-mono);
  color: var(--text-3);
}
.nv-item.more {
  flex: none;
  padding: 0 11px;
  font-family: var(--f-mono);
  color: var(--text-2);
}

/* a key's door: which door, where and how far (click to see it on the map), then the two actions */
.nv-keys {
  flex: 0 0 auto;
  flex-direction: row;
  align-items: center;
  gap: 14px;
  padding-top: 10px;
  padding-bottom: 10px;
}
.nk-info {
  flex: 1 1 auto;
  min-width: 0;
  max-width: 230px;
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.nv-keys .nv-lbl {
  color: var(--c-key);
}
/* the switch between a key's doors: big enough to hit easily */
.nk-pick {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  margin-left: auto;
  padding: 2px;
  border: 1px solid var(--line-2);
  border-radius: 10px;
  background: var(--surface-2);
  color: var(--text);
  font: 650 12.5px var(--f-mono);
  letter-spacing: 0;
}
.nk-pick > span {
  min-width: 34px;
  text-align: center;
}
.nk-pick button {
  display: grid;
  place-items: center;
  width: 32px;
  height: 30px;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: var(--surface-3);
  color: var(--text);
}
.nk-pick button:hover {
  background: var(--surface-4);
  color: var(--accent);
}
.nk-door {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
  margin: 0 0 0 -4px;
  padding: 3px 6px 3px 4px;
  border: 0;
  border-radius: 9px;
  background: none;
  color: var(--text);
  text-align: left;
}
.nk-door:hover {
  background: rgba(255, 255, 255, 0.05);
}
.nk-door:hover b {
  text-decoration: underline;
  text-underline-offset: 2px;
}
.nk-ic {
  flex: none;
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  border: 1px solid color-mix(in srgb, var(--door) 50%, transparent);
  background: color-mix(in srgb, var(--door) 18%, transparent);
  color: #ff9d90;
}
.nk-t {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.nk-t b,
.nk-t small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.nk-t b {
  font-size: 14px;
  font-weight: 650;
  line-height: 1.25;
}
.nk-t small {
  font-size: 11.5px;
  color: var(--text-2);
}
.nv-kacts {
  flex: none;
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.nv-kacts .btn {
  justify-content: flex-start;
  gap: 6px;
  min-height: 30px;
  padding: 0 11px 0 9px;
  border-radius: 9px;
  font-size: 12.5px;
  font-weight: 600;
}
.nv-kacts .s {
  display: none;
}
.nk-go {
  border-color: transparent;
  background: var(--door);
  color: #fff;
  box-shadow: 0 3px 12px color-mix(in srgb, var(--door) 35%, transparent);
}
.nk-go:hover:not(:disabled) {
  border-color: transparent;
  background: color-mix(in srgb, var(--door) 85%, #fff);
  color: #fff;
}
.nk-on {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 30px;
  padding: 0 10px 0 8px;
  border-radius: 9px;
  background: var(--ok-soft);
  color: var(--ok);
  font-size: 12.5px;
  font-weight: 600;
  white-space: nowrap;
}
.on-route {
  justify-content: flex-start;
  min-height: 28px;
  padding: 0 9px;
  font-size: 12.5px;
}
.nv-kacts .on-route {
  padding: 0 2px;
}
.nv-goto {
  border-color: color-mix(in srgb, var(--door) 60%, var(--line-2));
  background: color-mix(in srgb, var(--door) 12%, var(--surface-2));
  color: #ffc2ba;
}
.nv-goto:hover:not(:disabled) {
  background: color-mix(in srgb, var(--door) 24%, var(--surface-3));
  border-color: var(--door);
  color: #fff;
}
.on-route {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 34px;
  color: var(--ok);
  font-weight: 600;
  font-size: var(--t-sm);
}

/* the stop after */
.nv-next {
  flex: 0 1 230px;
  min-width: 160px;
  gap: 4px;
}
.nv-next .nv-stop b {
  font-size: 15px;
  font-weight: 600;
}

/* the route's controls */
.nv-tools {
  flex: 0 0 auto;
  flex-direction: row;
  align-items: center;
  gap: 2px;
  padding: 8px 10px;
}
.nv-tool {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-width: 70px;
  min-height: 64px;
  padding: 8px 6px;
  border: 0;
  border-radius: 10px;
  background: none;
  color: var(--text-2);
  font-size: 12px;
  font-weight: 550;
  line-height: 1.15;
  text-align: center;
  white-space: nowrap;
}
.nv-tool:hover:not(:disabled) {
  background: var(--surface-3);
  color: var(--text);
}
.nv-tool[aria-expanded="true"] {
  background: var(--accent-soft);
  color: var(--accent);
}
.nv-tool .ic {
  color: var(--text);
}
.nv-tool[aria-expanded="true"] .ic {
  color: var(--accent);
}
.nv-tool:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
.nt-end .ic {
  color: #f08a7e;
}

/* Back and Next stop */
.nv-go {
  flex: 0 0 auto;
  flex-direction: row;
  align-items: center;
  gap: 10px;
  padding: 14px 18px;
}
.nv-back {
  min-height: 52px;
  gap: 4px;
  padding: 0 14px 0 10px;
  border-radius: 12px;
  background: transparent;
}
.nv-next-btn {
  min-height: 54px;
  min-width: 180px;
  padding: 0 22px;
  font-size: 16px;
  font-weight: 750;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border-radius: 12px;
  box-shadow:
    0 6px 22px color-mix(in srgb, var(--accent) 35%, transparent),
    inset 0 1px 0 rgba(255, 255, 255, 0.25);
}

/* the tray on top of the bar: Options, Stops or an item */
.nv-tray {
  position: relative;
  flex: 0 1 auto;
  min-height: 0;
  max-height: 40vh;
  overflow-y: auto;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.015);
}
.nt-x {
  position: absolute;
  top: 8px;
  right: 8px;
}
.nv-opts {
  padding: 10px 18px 14px;
}
.nt-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}
.nt-head b {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: var(--t-sm);
}
.nt-head b .ic {
  color: var(--accent);
}
.nt-body {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 12px 28px;
}
.nt-grp small {
  display: block;
  margin-bottom: 6px;
  font-size: 10.5px;
  font-weight: 650;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-3);
}
.nt-whole {
  margin-left: auto;
}
.nt-tgs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.nv-tg {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  padding: 0 12px 0 8px;
  border: 1px solid var(--line-2);
  border-radius: 10px;
  background: var(--surface-2);
  color: var(--text-2);
  font-size: var(--t-sm);
  font-weight: 550;
}
.nv-tg:hover:not(:disabled) {
  color: var(--text);
  border-color: var(--line-3);
}
.nv-tg .sw {
  position: relative;
  width: 26px;
  height: 16px;
  border-radius: 9px;
  background: var(--surface-4);
  transition: background var(--fast);
}
.nv-tg .sw::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--text-3);
  transition: transform var(--fast) var(--ease);
}
.nv-tg[aria-pressed="true"] {
  color: var(--text);
  border-color: color-mix(in srgb, var(--accent) 45%, var(--line-2));
}
.nv-tg[aria-pressed="true"] .sw {
  background: var(--accent);
}
.nv-tg[aria-pressed="true"] .sw::after {
  transform: translateX(10px);
  background: #fff;
}
.nv-tg:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
.nav-more {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 0 28px;
  padding: 6px 48px 12px 18px;
}
.nav-more h4 {
  margin: 10px 0 4px;
  font-size: 11px;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--text-3);
}
.nav-spot {
  padding: 8px 0;
  border-top: 1px solid var(--line);
  font-size: var(--t-sm);
}
.nav-spot:first-of-type {
  border-top: 0;
}
.nav-spot .who {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0;
  border: 0;
  background: none;
  font-weight: 600;
  text-align: left;
}
button.who:hover {
  color: var(--accent);
}
.nav-spot p {
  margin: 4px 0 0;
  color: var(--text-2);
  white-space: pre-line;
}
.nav-key {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 10px;
  margin: 8px 0 2px;
  padding: 8px 10px;
  border-radius: 12px;
  background: color-mix(in srgb, var(--c-key) 7%, var(--surface-2));
  border: 1px solid color-mix(in srgb, var(--c-key) 28%, var(--line));
  font-size: var(--t-sm);
}
.nav-key p {
  flex: 1 1 200px;
  margin: 0;
  color: var(--text-2);
}
.nav-key p .ic {
  display: inline-block;
  vertical-align: -2px;
  color: var(--c-key);
}
.nav-key p b {
  color: var(--text);
}
.nav-key .acts {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.nav-detail .back {
  margin: 6px 0 6px -8px;
}

/* finished, nothing to visit, paused */
.nv-row.nv-end > .nv-sec:not(.nv-prog):not(.nv-go) {
  flex: 1 1 auto;
}
.nv-end > .nv-sec:first-child:not(.nv-prog) {
  flex-direction: row;
  align-items: center;
  gap: 12px;
}

/* As the map narrows, the bar drops what's also elsewhere: first the stop after (it's in Stops),
   then the tool labels (they're tooltips), then the progress (the bottom edge and "2 of 43" still say it).
   With a key door the bar has more to show, so it makes room sooner, and below 1240px the door moves to
   its own line under the bar so the stop's name never gets squeezed. */
@container nav (max-width: 1680px) {
  .nv-row:has(.nv-keys) .nv-next {
    display: none;
  }
  .nv-row:has(.nv-keys) .nv-prog {
    width: 190px;
  }
  .nv-row:has(.nv-keys) .nv-prog .nv-ic {
    display: none;
  }
  .nv-row:has(.nv-keys) .nv-tool span {
    display: none;
  }
  .nv-row:has(.nv-keys) .nv-tool {
    min-width: 46px;
    min-height: 48px;
  }
  .nv-row:has(.nv-keys) .nv-kacts .l {
    display: none;
  }
  .nv-row:has(.nv-keys) .nv-kacts .s {
    display: inline;
  }
}
@container nav (max-width: 1360px) {
  .nv-prog {
    width: 220px;
  }
}
@container nav (max-width: 1240px) {
  /* with a key door: two lines, the door and its buttons across the bottom */
  .nv-row:has(.nv-keys) {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    grid-template-areas:
      "cur tools go"
      "keys keys keys";
  }
  .nv-row:has(.nv-keys) > .nv-prog {
    display: none;
  }
  .nv-row:has(.nv-keys) .nv-of {
    display: inline;
  }
  .nv-row:has(.nv-keys) > .nv-cur {
    grid-area: cur;
  }
  .nv-row:has(.nv-keys) > .nv-tools {
    grid-area: tools;
  }
  .nv-row:has(.nv-keys) > .nv-go {
    grid-area: go;
  }
  .nv-row:has(.nv-keys) > .nv-keys {
    grid-area: keys;
    border-left: 0;
    border-top: 1px solid var(--line);
    padding-top: 10px;
    padding-bottom: 10px;
  }
  .nv-row:has(.nv-keys) .nk-info {
    max-width: none;
  }
  .nv-row:has(.nv-keys) .nk-pick {
    margin-left: 10px;
  }
  .nv-row:has(.nv-keys) .nv-kacts {
    flex-direction: row;
  }
  .nv-row:has(.nv-keys) .nv-kacts .l {
    display: inline;
  }
  .nv-row:has(.nv-keys) .nv-kacts .s {
    display: none;
  }
  .nv-row:has(.nv-keys) .nv-tool span {
    display: block;
  }
  .nv-row:has(.nv-keys) .nv-tool {
    min-width: 70px;
    min-height: 64px;
  }
}
@container nav (max-width: 1180px) {
  .nv-next {
    display: none;
  }
}
@container nav (max-width: 1020px) {
  .nv-prog {
    display: none;
  }
  .nv-of {
    display: inline;
  }
  .nv-back span {
    display: none;
  }
  .nv-back {
    padding: 0 14px;
  }
}
@container nav (max-width: 900px) {
  .nv-tool span,
  .nv-row:has(.nv-keys) .nv-tool span {
    display: none;
  }
  .nv-tool,
  .nv-row:has(.nv-keys) .nv-tool {
    min-width: 46px;
    min-height: 48px;
  }
  .nv-next-btn {
    min-width: 0;
    padding: 0 18px;
  }
  .nv-sec {
    padding-left: 16px;
    padding-right: 16px;
  }
}
/* a narrow map: the pieces stack */
@container nav (max-width: 759px) {
  .nv-row,
  .nv-row:has(.nv-keys) {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
      "cur cur"
      "keys keys"
      "tools go";
    min-height: 0;
  }
  .nv-row.nv-end {
    grid-template-areas: none;
    grid-template-columns: minmax(0, 1fr) auto;
  }
  .nv-row > .nv-sec {
    border-left: 0 !important;
    padding: 10px 14px;
  }
  .nv-prog,
  .nv-next {
    display: none !important;
  }
  .nv-cur {
    grid-area: cur;
    gap: 10px;
  }
  .nv-ct {
    flex: 1 1 auto;
  }
  .nv-keys {
    grid-area: keys;
    gap: 10px;
    border-top: 1px solid var(--line);
  }
  .nk-info {
    max-width: none;
  }
  .nv-kacts {
    flex-direction: row;
  }
  .nv-kacts .l {
    display: inline;
  }
  .nv-kacts .s {
    display: none;
  }
  .nv-tools {
    grid-area: tools;
    padding: 4px 6px !important;
    border-top: 1px solid var(--line);
  }
  .nv-go {
    grid-area: go;
    padding: 6px 10px !important;
    border-top: 1px solid var(--line);
  }
  .nv-row.nv-end .nv-go {
    grid-area: auto;
    border-top: 0;
  }
  .nv-row:has(.nv-keys) .nv-item .nm {
    display: inline;
  }
  .nv-item {
    max-width: 180px;
  }
  .nv-next-btn {
    min-height: 44px;
    font-size: 14px;
  }
  .nv-stop b {
    font-size: 17px;
  }
  .nav-more {
    grid-template-columns: 1fr;
    padding: 4px 44px 10px 12px;
  }
  .nv-opts {
    padding: 8px 12px 12px;
  }
  .nt-whole {
    margin-left: 0;
  }
}
@container nav (max-width: 480px) {
  .nv-back {
    display: none;
  }
  .nv-row:has(.nv-keys) .nv-kacts .l {
    display: none;
  }
  .nv-row:has(.nv-keys) .nv-kacts .s {
    display: inline;
  }
}
/* very narrow: the door on one line, the two buttons side by side under it */
@container nav (max-width: 400px) {
  .nv-keys {
    flex-direction: column;
    align-items: stretch;
    gap: 6px;
  }
  .nv-kacts {
    flex-direction: row;
  }
  .nv-kacts > * {
    flex: 1;
    justify-content: center !important;
  }
}

/* phones: a card just above the bottom sheet */
@media (max-width: 899px) {
  .nav {
    left: 8px;
    right: 8px;
    width: auto;
    transform: none;
    bottom: calc(var(--sheet-h, 0px) + 8px);
    max-height: calc(100% - var(--sheet-h, 0px) - 80px);
    animation: rise-in var(--mid) var(--ease);
  }
  .nv-tray {
    max-height: none;
    flex: 1;
  }
}
.nv-mini {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 8px 10px 12px;
}
.nv-mini .nv-t {
  flex: 1;
  min-width: 0;
}
.nv-mini .nv-t small {
  display: block;
  font-size: 10.5px;
  font-weight: 650;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--accent);
}
.nv-mini .nv-t b {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
/* short windows: a slimmer bar so the map keeps most of the space */
@media (max-height: 760px) and (min-width: 900px) {
  .nv-row {
    min-height: 0;
  }
  .nv-sec {
    padding-top: 8px;
    padding-bottom: 8px;
  }
  .nv-stop b {
    font-size: 15px;
  }
  .nv-num {
    width: 24px;
    height: 24px;
    font-size: 12px;
  }
  .nv-item {
    min-height: 34px;
  }
  .nv-ic {
    width: 34px;
    height: 34px;
  }
  .nv-tool span {
    display: none;
  }
  .nv-tool {
    min-width: 40px;
    min-height: 40px;
  }
  .nv-tools,
  .nv-go {
    padding-top: 6px;
    padding-bottom: 6px;
  }
  .nv-next-btn,
  .nv-back {
    min-height: 40px;
  }
  .nv-tray {
    max-height: 32vh;
  }
}
/* the stop's spot note, under the distance */
.nv-note {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  max-width: 250px;
  font-size: 12.5px;
  color: var(--text-2);
}
.nv-note .ic {
  flex: none;
  color: var(--text-3);
}
.nv-note > span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.nv-note i {
  font-style: normal;
  font-family: var(--f-mono);
  color: var(--text-3);
}
@media (max-height: 760px) and (min-width: 900px) {
  .nv-note {
    display: none;
  }
}
/* the current stop's tag on the map: "41 · Junkyard" */
.ovl .stop-tag text {
  font-size: 13.5px;
  font-weight: 700;
  letter-spacing: 0.01em;
}
.ovl .stop-tag text.n {
  font: 700 13px var(--f-mono);
}
.ovl .stop-tag text.k {
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.12em;
}
.ovl .stop-tag text.d {
  font: 600 12px var(--f-mono);
  fill: #b9c4c0;
}

/* ---------- "At this stop": the stop's loot in a window at the top right of the map ---------- */
.stopwin {
  --swc: var(--accent);
  z-index: 7;
  top: 140px; /* under Layers */
  right: 16px;
  width: 340px;
  max-height: calc(100% - var(--nav-h, 0px) - 172px); /* clear of the bar at the bottom */
  display: flex;
  flex-direction: column;
  border-radius: 16px;
  background: rgba(15, 19, 21, 0.97);
  backdrop-filter: blur(14px);
  border: 2px solid var(--swc);
  box-shadow:
    0 0 0 4px color-mix(in srgb, var(--swc) 18%, transparent),
    0 16px 44px rgba(0, 0, 0, 0.55);
  overflow: hidden;
  animation: rise-in var(--mid) var(--ease);
}
.stopwin.door {
  --swc: var(--door);
}
/* the head: a band in the stop's colour with its number, name, how far and what's there */
.sw-head {
  flex: none;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 10px 12px 12px;
  background: color-mix(in srgb, var(--swc) 14%, transparent);
  border-bottom: 1px solid color-mix(in srgb, var(--swc) 35%, transparent);
}
.stopwin.min .sw-head {
  border-bottom: 0;
}
.sw-num {
  flex: none;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--swc);
  color: var(--accent-ink);
  font: 700 17px var(--f-mono);
  box-shadow: 0 0 0 3px rgba(15, 19, 21, 0.9);
}
.stopwin.door .sw-num {
  color: #fff;
}
.sw-ht {
  flex: 1;
  min-width: 0;
}
.sw-ht small {
  display: block;
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--swc);
}
.stopwin.door .sw-ht small {
  color: #f08a7e;
}
.sw-ht b {
  display: block;
  font-size: 17px;
  line-height: 1.25;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.sw-sub {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 2px;
  font-size: 12px;
  color: var(--text-2);
  white-space: nowrap;
  overflow: hidden;
}
.sw-dist {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font: 600 12px var(--f-mono);
  color: var(--text);
}
.sw-dist + span::before {
  content: "·";
  margin-right: 8px;
  color: var(--text-3);
}
/* each item: what it is, where exactly, small tags; a key's door and Found it underneath */
.sw-row + .sw-row {
  border-top: 1px solid var(--line);
}
.sw-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 3px;
}
.sw-tag {
  padding: 1px 7px;
  border-radius: 999px;
  background: var(--surface-3);
  color: var(--text-2);
  font-size: 11px;
  font-weight: 600;
}
.sw-tag.unc {
  background: rgba(242, 193, 78, 0.14);
  color: #f2c14e;
}
.sw-key {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: -2px 8px 8px 54px;
}
.sw-opens {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-2);
}
.sw-opens .ic {
  flex: none;
  color: var(--door);
}
.sw-opens span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.sw-opens b {
  color: var(--text);
  font-weight: 600;
}
.sw-found {
  flex: none;
}
.sw-on {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  font-weight: 600;
  color: var(--ok);
}
/* the foot: Next stop */
.sw-foot {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 10px 10px 14px;
  border-top: 1px solid var(--line);
  font-size: 12px;
  color: var(--text-3);
}
.sw-list {
  list-style: none;
  margin: 0;
  padding: 6px;
  overflow-y: auto;
}
.sw-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px;
  border: 0;
  border-radius: 10px;
  background: none;
  color: var(--text);
  text-align: left;
}
.sw-item:hover {
  background: var(--surface-3);
}
.sw-item .catb {
  flex: none;
  border-radius: 9px;
}
.sw-t {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.sw-t b {
  font-size: 13.5px;
  font-weight: 650;
  line-height: 1.25;
}
.sw-t b i {
  font: 500 11px var(--f-mono);
  font-style: normal;
  color: var(--text-3);
}
.sw-t small {
  font-size: 12px;
  line-height: 1.35;
  color: var(--text-2);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.sw-ph {
  flex: none;
  width: 72px;
  height: 56px;
  border-radius: 8px;
  overflow: hidden;
  background: var(--surface-3);
}
.sw-ph img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
/* with the window open, the bar doesn't repeat the loot */
.nav.has-win .nv-items,
.nav.has-win .nv-note {
  display: none;
}

/* ---------- the fan: overlapping markers spring out into a ring to pick from (fan.js) ---------- */
.fan {
  inset: 0;
  z-index: 6;
  pointer-events: none;
}
.fan[hidden] {
  display: none;
}
.fan-in {
  position: absolute;
  width: 0;
  height: 0;
}
/* a soft dark pool behind the ring so the bubbles read against any part of the map */
.fan-glow {
  position: absolute;
  left: calc(var(--r) * -1);
  top: calc(var(--r) * -1);
  width: calc(var(--r) * 2);
  height: calc(var(--r) * 2);
  border-radius: 50%;
  background: radial-gradient(
    circle,
    rgba(8, 11, 13, 0.72) 0%,
    rgba(8, 11, 13, 0.55) 55%,
    rgba(8, 11, 13, 0) 100%
  );
  opacity: 0;
  transform: scale(0.6);
  transition:
    opacity 0.22s var(--ease),
    transform 0.32s var(--ease);
}
.fan-lines {
  position: absolute;
  left: 0;
  top: 0;
  overflow: visible;
  width: 1px;
  height: 1px;
}
.fan-lines line {
  stroke: var(--c);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-opacity: 0.45;
  stroke-dasharray: 240;
  stroke-dashoffset: 240;
  transition:
    stroke-dashoffset 0.34s var(--ease) var(--d),
    stroke-opacity 0.15s,
    stroke-width 0.15s;
}
.fan-lines line.on {
  stroke-opacity: 1;
  stroke-width: 3;
}
/* the hub on the real point: how many are here */
.fan-hub {
  position: absolute;
  left: 0;
  top: 0;
}
.fan-hub span {
  position: absolute;
  left: -15px;
  top: -15px;
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #fff;
  color: #0b0f12;
  font: 700 13px/1 var(--f-mono);
  box-shadow:
    0 0 0 4px rgba(242, 163, 58, 0.45),
    0 4px 12px rgba(0, 0, 0, 0.5);
  transform: scale(0.4);
  opacity: 0;
  transition:
    transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1),
    opacity 0.15s;
}
/* the bubbles: start on the point, spring out to their place on the ring */
.fan-b {
  position: absolute;
  left: -29px;
  top: -29px;
  width: 58px;
  height: 58px;
  padding: 0;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 0;
  background: #0f1518;
  box-shadow:
    0 0 0 3px var(--c),
    0 0 0 5px rgba(8, 11, 13, 0.9),
    0 8px 20px rgba(0, 0, 0, 0.55);
  cursor: pointer;
  pointer-events: auto;
  opacity: 0;
  transform: translate(0, 0) scale(0.3);
  transition:
    transform 0.42s cubic-bezier(0.34, 1.56, 0.64, 1) var(--d),
    opacity 0.18s ease var(--d),
    box-shadow 0.15s;
}
.fan-b .catb {
  border-radius: 50%;
  box-shadow: none;
}
.fan-b .catb.pic {
  background: #e9edeb;
}
.fan-k {
  position: absolute;
  right: -5px;
  top: -5px;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  border-radius: 10px;
  background: #0b0f12;
  border: 1.5px solid var(--c);
  color: #f1f4f2;
  font: 700 11px/17px var(--f-mono);
  text-align: center;
}
.fan.open .fan-glow {
  opacity: 1;
  transform: scale(1);
}
.fan.open .fan-lines line {
  stroke-dashoffset: 0;
}
.fan.open .fan-hub span {
  transform: scale(1);
  opacity: 1;
}
.fan.open .fan-b {
  opacity: 1;
  transform: translate(var(--x), var(--y)) scale(1);
}
.fan.open .fan-b:hover,
.fan.open .fan-b.cur {
  transform: translate(var(--x), var(--y)) scale(1.16);
  transition-delay: 0s;
  box-shadow:
    0 0 0 3px var(--c),
    0 0 0 6px #fff,
    0 0 26px 6px color-mix(in srgb, var(--c) 55%, transparent),
    0 10px 24px rgba(0, 0, 0, 0.6);
  z-index: 2;
}
.fan.open .fan-b:focus-visible {
  outline: none;
}
.fan.open .fan-b:active,
.fan.open .fan-b.pick {
  transform: translate(var(--x), var(--y)) scale(0.94);
  transition-duration: 0.1s;
}
/* closing: everything folds back into the point, quickly and all at once */
.fan.closing .fan-b,
.fan.closing .fan-lines line {
  transition-delay: 0s;
  transition-duration: 0.16s;
}
/* the card: what's here, or the one pointed at */
.fan-card {
  position: absolute;
  left: 0;
  top: var(--off);
  transform: translate(-50%, 8px);
  width: max-content;
  max-width: min(320px, 86vw);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 10px 14px 11px;
  border-radius: 14px;
  background: rgba(17, 23, 26, 0.96);
  border: 1px solid var(--line-2);
  box-shadow: var(--shadow);
  text-align: center;
  pointer-events: auto;
  opacity: 0;
  transition:
    opacity 0.2s 0.12s,
    transform 0.3s var(--ease) 0.12s,
    border-color 0.15s;
}
.fan-card.up {
  top: auto;
  bottom: var(--off);
  transform: translate(-50%, -8px);
}
.fan.open .fan-card {
  opacity: 1;
  transform: translate(-50%, 0);
}
.fan-card.item {
  border-color: color-mix(in srgb, var(--c) 60%, var(--line-2));
}
.fc-t {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
}
.fc-cat {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  font-weight: 600;
  color: var(--c);
}
.fc-s {
  font-size: 12.5px;
  color: var(--text-2);
}
.fc-hint {
  margin-top: 3px;
  font-size: 11px;
  color: var(--text-3);
}
.fc-hint kbd {
  display: inline-block;
  min-width: 17px;
  padding: 0 4px;
  border-radius: 4px;
  border: 1px solid var(--line-3);
  font: 600 10.5px/16px var(--f-mono);
  color: var(--text-2);
}
@media (prefers-reduced-motion: reduce) {
  .fan-b,
  .fan-glow,
  .fan-hub span,
  .fan-card,
  .fan-lines line {
    transition-duration: 0.01s !important;
    transition-delay: 0s !important;
  }
}

/* ---------- choosing your location: a proper card, a glowing map edge, and a ghost pin ---------- */
.banner.rich {
  top: 74px;
  gap: 14px 18px;
  max-width: min(560px, calc(100% - 24px));
  padding: 14px 14px 14px 16px;
  border-radius: 18px;
  border: 1.5px solid var(--accent);
  background:
    linear-gradient(135deg, rgba(242, 163, 58, 0.16), rgba(242, 163, 58, 0) 60%),
    rgba(17, 23, 26, 0.97);
  box-shadow:
    0 0 0 5px rgba(242, 163, 58, 0.14),
    0 18px 40px rgba(0, 0, 0, 0.55);
  animation: bn-pop 0.38s cubic-bezier(0.34, 1.4, 0.64, 1);
}
.banner.rich #bannerText {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
  flex: 1 1 260px;
}
.bn-ic {
  position: relative;
  flex: none;
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--accent-ink);
  box-shadow: 0 0 0 3px #fff inset;
}
.bn-ic::before,
.bn-ic::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 2px solid var(--accent);
  animation: bn-ring 2s ease-out infinite;
}
.bn-ic::after {
  animation-delay: 1s;
}
@keyframes bn-ring {
  from {
    transform: scale(1);
    opacity: 0.85;
  }
  to {
    transform: scale(1.9);
    opacity: 0;
  }
}
.bn-tx {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}
.banner .bn-title {
  color: var(--text);
  font-size: 18px;
  font-weight: 750;
  line-height: 1.2;
}
.bn-sub {
  color: var(--text-2);
  font-size: 13px;
  line-height: 1.35;
}
.banner.rich .bn-acts {
  flex: none;
  gap: 8px;
}
.banner.rich .bn-acts .btn {
  height: 42px;
  padding: 0 14px;
  gap: 6px;
  font-weight: 600;
}
.bn-kbd {
  margin-left: 4px;
  padding: 1px 5px;
  border-radius: 4px;
  border: 1px solid var(--line-3);
  font: 600 10.5px/1.4 var(--f-mono);
  color: var(--text-3);
}
@keyframes bn-pop {
  from {
    opacity: 0;
    transform: translate(-50%, -14px) scale(0.94);
  }
}
/* the whole map glows orange at its edges while you choose */
.map[data-mode="locate"]::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 4;
  pointer-events: none;
  box-shadow:
    inset 0 0 0 3px rgba(242, 163, 58, 0.75),
    inset 0 0 90px rgba(242, 163, 58, 0.22);
  animation: loc-edge 2.4s ease-in-out infinite;
}
@keyframes loc-edge {
  50% {
    box-shadow:
      inset 0 0 0 3px rgba(242, 163, 58, 0.45),
      inset 0 0 60px rgba(242, 163, 58, 0.12);
  }
}
/* the ghost of your pin under the mouse */
.locghost {
  position: absolute;
  left: 0;
  top: 0;
  z-index: 4;
  pointer-events: none;
}
.locghost[hidden] {
  display: none;
}
.lg-dot {
  position: absolute;
  left: -11px;
  top: -11px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #4da3ff;
  border: 3px solid #fff;
  opacity: 0.85;
  box-shadow:
    0 0 0 6px rgba(77, 163, 255, 0.25),
    0 4px 10px rgba(0, 0, 0, 0.5);
}
.lg-lbl {
  position: absolute;
  left: 18px;
  top: -30px;
  padding: 3px 8px;
  border-radius: 7px;
  background: rgba(17, 23, 26, 0.92);
  border: 1px solid var(--accent-line);
  color: var(--text);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}
/* the ghost pin stands in for the mouse cursor while it shows */
.map[data-mode="locate"].ghosting:not([data-cursor="move"]):not([data-cursor="pointer"]) {
  cursor: none;
}
@media (max-width: 899px) {
  .banner.rich {
    top: 64px;
    padding: 12px;
    gap: 10px;
  }
  .banner.rich .bn-acts {
    width: 100%;
    justify-content: flex-end;
  }
  .bn-ic {
    width: 40px;
    height: 40px;
  }
  .banner .bn-title {
    font-size: 16px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .bn-ic::before,
  .bn-ic::after,
  .map[data-mode="locate"]::after {
    animation: none;
  }
}

/* ---------- several loot spots selected (select.js) ---------- */
.selbar {
  left: 50%;
  top: 172px; /* under the location card, clear of the legend and the shortcuts at the bottom */
  transform: translateX(-50%);
  z-index: 8;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 10px;
  max-width: min(760px, calc(100% - 32px));
  padding: 10px 12px 10px 16px;
  border-radius: 16px;
  background: rgba(15, 19, 21, 0.96);
  border: 2px solid #4da3ff;
  box-shadow:
    0 0 0 4px rgba(77, 163, 255, 0.15),
    0 14px 36px rgba(0, 0, 0, 0.5);
  animation: rise-in var(--mid) var(--ease);
}
.selbar[hidden] {
  display: none;
}
.sb-n {
  font-size: 15px;
  white-space: nowrap;
}
.sb-n b {
  display: inline-grid;
  place-items: center;
  min-width: 28px;
  height: 28px;
  margin-right: 6px;
  padding: 0 8px;
  border-radius: 999px;
  background: #4da3ff;
  color: #06223f;
  font: 700 14px var(--f-mono);
}
.sb-hint {
  flex: 1;
  min-width: 140px;
  font-size: var(--t-xs);
  color: var(--text-2);
}
.sb-file .sel {
  min-height: 34px;
  max-width: 190px;
}
/* a selected marker in the ring of markers on top of each other */
.fan-b.sel {
  box-shadow:
    0 0 0 3px #0b0f12,
    0 0 0 6px #4da3ff;
}
/* while Ctrl is held over the map */
.map.ctrl-on,
.map.ctrl-on .ovl {
  cursor: crosshair;
}
.ctrlhint {
  left: 50%;
  top: 172px;
  transform: translateX(-50%);
  z-index: 8;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px 8px 10px;
  border-radius: 999px;
  background: rgba(15, 19, 21, 0.95);
  border: 2px solid #4da3ff;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.45);
  font-size: var(--t-sm);
  font-weight: 600;
  white-space: nowrap;
  pointer-events: none;
}
.ctrlhint[hidden] {
  display: none;
}
/* the short message: what Q / Esc just closed, a selection made */
.qflash {
  left: 50%;
  bottom: calc(var(--nav-h, 0px) + 92px);
  transform: translateX(-50%);
  z-index: 9;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 9px 16px 9px 10px;
  border-radius: 999px;
  background: rgba(15, 19, 21, 0.96);
  border: 2px solid var(--accent);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.5);
  font-size: 15px;
  font-weight: 650;
  white-space: nowrap;
  pointer-events: none;
}
.qflash[hidden] {
  display: none;
}
.qflash.is-sel {
  border-color: #4da3ff;
}
.qflash .ic {
  color: var(--accent);
}
.qflash.is-sel .ic {
  color: #4da3ff;
}
.qflash.show {
  animation: qflash 1.6s var(--ease) both;
}
@keyframes qflash {
  0% {
    opacity: 0;
    transform: translate(-50%, 10px) scale(0.96);
  }
  12% {
    opacity: 1;
    transform: translate(-50%, 0) scale(1);
  }
  80% {
    opacity: 1;
  }
  100% {
    opacity: 0;
  }
}
/* the stop window: how long walking to the stop you're heading to */
.sw-eta {
  font-size: 12px;
  color: var(--text-3);
}
.sw-dist + .sw-eta::before,
.sw-eta + span::before {
  content: "·";
  margin-right: 8px;
  color: var(--text-3);
}
.sw-dist + .sw-eta + span::before {
  content: "·";
}

/* ---------- planning a trip (T): a bar at the bottom of the map, like the route navigator ---------- */
.tripcard {
  container: tc / inline-size;
  z-index: 8;
  left: 50%;
  bottom: 16px;
  transform: translateX(-50%);
  width: min(1120px, calc(100% - 32px));
  max-height: calc(100% - 90px);
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  overflow-y: auto;
  border-radius: 14px;
  background: rgba(15, 19, 21, 0.96);
  backdrop-filter: blur(14px);
  border: 1px solid var(--accent-line);
  box-shadow:
    0 18px 48px rgba(0, 0, 0, 0.55),
    0 0 0 4px rgba(242, 163, 58, 0.1);
  animation: nav-in var(--mid) var(--ease);
  cursor: default;
}
.tripcard[hidden] {
  display: none;
}
/* the shortcuts card (the trip's keys: E, A D, X, Q) sits just above the bar */
.map:has(.tripcard:not([hidden])) .mkeys {
  bottom: calc(var(--trip-h, 0px) + 12px);
}
.tc-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas:
    "head acts"
    "wf stats"
    "pick stats";
}
.tc-head {
  grid-area: head;
}
.tc-pick {
  grid-area: pick;
}
.tc-row > .tc-acts {
  grid-area: acts;
  justify-content: flex-end;
}
.tc-wf {
  grid-area: wf;
}
.tc-stats {
  grid-area: stats;
}
.tc-row > .tc-wf,
.tc-row > .tc-stats {
  border-top: 1px solid var(--line);
}
.tc-row > .tc-stats {
  border-left: 1px solid var(--line);
}
/* Pick up: under the slider, its label beside the choice */
.tc-row > .tc-pick {
  flex-direction: row;
  align-items: center;
  gap: 14px;
  padding-top: 0;
}
.tc-pick .seg {
  flex: 1;
  max-width: 320px;
}
.tc-sec {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 6px;
  min-width: 0;
  padding: 12px 18px;
}
/* what to do now */
.tc-head {
  flex-direction: row;
  align-items: center;
  justify-content: flex-start;
  gap: 14px;
}
.tc-ic {
  width: 44px;
  height: 44px;
}
.tc-ht {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.tc-head .nv-lbl {
  color: var(--accent);
}
.tc-title {
  font-size: 18px;
  font-weight: 750;
  line-height: 1.25;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.tc-sub {
  font-size: var(--t-xs);
  color: var(--text-2);
  line-height: 1.4;
}
/* how far off the way, pick up */
.tc-field {
  min-width: 0;
}
.tc-fl,
.tset-fl {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-3);
  white-space: nowrap;
}
.tc-fl output,
.tset-fl output {
  font: 700 14px/1 var(--f-mono);
  letter-spacing: 0;
  text-transform: none;
  color: var(--accent);
  white-space: nowrap;
}
.tc-fh {
  font-size: var(--t-xs);
  color: var(--text-3);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.tc-field .seg button {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.tc-field .seg button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
/* what it comes to: the time running first and biggest, then the distance and the stops. Nothing
   in here wraps: each figure stays on one line */
.tc-stats {
  display: grid;
  grid-template-columns: 150px 136px 134px 56px;
  align-items: center;
  gap: 18px;
}
.tc-stat {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  white-space: nowrap;
}
.tc-stat .nv-lbl .ic {
  color: var(--accent);
}
.tc-stat b {
  font-size: 19px;
  font-weight: 750;
  line-height: 1.2;
  font-variant-numeric: tabular-nums;
}
.tc-stat.tc-run b {
  font-size: 28px;
  line-height: 1.1;
  color: var(--accent);
}
.tc-stat small {
  font-size: 12px;
  color: var(--text-3);
}
.tc-stat.tc-empty b {
  color: var(--text-3);
}
.tc-u {
  margin-left: 4px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-3);
}
.tc-plus {
  color: var(--accent);
  font-weight: 650;
}
/* the buttons */
.tc-acts {
  flex: 0 0 auto;
  flex-direction: row;
  align-items: center;
  gap: 6px;
}
.tc-acts [hidden] {
  display: none;
}
.tc-me {
  white-space: nowrap;
}
.tc-go {
  height: 44px;
  margin-left: 4px;
  padding: 0 18px;
  gap: 5px;
  font-weight: 650;
  white-space: nowrap;
}
.tc-go kbd {
  background: rgba(31, 19, 0, 0.12);
  border-color: rgba(31, 19, 0, 0.4);
  color: var(--accent-ink);
}
/* the loot in reach, by kind: a strip along the bottom */
.tc-cats {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 14px;
  padding: 8px 20px;
  border-top: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.02);
}
.tc-cats[hidden] {
  display: none;
}
.tc-cl {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-3);
}
.tc-cat {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: var(--t-xs);
  color: var(--text-2);
  white-space: nowrap;
}
.tc-cat i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--c);
}
.tc-none {
  font-size: var(--t-xs);
  color: var(--text-3);
}
/* narrow (and phones): one thing a row, the figures spread across theirs */
@container tc (max-width: 900px) {
  .tc-row {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
      "head acts"
      "wf wf"
      "pick pick"
      "stats stats";
  }
  .tc-row > .tc-pick,
  .tc-row > .tc-stats {
    border-left: 0;
  }
  .tc-row > .tc-pick {
    padding-top: 0;
  }
  .tc-pick .seg {
    max-width: none;
  }
  .tc-head {
    padding: 10px 12px;
    gap: 10px;
  }
  .tc-ic {
    width: 36px;
    height: 36px;
  }
  .tc-title {
    font-size: 16px;
  }
  .tc-sub {
    display: none;
  }
  .tc-acts {
    padding: 8px 10px;
  }
  .tc-wf,
  .tc-pick {
    padding: 8px 14px;
  }
  .tc-fh {
    display: none;
  }
  .tc-stats {
    grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr) minmax(0, 1.1fr) minmax(0, 0.55fr);
    gap: 10px;
    padding: 10px 14px;
  }
  .tc-stat.tc-run b {
    font-size: 24px;
  }
  .tc-stat b {
    font-size: 16px;
  }
  .tc-cats {
    display: none;
  }
}
@container tc (max-width: 480px) {
  .tc-stats {
    grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr) minmax(0, 0.5fr);
  }
  .tc-walk {
    display: none !important;
  }
  .tc-go kbd,
  .tc-gol,
  .tc-fit,
  .tc-ic {
    display: none !important;
  }
  .tc-go {
    padding: 0 14px;
  }
  .tc-title {
    white-space: normal;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
  }
  .tc-stat small {
    font-size: 11px;
  }
}
@media (max-width: 899px) {
  .tripcard {
    left: 8px;
    right: 8px;
    width: auto;
    transform: none;
    bottom: calc(var(--sheet-h, 0px) + 8px);
    max-height: calc(100% - var(--sheet-h, 0px) - 70px);
    animation: rise-in var(--mid) var(--ease);
  }
}
/* planning, the cursor is a crosshair */
.map[data-mode="trip"] {
  cursor: crosshair;
}
.map[data-mode="trip"][data-cursor="move"] {
  cursor: grab;
}
@media (prefers-reduced-motion: reduce) {
  .tripcard {
    animation: none;
  }
}

/* a slider: an orange track filled up to the thumb (set by --p from the value) */
.range {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 26px;
  margin: 0;
  background: transparent;
  cursor: pointer;
}
.range::-webkit-slider-runnable-track {
  height: 6px;
  border-radius: 6px;
  background: linear-gradient(to right, var(--accent) var(--p, 50%), var(--surface-4) var(--p, 50%));
}
.range::-moz-range-track {
  height: 6px;
  border-radius: 6px;
  background: linear-gradient(to right, var(--accent) var(--p, 50%), var(--surface-4) var(--p, 50%));
}
.range::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 20px;
  height: 20px;
  margin-top: -7px;
  border-radius: 50%;
  background: #fff;
  border: 3px solid var(--accent);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.5);
}
.range::-moz-range-thumb {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #fff;
  border: 3px solid var(--accent);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.5);
}
.range:focus-visible {
  outline: none;
}
.range:focus-visible::-webkit-slider-thumb {
  box-shadow: 0 0 0 4px var(--accent-line);
}
.range:focus-visible::-moz-range-thumb {
  box-shadow: 0 0 0 4px var(--accent-line);
}

/* a running trip's controls (the navigator's Options and the Route tab) */
.tset {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}
.nt-trip {
  align-items: flex-end;
}
.nt-trip .tset {
  flex: 1 1 220px;
}
.nt-trip .tset-fl {
  font-size: 10.5px;
}
.sw-arrive {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  font-size: var(--t-sm);
  color: var(--text-2);
}
.sw-arrive .ic {
  color: var(--accent);
}
/* the trip card is at the bottom: toasts come in at the top, so they never cover Start trip */
body:has(.tripcard.at-bottom:not([hidden])) .toast {
  top: 64px;
  bottom: auto;
  left: 50%;
  right: auto;
  transform: translate(-50%, -140%);
}
body:has(.tripcard.at-bottom:not([hidden])) .toast.on {
  transform: translate(-50%, 0);
}

/* ---------- the navigator: time first, the key door on one line, a compact phone bar ---------- */
.nv-left {
  display: block;
  margin-top: 1px;
  font-size: 12px;
  color: var(--text-2);
  white-space: nowrap;
}
.nv-left b {
  color: var(--accent);
  font-weight: 700;
}
.nv-meta .nv-time {
  margin-right: 4px;
  color: var(--accent);
  font: 700 13px/1 var(--f-sans, inherit);
}
/* a key's door: one line; it opens the Stops tray, where each door has Add and Navigate */
.nv-sec.nv-keys {
  justify-content: center;
}
.nk-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-width: 0;
  max-width: 320px;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid color-mix(in srgb, var(--door) 40%, transparent);
  background: color-mix(in srgb, var(--door) 9%, transparent);
  color: var(--text);
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.nk-chip:hover {
  border-color: var(--door);
  background: color-mix(in srgb, var(--door) 16%, transparent);
}
.nk-chip .nk-ic {
  flex: none;
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: color-mix(in srgb, var(--door) 22%, transparent);
  color: #f08a7e;
}
.nk-chip .nk-t {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.nk-chip .nk-t small {
  font-size: 10.5px;
  font-weight: 650;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: #f08a7e;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.nk-chip .nk-t b {
  font-size: 14px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.nk-chip .nk-far {
  flex: none;
  font: 500 12px var(--f-mono);
  color: var(--text-2);
}
.nk-chip > .ic {
  flex: none;
  color: var(--text-3);
}
/* the "At this stop" window: running time first; Go to the door next beside Found it */
.sw-sub .sw-eta b {
  display: inline;
  font-size: inherit;
  font-weight: 700;
  line-height: inherit;
  color: var(--accent);
}
.sw-key .sw-go {
  flex: none;
}
.sw-tag.noxy {
  color: #9fc4ea;
  background: rgba(77, 163, 255, 0.12);
  border-color: rgba(77, 163, 255, 0.3);
}
/* phones: one line by default (the stop, how far, Next); ⌄ folds the whole bar back to it */
.nv-mini .nv-how {
  display: block;
  margin-top: 1px;
  font-size: 12px;
  color: var(--text-2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.nv-mini .nv-num.door {
  background: var(--door);
  color: #fff;
}
.nav > .nv-fold {
  display: none;
}
@media (max-width: 899px) {
  /* the loot at the stop gets its own row under the stop, not a squeezed column beside it */
  .nav .nv-cur {
    flex-wrap: wrap;
  }
  .nav .nv-cur .nv-ct {
    max-width: calc(100% - 36px);
  }
  .nav .nv-cur .nv-items {
    flex: 1 1 100%;
    max-width: none;
    max-height: none;
    flex-wrap: nowrap;
    overflow-x: auto;
    scrollbar-width: none;
  }
  .nav .nv-cur .nv-items .nv-item {
    flex: none;
    max-width: 220px;
  }
  .nav > .nv-fold {
    display: grid;
    position: absolute;
    top: 6px;
    right: 6px;
    z-index: 2;
  }
  /* the loot at the stop: two lines rather than cut short */
  .nav .nv-item {
    height: auto;
    min-height: 36px;
    padding-top: 4px;
    padding-bottom: 4px;
  }
  .nav .nv-item .nm {
    white-space: normal;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    line-height: 1.25;
  }
}

/* ---------- the route card: on the right of the map while you plan (route-view.js) ---------- */
.planwin {
  z-index: 7;
  top: 140px; /* under Layers */
  right: 16px;
  width: 340px;
  max-height: calc(100% - 156px);
  display: flex;
  flex-direction: column;
  border-radius: 16px;
  background: rgba(15, 19, 21, 0.97);
  backdrop-filter: blur(14px);
  border: 2px solid var(--accent);
  box-shadow:
    0 0 0 4px color-mix(in srgb, var(--accent) 18%, transparent),
    0 16px 44px rgba(0, 0, 0, 0.55);
  overflow: hidden;
  animation: rise-in var(--mid) var(--ease);
}
.planwin[hidden] {
  display: none;
}
/* while it shows, the map's other buttons and the shortcuts card step aside (A, T and the panel still
   have them) */
body.plan-on #moveBtn,
body.plan-on #addLootBtn,
body.plan-on #tripBtn,
body.plan-on .mkeys {
  display: none !important;
}
.pw-head {
  flex: none;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 12px 10px;
  background: color-mix(in srgb, var(--accent) 14%, transparent);
  border-bottom: 1px solid color-mix(in srgb, var(--accent) 35%, transparent);
}
.pw-ic {
  flex: none;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--accent-ink);
}
.pw-ht {
  flex: 1;
  min-width: 0;
}
.pw-ht small {
  display: block;
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
}
.pw-ht b {
  display: block;
  font-size: 17px;
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.pw-save {
  flex: none;
}
.pw-save .ic,
.pw-saved .ic {
  color: var(--accent);
}
.pw-saved {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-2);
}
/* how long it takes: the time running, big, then the stops and studs */
.pw-est {
  flex: none;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  font-size: 12.5px;
  color: var(--text-2);
}
.pw-est .est {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
}
.pw-est .est > span:first-child {
  flex-basis: 100%;
  margin-bottom: 2px;
}
.pw-est .est > span:first-child + span::before {
  content: none;
}
.pw-est .est-t {
  font-size: 26px;
  line-height: 1.1;
}
.pw-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
}
.pw-sec {
  padding: 12px 14px;
}
.pw-sec + .pw-sec {
  border-top: 1px solid var(--line);
}
.pw-sec h4 {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 8px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-3);
}
.pw-sec h4 .cnt {
  padding: 1px 7px;
  border-radius: 999px;
  background: var(--surface-3);
  color: var(--text-2);
  font: 600 11px var(--f-mono);
  letter-spacing: 0;
}
.pw-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.pw-row {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 40px;
  padding: 0 4px 0 12px;
  border-radius: 10px;
  background: var(--surface-2);
  border: 1px solid var(--line);
}
.pw-row .dot {
  flex: none;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--c);
}
.pw-name {
  flex: 1;
  min-width: 0;
  font-size: 14px;
  font-weight: 650;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.pw-row small {
  flex: none;
  font-size: 12px;
  color: var(--text-3);
}
.pw-warn {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 8px 0 0;
  font-size: 12px;
  color: var(--warn);
}
.pw-tgs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.pw-foot {
  flex: none;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px 12px;
  border-top: 1px solid var(--line);
}
.pw-clear {
  height: 50px;
}
.pw-start {
  flex: 1;
  height: 50px;
  justify-content: center;
  gap: 6px;
  font-weight: 650;
}
.pw-start kbd {
  margin-left: 4px;
  background: rgba(31, 19, 0, 0.12);
  border-color: rgba(31, 19, 0, 0.4);
  color: var(--accent-ink);
}
@media (prefers-reduced-motion: reduce) {
  .planwin {
    animation: none;
  }
}
/* the panel, while the card is on the map: a line pointing to it */
.pw-hint {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 14px;
  padding: 10px 12px;
  border-radius: 12px;
  background: var(--accent-soft);
  border: 1px solid var(--accent-line);
  font-size: var(--t-xs);
  color: var(--text-2);
}
.pw-hint .ic {
  flex: none;
  color: var(--accent);
}

/* your location: clearing it is a quiet ✕ that only turns red when you point at it */
.locx {
  border-color: var(--line-2);
  background: rgba(17, 23, 26, 0.94);
  color: var(--text-3);
}
.locx:hover {
  border-color: rgba(239, 107, 94, 0.55);
  color: var(--danger);
}

/* your location on a mid-size window: a slimmer card at the left of the map, so it never runs into Layers
   and the map's buttons on the right */
@media (min-width: 900px) and (max-width: 1279px) {
  .mtc {
    left: 14px;
    transform: none;
    max-width: calc(100% - 250px);
  }
  .loc {
    height: 64px;
    min-width: 0;
    max-width: 100%;
    gap: 12px;
    border-radius: 18px;
  }
  .locdot {
    width: 42px;
    height: 42px;
  }
  .loc .t b {
    font-size: 18px;
  }
  .loc .chg {
    padding: 9px 14px;
  }
  .locx {
    width: 64px;
    border-radius: 18px;
  }
}

/* Resume route: its key, readable on the orange button */
.nv-next-btn kbd {
  margin-left: 6px;
  background: rgba(31, 19, 0, 0.12);
  border-color: rgba(31, 19, 0, 0.4);
  color: var(--accent-ink);
}

/* the trip bar: A and D either side of the width slider (narrower, wider); they click too. On touch
   screens they're − and + */
.tc-wrow {
  display: flex;
  align-items: center;
  gap: 10px;
}
.tc-wrow .range {
  flex: 1;
  min-width: 0;
}
.tc-key {
  flex: none;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  padding: 0;
  border-radius: 9px;
  border: 1.5px solid var(--accent);
  border-bottom-width: 4px;
  background: var(--accent-soft);
  color: var(--accent);
  cursor: pointer;
  transition:
    transform 0.08s var(--ease),
    background var(--fast);
}
.tc-key:hover {
  background: rgba(242, 163, 58, 0.26);
}
.tc-key:active {
  transform: translateY(2px);
  border-bottom-width: 2px;
}
.tc-key kbd {
  border: 0;
  padding: 0;
  background: none;
  color: inherit;
  font: 800 17px/1 var(--f-mono);
}
.tc-key i {
  display: none;
  font: 700 20px/1 var(--f-sans, inherit);
  font-style: normal;
}
@media (hover: none) {
  .tc-key kbd {
    display: none;
  }
  .tc-key i {
    display: block;
  }
}
