:root {
  color-scheme: dark;
  --ink: #f6f7fb;
  --muted: #9aa3b2;
  --dim: #697386;
  --black: #04060a;
  --panel: rgba(5, 7, 12, 0.9);
  --panel-solid: #080b12;
  --surface: #10151f;
  --surface-2: #171d29;
  --line: rgba(255, 255, 255, 0.14);
  --soft-line: rgba(255, 255, 255, 0.08);
  --art: #73CAE4;
  --architecture: #83B692;
  --industrial: #B8BCC6;
  --manifesta: #FF8121;
  --ruhrtriennale: #EB1E81;
  --accent: #E7A8BB;
  --priority-glow: rgba(231, 168, 187, 0.74);
  --green: #79ff91;
  --warning: #ffb545;
  --shadow: 0 22px 70px rgba(0, 0, 0, 0.48);
  --marker-outline: #06090f;
  --map-ink-rgb: 255, 255, 255;
  --page-bg: var(--black);
  accent-color: var(--accent);
  font-family: Inter, Roboto, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body.map-theme-light {
  --marker-outline: #eee;
  --map-ink-rgb: 0, 0, 0;
  --page-bg: #eee;
}

* {
  box-sizing: border-box;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

html,
body,
.shell,
main {
  width: 100%;
  min-height: 100%;
}

html,
body {
  overflow: hidden;
}

body {
  min-height: 100svh;
  margin: 0;
  background: var(--page-bg);
  color: var(--ink);
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  border: 0;
  cursor: pointer;
}

.shell {
  position: relative;
  min-height: 100svh;
  overflow: hidden;
  background: var(--page-bg);
}

main {
  min-height: 100svh;
}

.map-panel,
#map {
  position: fixed;
  inset: 0;
}

#map {
  z-index: 1;
  background:
    radial-gradient(circle at 20% 15%, rgba(65, 231, 255, 0.08), transparent 28rem),
    var(--page-bg);
}

.leaflet-container {
  background: #070b13;
  font-family: inherit;
}

body.map-theme-light .leaflet-container {
  background: #e9e7e2;
}

body.map-theme-satellite .leaflet-container {
  background: #12140f;
}

.leaflet-tile {
  filter: invert(1) hue-rotate(180deg);
}

/* Range rings are plain HTML/CSS circles, not SVG -- see the comment above
   the map's zoomanim/zoom listeners in app.js for why. Width/height/left/top
   are set directly by JS every animation frame (never a CSS transition, and
   never a scale transform), so the ring stroke below is completely
   unaffected by however that resize is happening at any given moment. */
.range-ring-html {
  position: absolute;
  box-sizing: border-box;
  border-radius: 50%;
  pointer-events: none;
  background-color: var(--ring-fill);
  /* The three rings are separate, overlapping, semi-transparent masked
     layers, each resizing independently every animation frame during
     zoom. Without an isolation hint, mobile compositors (Android browsers
     especially -- this was invisible on desktop) can end up treating
     their overlap as a single region to repaint together, which is what
     was producing visible flicker where they crossed each other, worst
     right where the rings actually overlap on screen. contain: paint
     tells the browser this element never paints outside its own box, so
     each ring's repaint is independent of its neighbours; will-change
     hints that these specific properties change often, so the browser can
     keep the ring on its own compositor layer instead of re-flattening it
     with whatever's underneath on every frame. */
  contain: paint;
  will-change: width, height, left, top;
}

/* The stroke itself is a pseudo-element: a solid/dashed/dotted disc masked
   down to a thin ring at the outer edge. This (rather than border-style)
   is what gives us exact control over dash length and gap size, which
   plain CSS borders don't expose at all. --ring-pattern is a
   repeating-conic-gradient computed and updated in JS (see
   ringDashBackground() in app.js): the dash/gap lengths there are constant
   *screen pixels*, not constant angle, so as the ring's radius changes
   during zoom the number of dashes around it changes too, recomputed every
   frame -- giving the flowing/circular-motion look rather than a fixed
   graphic being rescaled. */
.range-ring-html::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 2px), #000 calc(100% - 2px));
  mask: radial-gradient(farthest-side, transparent calc(100% - 2px), #000 calc(100% - 2px));
  background: var(--ring-pattern, var(--ring-stroke));
}

.range-ring-html.car::before {
  background: var(--ring-stroke);
}

body.map-theme-light .leaflet-tile,
body.map-theme-satellite .leaflet-tile {
  filter: none;
}

.leaflet-control-zoom {
  margin-right: calc(0.75rem + env(safe-area-inset-right)) !important;
  margin-bottom: calc(1rem + env(safe-area-inset-bottom)) !important;
  border: 1px solid var(--soft-line) !important;
  border-radius: 999px !important;
  overflow: hidden;
}

.leaflet-control-zoom a {
  width: 44px !important;
  height: 44px !important;
  border: 0 !important;
  background: rgba(0, 0, 0, 0.86) !important;
  color: var(--ink) !important;
  line-height: 42px !important;
}

.leaflet-control-attribution {
  border-radius: 999px 0 0 0;
  background: rgba(0, 0, 0, 0.62) !important;
  color: var(--dim) !important;
}

.leaflet-control-attribution a {
  color: var(--muted) !important;
}

.map-fallback {
  position: fixed;
  inset: 0;
  z-index: 2;
  display: none;
  place-content: center;
  gap: 0.35rem;
  padding: 2rem;
  text-align: center;
  background: #070b13;
}

.map-hud {
  position: fixed;
  z-index: 30;
  top: calc(0.9rem + env(safe-area-inset-top));
  left: calc(0.85rem + env(safe-area-inset-left));
  display: grid;
  gap: 0.65rem;
}

.map-button,
.overlay-back,
.close,
.route-actions button,
.select-route {
  display: grid;
  place-items: center;
  border: 1px solid var(--soft-line);
  background: rgba(0, 0, 0, 0.88);
  color: var(--ink);
}

.map-button {
  width: 54px;
  height: 54px;
  border-radius: 999px;
  backdrop-filter: blur(16px);
}

.map-button.route-active {
  border-color: transparent;
  background: var(--accent);
  color: var(--black);
}

.map-button:active,
.overlay-back:active,
.close:active,
.route-actions button:active,
.select-route:active {
  transform: scale(0.97);
}

.button-icon {
  display: block;
  width: 24px;
  height: 24px;
  background: currentColor;
  mask: var(--button-icon) center / contain no-repeat;
  -webkit-mask: var(--button-icon) center / contain no-repeat;
}

