: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: #EB1E81;
  --architecture: #73CAE4;
  --land-art: #83B692;
  --industrial: #B8BCC6;
  --manifesta: #FF8121;
  --ruhrtriennale: #8B1538;
  --ddw: #FFB805;
  --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-layers {
  --button-icon: url("./packages/client/assets/icons/navigation/layers.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);
}

.map-theme-control {
  position: relative;
  margin: 0 calc(0.75rem + env(safe-area-inset-right)) 0.65rem 0 !important;
}

.map-theme-control .map-theme-button {
  margin: 0 !important;
}

.map-theme-control.open .map-theme-button {
  background: var(--ink);
  color: var(--black);
}

.map-theme-menu {
  position: absolute;
  top: 50%;
  right: calc(100% + 0.5rem);
  display: flex;
  gap: 0.25rem;
  padding: 0.25rem;
  border: 1px solid var(--soft-line);
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.88);
  backdrop-filter: blur(16px);
  transform: translateY(-50%);
  white-space: nowrap;
}

.map-theme-menu[hidden] {
  display: none;
}

.map-theme-option {
  min-height: 38px;
  border: 0;
  border-radius: 999px;
  padding: 0 0.85rem;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 0.85rem;
  font-weight: 800;
  cursor: pointer;
}

.map-theme-option.active {
  background: var(--accent);
  color: var(--black);
}

.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;
}

#savedToursGroup {
  margin-top: 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;
}

.tour-storage-note {
  margin: -0.6rem 0 0;
  color: var(--dim);
  font-size: 0.72rem;
  line-height: 1.35;
}

.route-start-content select + .group-caption {
  margin-top: 0.7rem;
}

.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.ddw {
  background: var(--ddw);
}

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

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

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

.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-nav-action {
  grid-column: 1 / -1;
  width: 100%;
  min-height: 48px;
  border: 0;
  border-radius: 8px;
  padding: 0 0.4rem;
  background: var(--black);
  color: var(--ink);
  font: inherit;
  font-size: 0.92rem;
  font-weight: 850;
  cursor: pointer;
}

.tour-nav-action:active {
  transform: scale(0.99);
}

.route-strip .route-actions .tour-close {
  width: 36px;
  height: 36px;
  font-size: 1.4rem;
  line-height: 1;
}

.route-strip .tour-close > span {
  color: var(--ink);
  font-size: 1.4rem;
  font-weight: 400;
}

.tour-close > span {
  display: block;
  line-height: 1;
  transform: translateY(-1px);
}

.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);
}


.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 and share share one sticky column, so share never scrolls
   underneath the close button. */
.detail-controls {
  position: sticky;
  top: 0.8rem;
  float: right;
  z-index: 2;
  display: grid;
  gap: 0.55rem;
  margin: 0.8rem 0.8rem 0 0;
}

.close {
  width: 50px;
  height: 50px;
  border-radius: 999px;
  font-size: 1.8rem;
  line-height: 1;
  backdrop-filter: blur(16px);
}

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

.detail-hero {
  position: relative;
  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;
}

/* Photo heroes (ours and Commons placeholders): greyscale, multiplied over the
   category colour so black stays black and white becomes the colour. The photo
   sits on its own layer so the filter never touches the title text. */
.detail-hero.duotone {
  min-height: 190px;
  padding-bottom: 1.6rem;
  background: var(--hero, #41e7ff);
  isolation: isolate;
}

.detail-hero.duotone::before,
.detail-hero.duotone::after {
  position: absolute;
  inset: 0;
  content: "";
}

.detail-hero.duotone::before {
  z-index: -2;
  background: var(--hero-image) center / cover;
  filter: grayscale(1) contrast(1.1) brightness(var(--hero-boost, 1));
  mix-blend-mode: multiply;
}

.detail-hero.duotone::after {
  z-index: -1;
  background: linear-gradient(135deg, rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0.08));
}

/* One small horizontal line in the strip under the city/distance pills,
   bottom right, so it never competes with the close/share buttons. */
.hero-credit {
  position: absolute;
  right: 0.7rem;
  bottom: 0.45rem;
  z-index: 2;
  max-width: calc(100% - 1.4rem);
  overflow: hidden;
  color: rgba(255, 255, 255, 0.88);
  font-size: 0.6rem;
  font-weight: 650;
  line-height: 1;
  text-decoration: none;
  text-overflow: ellipsis;
  text-shadow: 0 0 3px rgba(0, 0, 0, 0.6);
  white-space: nowrap;
}

a.hero-credit:hover,
a.hero-credit:focus-visible {
  color: #fff;
  text-decoration: underline;
}

.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;
}

.app-dialog {
  z-index: 120;
}

.app-dialog-card {
  display: grid;
  gap: 0.8rem;
}

.app-dialog-title {
  margin: 0;
  font-size: 1.1rem;
  line-height: 1.25;
}

.app-dialog-message {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.45;
  white-space: pre-line;
}

.app-dialog-message:empty,
.app-dialog-input[hidden] {
  display: none;
}

.app-dialog-input {
  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);
  font: inherit;
}

.app-dialog-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.5rem;
  margin-top: 0.3rem;
}

.app-dialog-actions button {
  min-height: 44px;
  padding: 0 1.1rem;
  border: 0;
  border-radius: 8px;
  font: inherit;
  font-weight: 850;
  cursor: pointer;
}

.app-dialog-actions .primary {
  background: var(--accent);
  color: var(--black);
}

.app-dialog-actions .secondary {
  background: rgba(255, 255, 255, 0.1);
  color: var(--ink);
}

.app-dialog-actions .danger {
  background: #ff8a80;
  color: var(--black);
}

.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],
.tour-text-action[hidden] {
  display: 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;
}

.privacy-text p {
  margin: 0.45rem 0 0;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 400;
  line-height: 1.45;
}

.privacy-more summary {
  display: inline-block;
  margin-top: 0.5rem;
  color: var(--accent);
  cursor: pointer;
  font-size: 0.78rem;
  font-weight: 850;
  list-style: none;
  text-transform: uppercase;
}

.privacy-more summary::-webkit-details-marker {
  display: none;
}

.privacy-less-label,
.privacy-more[open] .privacy-more-label {
  display: none;
}

.privacy-more[open] .privacy-less-label {
  display: inline;
}

.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-current-note {
  margin-bottom: 0.9rem;
  color: var(--accent);
}

.detail-current-note p,
.detail-body .detail-current-note p {
  margin: 0 0 0.6rem;
  color: var(--accent);
}

.detail-current-note p:last-child {
  margin-bottom: 0;
}

.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;
}

.info-tile .museumkaart-flag {
  display: inline-block;
  margin-right: 0.15rem;
  padding: 0.05rem 0.45rem;
  border: 1px solid var(--accent);
  border-radius: 999px;
  color: var(--accent);
  font-size: 0.7rem;
  font-weight: 850;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  vertical-align: 0.1em;
}

.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(2, 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;
}

.icon-action {
  display: flex !important;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  white-space: nowrap;
}

.icon-action .button-icon,
.icon-action .navigation-icon {
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
}

/* Optical balance: an invisible spacer after the label, a bit narrower than
   the icon in front, so the icon + label group reads as centred. */
.icon-action::after {
  content: "";
  flex: 0 0 14px;
}

.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;
  pointer-events: none;
  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);
}

/* The opened destination breathes so it stays findable among its neighbours.
   Only the icon shape animates (the glow and the click area stay put), using
   the separate `scale` property so the diamond's rotation is untouched. */
.dtour-marker.focused::before,
.dtour-marker.focused.triangle::after {
  animation: markerBreathe 2.4s ease-in-out infinite;
}

@keyframes markerBreathe {
  0%, 100% { scale: 0.9; }
  50% { scale: 1.3; }
}

@media (prefers-reduced-motion: reduce) {
  .dtour-marker.focused::before,
  .dtour-marker.focused.triangle::after { animation: none; }
}

.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: 970px), (min-width: 780px) and (orientation: landscape) {
  .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,
  .map-theme-control {
    margin-right: calc(1.2rem + env(safe-area-inset-right)) !important;
  }
}

.tag-pill {
  appearance: none;
  color: rgba(255, 255, 255, 0.72);
  cursor: pointer;
}

.tag-pill.festival-pill {
  background: var(--chip-color);
  color: var(--chip-ink);
  font-weight: 850;
}

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


/* About menu: page navigation (shared by map and magazine) */
.about-nav {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.6rem;
  max-width: 31rem;
}

.about-nav a {
  display: grid;
  place-items: center;
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--ink);
  font-size: 0.92rem;
  font-weight: 700;
  text-decoration: none;
}