.button-icon-menu {
  --button-icon: url("./packages/client/assets/icons/navigation/menu.svg");
}

.button-icon-list {
  --button-icon: url("./packages/client/assets/icons/navigation/list.svg");
}

.button-icon-route {
  --button-icon: url("./packages/client/assets/icons/navigation/route.svg");
}

.button-icon-share {
  --button-icon: url("./packages/client/assets/icons/navigation/share.svg");
}

.button-icon-pencil {
  --button-icon: url("./packages/client/assets/icons/navigation/pencil.svg");
}

.map-share-button {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  margin: 0 calc(0.75rem + env(safe-area-inset-right)) 0.65rem 0 !important;
  border: 1px solid var(--soft-line);
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.88);
  color: var(--ink);
  backdrop-filter: blur(16px);
}

.map-share-button .button-icon {
  width: 20px;
  height: 20px;
}

.map-share-button:active {
  transform: scale(0.97);
}

.navigation-icon {
  display: block;
  width: 24px;
  height: 24px;
  fill: currentColor;
}

.map-status {
  position: fixed;
  z-index: 25;
  left: calc(0.85rem + env(safe-area-inset-left));
  bottom: calc(1rem + env(safe-area-inset-bottom));
  max-width: min(70vw, 360px);
  display: flex;
  align-items: stretch;
  gap: 0.4rem;
}

.map-status-recenter {
  display: flex;
  align-items: center;
  gap: 0.62rem;
  min-width: 0;
  flex: 1 1 auto;
  overflow: hidden;
  padding: 0.5rem 0.78rem 0.5rem 0.62rem;
  border: 1px solid var(--soft-line);
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.82);
  color: var(--text);
  font: inherit;
  text-align: left;
  cursor: pointer;
  appearance: none;
  backdrop-filter: blur(16px);
  transition: border-color 180ms ease, transform 180ms ease;
}

.map-status-recenter:hover {
  border-color: rgba(255, 255, 255, 0.22);
}

.map-status-recenter:active {
  transform: scale(0.98);
}

.map-status-edit {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 38px;
  border: 1px solid var(--soft-line);
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.82);
  color: var(--muted);
  cursor: pointer;
  appearance: none;
  backdrop-filter: blur(16px);
  transition: border-color 180ms ease, transform 180ms ease, color 180ms ease;
}

.map-status-edit .button-icon {
  width: 16px;
  height: 16px;
}

.map-status-edit:hover {
  border-color: rgba(255, 255, 255, 0.22);
  color: var(--text);
}

.map-status-edit:active {
  transform: scale(0.94);
}

.map-status-edit[aria-expanded="true"] {
  color: var(--accent);
  border-color: var(--accent);
}

.base-quick-picker {
  position: fixed;
  z-index: 26;
  left: calc(0.85rem + env(safe-area-inset-left));
  bottom: calc(4.1rem + env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  min-width: 220px;
  max-width: min(78vw, 320px);
  padding: 0.5rem;
  border: 1px solid var(--soft-line);
  border-radius: 1rem;
  background: rgba(0, 0, 0, 0.9);
  backdrop-filter: blur(16px);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.45);
}

.base-quick-picker[hidden] {
  display: none;
}