.about-nav a:hover,
.about-nav a:focus-visible {
  background: rgba(255, 255, 255, 0.14);
}

body[data-page="home"] .about-nav [data-nav="home"],
body[data-page="map"] .about-nav [data-nav="map"],
body[data-page="magazine"] .about-nav [data-nav="magazine"] {
  border-color: #EB1E81;
  background: #EB1E81;
  color: #04060a;
}

/* Sections that only make sense on the map */
body:not([data-page="map"]) [data-only="map"] {
  display: none;
}


/* ---- One destinations overlay (no tabs): routes on top, then search and results ---- */
.overlay-tabs.bare {
  height: 0;
  min-height: 0;
  margin: 0 -3rem;
  padding: 0;
  border-bottom: 0;
}

/* The solid bar behind the close button appears without changing the layout. */
.overlay-tabs.bare::before {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  height: 56px;
  background: var(--panel-solid);
  opacity: 0;
  pointer-events: none;
  transition: opacity 140ms ease;
}

.overlay-tabs.bare.stuck::before {
  opacity: 1;
}

.overlay-tabs.bare .overlay-tabs-close {
  top: 11px;
  bottom: auto;
}

.plan-body {
  gap: 1.6rem;
}

.routes-block {
  display: grid;
  gap: 1.2rem;
  margin-bottom: 0.9rem; /* gap 1.6rem + 0.9rem = 40px */
  align-content: start;
}

.plan-body > .controls {
  margin-bottom: 0.9rem;
}

#savedToursGroup {
  margin-top: 0;
}

.search-clear {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 26px;
  height: 26px;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.16);
  color: var(--ink);
  font-size: 1.05rem;
  line-height: 1;
  cursor: pointer;
}

.search-clear[hidden] {
  display: none;
}

.search-clear > span {
  display: block;
  transform: translateY(-1px);
}

.search input::-webkit-search-cancel-button,
.search input::-webkit-search-decoration {
  -webkit-appearance: none;
  appearance: none;
  display: none;
}

.route-stops-wrap {
  grid-column: 1 / -1;
  display: grid;
  gap: 1rem;
}

.route-stops-toggle {
  justify-self: start;
  padding: 0;
  border: 0;
  background: transparent;
  color: rgba(4, 6, 10, 0.78);
  font: inherit;
  font-size: 0.84rem;
  font-weight: 850;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}

.route-stops[hidden] {
  display: none;
}

.route-stops {
  display: grid;
  gap: 1.2rem;
  margin-top: 0.2rem;
}

.route-strip .route-stops .route-steps {
  gap: 1rem;
}

.route-strip .route-stops .list {
  padding-bottom: 0;
  gap: 1rem;
}

/* The stop cards stay pink: a lighter wash of the block colour with dark text. */
.route-strip .route-stops .card {
  border-color: rgba(4, 6, 10, 0.14);
  background: rgba(255, 255, 255, 0.24);
  color: var(--black);
}

.route-strip .route-stops .card h2,
.route-strip .route-stops .card.priority-card h2,
.route-strip .route-stops .card.priority-card h2 .priority-toggle {
  color: var(--black);
}

.route-strip .route-stops .card p,
.route-strip .route-stops .card .group-caption {
  color: rgba(4, 6, 10, 0.68);
}

/* undo the small uppercase styling the pink block gives to every span */
.route-strip .route-stops .card span {
  color: inherit;
  font-size: inherit;
  font-weight: inherit;
  letter-spacing: inherit;
  text-transform: none;
}

.route-strip .route-stops .card .step-number {
  background: var(--black);
  color: #fff;
  font-size: 0.85rem;
  font-weight: 850;
}

.route-strip .route-stops .drag-handle {
  color: rgba(4, 6, 10, 0.5);
}

.route-strip .route-stops .drag-handle span {
  font-size: 1.15rem;
}

.route-strip .route-stops .select-route,
.route-strip .route-stops .select-route.active,
.route-strip .route-stops .suggest-card .select-route {
  background: var(--black);
  color: #fff;
}

.route-strip .route-stops .route-start-content select {
  border-color: rgba(4, 6, 10, 0.18);
  background: rgba(255, 255, 255, 0.4);
  color: var(--black);
}