.base-quick-picker button {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.6rem;
  border: 0;
  border-radius: 0.6rem;
  background: transparent;
  color: var(--text);
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.base-quick-picker button:hover {
  background: rgba(255, 255, 255, 0.08);
}

.base-quick-picker button.active {
  color: var(--accent);
}

.overlay-header p,
.route-strip span {
  margin: 0;
  color: var(--dim);
  font-size: 0.72rem;
  font-weight: 850;
  letter-spacing: 0;
  text-transform: uppercase;
}

.map-status-text,
.map-status-text > span,
.map-status-recenter strong {
  display: block;
}

.target-icon {
  display: grid;
  width: 19px;
  height: 19px;
  flex: 0 0 auto;
  place-items: center;
  color: var(--accent);
  font-size: 1.35rem;
  font-weight: 600;
  line-height: 1;
}

.map-status-text > span {
  margin-top: 0.08rem;
  color: var(--muted);
  font-size: 0.78rem;
}

.overlay-panel {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  flex-direction: column;
  gap: 1.35rem;
  height: 100svh;
  max-height: 100svh;
  overflow-x: hidden;
  overflow-y: auto;
  padding: 0 3rem calc(3rem + env(safe-area-inset-bottom));
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  background: color-mix(in srgb, var(--panel-solid) 92%, transparent);
  backdrop-filter: blur(22px);
  opacity: 0;
  pointer-events: none;
  transform: translateX(calc(-100% - 1rem));
  transition:
    opacity 220ms ease-out,
    transform 260ms cubic-bezier(0.22, 1, 0.36, 1);
}

.overlay-panel.open {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.overlay-back {
  position: fixed;
  top: calc(1.4rem + env(safe-area-inset-top));
  left: calc(1.4rem + env(safe-area-inset-left));
  z-index: 3;
  width: 52px;
  height: 52px;
  border-radius: 999px;
  font-size: 2rem;
  line-height: 1;
}

.map-button > span,
.overlay-back > span,
.close > span {
  display: block;
  line-height: 1;
}

.overlay-back span {
  transform: translate(-1px, -2px);
}

.overlay-header {
  display: flex;
  min-height: 52px;
  align-items: center;
  margin-top: calc(1.45rem + env(safe-area-inset-top));
  padding-left: 3rem;
}

.overlay-header p {
  color: #fff;
}

.overlay-intro {
  display: grid;
  gap: 0.45rem;
  padding-top: 0.3rem;
}

.overlay-intro h1 {
  margin: 0;
  font-size: 1.55rem;
  line-height: 1.04;
}

.overlay-intro p {
  max-width: 31rem;
  margin: 0;
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.92rem;
  line-height: 1.45;
}

.overlay-body,
.controls,
.tab-panel {
  display: grid;
  gap: 1.6rem;
  flex: 0 0 auto;
  align-content: start;
}

.tab-panel[hidden] {
  display: none;
}

.overlay-tabs-sentinel {
  height: 0;
}

.overlay-tabs {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: end;
  margin: 0.2rem -3rem 0.4rem;
  padding: 0.85rem 3rem 0;
  background: transparent;
  border-bottom: 4px solid var(--black);
}

.overlay-tabs.stuck {
  background: var(--panel-solid);
}

.overlay-tab-track {
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: end;
  flex: 1 1 auto;
  gap: 0.5rem;
}

.overlay-tabs-close {
  display: none;
  place-items: center;
  position: absolute;
  left: 1.35rem;
  bottom: 0.85rem;
  width: 34px;
  height: 34px;
  border: 1px solid var(--soft-line);
  border-radius: 999px;
  background: var(--panel-solid);
  color: var(--ink);
  font-size: 1.3rem;
  line-height: 1;
  cursor: pointer;
}

.overlay-tabs.stuck .overlay-tabs-close {
  display: grid;
}

.overlay-tabs-close > span {
  display: block;
  transform: translate(-1px, -2px);
}

.overlay-tabs-close:active {
  transform: scale(0.94);
}

.overlay-tab {
  min-height: 38px;
  margin-bottom: 6px;
  border: 0;
  border-radius: 8px;
  background: var(--surface-2);
  color: rgba(255, 255, 255, 0.66);
  font-weight: 800;
  cursor: pointer;
  transition: background 160ms ease, color 160ms ease, margin-bottom 160ms ease, border-radius 160ms ease;
}

.overlay-tab.unsaved {
  color: var(--accent);
}

.overlay-tab.active {
  margin-bottom: 0;
  border-radius: 8px 8px 0 0;
  background: var(--black);
  color: #fff;
}

.inline-link {
  border: 0;
  background: transparent;
  padding: 0;
  color: var(--accent);
  font: inherit;
  font-weight: 800;
  text-decoration: underline;
  text-underline-offset: 0.15rem;
  cursor: pointer;
}

.overlay-group {
  display: grid;
  gap: 0.85rem;
}

.overlay-header + .overlay-body,
.overlay-header + .controls,
.overlay-header + 
.route-sync-status {
  margin: -0.2rem 0 0;
  color: var(--dim);
  font-size: 0.72rem;
  line-height: 1.25;
}

.route-strip {
  margin-top: 0.4rem;
}

.group-caption {
  margin: 0;
  color: var(--dim);
  font-size: 0.72rem;
  font-weight: 850;
  letter-spacing: 0;
  text-transform: uppercase;
}

.primary-action,
.secondary-action,
.detail-actions a,
.detail-actions button {
  display: grid;
  min-height: 48px;
  place-items: center;
  border-radius: 8px;
  background: var(--accent);
  color: var(--black);
  font-weight: 850;
  text-decoration: none;
}


.saved-route-select select {
  min-height: 46px;
  border: 0;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.09);
  color: var(--muted);
  font: inherit;
  font-weight: 800;
}

.saved-route-select select:disabled {
  cursor: default;
  opacity: 0.58;
}

.saved-route-select {
  display: grid;
  gap: 0.3rem;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}

.saved-route-select.compact {
  gap: 0;
}

.saved-route-select select {
  width: 100%;
  padding: 0 0.7rem;
}

.secondary-action {
  min-height: 46px;
  border: 0;
  background: rgba(255, 255, 255, 0.12);
  color: var(--ink);
}

.empty.compact {
  padding: 0.9rem 1rem;
  border: 1px solid var(--soft-line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.055);
  text-align: left;
}

.tour-empty-state {
  display: grid;
  gap: 1.6rem;
}

.tour-empty-state[hidden],
.current-trip[hidden] {
  display: none;
}

.current-trip {
  display: grid;
  gap: 1.6rem;
}

.section-heading {
  display: grid;
  gap: 0.35rem;
}

.section-heading h2 {
  margin: 0;
  font-size: 1.35rem;
  line-height: 1.08;
}

.search,
.log textarea,
.route-start-content select {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.07);
  color: var(--ink);
}

.route-steps {
  display: grid;
  gap: 1.4rem;
}

.route-start {
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 1.1rem;
}

.route-start-content {
  display: grid;
  gap: 0.3rem;
  min-width: 0;
}

.route-start-content select {
  width: 100%;
  min-width: 0;
  min-height: 46px;
  padding: 0 0.7rem;
  font: inherit;
}

.step-number {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  color: var(--ink);
  font-weight: 850;
  font-size: 0.85rem;
}

.legend,
.shape-key,
.range-key {
  display: grid;
  gap: 0.85rem;
  padding: 1.1rem;
  border: 1px solid var(--soft-line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.045);
}

.legend button,
.shape-key span,
.range-key span {
  display: flex;
  width: 100%;
  align-items: center;
  gap: 0.55rem;
  border: 0;
  background: transparent;
  color: var(--muted);
  padding: 0;
  text-align: left;
  font-size: 0.9rem;
  font-weight: 750;
}

.legend button {
  cursor: pointer;
}

.legend button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
}

.legend strong {
  color: var(--ink);
  font-weight: 850;
}

.shape-key span,
.range-key span {
  color: var(--ink);
}

.legend small {
  margin-left: auto;
  color: var(--dim);
  font-size: 0.78rem;
  font-weight: 400;
  line-height: 1.2;
  text-align: right;
}

.dot {
  width: 13px;
  height: 13px;
  border-radius: 999px;
}

.dot.manifesta {
  background: var(--manifesta);
}

.dot.ruhrtriennale {
  background: var(--ruhrtriennale);
}

.dot.art {
  background: var(--art);
}

.dot.architecture {
  background: var(--architecture);
}

.dot.industrial {
  background: var(--industrial);
}


.range-legend-icon {
  display: block;
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
  background: rgba(255, 255, 255, 0.58);
  mask: var(--range-icon) center / contain no-repeat;
  -webkit-mask: var(--range-icon) center / contain no-repeat;
}

.range-legend-icon.walk {
  --range-icon: url("./packages/client/assets/icons/range/walk.svg");
}

.range-legend-icon.bike {
  --range-icon: url("./packages/client/assets/icons/range/bike.svg");
}

.range-legend-icon.car {
  --range-icon: url("./packages/client/assets/icons/range/car.svg");
}

.line {
  width: 36px;
  border-top: 2px solid rgba(255, 255, 255, 0.42);
}

.line.dotted {
  border-top-style: dotted;
  width: 30px;
}

.line.dashed {
  border-top-style: dashed;
  border-color: rgba(255, 255, 255, 0.23);
}

.line.solid {
  border-color: rgba(255, 255, 255, 0.13);
}

.shape-dot,
.shape-square,
.shape-diamond,
.shape-triangle {
  position: relative;
  display: block;
  flex: 0 0 auto;
  width: 17px;
  height: 17px;
}

.shape-dot,
.shape-square,
.shape-diamond {
  background: #999;
}

.shape-dot {
  border-radius: 999px;
}

.shape-square {
  width: 14px;
  height: 14px;
  margin-left: 1.5px;
  border-radius: 0;
}

.shape-diamond {
  width: 14px;
  height: 14px;
  margin-left: 1.5px;
  border-radius: 0;
  transform: rotate(45deg);
}

.shape-triangle {
  width: 0;
  height: 0;
  border-right: 10px solid transparent;
  border-bottom: 18px solid #999;
  border-left: 10px solid transparent;
}

.search {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  min-height: 48px;
  padding: 0 0.85rem;
}

.search span {
  color: var(--dim);
}

.search input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
}

.search input::placeholder,
.log textarea::placeholder {
  color: var(--dim);
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  max-width: 100%;
}

.chip {
  min-height: 0;
  white-space: nowrap;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.09);
  color: var(--muted);
  padding: 0.22rem 0.5rem;
  font-size: 0.72rem;
  font-weight: 850;
}

.segments button {
  min-height: 36px;
  white-space: nowrap;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.09);
  color: var(--muted);
  padding: 0 0.85rem;
  font-weight: 800;
}

.chip.active {
  background: var(--chip-color, var(--accent));
  color: var(--chip-ink, var(--black));
}

.segments button.active {
  background: var(--accent);
  color: var(--black);
}

.segments {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.7rem;
}

.segments button {
  border-radius: 8px;
  padding: 0 0.35rem;
}


.route-sync-status {
  margin: -0.2rem 0 0;
  color: var(--dim);
  font-size: 0.72rem;
  line-height: 1.25;
}

.route-strip {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: start;
  gap: 1.2rem;
  padding: 1.1rem;
  border: 1px solid color-mix(in srgb, var(--accent) 60%, #fff 16%);
  border-radius: 8px;
  background: var(--accent);
  color: var(--black);
}

.route-strip span {
  color: rgba(4, 6, 10, 0.66);
}

.route-strip strong {
  display: block;
  margin-top: 0.12rem;
  font-size: 0.98rem;
}

.route-strip em {
  display: block;
  margin-top: 0.22rem;
  color: rgba(4, 6, 10, 0.62);
  font-size: 0.78rem;
  font-style: normal;
  font-weight: 800;
}

.route-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.55rem;
}

.route-actions button,
.select-route {
  width: 44px;
  height: 44px;
  border-radius: 999px;
}

.route-strip .route-actions button {
  background: var(--black);
  color: var(--ink);
}

.tour-text-actions {
  display: flex;
  grid-column: 1 / -1;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: 0.15rem;
}

.tour-button-actions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr));
  gap: 0.85rem;
  margin-top: -0.35rem;
}

.tour-button-action-group {
  display: grid;
  gap: 0.35rem;
  align-content: start;
}

.tour-action-caption {
  color: var(--dim);
  font-size: 0.72rem;
  font-weight: 400;
  line-height: 1.2;
}

.tour-action-caption[hidden] {
  display: none;
}

.tour-button-action {
  min-height: 46px;
  border: 0;
  border-radius: 8px;
  padding: 0 1rem;
  font-weight: 850;
}

.tour-button-action.primary {
  background: var(--accent);
  color: var(--black);
}

.tour-button-action.secondary {
  background: rgba(255, 255, 255, 0.12);
  color: var(--ink);
}

.tour-text-action {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  min-height: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: rgba(255, 255, 255, 0.72);
  padding: 0;
  font-size: 0.72rem;
  font-weight: 400;
  letter-spacing: 0;
  line-height: 1.2;
  text-decoration: underline;
  text-underline-offset: 0.18rem;
}

.tour-text-action .button-icon {
  width: 12px;
  height: 12px;
}

.tour-text-action.danger {
  color: rgba(255, 255, 255, 0.62);
}

.route-strip .tour-text-action,
.route-strip .tour-text-action.danger {
  color: rgba(4, 6, 10, 0.72);
}

.list {
  flex: 0 0 auto;
  min-height: 0;
  overflow: visible;
  display: grid;
  gap: 1.4rem;
  align-content: start;
  padding: 0.1rem 0 5rem;
}

.card {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 1.1rem;
  padding: 1.05rem;
  border: 1px solid var(--soft-line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.055);
}

.route-stop {
  position: relative;
  grid-template-columns: auto auto 1fr auto;
  align-items: center;
}

.route-stop.dragging {
  opacity: 0.46;
}

.route-stop-list {
  gap: calc(1.4rem + 8px);
}

.route-stop.drag-over::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: calc((1.4rem + 8px) / -2 - 1.5px);
  height: 3px;
  border-radius: 999px;
  background: var(--accent);
  pointer-events: none;
}

.drag-handle {
  display: grid;
  width: 28px;
  min-height: 44px;
  place-items: center;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--dim);
  cursor: grab;
  font-size: 1.15rem;
  line-height: 1;
  touch-action: none;
}

.drag-handle:active {
  cursor: grabbing;
}

.card h2 {
  margin: 0;
  font-size: 1.02rem;
  line-height: 1.15;
}

.card.priority-card h2 {
  color: var(--accent);
}

.card.priority-card h2 .priority-toggle {
  color: var(--accent);
}

.priority-toggle {
  appearance: none;
  display: inline;
  width: auto;
  height: auto;
  min-width: 0;
  min-height: 0;
  margin: 0 0 0 0.34rem;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  color: #737987;
  font: inherit;
  font-size: 0.78em;
  line-height: 1;
  vertical-align: baseline;
}

.priority-toggle span {
  display: inline;
  line-height: 1;
}

.priority-toggle.active {
  background: transparent;
  color: var(--accent);
}

.priority-toggle-detail {
  color: rgba(255, 255, 255, 0.33);
}

.priority-toggle-detail.active {
  color: rgba(255, 255, 255, 1);
}

.card p {
  margin: 0.38rem 0 0;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.35;
}

.suggest-card {
  margin-top: -0.65rem;
}

.suggest-card .select-route {
  background: rgba(255, 255, 255, 0.12);
  color: var(--ink);
}


.card-meta-line {
  margin-top: 0.5rem;
  color: rgba(255, 255, 255, 0.82);
  font-size: 0.68rem;
  font-weight: 400;
  letter-spacing: 0;
  line-height: 1.25;
  text-transform: uppercase;
}

.meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 0.65rem;
}

.pill {
  display: inline-flex;
  align-items: center;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.09);
  color: var(--muted);
  padding: 0.22rem 0.5rem;
  font: inherit;
  font-size: 0.72rem;
  font-weight: 850;
  line-height: 1;
}


.pill.category-pill {
  background: var(--pill-color, rgba(255, 255, 255, 0.09));
  color: var(--pill-ink, var(--black));
  cursor: pointer;
}