/* ---- Stop cards: number top-left, the whole left column is the drag handle ---- */
.route-strip {
  grid-template-columns: minmax(0, 1fr) auto;
}

.route-stops-wrap,
.route-stops,
.route-steps {
  min-width: 0;
}

.route-stop {
  grid-template-columns: 2rem minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.6rem;
  min-height: 4.6rem;
  padding: 0.8rem 0.7rem 0.8rem 0.35rem;
}

.route-stop .step-number {
  grid-column: 1;
  grid-row: 1;
  z-index: 1;
  align-self: start;
  justify-self: center;
  width: 26px;
  height: 26px;
  font-size: 0.75rem;
  pointer-events: none; /* clicks and drags fall through to the handle underneath */
}

.route-stop .drag-handle {
  grid-column: 1;
  grid-row: 1;
  align-self: stretch;
  justify-self: stretch;
  width: auto;
  min-height: 0;
}

.route-stop > [data-open] {
  grid-column: 2;
  min-width: 0;
}

.route-stop .card-actions {
  grid-column: 3;
}

.route-stop h2,
.route-stop p {
  overflow-wrap: anywhere;
}

.route-start {
  grid-template-columns: 2rem minmax(0, 1fr);
  align-items: start;
  gap: 0.6rem;
  padding: 0.8rem 0.7rem 0.8rem 0.35rem;
}

.route-start .step-number {
  justify-self: center;
  width: 26px;
  height: 26px;
  font-size: 0.75rem;
}

.route-strip .route-stops .route-stop .step-number {
  width: 26px;
  height: 26px;
  font-size: 0.75rem;
}


/* Drop indicator while reordering stops */
.route-stop-list {
  position: relative;
}

.route-drop-line {
  position: absolute;
  right: 0;
  left: 0;
  z-index: 3;
  height: 3px;
  border-radius: 999px;
  background: var(--black);
  pointer-events: none;
}

.route-stop .drag-handle {
  cursor: grab;
  user-select: none;
  -webkit-user-select: none;
}

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

/* the semi-transparent copy that follows the pointer */
.route-stop.drag-ghost {
  position: absolute;
  right: 0;
  left: 0;
  z-index: 4;
  margin: 0;
  opacity: 0.82;
  box-shadow: 0 10px 28px rgba(4, 6, 10, 0.3);
  pointer-events: none;
}

.route-stop.drag-ghost .drag-handle {
  cursor: grabbing;
}

/* ---- Pink block polish ---- */
/* Keep the drag handle clear of the number, even on short cards. */
.route-stop {
  min-height: 6.8rem;
}

/* Same spacing before the "Add destination" card as between stops, so there is room to drop a stop at the end. */
.route-strip .route-stops .suggest-card {
  margin-top: 0;
}

.route-strip .route-stops .tour-button-action,
.route-strip .route-stops .tour-button-action.primary {
  background: var(--black);
  color: #fff;
}

.route-strip .route-stops .tour-action-caption {
  color: rgba(4, 6, 10, 0.68);
}


/* Show / hide stops: underlined label plus a chevron that is not underlined */
.route-stops-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
}

.route-stops-toggle .route-stops-label {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.route-stops-caret {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: translateY(-2px) rotate(45deg);
  transition: transform 160ms ease;
}

.route-stops-toggle[aria-expanded="true"] .route-stops-caret {
  transform: translateY(2px) rotate(-135deg);
}

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

/* The Save route button sits below the collapsible stops, inside the pink block */
.route-strip .tour-button-actions {
  margin-top: 0;
}

.route-strip .tour-button-action,
.route-strip .tour-button-action.primary {
  background: var(--black);
  color: #fff;
}

.route-strip .tour-action-caption {
  color: rgba(4, 6, 10, 0.68);
}

/* Navigation sits at the very bottom of the pink block, under Save route */
.route-strip .nav-actions {
  margin-top: 0;
}

.route-strip .nav-actions .tour-nav-action {
  min-height: 46px;
}


/* Information block at the end of the stops: no button, just a hint */
.suggest-card.info-card {
  grid-template-columns: minmax(0, 1fr);
}

.route-strip .route-stops .suggest-card.info-card {
  border: 1px dashed rgba(4, 6, 10, 0.35);
  background: transparent;
}

/* ---- Overlay spacing and select polish ---- */
/* 20px between the intro text and the first block (the empty sentinel and sticky bar
   would otherwise each add one flex gap). */
.overlay-tabs-sentinel {
  margin-top: -1.35rem;
}

.overlay-tabs.bare {
  margin-top: -1.35rem;
}

.plan-body {
  margin-top: calc(20px - 1.35rem);
}

/* hidden groups must really disappear (the Tag filter label showed with no tag active) */
.overlay-group[hidden] {
  display: none;
}

/* Results label to first card: same distance as caption to field in the blocks above */
#destinationList {
  margin-top: calc(0.85rem - 1.6rem);
}