.pill.category-pill:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.pill.good {
  background: rgba(121, 255, 145, 0.17);
  color: var(--green);
}

.pill.warn {
  background: rgba(255, 181, 69, 0.17);
  color: var(--warning);
}

.card-actions {
  display: grid;
  gap: 0.5rem;
  align-content: start;
}

.select-route {
  color: var(--muted);
  font-size: 1.35rem;
  font-weight: 850;
  line-height: 1;
}

.select-route.active {
  border-color: transparent;
  background: var(--accent);
  color: var(--black);
}

.detail-sheet {
  position: fixed;
  inset: auto 0 0;
  z-index: 70;
  max-height: 88svh;
  overflow: auto;
  border-radius: 18px 18px 0 0;
  background: var(--panel-solid);
  box-shadow: var(--shadow);
  transform: translateY(105%);
  transition: transform 260ms cubic-bezier(0.22, 1, 0.36, 1);
}

.detail-sheet.open {
  transform: translateY(0);
}

.close {
  position: sticky;
  top: 0.8rem;
  float: right;
  z-index: 2;
  width: 50px;
  height: 50px;
  margin: 0.8rem 0.8rem 0 0;
  border-radius: 999px;
  font-size: 1.8rem;
  line-height: 1;
}

.detail-hero {
  min-height: 178px;
  padding: 5.2rem 1rem 1rem;
  background:
    linear-gradient(135deg, rgba(0, 0, 0, 0.08), rgba(0, 0, 0, 0.72)),
    radial-gradient(circle at 15% 5%, color-mix(in srgb, var(--hero, #41e7ff) 90%, white) 0 18%, transparent 42%),
    var(--hero, #41e7ff);
  background-position: center;
  background-size: cover;
  color: #fff;
}

.detail-hero.has-image {
  background:
    linear-gradient(rgba(0, 0, 0, 0.1), rgba(0, 0, 0, 0.1)),
    var(--hero-image),
    var(--hero, #41e7ff);
  background-position: center;
  background-size: cover;
}

.detail-hero.has-image.needs-overlay {
  background:
    linear-gradient(135deg, rgba(0, 0, 0, 0.64), rgba(0, 0, 0, 0.24)),
    linear-gradient(0deg, color-mix(in srgb, var(--hero, #41e7ff) 14%, transparent), color-mix(in srgb, var(--hero, #41e7ff) 14%, transparent)),
    var(--hero-image),
    var(--hero, #41e7ff);
  background-position: center;
  background-size: cover;
}

.detail-hero h2 {
  max-width: 720px;
  margin: 0;
  font-size: 1.75rem;
  line-height: 1.05;
}

.detail-hero .pill {
  background: rgba(255, 255, 255, 0.14);
  color: rgba(255, 255, 255, 0.7);
}


.detail-body {
  display: grid;
  gap: 1rem;
  padding: 1rem 1rem 2rem;
}

.detail-body p {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.detail-description-clamp {
  display: grid;
  gap: 0.75rem;
}



.photo-strip {
  display: flex;
  gap: 0.5rem;
  margin: -0.1rem -1rem 0;
  overflow-x: auto;
  padding: 0 1rem 0.15rem;
  scrollbar-width: none;
}

.photo-strip::-webkit-scrollbar {
  display: none;
}

.photo-strip button {
  flex: 0 0 auto;
  height: 100px;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
  cursor: pointer;
  overflow: hidden;
}

.photo-strip img {
  display: block;
  width: auto;
  height: 100px;
  object-fit: cover;
}

.photo-gallery {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr) 64px;
  grid-template-rows: minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.5rem;
  padding: calc(4.5rem + env(safe-area-inset-top)) 0 calc(1.2rem + env(safe-area-inset-bottom));
  background: rgba(0, 0, 0, 0.94);
  opacity: 0;
  pointer-events: none;
  transition: opacity 320ms ease;
}

.photo-gallery.open {
  opacity: 1;
  pointer-events: auto;
}

.photo-gallery img {
  grid-column: 2;
  grid-row: 1;
  max-width: 100%;
  max-height: 100%;
  justify-self: center;
  object-fit: contain;
  opacity: 1;
  transform: translateX(0);
  transition: opacity 360ms ease, transform 360ms cubic-bezier(0.22, 1, 0.36, 1);
}

/* Applied with transitions disabled the instant a new photo starts loading
   (see renderGallery in app.js), then removed once it has loaded -- so the
   fade/slide-in above always animates the incoming photo into place, never
   the one it's replacing. */
.photo-gallery img.enter-right,
.photo-gallery img.enter-left {
  opacity: 0;
}

.photo-gallery img.enter-right {
  transform: translateX(28px);
}

.photo-gallery img.enter-left {
  transform: translateX(-28px);
}

.gallery-close,
.gallery-nav {
  border: 0;
  background: rgba(0, 0, 0, 0.74);
  color: #fff;
  cursor: pointer;
}

.gallery-close {
  position: fixed;
  top: calc(1rem + env(safe-area-inset-top));
  right: calc(1rem + env(safe-area-inset-right));
  width: 52px;
  height: 52px;
  border-radius: 999px;
  font-size: 2rem;
  line-height: 1;
}

.gallery-nav {
  width: 48px;
  height: 72px;
  border-radius: 999px;
  font-size: 3rem;
  line-height: 0.7;
}

.gallery-nav.prev {
  grid-column: 1;
  grid-row: 1;
  justify-self: end;
}

.gallery-nav.next {
  grid-column: 3;
  grid-row: 1;
  justify-self: start;
}

.photo-gallery p {
  grid-column: 1 / -1;
  grid-row: 2;
  justify-self: start;
  display: grid;
  gap: 0.12rem;
  margin: 0;
  padding: 0 1rem;
  color: rgba(255, 255, 255, 0.78);
  font-size: 0.82rem;
  line-height: 1.25;
  text-align: left;
}

.photo-gallery p span,
.photo-gallery p small {
  display: block;
}

.photo-gallery p small {
  color: rgba(255, 255, 255, 0.46);
  font-size: 0.72rem;
}

.share-sheet {
  position: fixed;
  inset: 0;
  z-index: 95;
  display: grid;
  place-items: center;
  padding: 1.5rem calc(1.5rem + env(safe-area-inset-right)) calc(1.5rem + env(safe-area-inset-bottom)) calc(1.5rem + env(safe-area-inset-left));
  background: rgba(0, 0, 0, 0.6);
  opacity: 0;
  pointer-events: none;
  transition: opacity 200ms ease;
}

.share-sheet.open {
  opacity: 1;
  pointer-events: auto;
}

.share-sheet-card {
  position: relative;
  width: 100%;
  max-width: 420px;
  padding: 1.4rem 1.3rem 1.3rem;
  border: 1px solid var(--soft-line);
  border-radius: 16px;
  background: var(--panel-solid);
  box-shadow: var(--shadow);
}

.share-sheet-close {
  position: absolute;
  top: 0.6rem;
  right: 0.6rem;
  width: 38px;
  height: 38px;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  color: var(--ink);
  font-size: 1.3rem;
  line-height: 1;
  cursor: pointer;
}

.share-field {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.65rem;
}

.share-field input {
  flex: 1;
  min-width: 0;
  min-height: 46px;
  padding: 0 0.8rem;
  border: 1px solid var(--soft-line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--ink);
}

.share-field button {
  flex: 0 0 auto;
  min-height: 46px;
  padding: 0 1.15rem;
  border: 0;
  border-radius: 8px;
  background: var(--accent);
  color: var(--black);
  font-weight: 850;
  cursor: pointer;
}

.place-crosshair {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: grid;
  pointer-events: none;
  opacity: 0;
  transition: opacity 200ms ease;
}

.place-crosshair.open {
  opacity: 1;
}

.place-crosshair-pin {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 30px;
  height: 30px;
  margin: -30px 0 0 -15px;
  pointer-events: none;
}

.place-crosshair-pin::before,
.place-crosshair-pin::after {
  content: "";
  position: absolute;
}

.place-crosshair-pin::before {
  inset: 0;
  border-radius: 50% 50% 50% 0;
  background: var(--accent);
  transform: rotate(-45deg);
  box-shadow: var(--shadow);
}

.place-crosshair-pin::after {
  top: 8px;
  left: 8px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--black);
}

.place-crosshair-bar {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  display: grid;
  gap: 0.6rem;
  padding: 1.1rem 1.3rem calc(1.1rem + env(safe-area-inset-bottom));
  background: linear-gradient(0deg, rgba(7, 11, 19, 0.92), rgba(7, 11, 19, 0.7) 80%, transparent);
  pointer-events: none;
}

.place-crosshair.open .place-crosshair-bar {
  pointer-events: auto;
}

.place-crosshair-hint {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
  text-align: center;
}

.place-crosshair-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.7rem;
}

.quick-add-card {
  display: grid;
  gap: 0.2rem;
}

.quick-add-field {
  display: grid;
  gap: 0.3rem;
  margin-top: 0.9rem;
}

.quick-add-field input,
.quick-add-field textarea {
  width: 100%;
  min-height: 46px;
  padding: 0.55rem 0.8rem;
  border: 1px solid var(--soft-line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--ink);
  font: inherit;
  resize: vertical;
}

.quick-add-field textarea {
  min-height: 72px;
}

.quick-add-field.field-overridden > .group-caption {
  color: var(--warning);
}

.quick-add-field.field-overridden input,
.quick-add-field.field-overridden textarea {
  color: var(--warning);
}

.quick-add-status {
  margin: 0.9rem 0 0;
  font-size: 0.8rem;
  font-weight: 800;
  color: var(--muted);
}

.quick-add-status.error {
  color: #ff8a80;
}

.edit-overlay-card {
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 480px;
  height: 85vh;
  max-height: 85vh;
  padding-bottom: 1.3rem;
}

.edit-overlay-scroll {
  flex: 1 1 auto;
  min-height: 0;
  margin: 0 -0.2rem;
  padding: 0 0.2rem;
  overflow-y: auto;
}

.edit-overlay-card > .primary-action {
  width: 100%;
  margin-top: 1.1rem;
  flex: 0 0 auto;
}

.edit-overlay-card > .detail-action-full {
  margin-top: 0.6rem;
  flex: 0 0 auto;
}

.edit-location-row {
  display: flex;
  align-items: center;
  gap: 0.7rem;
}

.edit-location-value {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.edit-location-row .secondary-action {
  flex: 0 0 auto;
  min-height: 40px;
  padding: 0 1rem;
}

.edit-inline-add {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.edit-inline-add input {
  flex: 1 1 auto;
  min-width: 0;
  min-height: 42px;
  padding: 0 0.7rem;
  border: 1px solid var(--soft-line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--ink);
  font: inherit;
}

.edit-inline-add .secondary-action {
  flex: 0 0 auto;
  min-height: 42px;
  padding: 0 1rem;
}

.edit-field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.8rem;
}

.edit-sources-list {
  display: grid;
  gap: 0.6rem;
}

.edit-source-row {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  gap: 0.5rem;
  align-items: start;
  padding: 0.7rem;
  border: 1px solid var(--soft-line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
}

.edit-source-row input {
  min-height: 40px;
  padding: 0 0.6rem;
  border: 1px solid var(--soft-line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--ink);
  font: inherit;
  font-size: 0.82rem;
}

.edit-source-row input[data-source-field="url"] {
  grid-column: 1 / -1;
}

.edit-source-remove {
  min-height: 40px;
  padding: 0 0.7rem;
  border: 0;
  border-radius: 8px;
  background: rgba(255, 99, 99, 0.16);
  color: #ff8a80;
  font-weight: 800;
}

.hidden-destinations-group {
  margin-top: 1.1rem;
}

.dimmed-list {
  opacity: 0.5;
}

#destinationAdminActions {
  margin-top: 1.1rem;
}

.tour-text-actions[hidden] {
  display: none;
}

.map-theme-links {
  display: flex;
  gap: 1.1rem;
}

.map-theme-link {
  border: 0;
  background: transparent;
  padding: 0;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 800;
  color: var(--ink);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
}

.map-theme-link.active {
  color: var(--accent);
  text-decoration: none;
}

.admin-toggle-group {
  margin-top: 0.4rem;
}

.admin-toggle {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  cursor: pointer;
}

.admin-toggle input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.admin-toggle-track {
  position: relative;
  flex: 0 0 auto;
  width: 46px;
  height: 26px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  transition: background 160ms ease;
}

.admin-toggle-track::after {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  transition: transform 160ms ease;
  content: "";
}

.admin-toggle input:checked + .admin-toggle-track {
  background: var(--accent);
}

.admin-toggle input:checked + .admin-toggle-track::after {
  transform: translateX(20px);
  background: var(--black);
}

.admin-toggle-label {
  color: var(--ink);
  font-size: 0.9rem;
  font-weight: 800;
}

.admin-toggle-status {
  margin: 0.5rem 0 0;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}

.admin-toggle-status.error {
  color: #ff8a80;
}

.app-version-tag {
  margin: 1.5rem 0 0;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
  opacity: 0.6;
  text-align: center;
}

.detail-description-group {
  display: grid;
  gap: 0.45rem;
}


.detail-more {
  display: grid;
  gap: 0.75rem;
}

.detail-more-content {
  display: grid;
  gap: 0.75rem;
}

.detail-more-content[hidden] {
  display: none;
}

.detail-more-toggle {
  width: fit-content;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--accent);
  cursor: pointer;
  font-size: 0.8rem;
  font-weight: 750;
  text-transform: uppercase;
}

.detail-more p {
  padding-top: 0.25rem;
}

.context-block {
  display: grid;
  gap: 0.55rem;
  padding: 1rem;
  border: 1px solid var(--soft-line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.045);
}

.context-block > p {
  margin: 0;
  color: rgba(255, 255, 255, 0.68);
  font-size: 0.72rem;
  font-weight: 850;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.context-block h3 {
  margin: 0;
  color: #fff;
  font-size: 1rem;
  line-height: 1.12;
}

.context-block div {
  display: grid;
  gap: 0.75rem;
}

.context-block div p,
.access-note {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.48;
}

.access-note strong {
  color: rgba(255, 255, 255, 0.8);
}

.info-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.6rem;
}

.info-tile {
  min-height: 78px;
  padding: 0.8rem;
  border: 1px solid var(--soft-line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.055);
}

.info-tile span {
  display: block;
  color: var(--dim);
  font-size: 0.72rem;
  font-weight: 850;
  text-transform: uppercase;
}

.info-tile strong {
  display: block;
  margin-top: 0.25rem;
  font-size: 0.92rem;
}

.artist-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.detail-actions {
  display: grid;
  gap: 0.55rem;
}

.detail-actions .primary-action {
  background: var(--accent);
  color: var(--black);
}

.detail-actions .secondary-action {
  background: rgba(255, 255, 255, 0.12);
  color: var(--ink);
}

.detail-action-full {
  width: 100%;
}

.detail-action-full.danger {
  background: rgba(255, 99, 99, 0.16);
  color: #ff8a80;
}

.detail-actions-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.55rem;
}

.detail-edit-link {
  margin-top: 1.1rem;
  text-align: left;
}

.detail-actions-row .primary-action,
.detail-actions-row .secondary-action {
  padding: 0 0.4rem;
  font-size: 0.92rem;
}

.log {
  display: grid;
  gap: 0.55rem;
}

.stale-warning {
  padding: 0.75rem;
  border: 1px solid rgba(255, 181, 69, 0.45);
  border-radius: 8px;
  background: rgba(255, 181, 69, 0.13);
  color: #ffd28c;
  font-weight: 800;
}

.sources-list {
  border: 1px solid var(--soft-line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.055);
  padding: 0.75rem;
}

.sources-list p {
  margin: 0;
  color: var(--ink);
  font-size: 0.8rem;
  font-weight: 850;
  text-transform: uppercase;
}

.sources-list ul {
  margin: 0.65rem 0 0;
  padding-left: 1.15rem;
}

.sources-list li + li {
  margin-top: 0.45rem;
}

.sources-list a {
  color: var(--ruhrtriennale);
}

.log textarea {
  min-height: 92px;
  resize: vertical;
  padding: 0.8rem;
}

.empty {
  padding: 2rem 1rem;
  color: var(--muted);
  text-align: center;
}


.range-mode-icon {
  display: grid;
  width: 24px;
  height: 24px;
  place-items: center;
  color: rgba(var(--map-ink-rgb), var(--range-opacity, 0.4));
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.5));
  background: currentColor;
  mask: var(--range-icon) center / contain no-repeat;
  -webkit-mask: var(--range-icon) center / contain no-repeat;
  pointer-events: none;
}


.range-mode-icon.walk {
  transform: translateX(-6px);
}

.range-mode-icon.walk.range-icon-reveal {
  animation-name: rangeWalkIconReveal;
}

@keyframes rangeWalkIconReveal {
  from {
    opacity: 0;
    transform: translateX(-10px) scale(0.88);
  }
  to {
    opacity: 1;
    transform: translateX(-6px) scale(1);
  }
}

.range-mode-icon.range-icon-reveal {
  animation: rangeIconReveal 520ms cubic-bezier(0.22, 1, 0.36, 1) 120ms both;
}

@keyframes rangeIconReveal {
  from {
    opacity: 0;
    transform: translateX(-4px) scale(0.88);
  }
  to {
    opacity: 1;
    transform: translateX(0) scale(1);
  }
}

.marker-offset {
  display: grid;
  width: 56px;
  height: 56px;
  place-items: center;
  transform: translate(var(--marker-x, 0), var(--marker-y, 0));
}



.marker-reveal {
  animation: markerReveal var(--reveal-duration, 680ms) cubic-bezier(0.22, 1, 0.36, 1) both;
  animation-delay: var(--reveal-delay, 0ms);
}

@keyframes markerReveal {
  from {
    opacity: 0;
    transform: scale(var(--reveal-scale, 0.82));
  }
  to {
    opacity: var(--reveal-opacity, 1);
    transform: scale(1);
  }
}


.dtour-marker.marker-exit {
  animation: markerExit 1000ms cubic-bezier(0.22, 1, 0.36, 1) both;
  pointer-events: none;
}

.dtour-group-marker.group-refresh.marker-reveal {
  animation-name: groupMarkerReveal;
}

.dtour-group-marker.group-exit {
  animation: markerExit 1000ms cubic-bezier(0.22, 1, 0.36, 1) both;
  pointer-events: none;
}

.leaflet-marker-icon.marker-leaving {
  pointer-events: none;
}

@keyframes markerExit {
  from {
    opacity: 1;
    transform: scale(1);
  }
  to {
    opacity: 0;
    transform: scale(0.68);
  }
}

@keyframes groupMarkerReveal {
  0% {
    opacity: 0;
    transform: scale(0.76);
    animation-timing-function: cubic-bezier(0.22, 1, 0.36, 1);
  }
  34% {
    opacity: var(--reveal-opacity, 1);
    transform: scale(1.33);
    animation-timing-function: cubic-bezier(0.16, 1, 0.3, 1);
  }
  100% {
    opacity: var(--reveal-opacity, 1);
    transform: scale(1);
  }
}


.route-line-path {
  animation: routeLineAnts 700ms linear infinite;
}

@keyframes routeLineAnts {
  to {
    stroke-dashoffset: -7;
  }
}

@media (prefers-reduced-motion: reduce) {
  .marker-reveal,
  .dtour-marker.marker-exit,
  .dtour-group-marker.group-exit,
  .range-mode-icon.range-icon-reveal,
  .route-line-path {
    animation: none;
  }
}

.dtour-group-marker {
  position: relative;
  display: grid;
  width: 29px;
  height: 29px;
  place-items: center;
  border-radius: 999px;
  background: var(--group-marker);
  box-shadow: 0 0 0 2px var(--marker-outline);
}

.dtour-group-marker::before {
  position: absolute;
  inset: -8px;
  z-index: 0;
  border-radius: inherit;
  background: radial-gradient(circle, var(--priority-glow) 0 18%, rgba(231, 168, 187, 0.28) 36%, transparent 70%);
  opacity: 0;
  content: "";
}

.dtour-group-marker.priority-high::before {
  opacity: 1;
}

.dtour-group-marker::after {
  position: absolute;
  inset: 6.5px;
  z-index: 1;
  border-radius: inherit;
  background: #05070c;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.12);
  content: "";
}

.dtour-group-marker span {
  position: relative;
  z-index: 2;
  color: rgba(255, 255, 255, 0.86);
  font-size: 0.58rem;
  font-weight: 650;
  line-height: 1;
}

.dtour-group-marker.dimmed {
  opacity: 0.45;
  --reveal-opacity: 0.45;
}

.group-list {
  display: grid;
  gap: 1rem;
}

.dtour-marker {
  position: relative;
  display: block;
  width: 27px;
  height: 27px;
}

.dtour-marker::after {
  position: absolute;
  inset: -9px;
  z-index: 0;
  border-radius: 999px;
  background: radial-gradient(circle, var(--priority-glow) 0 20%, rgba(231, 168, 187, 0.34) 36%, transparent 70%);
  opacity: 0;
  content: "";
}

.dtour-marker.priority-high::after {
  opacity: 1;
}

.dtour-marker::before {
  position: absolute;
  inset: 0;
  z-index: 1;
  border: 2px solid var(--marker-outline);
  background:
    radial-gradient(circle at 0 0, rgba(255, 255, 255, 0.1) 0 24%, transparent 25%),
    radial-gradient(circle at 100% 100%, rgba(0, 0, 0, 0.1) 0 24%, transparent 25%),
    var(--marker);
  content: "";
}

.dtour-marker.circle::before {
  border-radius: 999px;
}

.dtour-marker.square::before {
  inset: 3px;
  border-radius: 0;
}

.dtour-marker.diamond::before {
  inset: 3px;
  border-radius: 0;
  transform: rotate(45deg);
}

.dtour-marker.triangle {
  width: 0;
  height: 0;
}

.dtour-marker.triangle::before {
  z-index: 1;
  inset: auto;
  width: 0;
  height: 0;
  border-top: 0;
  border-right: 15px solid transparent;
  border-bottom: 27px solid var(--marker-outline);
  border-left: 15px solid transparent;
  background: transparent;
}

.dtour-marker.triangle::after {
  z-index: 2;
  position: absolute;
  top: 4px;
  left: 4px;
  width: 22px;
  height: 19px;
  background:
    radial-gradient(circle at 0 0, rgba(255, 255, 255, 0.1) 0 24%, transparent 25%),
    radial-gradient(circle at 100% 100%, rgba(0, 0, 0, 0.1) 0 24%, transparent 25%),
    var(--marker);
  clip-path: polygon(50% 0, 100% 100%, 0 100%);
  content: "";
}

.dtour-marker.triangle.priority-high {
  filter: drop-shadow(0 0 10px var(--priority-glow));
}

.dtour-marker.selected {
  transform: scale(1.22);
}

.dtour-marker.focused {
  transform: scale(1.42);
}

.dtour-marker.focused:not(.triangle)::before {
  border-color: #fff;
}

.dtour-marker.focused.triangle::before {
  border-bottom-color: #fff;
}

.dtour-marker.dimmed {
  opacity: 0.45;
  --reveal-opacity: 0.45;
}



.cursor-label {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 60;
  max-width: 14rem;
  padding: 0.28rem 0.48rem;
  border: 1px solid var(--soft-line);
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.84);
  color: rgba(255, 255, 255, 0.88);
  font-size: 0.72rem;
  font-weight: 750;
  line-height: 1.15;
  opacity: 0;
  pointer-events: none;
  white-space: nowrap;
}

.cursor-label.visible {
  opacity: 1;
}

.cursor-label.priority {
  color: var(--accent);
}

.leaflet-tooltip {
  border: 1px solid var(--soft-line);
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.82);
  color: var(--ink);
  box-shadow: var(--shadow);
  font-weight: 800;
}

@media (min-width: 780px) {
  .overlay-panel {
    width: min(430px, calc(100vw - 2rem));
    height: auto;
    max-height: calc(100svh - 2rem);
    inset: 1rem auto 1rem calc(1rem + env(safe-area-inset-left));
    border: 1px solid var(--soft-line);
    border-radius: 12px;
    box-shadow: var(--shadow);
  }

  .overlay-back {
    position: absolute;
    top: 0.75rem;
    left: 0.75rem;
  }

  .overlay-header {
    padding-left: 3rem;
  }

  .detail-sheet {
    right: 1rem;
    bottom: 1rem;
    left: auto;
    width: min(460px, calc(100vw - 2rem));
    max-height: calc(100svh - 2rem);
    border-radius: 12px;
  }

  /* At this width, overlays become floating cards inset 1rem from the
     screen edges (see .overlay-panel and .detail-sheet above) instead of
     covering it edge to edge. The map's own HUD buttons sit closer to the
     edge than that -- map-hud/map-status at ~0.85rem, the zoom control and
     share button at ~0.75rem -- so a sliver of each button used to poke
     out past the card's edge, and being the same near-black colour as the
     overlay it read as a bump in the card's border rather than a floating
     button. Nudging them past the card's 1rem edge tucks them fully out
     of sight once an overlay is open. */
  .map-hud {
    top: calc(1.2rem + env(safe-area-inset-top));
    left: calc(1.2rem + env(safe-area-inset-left));
  }

  .map-status,
  .base-quick-picker {
    left: calc(1.2rem + env(safe-area-inset-left));
  }

  .leaflet-control-zoom {
    margin-right: calc(1.2rem + env(safe-area-inset-right)) !important;
  }

  .map-share-button {
    margin-right: calc(1.2rem + env(safe-area-inset-right)) !important;
  }
}

.tag-pill {
  color: rgba(255, 255, 255, 0.72);
}