/* dropdowns: own chevron with room on the right */
.saved-route-select select,
.route-start-content select {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 2.6rem;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%23aeb4c2' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 1.1rem center;
  background-size: 12px 8px;
}

.route-strip .route-stops .route-start-content select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%2304060a' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}

/* Route dropdown and the selected route block sit close together (16px) */
.route-sync-status:empty {
  display: none;
}

.routes-block {
  gap: 0;
}

.routes-block .current-trip {
  margin-top: 16px;
}

.routes-block .route-strip {
  margin-top: 0;
}


/* ---- Phone (portrait): map on top, destinations as a bottom sheet ---- */
.sheet-grabber {
  display: none;
}

@media (max-width: 969px) and (orientation: portrait) {
  /* the destination sheet never covers the menu and route buttons at the top left */
  .detail-sheet {
    max-height: calc(100svh - 9.75rem - env(safe-area-inset-top));
  }

  #planOverlay {
    inset: auto 0 0 0;
    height: 66svh;
    max-height: 66svh;
    padding: 0 1.5rem calc(2rem + env(safe-area-inset-bottom));
    border-top: 1px solid var(--soft-line);
    border-radius: 18px 18px 0 0;
    box-shadow: 0 -12px 36px rgba(0, 0, 0, 0.42);
    transform: translateY(calc(100% + 1rem));
  }

  #planOverlay.open {
    transform: translateY(0);
  }

  #planOverlay .overlay-back,
  #planOverlay .overlay-header,
  #planOverlay .overlay-tabs,
  #planOverlay .overlay-tabs-sentinel {
    display: none;
  }

  #planOverlay .sheet-grabber {
    position: sticky;
    top: 0;
    z-index: 6;
    display: block;
    flex: 0 0 auto;
    height: 30px;
    margin: 0 -1.5rem -0.6rem;
    padding: 0;
    border: 0;
    border-radius: 18px 18px 0 0;
    background: color-mix(in srgb, var(--panel-solid) 92%, transparent);
    cursor: pointer;
    touch-action: none;
  }

  #planOverlay .sheet-grabber::after {
    content: "";
    position: absolute;
    top: 11px;
    left: 50%;
    width: 44px;
    height: 5px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.32);
    transform: translateX(-50%);
  }

  /* the route button turns into the close arrow while the sheet is open */
  body.plan-open #routeBtn .button-icon {
    display: none;
  }

  body.plan-open #routeBtn::after {
    content: "";
    width: 13px;
    height: 13px;
    border-right: 3px solid currentColor;
    border-bottom: 3px solid currentColor;
    transform: translateY(-3px) rotate(45deg);
  }
}

/* the starting-point dropdowns on the pink block: draw the chevron once, not tiled */
.route-strip .route-stops .route-start-content select {
  background-repeat: no-repeat;
  background-position: right 1.1rem center;
  background-size: 12px 8px;
}


/* ---- Adding stops: feedback ---- */
.routes-block {
  scroll-margin-top: 12px;
}

.route-stop.just-added {
  animation: stopAdded 1.6s ease-out;
}

@keyframes stopAdded {
  0% {
    box-shadow: 0 0 0 3px rgba(4, 6, 10, 0.7);
    background: rgba(255, 255, 255, 0.55);
  }
  100% {
    box-shadow: 0 0 0 3px rgba(4, 6, 10, 0);
  }
}

.route-strip.bump {
  animation: routeBump 0.6s ease-out;
}

@keyframes routeBump {
  0% {
    transform: scale(1);
  }
  30% {
    transform: scale(1.018);
    filter: brightness(1.08);
  }
  100% {
    transform: scale(1);
  }
}

/* the + button that flies from the list up into the route block */
.stop-fly {
  position: fixed;
  z-index: 300;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: var(--black);
  color: #fff;
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1;
  pointer-events: none;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35);
}
