/*
 * Rider map — warm paper background, apple-green primary (Apple's system
 * green; --primary-text is its darker, readable-on-white variant for links
 * and coloured text), Inter body + Fraunces display.
 */
:root {
  --background: oklch(0.975 0.012 85);
  --foreground: oklch(0.22 0.02 55);
  --card: oklch(0.99 0.008 85);
  /* "Trail" palette — pine (primary), deep pine (text, hover), moss (tints), stone (surfaces) and
     ink. Riders on the road keep their live green (--green). */
  --pine: #1f7a4c;
  --pine-strong: #155c38;
  --pine-bright: #3fbf7a;
  --moss: #e4f1e8;
  --stone: #f5f3ee;
  --ink: #17201b;
  --radius-ctrl: 12px;
  --shadow-ctrl: 0 1px 0 rgb(255 255 255 / 0.6) inset, 0 8px 22px -10px rgb(23 32 27 / 0.45);
  --primary: var(--pine);
  --primary-text: var(--pine-strong);
  --primary-foreground: #fff;
  --secondary: oklch(0.92 0.025 80);
  --muted-foreground: oklch(0.48 0.025 60);
  --border: oklch(0.88 0.02 80);
  --ring: var(--pine);
  --green: #22c55e;
  --radius: 0.375rem;
  --shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --font-sans: "Inter", ui-sans-serif, system-ui, sans-serif;
  --font-serif: "Fraunces", ui-serif, Georgia, serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--background);
  color: var(--foreground);
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
}
button { font: inherit; color: inherit; }
[hidden] { display: none !important; }
svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

.rm { position: fixed; inset: 0; overflow: hidden; }
/* z-index 0 makes the map its own stacking layer, so rider pins (and their
   z-indexes) always stay beneath the floating panels. */
.rm-map { position: absolute; inset: 0; z-index: 0; }

/* Loading / empty message */
.rm-status {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); z-index: 5;
  padding: 6px 12px; border-radius: 9999px; background: var(--card); box-shadow: var(--shadow);
  font-size: 13px; color: var(--muted-foreground);
}
.rm-status-loading::before {
  content: ""; display: inline-block; width: 10px; height: 10px; margin-right: 8px; vertical-align: -1px;
  border: 2px solid var(--border); border-top-color: var(--primary); border-radius: 50%;
  animation: rm-spin 0.8s linear infinite;
}
@keyframes rm-spin { to { transform: rotate(360deg); } }

/* Map loading: a bike rolling along a road, until the map is drawn. */
.rm-loader {
  position: absolute; inset: 0; z-index: 4; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 14px; background: var(--background); transition: opacity 0.4s ease, visibility 0.4s;
}
.rm-loader-done { opacity: 0; visibility: hidden; pointer-events: none; }
.rm-loader-scene { position: relative; width: 220px; padding-bottom: 6px; overflow: hidden; }
.rm-loader-bike { display: block; width: 132px; height: 77px; margin: 0 auto; stroke: var(--foreground); stroke-width: 3.2; overflow: visible; }
.rm-loader-frame { animation: rm-bump 0.5s ease-in-out infinite; }
.rm-loader-wheel { animation: rm-spin 0.7s linear infinite; }
.rm-loader-wheel path { stroke-width: 1.4; opacity: 0.55; }
.rm-loader-tube { stroke: var(--primary); }
.rm-loader-bag { fill: var(--primary); stroke: none; opacity: 0.85; }
.rm-loader-road {
  height: 3px; border-radius: 3px; margin-top: 1px;
  background: repeating-linear-gradient(90deg, var(--muted-foreground) 0 18px, transparent 18px 30px);
  opacity: 0.5; animation: rm-road 0.6s linear infinite;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 25%, #000 75%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 25%, #000 75%, transparent);
}
.rm-loader-text { margin: 0; font-size: 13px; color: var(--muted-foreground); }
@keyframes rm-road { to { background-position: -30px 0; } }
@keyframes rm-bump { 50% { transform: translateY(-1.5px); } }
/* Riders drop in once the map is drawn. */
.rm-pins-enter .rm-pin-box { animation: rm-pin-pop 0.45s cubic-bezier(0.34, 1.56, 0.64, 1) both; }
@keyframes rm-pin-pop { from { opacity: 0; transform: scale(0.4); } }
/* A trail stop's name and date on hover. */
.rm-stop-popup .maplibregl-popup-content { padding: 6px 10px; border-radius: 10px; box-shadow: var(--shadow); }
.rm-stop-tip { display: flex; flex-direction: column; gap: 1px; font-size: 12px; color: var(--muted-foreground); }
.rm-stop-tip strong { font-size: 13px; color: var(--foreground); }
@media (prefers-reduced-motion: reduce) {
  .rm-loader-frame, .rm-loader-wheel, .rm-loader-road, .rm-pins-enter .rm-pin-box { animation: none; }
  .rm-loader { transition: none; }
}

/* Floating panels */
.rm-panel {
  position: absolute; top: 16px; z-index: 10;
  border: 1px solid var(--border); background: oklch(0.975 0.012 85 / 0.9);
  box-shadow: var(--shadow); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
}
.rm-panel {
  left: 16px; right: 80px; max-width: 24rem;
  display: flex; flex-direction: column; gap: 8px; padding: 8px; border-radius: 0.5rem;
}
.rm-topright { position: absolute; top: 16px; right: 16px; z-index: 10; display: flex; flex-direction: column; align-items: flex-end; gap: 8px; }

/* Search bar */
.rm-search { position: relative; }
.rm-search-icon { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); color: var(--muted-foreground); pointer-events: none; }
.rm-input {
  width: 100%; height: 36px; padding: 4px 64px 4px 32px;
  border: 1px solid var(--border); border-radius: var(--radius); background: transparent;
  font: inherit; font-size: 14px; color: var(--foreground); outline: none;
}
.rm-input::placeholder { color: var(--muted-foreground); }
.rm-input:focus-visible { border-color: var(--ring); box-shadow: 0 0 0 3px rgb(52 199 89 / 0.25); }
.rm-search-actions { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); display: flex; align-items: center; }
.rm-icon-btn {
  display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px;
  border: 0; border-radius: var(--radius); background: none; color: var(--muted-foreground); cursor: pointer;
}
.rm-icon-btn:hover { color: var(--foreground); background: var(--secondary); }
.rm-country-btn.rm-picker-selected { background: var(--secondary); font-size: 16px; line-height: 1; }
.rm-picker { position: relative; }

/* Country dropdown */
.rm-popover {
  position: absolute; right: 0; top: calc(100% + 6px); z-index: 20; width: 16rem;
  border: 1px solid var(--border); border-radius: var(--radius); background: var(--card);
  box-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
  overflow: hidden;
}
.rm-popover-search { display: flex; align-items: center; gap: 8px; padding: 0 12px; border-bottom: 1px solid var(--border); color: var(--muted-foreground); }
.rm-popover-search input { flex: 1; height: 40px; border: 0; outline: none; background: transparent; font: inherit; font-size: 14px; color: var(--foreground); }
.rm-options { max-height: 300px; overflow-y: auto; padding: 4px; }
.rm-option {
  display: flex; width: 100%; align-items: center; gap: 8px; padding: 6px 8px;
  border: 0; border-radius: calc(var(--radius) - 2px); background: none; text-align: left; font-size: 14px; cursor: pointer;
}
.rm-option[data-highlighted="true"] { background: var(--secondary); }
.rm-option-flag { font-size: 16px; line-height: 1; }
.rm-option-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rm-option-count { font-size: 12px; color: var(--muted-foreground); }
.rm-empty { padding: 24px 8px; text-align: center; font-size: 14px; }

/* Row under the search */
.rm-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 0 4px; }

/* Switch (shadcn look) */
.rm-switch {
  position: relative; width: 32px; height: 18px; padding: 0; flex-shrink: 0;
  border: 0; border-radius: 9999px; background: var(--border); cursor: pointer; transition: background 0.15s;
}
.rm-switch span {
  position: absolute; top: 2px; left: 2px; width: 14px; height: 14px; border-radius: 50%;
  background: var(--background); box-shadow: 0 1px 2px rgb(0 0 0 / 0.2); transition: transform 0.15s;
}
.rm-switch[aria-checked="true"] { background: var(--primary); }
.rm-switch[aria-checked="true"] span { transform: translateX(14px); }
.rm-switch:focus-visible, .rm-icon-btn:focus-visible { outline: 2px solid var(--ring); outline-offset: 2px; }

/* Avatar markers */
.rm-pin { position: relative; width: 0; height: 0; cursor: pointer; }
.rm-pin-box { position: absolute; left: 0; top: 0; transform: translate(-50%, -50%); }
.rm-pin[data-selected] .rm-pin-box { filter: drop-shadow(0 6px 12px rgba(0, 0, 0, 0.45)); }
.rm-pin-img {
  position: relative; display: block; width: 100%; height: 100%; border-radius: 9999px; object-fit: cover;
  box-shadow: var(--shadow);
}
.rm-pin-active { box-shadow: 0 0 0 2px var(--green), var(--shadow); }
.rm-pin-home { box-shadow: 0 0 0 1px rgb(255 255 255 / 0.8), var(--shadow); opacity: 0.9; filter: grayscale(0.35); }
.rm-fallback { display: flex; align-items: center; justify-content: center; line-height: 1; }
.rm-pin-halo {
  position: absolute; inset: 0; border: 2px solid #4ade80; border-radius: 9999px; pointer-events: none;
  animation: rm-ping 1s cubic-bezier(0, 0, 0.2, 1) infinite;
}
@keyframes rm-ping { 75%, 100% { transform: scale(2); opacity: 0; } }
.rm-pin-flag {
  position: absolute; right: -3px; bottom: -3px; display: flex; align-items: center; justify-content: center;
  border-radius: 9999px; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.45); line-height: 1;
}
/* Day / night shade on: a moon on the pins of the riders where the sun has set (top left, the flag is bottom right). */
.rm-pin-moon {
  position: absolute; left: -4px; top: -4px; display: flex; align-items: center; justify-content: center;
  width: 15px; height: 15px; border-radius: 9999px; background: #1c2648; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.45);
  font-size: 9px; line-height: 1; pointer-events: none;
}
.rm-popup-sky:empty { display: none; }

/* Hover popup ("liquid glass", always dark) */
.wp-avatar-popup { z-index: 10000; }
.wp-avatar-popup .maplibregl-popup-tip { display: none; }
.wp-avatar-popup .maplibregl-popup-content {
  padding: 7px 9px; color: #fff; border-radius: 10px;
  background: color-mix(in oklch, black 68%, transparent);
  backdrop-filter: blur(16px) saturate(160%); -webkit-backdrop-filter: blur(16px) saturate(160%);
  border: 1px solid color-mix(in oklch, white 22%, transparent);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.35), inset 0 1px 0 color-mix(in oklch, white 14%, transparent);
}
.rm-popup {
  display: flex; align-items: center; gap: 8px; min-width: 150px; max-width: 220px; margin: -7px -9px; padding: 7px 9px;
  border: 0; border-radius: 10px; background: none; color: #fff; font-family: var(--font-sans); line-height: 1.3;
  text-align: left; cursor: pointer; transition: background 0.15s;
}
.rm-popup:hover, .rm-popup:focus-visible { background: rgb(255 255 255 / 0.12); outline: none; }
.rm-popup-thumb { display: flex; align-items: center; justify-content: center; width: 28px; height: 28px; flex-shrink: 0; border-radius: 9999px; object-fit: cover; font-size: 14px; }
.rm-popup-col { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.rm-popup-name, .rm-popup-meta { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rm-popup-name { font-weight: 700; font-size: 12px; }
.rm-popup-meta { margin-top: 1px; font-size: 10.5px; color: rgb(255 255 255 / 0.7); }
.rm-popup-chevron { flex-shrink: 0; font-size: 20px; line-height: 1; color: rgb(255 255 255 / 0.6); transition: transform 0.15s, color 0.15s; }
.rm-popup:hover .rm-popup-chevron { transform: translateX(2px); color: #4ade80; }


/* Left column: search panel, and the selected rider's card right under it */
.rm-left {
  position: absolute; top: 16px; left: 16px; right: 80px; z-index: 10; max-width: 24rem; max-height: calc(100% - 32px);
  display: flex; flex-direction: column; gap: 8px; pointer-events: none;
}
.rm-left > * { pointer-events: auto; }
.rm-left .rm-panel { position: static; max-width: none; }

/* Selected rider card: floating blurry white card */
.rm-card {
  position: relative; min-height: 0; overflow-y: auto; padding: 14px;
  border: 1px solid rgb(255 255 255 / 0.6); border-radius: 0.75rem;
  background: rgb(255 255 255 / 0.72); backdrop-filter: blur(16px) saturate(160%); -webkit-backdrop-filter: blur(16px) saturate(160%);
  box-shadow: 0 10px 30px -8px rgb(0 0 0 / 0.25);
  opacity: 0; transform: translateY(-6px); transition: opacity 0.18s ease-out, transform 0.18s ease-out;
}
.rm-card.rm-drawer-open { opacity: 1; transform: none; }
.rm-card-body { display: flex; flex-direction: column; gap: 8px; }
.rm-card-header { display: flex; align-items: center; gap: 12px; padding-right: 28px; }
.rm-card-avatar { width: 48px; height: 48px; flex-shrink: 0; border-radius: 9999px; }
.rm-card-avatar-active { box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--green); }
.rm-card-img { display: flex; align-items: center; justify-content: center; width: 100%; height: 100%; border-radius: 9999px; object-fit: cover; font-size: 22px; }
.rm-card-titles { min-width: 0; }
.rm-card-name { margin: 0; font-family: var(--font-serif); font-weight: 600; font-size: 18px; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rm-card-line { margin-top: 2px; font-size: 13px; color: var(--muted-foreground); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rm-on-road { display: flex; align-items: center; gap: 6px; font-weight: 500; color: #15803d; }
.rm-dot { width: 6px; height: 6px; flex-shrink: 0; border-radius: 50%; background: var(--green); animation: rm-pulse 2s infinite; }
@keyframes rm-pulse { 50% { opacity: 0.5; } }
.rm-card-bio {
  margin: 0; font-size: 13px; line-height: 1.5; color: var(--muted-foreground);
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.rm-card-label { margin-top: 2px; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted-foreground); }
.rm-flag-row { display: flex; align-items: center; padding: 2px 0 2px 4px; overflow-x: auto; scrollbar-width: none; }
.rm-flag-bubble {
  display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; flex-shrink: 0;
  margin-left: -4px; border: 2px solid #fff; border-radius: 9999px; background: var(--secondary); font-size: 15px;
}
.rm-flag-bubble:first-child { margin-left: 0; }
.rm-journeys { display: flex; flex-direction: column; gap: 4px; }
.rm-journey {
  display: flex; flex-direction: column; gap: 1px; padding: 6px 10px;
  border-radius: var(--radius); background: rgb(255 255 255 / 0.6); color: inherit; text-decoration: none;
}
.rm-journey-meta { font-size: 12px; color: var(--muted-foreground); }
.rm-more {
  align-self: flex-start; padding: 4px 0; border: 0; background: none; cursor: pointer;
  font-size: 13px; font-weight: 600; color: var(--primary-text);
}
.rm-more:hover { text-decoration: underline; }
.rm-journey:hover .rm-journey-title { color: var(--primary-text); }
.rm-journey-title { min-width: 0; font-family: var(--font-serif); font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Phones & tablets: the card becomes a compact preview docked at the bottom */
@media (max-width: 1023px) {
  .rm-card {
    position: fixed; left: 12px; right: 12px; bottom: max(12px, env(safe-area-inset-bottom)); z-index: 30;
    max-width: 32rem; margin: 0 auto; padding: 12px; transform: translateY(16px);
  }
  .rm-preview { gap: 6px; }
  .rm-preview .rm-card-avatar { width: 40px; height: 40px; }
  .rm-preview .rm-card-name { font-size: 16px; }
  .rm-preview .rm-card-label { display: none; }
  .rm-preview }


.rm-toast {
  position: absolute; left: 50%; bottom: 24px; z-index: 40; transform: translateX(-50%);
  padding: 8px 14px; border-radius: 9999px; background: var(--foreground); color: var(--background);
  font-size: 13px; box-shadow: var(--shadow); animation: rm-fade 4s forwards;
}
@keyframes rm-fade { 0%, 85% { opacity: 1; } 100% { opacity: 0; visibility: hidden; } }

/* Modal (native <dialog>) */
.rm-modal {
  width: min(28rem, calc(100vw - 32px)); max-height: calc(100dvh - 32px); padding: 24px; overflow-y: auto;
  border: 1px solid var(--border); border-radius: 0.75rem; background: var(--background); color: var(--foreground);
  box-shadow: 0 25px 50px -12px rgb(0 0 0 / 0.25);
}
.rm-modal::backdrop { background: rgb(0 0 0 / 0.35); backdrop-filter: blur(2px); }
.rm-modal[open] { animation: rm-pop 0.18s ease-out; }
@keyframes rm-pop { from { opacity: 0; transform: translateY(8px) scale(0.98); } }
.rm-modal-close { position: absolute; top: 12px; right: 12px; }
.rm-modal-alt { display: flex; justify-content: center; gap: 16px; margin: 16px 0 0; font-size: 13px; color: var(--muted-foreground); }
.rm-modal-alt a, .rm-link { color: var(--primary-text); font-weight: 600; }
.rm-link { padding: 0; border: 0; background: none; cursor: pointer; font-size: 13px; }
.rm-danger { color: oklch(0.55 0.22 27); }

/* Wizard */
.rm-wizard { display: flex; flex-direction: column; gap: 6px; }
.rm-wizard-head h2 { margin: 0 32px 10px 0; font-family: var(--font-serif); font-size: 22px; font-weight: 600; }
.rm-dots { display: flex; gap: 6px; margin-bottom: 12px; }
.rm-dots span { flex: 1; height: 4px; border-radius: 9999px; background: var(--border); transition: background 0.2s; }
.rm-dots span.rm-dot-done { background: var(--primary); }
.rm-step { display: flex; flex-direction: column; gap: 6px; }
.rm-step h3 { margin: 0 0 4px; font-size: 16px; }
.rm-step h3 small { font-weight: 400; font-size: 12px; color: var(--muted-foreground); }
.rm-step fieldset { display: flex; flex-direction: column; gap: 6px; margin: 0; padding: 0; border: 0; min-width: 0; }
.rm-hint { margin: 0 0 6px; font-size: 13px; color: var(--muted-foreground); }
.rm-label { margin-top: 8px; font-size: 13px; font-weight: 600; }
.rm-wizard .rm-input { padding: 4px 12px; }
.rm-field-error { margin: 2px 0 0; font-size: 12px; color: oklch(0.55 0.22 27); }
.rm-wizard-foot { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; }
.rm-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 36px; padding: 8px 16px;
  border: 1px solid transparent; border-radius: var(--radius); background: var(--primary); color: var(--primary-foreground);
  font-size: 14px; font-weight: 500; cursor: pointer;
}
.rm-btn:hover { background: rgb(52 199 89 / 0.9); }
.rm-btn-ghost { background: none; color: var(--foreground); margin-right: auto; }
.rm-btn-ghost:hover { background: var(--secondary); }
.rm-btn-outline { background: var(--card); color: var(--foreground); border-color: var(--border); }
.rm-btn-outline:hover { background: var(--secondary); }
.rm-btn:focus-within, .rm-btn:focus-visible { outline: 2px solid var(--ring); outline-offset: 2px; }
.rm-visually-hidden, .rm-picker-input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.rm-picker-input { left: 50%; bottom: 0; }

.rm-avatar-pick { display: flex; align-items: center; gap: 16px; }
.rm-avatar-preview-wrap {
  display: flex; align-items: center; justify-content: center; width: 72px; height: 72px; flex-shrink: 0;
  border: 2px dashed var(--border); border-radius: 9999px; font-size: 30px;
}
.rm-avatar-preview-wrap:has(img:not([src]))::before { content: "🚴"; }
.rm-avatar-preview:not([src]) { display: none; }
.rm-avatar-preview { width: 72px; height: 72px; border-radius: 9999px; object-fit: cover; box-shadow: 0 0 0 3px var(--card), var(--shadow); }
.rm-cap { position: relative; cursor: pointer; }
.rm-cap input { position: absolute; opacity: 0; }
.rm-cap img { display: block; width: 56px; height: 56px; border-radius: 9999px; box-shadow: 0 0 0 2px var(--border); transition: transform 0.15s, box-shadow 0.15s; }
.rm-cap:hover img { transform: translateY(-2px); }
.rm-cap input:checked + img { box-shadow: 0 0 0 3px var(--primary); }
.rm-cap input:focus-visible + img { outline: 2px solid var(--ring); outline-offset: 3px; }

.rm-picker-field { display: flex; align-items: center; gap: 8px; height: 36px; text-align: left; cursor: pointer; background: var(--card); }

.rm-picker-field svg { margin-left: auto; color: var(--muted-foreground); }
.rm-placeholder { color: var(--muted-foreground); }
.rm-picker .rm-popover { left: 0; right: auto; }
.rm-search .rm-picker .rm-popover { left: auto; right: 0; }

.rm-choice { display: flex; flex-direction: column; gap: 8px; margin-bottom: 4px; }
.rm-choice label {
  display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--card); font-size: 14px; cursor: pointer;
}
.rm-choice label:has(input:checked) { border-color: var(--primary); box-shadow: 0 0 0 1px var(--primary); }
.rm-choice input { accent-color: var(--primary); }
.rm-place { position: relative; }
.rm-place-list {
  position: absolute; left: 0; right: 0; top: calc(100% + 4px); z-index: 20;
  border: 1px solid var(--border); border-radius: var(--radius); background: var(--card);
  box-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.1);
}

/* Just-pinned avatar: drops in with a bounce, then a ripple */
.rm-pin-drop .rm-pin-box { animation: rm-drop 0.9s cubic-bezier(0.34, 1.56, 0.64, 1) both; }
@keyframes rm-drop {
  0% { transform: translate(-50%, -400%) scale(0.4); opacity: 0; }
  50% { opacity: 1; }
  100% { transform: translate(-50%, -50%) scale(1); }
}
.rm-pin-ripple {
  position: absolute; inset: -4px; border: 3px solid var(--primary); border-radius: 9999px; pointer-events: none;
  animation: rm-ripple 1.2s 0.7s ease-out 3 both;
}
@keyframes rm-ripple { from { transform: scale(0.8); opacity: 1; } to { transform: scale(2.6); opacity: 0; } }



/* Wizard: compact avatar row (preview · photo button · three caps) */
.rm-avatar-pick { flex-wrap: wrap; gap: 8px; margin-bottom: 4px; }
.rm-avatar-pick .rm-avatar-preview-wrap, .rm-avatar-pick .rm-avatar-preview { width: 52px; height: 52px; font-size: 22px; }
.rm-avatar-pick .rm-hint { margin: 0; }
.rm-btn-sm { min-height: 32px; padding: 4px 10px; font-size: 13px; }
.rm-cap img { width: 36px; height: 36px; }

/* Country grid: flag tiles in a panel that expands inside the dialog */
.rm-picker-grid .rm-popover { position: static; width: auto; margin-top: 6px; box-shadow: none; }
.rm-flag-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(40px, 1fr)); gap: 4px;
  max-height: 176px; padding: 6px;
}
.rm-flag-tile {
  display: flex; align-items: center; justify-content: center; height: 36px; padding: 0;
  border: 1px solid transparent; border-radius: var(--radius); background: none; font-size: 22px; cursor: pointer;
}
.rm-flag-tile[data-highlighted="true"] { background: var(--secondary); }
.rm-flag-tile[aria-selected="true"] { border-color: var(--primary); background: rgb(52 199 89 / 0.1); }
.rm-flag-grid .rm-empty { grid-column: 1 / -1; }
.rm-picker-flag-emoji { font-size: 18px; line-height: 1; }

/* Base camp: flag button inline with the city search; the grid wraps below */
.rm-inline-row { display: flex; flex-wrap: wrap; gap: 6px; }
.rm-inline-row > .rm-picker { display: contents; }
.rm-inline-row .rm-popover { order: 1; flex-basis: 100%; margin-top: 0; }
.rm-inline-row .rm-place { flex: 1; min-width: 0; }
.rm-picker-flag { width: auto; flex-shrink: 0; gap: 4px; padding: 0 8px; }
.rm-picker-flag .rm-placeholder { font-size: 16px; }

/* Follow links: network icon + field (+ Paste on phones) */
.rm-link-field { display: flex; align-items: center; gap: 8px; margin-top: 6px; }
.rm-link-icon { display: flex; flex-shrink: 0; width: 20px; justify-content: center; color: var(--muted-foreground); }
.rm-link-icon svg { width: 20px; height: 20px; }
.rm-link-field:focus-within .rm-link-icon { color: var(--primary-text); }
.rm-link-field .rm-input { flex: 1; min-width: 0; }
.rm-paste {
  display: inline-flex; align-items: center; gap: 4px; flex-shrink: 0; height: 36px; padding: 0 10px;
  border: 1px solid var(--border); border-radius: var(--radius); background: var(--card); font-size: 13px; cursor: pointer;
}
.rm-touch-only { display: none !important; }
@media (pointer: coarse) { .rm-touch-only { display: revert !important; } .rm-paste.rm-touch-only { display: inline-flex !important; } }

/* Rider card: social links */
.rm-card-links { display: flex; gap: 6px; }
.rm-card-link {
  display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px;
  border-radius: 9999px; background: rgb(255 255 255 / 0.7); color: var(--foreground); box-shadow: 0 0 0 1px var(--border);
}
.rm-card-link:hover { color: var(--primary-text); box-shadow: 0 0 0 1px var(--primary); }

/* Phones: the panel spans the width */
@media (max-width: 639px) {
  .rm-left { right: 16px; }
}

/* Top-left panel: white frosted card, Inter throughout, color-coded stats */
.rm-left .rm-panel {
  gap: 10px; padding: 10px; border-radius: 14px; border-color: rgb(255 255 255 / 0.7);
  background: rgb(255 255 255 / 0.78); backdrop-filter: blur(16px) saturate(160%); -webkit-backdrop-filter: blur(16px) saturate(160%);
  box-shadow: 0 10px 30px -10px rgb(0 0 0 / 0.25); font-family: var(--font-sans);
}
.rm-panel .rm-input {
  height: 38px; border: 1px solid transparent; border-radius: 10px; background: oklch(0.95 0.01 80); font-size: 14px;
  transition: background 0.15s, border-color 0.15s;
}
.rm-panel .rm-input:focus-visible { background: #fff; border-color: var(--ring); box-shadow: 0 0 0 3px rgb(52 199 89 / 0.15); }
.rm-panel .rm-row { padding: 0 2px; }

/* Riders in view: a slider of thumbnails (photo, name, country) */
.rm-strip { min-width: 0; padding: 8px 0 0; border-top: 1px solid oklch(0.9 0.015 80); }
.rm-strip-head { display: flex; align-items: center; justify-content: space-between; min-height: 24px; padding: 0 2px 4px; }
.rm-strip-nav { display: flex; gap: 2px; }
.rm-strip-nav[hidden] { display: none; }
.rm-strip-nav .rm-icon-btn { width: 24px; height: 24px; font-size: 16px; line-height: 1; }
.rm-strip-list {
  display: flex; gap: 4px; overflow-x: auto; scroll-snap-type: x proximity; scrollbar-width: none;
  margin: 0 -4px; padding: 2px 4px 4px; overscroll-behavior-x: contain;
}
.rm-strip-list::-webkit-scrollbar { display: none; }
.rm-strip-empty { margin: 6px 2px; font-size: 12.5px; color: var(--muted-foreground); }
.rm-thumb {
  flex: 0 0 72px; display: flex; flex-direction: column; align-items: center; gap: 3px; min-width: 0; padding: 6px 4px;
  border: 0; border-radius: 12px; background: none; font: inherit; text-align: center; cursor: pointer; scroll-snap-align: start;
  transition: background 0.15s;
}
.rm-thumb:hover { background: rgb(255 255 255 / 0.75); }
.rm-thumb:focus-visible { outline: 2px solid var(--ring); outline-offset: -2px; }
.rm-thumb-img {
  display: flex; align-items: center; justify-content: center; width: 44px; height: 44px; flex-shrink: 0;
  border-radius: 9999px; object-fit: cover; font-size: 20px; box-shadow: 0 0 0 2px #fff, 0 1px 4px rgb(0 0 0 / 0.2);
}
.rm-thumb-road .rm-thumb-img { box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--green, #16a34a); }
.rm-thumb-name, .rm-thumb-country { max-width: 100%; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.rm-thumb-name { margin-top: 2px; font-size: 12px; font-weight: 600; line-height: 1.2; color: var(--foreground); }
.rm-thumb-country { font-size: 10.5px; line-height: 1.2; color: var(--muted-foreground); }

/* "All · 21 | ● Riding · 9" segmented toggle, continent beside it */
.rm-panel .rm-row { gap: 8px; }
.rm-segment { display: inline-flex; flex-shrink: 0; padding: 3px; border-radius: 10px; background: oklch(0.95 0.01 80); }
.rm-segment button {
  display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; border: 0; border-radius: 8px;
  background: none; color: var(--muted-foreground); font-size: 12.5px; font-weight: 600; cursor: pointer; white-space: nowrap;
  transition: background 0.15s, color 0.15s;
}
.rm-segment button::after { content: " · " attr(data-count); font-weight: 500; opacity: 0.75; }
.rm-segment button[aria-checked="true"] { background: #fff; color: var(--foreground); box-shadow: 0 1px 3px rgb(0 0 0 / 0.12); }
.rm-segment button:focus-visible { outline: 2px solid var(--ring); outline-offset: 1px; }
.rm-segment .rm-dot { animation: none; }
.rm-segment button[aria-checked="true"] .rm-dot { animation: rm-pulse 2s infinite; }
.rm-continent { min-width: 0; font-size: 12.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Phones: the riders slider becomes a bar docked at the bottom of the screen
   (the panel drops its backdrop blur, which would otherwise trap the fixed bar). */
@media (max-width: 639px) {
  .rm-left .rm-panel { backdrop-filter: none; -webkit-backdrop-filter: none; background: rgb(255 255 255 / 0.94); }
  .rm-strip {
    position: fixed; left: 12px; right: 12px; bottom: max(12px, env(safe-area-inset-bottom)); z-index: 20;
    padding: 6px 8px; border: 1px solid rgb(255 255 255 / 0.7); border-radius: 14px;
    background: rgb(255 255 255 / 0.8); backdrop-filter: blur(16px) saturate(160%); -webkit-backdrop-filter: blur(16px) saturate(160%);
    box-shadow: 0 10px 30px -10px rgb(0 0 0 / 0.3);
  }
  .rm-strip-nav { display: none; }
  .rm:has(.rm-drawer-open) .rm-strip { display: none; }
}

/* Rider page */
.rp { max-width: 44rem; min-height: 100%; margin: 0 auto; padding: 16px 16px 48px; display: flex; flex-direction: column; gap: 12px; }
body:has(.rp) { overflow-y: auto; background: linear-gradient(oklch(0.95 0.02 80), var(--background) 320px); }
.rp-nav { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.rp-back { font-size: 14px; font-weight: 600; color: var(--foreground); text-decoration: none; }
.rp-back:hover { color: var(--primary-text); }
.rp-actions { display: flex; gap: 8px; }
.rp-actions form { display: contents; }
.rp-card {
  padding: 18px; border: 1px solid rgb(255 255 255 / 0.7); border-radius: 16px;
  background: rgb(255 255 255 / 0.85); box-shadow: 0 10px 30px -14px rgb(0 0 0 / 0.25);
}
.rp-hero { display: flex; align-items: center; gap: 20px; }
.rp-avatar { width: 96px; height: 96px; flex-shrink: 0; border-radius: 9999px; font-size: 40px; }
.rp-hero-text { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.rp-hero h1 { margin: 0; font-family: var(--font-serif); font-size: 28px; font-weight: 600; line-height: 1.15; }
.rp-line { margin: 0; font-size: 14px; color: var(--muted-foreground); }
.rp-line.rm-on-road { color: #15803d; }
.rp-map-link { align-self: flex-start; font-size: 13px; font-weight: 600; color: var(--primary-text); text-decoration: none; }
.rp-map-link:hover { text-decoration: underline; }
.rp-bio { margin: 0; font-size: 15px; line-height: 1.6; color: var(--foreground); white-space: pre-line; }
.rp-card h2 { display: flex; align-items: baseline; gap: 8px; margin: 0 0 12px; font-size: 16px; }
.rp-card h2 span { font-size: 13px; font-weight: 600; color: var(--muted-foreground); }
.rp .rm-journey { padding: 10px 12px; background: oklch(0.97 0.01 80); }
.rp .rm-journey-title { font-size: 15px; white-space: normal; }
@media (max-width: 639px) {
  .rp-hero { flex-direction: column; text-align: center; }
  .rp-hero-text { align-items: center; }
  .rp-map-link { align-self: center; }
}
a.rm-btn { text-decoration: none; }
.rp-avatar .rm-card-img { font-size: 44px; }

/* Share button + desktop link popover */
.rm-share { position: relative; display: inline-flex; }
.rm-share-btn {
  display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 12px; border: 1px solid var(--border);
  border-radius: 9999px; background: rgb(255 255 255 / 0.8); font-size: 13px; font-weight: 600; cursor: pointer;
}
.rm-share-btn:hover { border-color: var(--primary); color: var(--primary-text); }
.rm-share-pop {
  position: absolute; top: calc(100% + 6px); left: 0; z-index: 30; display: flex; gap: 6px; width: 20rem; padding: 8px;
  border: 1px solid var(--border); border-radius: 12px; background: #fff; box-shadow: 0 10px 30px -10px rgb(0 0 0 / 0.3);
}
.rm-share-pop input {
  flex: 1; min-width: 0; height: 32px; padding: 0 10px; border: 1px solid var(--border); border-radius: 8px;
  background: oklch(0.97 0.01 80); font: inherit; font-size: 13px;
}

/* Rider page: last position mini map, header actions */
.rp-minimap { height: 240px; margin-bottom: 10px; border-radius: 12px; overflow: hidden; }
.rp-minimap-pin {
  width: 44px; height: 44px; border-radius: 9999px; object-fit: cover; box-shadow: 0 0 0 3px #fff, 0 4px 10px rgb(0 0 0 / 0.3);
  display: flex; align-items: center; justify-content: center; font-size: 20px;
}
.rp-minimap-pin-active { box-shadow: 0 0 0 3px #fff, 0 0 0 5px var(--green), 0 4px 10px rgb(0 0 0 / 0.3); }
.rp-h2-action { margin-left: auto; }
.rp-actions .rm-share-pop { left: auto; right: 0; }

/* Journey form */
.rm-two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.rm-two > div { display: flex; flex-direction: column; gap: 6px; }
.rm-duration { display: grid; grid-template-columns: 1fr 1.2fr; gap: 6px; }
.rm-textarea { height: auto; padding: 8px 12px; resize: vertical; font: inherit; font-size: 14px; }
.rm-segment-field { align-self: flex-start; }
.rm-segment-field label { position: relative; cursor: pointer; }
.rm-segment-field input { position: absolute; opacity: 0; }
.rm-segment-field span { display: inline-block; padding: 5px 12px; border-radius: 8px; font-size: 13px; font-weight: 600; color: var(--muted-foreground); }
.rm-segment-field input:checked + span { background: #fff; color: var(--foreground); box-shadow: 0 1px 3px rgb(0 0 0 / 0.12); }
.rm-segment-field input:focus-visible + span { outline: 2px solid var(--ring); }
.rm-picker-field [data-country-picker-target="flag"] { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }

/* Map: numbered bubbles for crowded riders */
.rm-cluster-wrap { z-index: 50; }
.rm-cluster {
  display: flex; align-items: center; justify-content: center; width: var(--size); height: var(--size); padding: 0;
  border: 3px solid #fff; border-radius: 9999px; background: #34c759; color: #fff; cursor: pointer;
  font: 700 14px/1 var(--font-sans); box-shadow: 0 0 0 4px rgb(52 199 89 / 0.25), 0 4px 12px rgb(0 0 0 / 0.3);
  transition: transform 0.12s;
}
.rm-cluster:hover { transform: scale(1.08); }
.rm-cluster-road { box-shadow: 0 0 0 3px var(--green), 0 4px 12px rgb(0 0 0 / 0.3); }

/* Rider card: name links to the page; footer with page link + share */
a.rm-card-name { display: block; color: inherit; text-decoration: none; }
a.rm-card-name:hover { color: var(--primary-text); }
.rm-card-footer { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding-top: 4px; }
.rm-card-footer .rm-share-pop { left: auto; right: 0; top: auto; bottom: calc(100% + 6px); }

/* Faster pin drop to match the quicker camera */
.rm-pin-drop .rm-pin-box { animation-duration: 0.5s; }

/* Admin portal: a sidebar and the page (see the "Admin portal: shell" block at the end) */
body:has(.ad) { overflow-y: auto; }
.ad { display: flex; flex-direction: column; gap: 16px; padding: 16px 24px 48px; font-size: 14px; }
.ad-flash { margin: 0; padding: 10px 14px; border-radius: 10px; background: var(--moss); color: var(--pine-strong); font-weight: 500; box-shadow: inset 0 0 0 1px oklch(0.48 0.08 145 / 0.2); }
.ad-login { width: 100%; max-width: 22rem; margin: 10vh auto 0; padding: 24px; border-radius: 16px; background: #fff; box-shadow: var(--shadow); }
.ad-login h1, .ad-head h1 { margin: 0; font-family: var(--font-serif); font-size: 26px; font-weight: 600; line-height: 1.2; }
.ad-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.ad-head > a:not(.rm-btn) { margin-left: auto; color: var(--primary-text); }
.ad-stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.ad-stat { display: flex; flex-direction: column; gap: 2px; padding: 14px 16px; border-radius: 14px; background: #fff; color: inherit; text-decoration: none; box-shadow: 0 0 0 1px var(--border); transition: box-shadow 0.15s, transform 0.15s; }
a.ad-stat:hover { box-shadow: 0 0 0 1px var(--primary), 0 6px 16px -8px rgb(23 32 27 / 0.3); transform: translateY(-1px); }
.ad-stat strong { font-size: 28px; font-weight: 600; line-height: 1.1; font-variant-numeric: tabular-nums; }
.ad-stat span { font-size: 12px; font-weight: 500; color: var(--muted-foreground); }
.ad-two { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 16px; }
.ad-card { padding: 16px 18px; border-radius: 14px; background: #fff; box-shadow: 0 0 0 1px var(--border); }
.ad-card h2 { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 0 0 6px; font-size: 15px; font-weight: 600; }
.ad-card-link { font-size: 12px; font-weight: 600; color: var(--primary-text); text-decoration: none; }
.ad-card-link:hover { text-decoration: underline; }
.ad-card-empty { margin: 8px 0 0; color: var(--muted-foreground); font-size: 13px; }
.ad-line { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 0 -8px; padding: 8px; border-radius: 8px; color: inherit; text-decoration: none; }
.ad-line + .ad-line { box-shadow: 0 -1px 0 var(--border); }
a.ad-line:hover { background: var(--stone); }
.ad-line small { color: var(--muted-foreground); white-space: nowrap; }
.ad-line > span small { white-space: normal; }
.ad-table { width: 100%; border-collapse: separate; border-spacing: 0; }
.ad-table th, .ad-table td { padding: 10px 14px; text-align: left; vertical-align: middle; border-bottom: 1px solid var(--border); }
.ad-table th {
  position: sticky; top: 0; z-index: 1; padding-block: 8px;
  font-size: 11px; font-weight: 600; letter-spacing: 0.05em; text-transform: uppercase; white-space: nowrap;
  color: var(--muted-foreground); background: var(--stone);
}
.ad-table tbody tr:last-child td { border-bottom: none; }
.ad-empty { color: var(--muted-foreground); text-align: center !important; padding: 40px 14px !important; }
.ad-actions { display: flex; align-items: center; gap: 4px; justify-content: flex-end; }
.ad-actions form { display: contents; }
.ad-head-form { position: sticky; top: 0; z-index: 20; background: var(--background); padding: 14px 0; margin: -14px 0 0; }
.ad-head.ad-head-form .ad-head-link { margin-left: 0; }
.ad-head-save { margin-left: auto; }
.ad-form { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px 16px; }
.ad-form > .rm-field-error, .ad-form > footer, .ad-form .ad-field:has(textarea) { grid-column: 1 / -1; }
.ad-field { display: flex; flex-direction: column; gap: 4px; font-weight: 600; font-size: 13px; }
.ad-field small { font-weight: 400; color: var(--muted-foreground); }
.ad-field-check { flex-direction: row-reverse; justify-content: flex-end; align-items: center; gap: 8px; }

/* Journey page: full-screen map, details card on the left, link cards bottom-right */
.jm { position: fixed; inset: 0; }
.jm-map { position: absolute; inset: 0; z-index: 0; }
.jm-map.jm-adding canvas { cursor: crosshair; }
.jm-panel {
  position: absolute; top: 16px; left: 16px; z-index: 10; width: 24rem; max-height: calc(100% - 32px);
  display: flex; flex-direction: column; gap: 8px;
}
.jm-nav { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.jm-title { margin: 0; font-family: var(--font-serif); font-size: 22px; line-height: 1.2; }
.jm-meta { display: flex; align-items: center; gap: 6px; margin: 0; font-size: 13px; color: var(--muted-foreground); }
.jm-description { -webkit-line-clamp: 5; }
.jm-owner { display: flex; gap: 8px; flex-wrap: wrap; }
.jm-owner [aria-pressed="true"] { background: var(--foreground); }
.jm-stops { display: flex; flex-direction: column; gap: 2px; margin: 0; padding: 0; list-style: none; }
.jm-stops li { display: flex; align-items: center; gap: 4px; }
.jm-stops form { display: contents; }
.jm-stop-row {
  flex: 1; display: flex; align-items: center; gap: 8px; min-width: 0; padding: 4px 6px; border: 0; border-radius: 8px;
  background: none; text-align: left; font-size: 13px; cursor: pointer;
}
.jm-stop-row:hover { background: rgb(255 255 255 / 0.7); }
.jm-stop-row small { color: var(--muted-foreground); }
.jm-stop {
  display: flex; align-items: center; justify-content: center; width: 26px; height: 26px; flex-shrink: 0;
  border: 2px solid #fff; border-radius: 9999px; background: #34c759; color: #fff;
  font: 700 12px/1 var(--font-sans); box-shadow: 0 2px 6px rgb(0 0 0 / 0.3);
}
.jm-stop-sm { width: 22px; height: 22px; font-size: 11px; box-shadow: none; }
.jm-popup .maplibregl-popup-content { padding: 12px; border-radius: 12px; }
.jm-stop-form { display: flex; flex-direction: column; gap: 6px; }
.jm-stop-form .rm-input { height: 34px; padding: 4px 10px; font-size: 13px; }

.jm-link {
  display: flex; gap: 10px; align-items: center; padding: 8px; border-radius: 14px; color: inherit; text-decoration: none;
  background: rgb(255 255 255 / 0.85); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  box-shadow: 0 10px 30px -10px rgb(0 0 0 / 0.3);
}
.jm-link:hover { box-shadow: 0 0 0 2px var(--primary), 0 10px 30px -10px rgb(0 0 0 / 0.3); }
.jm-thumb { position: relative; width: 96px; height: 60px; flex-shrink: 0; border-radius: 10px; overflow: hidden; background: oklch(0.95 0.01 80); }
.jm-thumb img { width: 100%; height: 100%; object-fit: cover; }
.jm-thumb:not(.jm-thumb-icon) > svg { display: none; }
.jm-thumb-video::after {
  content: "▶"; position: absolute; inset: 0; margin: auto; width: 30px; height: 30px; border-radius: 9999px;
  display: flex; align-items: center; justify-content: center; background: rgb(0 0 0 / 0.6); color: #fff; font-size: 12px;
}
.jm-thumb-icon { display: flex; align-items: center; justify-content: center; color: var(--primary-text); }
.jm-thumb-icon svg { width: 26px; height: 26px; }
.jm-link-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; font-size: 13px; font-weight: 600; line-height: 1.3; }
.jm-link-text small { display: inline-flex; align-items: center; gap: 4px; font-weight: 500; color: var(--muted-foreground); }
.jm-link-text small svg { width: 12px; height: 12px; }

@media (max-width: 1023px) {
  .jm-panel { top: auto; left: 12px; right: 12px; bottom: 12px; width: auto; max-height: 40dvh; }
  .jm-link { padding: 6px; }
  .jm-thumb { width: 64px; height: 40px; }
}
.ad-tabs { align-self: flex-start; }
.ad-tabs a { display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; border-radius: 8px; color: var(--muted-foreground); font-weight: 600; font-size: 13px; text-decoration: none; }
.ad-tabs a:hover { color: var(--foreground); }
.ad-tabs a span { min-width: 18px; padding: 0 5px; border-radius: 9999px; background: rgb(0 0 0 / 0.06); font-size: 11px; font-weight: 600; text-align: center; font-variant-numeric: tabular-nums; }
.ad-tabs a[aria-current="page"] { background: #fff; color: var(--foreground); box-shadow: 0 1px 3px rgb(0 0 0 / 0.12); }

/* Journey page: building the route */
.jm-stops li { gap: 2px; }
.jm-stops .sortable-ghost { opacity: 0.4; }
.jm-handle { padding: 4px 2px; color: var(--muted-foreground); cursor: grab; user-select: none; letter-spacing: -2px; }
.jm-stop { cursor: pointer; }
.jm-stop-pending { background: #fff; color: var(--primary-text); border-color: #34c759; font-size: 16px; }
.jm-owner [aria-pressed="true"] { background: var(--green); }

.jm-links-form {
  display: flex; flex-direction: column; gap: 6px; margin-top: 8px;
  padding: 12px; border-radius: 12px; background: #fff; box-shadow: 0 0 0 1px var(--border); font-size: 13px;
}
.jm-links-form small { font-weight: 400; color: var(--muted-foreground); }
.jm-links-form .rm-input { height: 34px; padding: 4px 10px; font-size: 13px; }
.jm-links-form .rm-btn { align-self: flex-end; }

/* Journey panel: fixed header, only the stops list scrolls */
.jm-panel { overflow: hidden; }
.jm-panel > * { flex-shrink: 0; }
.jm-panel .jm-stops { flex: 1 1 auto; flex-shrink: 1; min-height: 0; overflow-y: auto; margin-right: -6px; padding-right: 6px; }
.jm-nav-actions { display: flex; align-items: center; gap: 6px; }
.jm-rider {
  display: inline-flex; align-items: center; gap: 8px; min-width: 0; padding: 3px 12px 3px 3px; border-radius: 9999px;
  background: #fff; box-shadow: 0 0 0 1px var(--border), 0 2px 6px rgb(0 0 0 / 0.08); color: var(--foreground);
  font-size: 13px; font-weight: 600; text-decoration: none; transition: box-shadow 0.15s;
}
.jm-rider:hover { box-shadow: 0 0 0 2px var(--primary), 0 2px 6px rgb(0 0 0 / 0.08); color: var(--primary-text); }
.jm-rider span:last-child { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.jm-rider-avatar { display: flex; align-items: center; justify-content: center; width: 28px; height: 28px; flex-shrink: 0; border-radius: 9999px; object-fit: cover; font-size: 14px; }
.jm-stops-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.jm-stop-label { min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.jm-date { flex-shrink: 0; margin-left: auto; font-size: 12px; color: var(--muted-foreground); font-variant-numeric: tabular-nums; }
input.jm-date {
  height: 26px; padding: 0 4px; border: 1px solid transparent; border-radius: 6px; background: transparent;
  font: inherit; font-size: 12px; color: var(--muted-foreground); cursor: pointer;
}
input.jm-date:hover, input.jm-date:focus { border-color: var(--border); background: #fff; color: var(--foreground); outline: none; }

.jm-links-form { top: calc(100% + 8px); bottom: auto; }

/* Draft / published */
.jm-visibility {
  display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 6px 10px; border-radius: 10px;
  background: oklch(0.48 0.08 145 / 0.1); font-size: 12.5px; font-weight: 600;
}
.jm-visibility form { display: contents; }
.jm-visibility-draft { background: oklch(0.8 0.12 85 / 0.25); }
.rp-draft { display: flex; align-items: center; gap: 8px; }
.rp-draft .rm-journey { flex: 1; min-width: 0; }
.rp-draft form { display: contents; }
.rp-drafts { margin-bottom: 8px; }
.rp-badge { margin-left: 6px; padding: 1px 8px; border-radius: 9999px; background: oklch(0.8 0.12 85 / 0.35); font-family: var(--font-sans); font-size: 11px; font-weight: 700; vertical-align: middle; }

/* Journey map: smaller pins, highlighted stop */
.jm-stop { width: 20px; height: 20px; font-size: 10px; border-width: 1.5px; transition: transform 0.12s, box-shadow 0.12s; }
.jm-stop-active { z-index: 5; transform: scale(1.35); background: var(--foreground); box-shadow: 0 0 0 3px #fff, 0 0 0 6px rgb(52 199 89 / 0.45); }
.jm-stops .jm-stop-sm { width: 20px; height: 20px; font-size: 10px; transform: none; }
.jm-row-active > .jm-stop-row { background: rgb(52 199 89 / 0.12); }
.jm-row-active .jm-stop-sm { background: var(--foreground); }

/* Stop dates: "6 Oct 2025"; for the owner a button over a native date input */
.jm-date-btn { padding: 2px 6px; border: 0; border-radius: 6px; background: none; cursor: pointer; }
.jm-date-btn:hover { background: #fff; color: var(--foreground); box-shadow: 0 0 0 1px var(--border); }
.jm-date-input { width: 1px; height: 1px; padding: 0; border: 0; opacity: 0; pointer-events: none; }

/* Stops grouped by country */
.jm-stops-actions { display: flex; align-items: center; gap: 10px; }
.jm-group { border-radius: 8px; }
.jm-group-head {
  display: flex; align-items: center; gap: 8px; padding: 6px 6px; border-radius: 8px; cursor: pointer; list-style: none;
  font-size: 13px; font-weight: 600;
}
.jm-group-head::-webkit-details-marker { display: none; }
.jm-group-head::before { content: "▸"; color: var(--muted-foreground); transition: transform 0.15s; }
.jm-group[open] > .jm-group-head::before { transform: rotate(90deg); }
.jm-group-head:hover { background: rgb(255 255 255 / 0.7); }
.jm-group-flag { font-size: 16px; line-height: 1; }
.jm-group-range { font-weight: 500; color: var(--muted-foreground); }
.jm-stops-inner { display: flex; flex-direction: column; gap: 2px; margin: 0 0 4px 18px; padding: 0; list-style: none; }
.jm-stops-inner li { display: flex; align-items: center; gap: 2px; }

/* Country flags: instant name tooltip */
.jm-flags { flex-wrap: wrap; overflow: visible; gap: 2px 0; }
[data-tip] { position: relative; }
[data-tip]:hover::after {
  content: attr(data-tip); position: absolute; top: calc(100% + 6px); left: 50%; transform: translateX(-50%); z-index: 20;
  padding: 3px 8px; border-radius: 6px; background: var(--foreground); color: #fff; font: 600 11px/1.4 var(--font-sans);
  white-space: nowrap; pointer-events: none;
}

/* Journey map pins are a map layer now; these style the list and the pending pin */
.jm-pending { width: 28px; height: 40px; opacity: 0.75; pointer-events: none; }
.jm-pending svg { width: 100%; height: 100%; }
.jm-stops .jm-kind-start { background: #16a34a; }
.jm-stops .jm-kind-end { background: #111827; }
.jm-stops .jm-kind-last { background: #2563eb; }
.jm-stops .jm-kind-fav { background: #e11d48; }
.jm-fav { flex-shrink: 0; width: 24px; height: 24px; padding: 0; border: 0; background: none; color: var(--muted-foreground); font-size: 15px; line-height: 1; cursor: pointer; }
span.jm-fav { cursor: default; }
.jm-fav-on { color: #e11d48; }
button.jm-fav:hover { color: #e11d48; transform: scale(1.15); }

/* Rider page: ⅓ profile + bio | ⅔ last position (map + flags) + journeys */
.rp-grid { display: grid; gap: 12px; }
.rp-col { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
@media (min-width: 1024px) {
  .rp { max-width: 76rem; }
  .rp-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); align-items: start; }
  .rp-col-side { position: sticky; top: 16px; }
  .rp-col-side .rp-hero { flex-direction: column; align-items: flex-start; }
  .rp-minimap { height: 320px; }
}
.rp-card-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.rp-card-head h2 { margin: 0; }
.rp-card-head .rp-map-link { flex-shrink: 0; }
.rp-flags { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; }
.rp-flags .rm-flag-bubble { margin-left: 0; }
.rp-flags-count { margin-left: 6px; font-size: 12px; font-weight: 600; color: var(--muted-foreground); }
.rp-card-head { flex-wrap: wrap; row-gap: 4px; }
.rp-card-head h2 { flex: 1 1 14rem; flex-wrap: wrap; }
.rp-card-head h2 span { white-space: nowrap; }

/* Stop list: flag, whole-row selection */
.jm-stop-flag { flex-shrink: 0; font-size: 14px; line-height: 1; }
.jm-stops li { border-radius: 8px; }
.jm-stops li.jm-row-active { background: rgb(52 199 89 / 0.12); }
.jm-stops li.jm-row-active > .jm-stop-row { background: none; }

/* Legs between stops (list rows + map menu) */
.jm-leg {
  display: flex; align-items: center; gap: 6px; margin-left: 30px; padding: 1px 0 1px 10px;
  border-left: 2px dashed rgb(52 199 89 / 0.35); font-size: 12px; color: var(--muted-foreground);
}
.jm-leg-mode { padding: 1px 2px; border: 0; border-radius: 6px; background: none; font: inherit; color: inherit; cursor: pointer; }
select.jm-leg-mode:hover { background: #fff; box-shadow: 0 0 0 1px var(--border); }
.jm-leg-route { padding: 1px 6px; border: 0; border-radius: 6px; background: none; font: inherit; color: inherit; cursor: pointer; }
.jm-leg-route:hover { background: #fff; box-shadow: 0 0 0 1px var(--border); }
.jm-leg-route-on { color: var(--primary-text); font-weight: 600; }
.jm-leg .rm-link { font-size: 12px; }
.jm-leg-km { font-weight: 600; font-variant-numeric: tabular-nums; }
.jm-leg-gpx { padding: 0 6px; border-radius: 6px; background: rgb(52 199 89 / 0.12); color: var(--primary-text); font-size: 11px; font-weight: 600; text-decoration: none; }
a.jm-leg-gpx:hover { text-decoration: underline; }
.jm-gpx-upload { position: relative; cursor: pointer; }
.jm-gpx-upload:focus-within { outline: 2px solid var(--ring); }
.jm-leg-route { margin-left: auto; }
.jm-leg-active { border-left-style: solid; border-left-color: var(--primary); border-radius: 0 8px 8px 0; background: rgb(52 199 89 / 0.12); color: var(--foreground); }
.jm-leg-active .jm-leg-mode, .jm-leg-active .jm-leg-route { background: #fff; box-shadow: 0 0 0 1px var(--primary); }
.jm-leg-menu { display: flex; flex-direction: column; gap: 8px; font-size: 13px; }
.jm-leg-options { display: flex; gap: 4px; }
.jm-leg-option {
  display: flex; align-items: center; justify-content: center; width: 36px; height: 36px; padding: 0;
  border: 1px solid var(--border); border-radius: 10px; background: #fff; font-size: 18px; line-height: 1; cursor: pointer;
  transition: transform 0.1s, border-color 0.1s;
}
.jm-leg-option:hover { border-color: var(--primary); transform: translateY(-1px); }
.jm-leg-option-on { border-color: var(--primary); background: rgb(52 199 89 / 0.12); box-shadow: 0 0 0 1px var(--primary); }
.jm-leg-menu .jm-leg-route { align-self: flex-start; margin-left: 0; border: 1px solid var(--border); padding: 4px 10px; font-size: 12px; }
.jm-leg-menu .jm-leg-route-on { border-color: var(--primary); background: rgb(52 199 89 / 0.1); }
.jm-via-drag { width: 12px; height: 12px; border: 2px solid #34c759; border-radius: 9999px; background: #fff; pointer-events: none; }
.jm-routing canvas { cursor: progress !important; }

/* Map: smaller numbered bubbles */
.rm-cluster { border-width: 2px; font-size: 11px; box-shadow: 0 0 0 3px rgb(52 199 89 / 0.22), 0 3px 8px rgb(0 0 0 / 0.28); }
.rm-cluster-road { box-shadow: 0 0 0 2px var(--green), 0 3px 8px rgb(0 0 0 / 0.28); }

/* Rider card: actions on the name's line, countries title, current country */
.rm-card-header { align-items: flex-start; }
.rm-card-titles { flex: 1; }
.rm-card-actions { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.rm-card-actions .rm-share-btn { height: 28px; padding: 0 10px; font-size: 12px; }
.rm-card-actions .rm-share-pop { left: auto; right: 0; }
.rm-card-place { color: var(--muted-foreground); font-weight: 400; }
.rm-card-flags { flex-wrap: wrap; overflow: visible; gap: 2px 0; }
.rm-preview .rm-card-label-countries { display: block; }
.rm-flag-here { box-shadow: 0 0 0 2px var(--green); z-index: 1; }
@media (max-width: 1023px) {
  .rm-card-header { padding-right: 0; }
  .rm-preview .rm-card-line { white-space: normal; }
}
.rm-card-name-row { display: flex; align-items: center; gap: 8px; min-width: 0; }
.rm-card-name-row .rm-card-name { flex: 1; min-width: 0; }
.rm-preview .rm-card-line.rm-on-road { display: block; }
.rm-preview .rm-on-road .rm-dot { display: inline-block; margin-right: 6px; vertical-align: 2px; }

.rm-card-header { padding-right: 0; }
.rm-modal-alt { flex-wrap: wrap; align-items: center; }
.rm-modal-alt form { display: contents; }

/* Admin: tabbed edit pages (riders, journeys) */
.ad-head > .ad-head-link { margin-left: auto; }
.ad-head > .ad-head-link + a { margin-left: 0; }
.ad-tabbed { display: flex; flex-direction: column; gap: 14px; }
.ad-tabbed [role="tabpanel"][hidden] { display: none; }
/* The form (and its Save button) only shows with one of its own panels. */
.ad-tabbed-form:not(:has(> [role="tabpanel"]:not([hidden]))) { display: none; }
.ad-tabbed-form { display: flex; flex-direction: column; gap: 12px; }
.ad-subtabs { align-self: flex-start; }
.ad-subtabs button {
  padding: 5px 12px; border: 0; border-radius: 8px; background: none; color: var(--muted-foreground);
  font: 600 13px var(--font-sans); cursor: pointer;
}
.ad-subtabs button::after { content: none; }
.ad-subtabs button span { margin-left: 2px; font-weight: 500; opacity: 0.7; }
.ad-subtabs button[aria-selected="true"] { background: #fff; color: var(--foreground); box-shadow: 0 1px 3px rgb(0 0 0 / 0.12); }
.ad-subtabs button:focus-visible { outline: 2px solid var(--ring); outline-offset: 1px; }
.ad-form .ad-field-wide { grid-column: 1 / -1; }
.ad-label { font-weight: 600; font-size: 13px; }

.ad-location { display: flex; flex-direction: column; gap: 10px; padding-top: 12px; border-top: 1px solid var(--border); }
.ad-location-head { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px; }
.ad-location-fields { display: flex; flex-direction: column; gap: 6px; min-width: 0; margin: 0; padding: 0; border: 0; }
.ad-location-pair { display: grid; grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr)); gap: 10px; }
.ad-location-intro { margin: 0; }
.ad-location-pair .ad-location-fields {
  padding: 10px 12px; border: 1px solid var(--border); border-radius: 12px; background: var(--card); cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.ad-location-pair .ad-location-active { border-color: var(--primary); box-shadow: 0 0 0 1px var(--primary); cursor: default; }
.ad-location-title { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 13px; }
.ad-location-badge {
  padding: 2px 8px; border-radius: 9999px; background: rgb(52 199 89 / 0.12); color: var(--primary-text);
  font-size: 11px; font-weight: 600; visibility: hidden;
}
.ad-location-active .ad-location-badge { visibility: visible; }
.ad-location-coords { margin: 0; font-size: 12px; font-variant-numeric: tabular-nums; }
.ad-location-pin:not(.ad-location-pin-active) { opacity: 0.55; cursor: pointer; }
.ad-location-pin-active { z-index: 1; }
.ad-location-map { height: 360px; border-radius: 12px; overflow: hidden; box-shadow: 0 0 0 1px var(--border); }
.ad-location-pin { width: 28px; height: 40px; cursor: grab; }
.ad-location-pin svg { width: 100%; height: 100%; }
.ad-location-hint { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; margin: 0; }
.ad-location-hint span:last-child { font-variant-numeric: tabular-nums; }

.ad-links { display: flex; flex-direction: column; gap: 4px; }
.ad-links .rm-hint { margin: 0 0 4px; }
.ad-links .rm-link { flex-shrink: 0; }

.ad-stops { display: grid; grid-template-columns: minmax(0, 1fr) 22rem; gap: 14px; }
.ad-stops > .rm-hint { grid-column: 1 / -1; }
.ad-stops-map { position: relative; height: 580px; border-radius: 12px; overflow: hidden; box-shadow: 0 0 0 1px var(--border); }
.ad-stops-map.jm-adding canvas { cursor: crosshair; }
.ad-stops-panel { display: flex; flex-direction: column; gap: 8px; height: 580px; min-height: 0; }
.ad-stops-panel > * { flex-shrink: 0; }
.ad-stops-panel .jm-stops { flex: 1 1 auto; min-height: 0; overflow-y: auto; }
.ad-stops-panel .jm-stops-head { justify-content: flex-end; }
@media (max-width: 800px) {
  .ad-stops { grid-template-columns: 1fr; }
  .ad-stops-map { height: 380px; }
  .ad-stops-panel { height: auto; }
}

/* Admin journey: tabs, save status and draft / published on one row */
.ad-subtabs-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.ad-save-status { margin-left: auto; font-size: 12px; font-weight: 600; color: var(--muted-foreground); }
.ad-save-status[data-state="saved"] { color: oklch(0.48 0.1 145); }
.ad-save-status[data-state="saving"] { color: var(--muted-foreground); }
.ad-save-status[data-state="dirty"] { color: oklch(0.6 0.13 70); }
.ad-save-status[data-state="failed"] { color: #dc2626; }
.ad-visibility button::after { content: none; }
.jm-save-status { font-size: 12px; font-weight: 600; color: var(--muted-foreground); }
.jm-save-status[data-state="failed"] { color: #dc2626; }

/* Stop list, calmer: number = favourite toggle, click the name to rename,
   handle / empty date / × appear on hover; legs read "41 km · 🛣 · 🚲". */
.jm-stops-head .rm-card-label { white-space: nowrap; }
.jm-stops-actions { gap: 8px; }
.jm-save-status { white-space: nowrap; }
.jm-stop-item { gap: 6px; padding: 1px 4px 1px 0; }
.jm-stop-item > .jm-stop-row {
  flex: 1; min-width: 0; padding: 4px 6px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; display: block;
}
.jm-stop-unnamed { color: var(--muted-foreground); }
button.jm-stop { padding: 0; font: 700 11px/1 var(--font-sans); transition: transform 0.1s, box-shadow 0.1s; }
button.jm-stop:hover { transform: scale(1.12); box-shadow: 0 0 0 2px #e11d48; }
.jm-stop.jm-stop-fav { position: relative; box-shadow: 0 0 0 2px #e11d48; }
.jm-stop.jm-stop-fav::after {
  content: "♥"; position: absolute; right: -5px; top: -6px; font-size: 10px; line-height: 1; color: #e11d48;
  text-shadow: 0 0 2px #fff, 0 0 2px #fff;
}
.jm-name-input { flex: 1; min-width: 0; height: 28px; padding: 2px 8px; border: 1px solid var(--primary); border-radius: 6px; font: inherit; font-size: 13px; outline: none; }
.jm-date-empty { color: var(--muted-foreground); opacity: 0.8; }
@media (hover: hover) {
  .jm-stop-item .jm-handle, .jm-stop-item .jm-remove, .jm-stop-item .jm-date-empty { opacity: 0; transition: opacity 0.12s; }
  .jm-stop-item:hover .jm-handle, .jm-stop-item:hover .jm-remove, .jm-stop-item:hover .jm-date-empty,
  .jm-stop-item:focus-within .jm-handle, .jm-stop-item:focus-within .jm-remove, .jm-stop-item:focus-within .jm-date-empty { opacity: 1; }
  .jm-stop-item:not(:has(.jm-handle)) { padding-left: 4px; }
}
.jm-remove { width: 24px; height: 24px; font-size: 16px; }

.jm-leg { gap: 4px; min-height: 24px; }
.jm-leg .jm-leg-route { margin-left: 0; padding: 1px 6px; font-size: 11.5px; }
.jm-leg-km { padding: 1px 4px; border: 0; border-radius: 6px; background: none; font: inherit; font-weight: 600; color: var(--foreground); cursor: pointer; }
.jm-leg-km:hover { background: #fff; box-shadow: 0 0 0 1px var(--border); }
.jm-leg select.jm-leg-mode { font-size: 12px; }
.jm-leg-menu .jm-leg-options { flex-wrap: wrap; }

/* Stop date picker: D+1…D+5 after the previous stop, then the month */
.dp {
  position: fixed; z-index: 1000; width: 17.5rem; padding: 12px; border-radius: 14px; background: #fff;
  box-shadow: 0 0 0 1px var(--border), 0 16px 40px -12px rgb(0 0 0 / 0.35); font-size: 13px;
}
.dp-label { margin-bottom: 6px; font-size: 11px; font-weight: 600; letter-spacing: 0.02em; color: var(--muted-foreground); text-transform: uppercase; }
.dp-quick { display: grid; grid-template-columns: repeat(5, 1fr); gap: 4px; margin-bottom: 10px; }
.dp-chip {
  display: flex; flex-direction: column; align-items: center; gap: 1px; padding: 5px 0; border: 1px solid var(--border);
  border-radius: 10px; background: #fff; cursor: pointer; font: inherit;
}
.dp-chip strong { font-size: 12px; color: var(--primary-text); }
.dp-chip small { font-size: 10.5px; color: var(--muted-foreground); white-space: nowrap; }
.dp-chip:hover, .dp-chip:focus-visible { border-color: var(--primary); outline: none; }
.dp-chip.dp-on { border-color: var(--primary); background: rgb(52 199 89 / 0.12); }
.dp-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.dp-title { font-size: 13px; }
.dp-nav { width: 28px; height: 28px; border: 0; border-radius: 8px; background: none; font-size: 18px; line-height: 1; cursor: pointer; }
.dp-nav:hover { background: var(--secondary); }
.dp-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.dp-weekday { padding: 2px 0 4px; text-align: center; font-size: 10.5px; font-weight: 600; color: var(--muted-foreground); }
.dp-day {
  height: 32px; border: 0; border-radius: 8px; background: none; font: inherit; font-variant-numeric: tabular-nums; cursor: pointer;
}
.dp-day:hover, .dp-day:focus-visible { background: var(--secondary); outline: none; }
.dp-today { font-weight: 700; color: var(--primary-text); }
.dp-base { box-shadow: inset 0 0 0 1px var(--border); }
.dp-day.dp-on { background: var(--primary); color: #fff; font-weight: 700; }
.dp-foot { display: flex; justify-content: space-between; margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--border); }

/* Stop list, round 3: 5px rhythm, plain stops as white rings, an empty
   heart on every number (click = favourite), dates always shown, bare selects. */
.jm-stops li.jm-stop-item { gap: 5px; }
.jm-stops .jm-kind-stop:not(.jm-stop-fav) { background: #fff; color: var(--primary-text); border: 1.5px solid #34c759; }
.jm-stops .jm-row-active .jm-kind-stop:not(.jm-stop-fav) { background: #34c759; color: #fff; }
.jm-stop-heart { position: relative; overflow: visible; }
.jm-stop-heart::after, .jm-stop.jm-stop-fav::after {
  content: "♡"; position: absolute; right: -6px; top: -7px; font-size: 11px; line-height: 1; color: #e11d48;
  text-shadow: 0 0 2px #fff, 0 0 2px #fff, 0 0 2px #fff;
}
.jm-stop.jm-stop-fav::after { content: "♥"; }
@media (hover: hover) { .jm-stop-item .jm-date-empty { opacity: 1; } }
.jm-date-empty { font-style: italic; }
.jm-leg select.jm-leg-mode { appearance: none; -webkit-appearance: none; padding: 1px 4px; background: none; }
.jm-remove.jm-remove-confirm {
  width: auto; height: 22px; padding: 0 8px; border-radius: 6px; background: #dc2626; color: #fff;
  font-size: 12px; font-weight: 600; opacity: 1 !important;
}
.jm-visibility { gap: 8px; }
.jm-visibility .jm-save-status { margin-left: auto; }
.jm-visibility form { flex-shrink: 0; }

/* Rider map search bar: [country ⌄] [search rider…] [×] [All | ● Riding] (+ account on phones) */
.rm-left { max-width: 30rem; }
.rm-searchbar {
  display: flex; align-items: center; gap: 4px; min-width: 0; padding: 3px; border: 1px solid transparent; border-radius: 12px;
  background: oklch(0.95 0.01 80); transition: background 0.15s, border-color 0.15s, box-shadow 0.15s;
}
.rm-searchbar:focus-within { background: #fff; border-color: var(--ring); box-shadow: 0 0 0 3px rgb(52 199 89 / 0.15); }
.rm-searchbar .rm-picker { flex-shrink: 0; }
.rm-searchbar .rm-popover { left: -4px; right: auto; top: calc(100% + 10px); }
.rm-country-btn {
  display: inline-flex; align-items: center; gap: 2px; height: 34px; padding: 0 4px 0 8px; border: 0; border-radius: 9px;
  background: none; color: var(--muted-foreground); font-size: 18px; line-height: 1; cursor: pointer;
}
.rm-country-btn:hover, .rm-country-btn[aria-expanded="true"] { background: rgb(0 0 0 / 0.06); color: var(--foreground); }
.rm-country-btn.rm-picker-selected { background: #fff; box-shadow: 0 1px 3px rgb(0 0 0 / 0.12); font-size: 18px; }
.rm-country-btn > svg:last-child { width: 14px; height: 14px; opacity: 0.7; }
.rm-country-btn:focus-visible { outline: 2px solid var(--ring); outline-offset: 1px; }
.rm-search-input {
  flex: 1 1 0; min-width: 0; height: 34px; padding: 0 4px; border: 0; outline: none; background: none;
  font: inherit; font-size: 14px; color: var(--foreground);
}
.rm-search-input::placeholder { color: var(--muted-foreground); }
.rm-searchbar .rm-icon-btn { flex-shrink: 0; }
.rm-scope-select {
  display: none; flex-shrink: 0; height: 30px; padding: 0 20px 0 8px; border: 0; border-radius: 8px;
  appearance: none; -webkit-appearance: none; font: inherit; font-size: 12px; font-weight: 600; color: var(--foreground);
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236b6257' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 5px center / 12px;
  box-shadow: 0 1px 3px rgb(0 0 0 / 0.12); cursor: pointer;
}
.rm-scope-select:focus-visible { outline: 2px solid var(--ring); outline-offset: 1px; }



@media (max-width: 639px) {
  .rm-left { max-width: none; }
}

/* Phones and tablets: All / Riding is a compact dropdown, sized to its
   chosen option by the map controller (fitScopeSelect). */
@media (max-width: 1023px) {
  .rm-panel .rm-segment { display: none; }
  .rm-scope-select { display: block; }
}

/* My location: its button (shared map buttons) turns blue once found; a blue dot on the map */
.rm-locate-on { color: #1a73e8 !important; }
.rm-locate-busy svg { animation: rm-pulse 1s infinite; }
.rm-me {
  width: 16px; height: 16px; border: 3px solid #fff; border-radius: 9999px; background: #1a73e8;
  box-shadow: 0 0 0 6px rgb(26 115 232 / 0.2), 0 1px 4px rgb(0 0 0 / 0.35);
}

/* Map credits on the other maps (mini maps, pickers): a © icon instead of MapLibre's "i" */
.maplibregl-ctrl-attrib.maplibregl-compact .maplibregl-ctrl-attrib-button {
  background-color: transparent; background-size: 16px; background-position: center; background-repeat: no-repeat;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236b6257' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='9.5'/%3E%3Cpath d='M14.8 14.8a4 4 0 1 1 0-5.6'/%3E%3C/svg%3E");
}

/* Admin Stops tab: the journey's real page, embedded, with the Override switch */
.ad-tabbed .ad-stops { display: flex; flex-direction: column; gap: 10px; }
.ad-tabbed .ad-stops[hidden] { display: none; }
.ad-stops-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.ad-stops-bar .rm-hint { flex: 1 1 20rem; margin: 0; }
.ad-stops-bar .rm-btn[aria-pressed="true"] { background: var(--foreground); }
.ad-stops-frame { display: block; width: 100%; height: min(78vh, 760px); border: 0; border-radius: 12px; box-shadow: 0 0 0 1px var(--border); background: var(--background); }

/* Journey page: banner while an admin edits someone else's journey */
.jm-override {
  padding: 6px 10px; border-radius: 10px; background: oklch(0.8 0.12 85 / 0.3); color: var(--foreground);
  font-size: 12.5px; font-weight: 600;
}

/* Claim page (invite link from the admin) */
.cl { min-height: 100dvh; display: flex; align-items: center; justify-content: center; padding: 24px 16px; }
.cl-card { width: 100%; max-width: 26rem; padding: 24px; border-radius: 16px; background: #fff; box-shadow: var(--shadow); }
.cl-head { display: flex; flex-direction: column; align-items: center; gap: 6px; margin-bottom: 8px; text-align: center; }
.cl-head h1 { margin: 4px 0 0; font-family: var(--font-serif); font-size: 24px; }
.cl-head p { margin: 0; }
.cl-avatar { width: 72px; height: 72px; border-radius: 9999px; object-fit: cover; box-shadow: 0 0 0 3px #fff, var(--shadow); }

/* Admin: avatars in lists, rider account / invite link */
@media (max-width: 639px) { .ad { padding: 12px 12px 40px; } }
.ad-who { display: inline-flex; align-items: center; gap: 8px; min-width: 0; }
.ad-who small { color: var(--muted-foreground); }
.ad-avatar { width: 28px; height: 28px; flex-shrink: 0; border-radius: 9999px; object-fit: cover; box-shadow: 0 0 0 1px var(--border); }
.ad-avatar-lg { width: 44px; height: 44px; }
.ad-line { align-items: center; }
.ad-account { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.ad-account p { flex: 1 1 18rem; margin: 0; }
.ad-account small { color: var(--muted-foreground); }
.ad-account form { display: contents; }
.ad-invite { display: flex; gap: 6px; flex-basis: 100%; }
.ad-invite .rm-input { flex: 1; padding-left: 10px; font-family: ui-monospace, monospace; font-size: 12.5px; }

/* Rider map: smaller numbered bubbles with a thin ring, so more riders show sooner */
.rm-cluster { border-width: 1.5px; font-size: 10.5px; box-shadow: 0 0 0 2px rgb(52 199 89 / 0.2), 0 2px 6px rgb(0 0 0 / 0.25); }
.rm-cluster-road { box-shadow: 0 0 0 1.5px var(--green), 0 2px 6px rgb(0 0 0 / 0.25); }

/* WeBikepack wordmark, above the search */
.rm-brand { display: inline-flex; align-items: center; gap: 8px; align-self: flex-start; padding: 0 2px; color: var(--foreground); text-decoration: none; }
.rm-brand-mark {
  display: flex; align-items: center; justify-content: center; width: 30px; height: 30px; border-radius: 9px;
  background: var(--primary); color: #fff; box-shadow: 0 2px 6px rgb(52 199 89 / 0.45);
}
.rm-brand-mark svg { width: 20px; height: 20px; stroke-width: 2.2; }
.rm-brand-name { font-family: var(--font-serif); font-size: 20px; font-weight: 600; letter-spacing: -0.01em; line-height: 1; }
.rm-brand-name span { color: var(--primary-text); }
.rm-brand:hover .rm-brand-mark { transform: rotate(-6deg); }
.rm-brand-mark { transition: transform 0.15s; }
@media (max-width: 639px) {
  .rm-brand-mark { width: 24px; height: 24px; border-radius: 7px; }
  .rm-brand-mark svg { width: 16px; height: 16px; }
  .rm-brand-name { font-size: 17px; }
}


/* Riders in view, round 2: flag badge on the photo, no country line, room for
   the selection ring, and a hover that lifts the card and the rider's pin */
.rm-strip-list { margin: 0 -8px; padding: 6px 8px 6px; scroll-padding-inline: 8px; }
.rm-thumb { gap: 5px; padding: 8px 4px 6px; transition: background 0.15s, box-shadow 0.15s, transform 0.15s; }
.rm-thumb-avatar { position: relative; display: block; width: 44px; height: 44px; flex-shrink: 0; transition: transform 0.15s; }
.rm-thumb-avatar .rm-thumb-img { width: 100%; height: 100%; }
.rm-thumb-flag {
  position: absolute; right: -4px; bottom: -3px; display: flex; align-items: center; justify-content: center;
  width: 20px; height: 20px; border-radius: 9999px; background: #fff; box-shadow: 0 1px 3px rgb(0 0 0 / 0.25);
  font-size: 12px; line-height: 1;
}
.rm-thumb-country { display: none; }
.rm-thumb:hover { background: #fff; box-shadow: 0 4px 12px -4px rgb(0 0 0 / 0.25); transform: translateY(-2px); }
.rm-thumb:hover .rm-thumb-avatar { transform: scale(1.06); }
.rm-thumb:hover .rm-thumb-name { color: var(--primary-text); }
.rm-pin.rm-pin-hover { z-index: 200 !important; }
.rm-pin-hover .rm-pin-box { transform: translate(-50%, -50%) scale(1.3); filter: drop-shadow(0 6px 10px rgb(0 0 0 / 0.4)); }
.rm-pin-box { transition: transform 0.15s; }

/* Logo: the cycling cap and the name in black */
.rm-brand img.rm-brand-mark { display: block; padding: 0; background: none; object-fit: cover; box-shadow: 0 1px 4px rgb(0 0 0 / 0.2); }
.rm-brand-name, .rm-brand-name span { color: var(--foreground); }

/* Claim pages: the riders map behind, dimmed, and the card in front */
.cl-map { position: fixed; inset: 0; z-index: 0; }
.cl-dim { position: fixed; inset: 0; z-index: 1; background: rgb(17 24 39 / 0.38); backdrop-filter: blur(1.5px); -webkit-backdrop-filter: blur(1.5px); }
.cl { position: relative; z-index: 2; }
.cl-card { box-shadow: 0 24px 60px -16px rgb(0 0 0 / 0.55); }
.rb-pin {
  width: 30px; height: 30px; border-radius: 9999px; object-fit: cover;
  box-shadow: 0 0 0 2px #fff, 0 2px 6px rgb(0 0 0 / 0.35);
}
.rb-pin-road { box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--green), 0 2px 6px rgb(0 0 0 / 0.35); }

/* Rider map: a light circle marks the rider hovered in "riders in view", and
   stays around the selected rider, whose pin also stays a little larger */
.rm-pin-box::before {
  content: ""; position: absolute; inset: -5px; z-index: -1; border-radius: 9999px; pointer-events: none;
  background: rgb(52 199 89 / 0.2); box-shadow: 0 0 0 1.5px rgb(52 199 89 / 0.6);
  opacity: 0; transform: scale(0.6); transition: opacity 0.15s, transform 0.2s;
}
.rm-pin-hover .rm-pin-box::before, .rm-pin[data-selected] .rm-pin-box::before { opacity: 1; transform: none; }
.rm-pin[data-selected] .rm-pin-box { transform: translate(-50%, -50%) scale(1.15); }
.rm-pin.rm-pin-hover .rm-pin-box { transform: translate(-50%, -50%) scale(1.3); }

/* Claim pages: logo above the card (back to the map), "log in instead" note */
.cl { flex-direction: column; gap: 14px; }
.rm-brand.cl-brand { align-self: center; padding: 6px 14px 6px 6px; border-radius: 9999px; background: #fff; box-shadow: 0 6px 20px -6px rgb(0 0 0 / 0.45); }
.rm-brand.cl-brand:hover { box-shadow: 0 0 0 2px var(--primary), 0 6px 20px -6px rgb(0 0 0 / 0.45); }
.cl-existing { margin: 6px 0 0; padding: 8px 10px; border-radius: 10px; background: rgb(52 199 89 / 0.12); font-size: 13px; }
.cl-existing[hidden], .cl-card [hidden] { display: none; }

/* Rider card, liquid glass: frosted, saturated backdrop with a bright rim and
   a soft top sheen; bold sans name that links to the page; location chip and
   icon-only share on the name's line; bio sits under the status. */
.rm-drawer {
  padding: 16px; border-radius: 22px; border: 1px solid rgb(255 255 255 / 0.55);
  background:
    linear-gradient(160deg, rgb(255 255 255 / 0.62) 0%, rgb(255 255 255 / 0.38) 45%, rgb(255 255 255 / 0.5) 100%);
  backdrop-filter: blur(24px) saturate(190%) brightness(1.04); -webkit-backdrop-filter: blur(24px) saturate(190%) brightness(1.04);
  box-shadow:
    inset 0 1px 0 rgb(255 255 255 / 0.9), inset 0 -1px 0 rgb(255 255 255 / 0.25),
    inset 0 0 0 1px rgb(255 255 255 / 0.18),
    0 1px 2px rgb(0 0 0 / 0.06), 0 18px 40px -12px rgb(15 23 42 / 0.35);
  scrollbar-width: none;
}
.rm-drawer::before {
  content: ""; position: absolute; inset: 0 0 auto; height: 55%; border-radius: inherit; pointer-events: none;
  background: radial-gradient(120% 80% at 20% 0%, rgb(255 255 255 / 0.55), transparent 60%);
}
.rm-drawer .rm-card-body { position: relative; gap: 12px; }
.rm-drawer .rm-card-header { gap: 12px; }
.rm-drawer .rm-card-avatar { width: 52px; height: 52px; box-shadow: 0 0 0 2px rgb(255 255 255 / 0.9), 0 4px 12px rgb(0 0 0 / 0.18); }
.rm-drawer .rm-card-avatar-active { box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--green), 0 4px 12px rgb(0 0 0 / 0.18); }
.rm-drawer .rm-card-titles { display: flex; flex-direction: column; gap: 2px; padding-top: 2px; }

.rm-drawer .rm-card-name-row { gap: 10px; }
.rm-drawer a.rm-card-name {
  display: inline-flex; align-items: center; gap: 2px; flex: 0 1 auto; min-width: 0;
  font-family: var(--font-sans); font-size: 18px; font-weight: 800; letter-spacing: -0.02em; color: var(--foreground);
}
.rm-card-name-text { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rm-card-name svg { flex-shrink: 0; width: 18px; height: 18px; stroke-width: 2.5; transform: rotate(-90deg); opacity: 0.45; transition: transform 0.15s, opacity 0.15s; }
.rm-drawer a.rm-card-name:hover { color: var(--primary-text); }
.rm-drawer a.rm-card-name:hover .rm-card-name-text { text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 2px; }
.rm-drawer a.rm-card-name:hover svg { opacity: 1; transform: rotate(-90deg) translateY(2px); }

.rm-drawer .rm-card-actions { margin-left: auto; gap: 6px; }
.rm-card-here, .rm-drawer .rm-card-actions .rm-share-btn {
  display: inline-flex; align-items: center; justify-content: center; height: 30px; border-radius: 9999px;
  border: 1px solid rgb(255 255 255 / 0.7); background: rgb(255 255 255 / 0.55);
  box-shadow: inset 0 1px 0 rgb(255 255 255 / 0.9), 0 1px 3px rgb(0 0 0 / 0.08);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
}
.rm-card-here { gap: 3px; padding: 0 9px 0 7px; color: #fc4c02; cursor: default; }
.rm-card-here svg { width: 14px; height: 14px; stroke-width: 2.25; }
.rm-card-here-flag { font-size: 15px; line-height: 1; }
.rm-drawer .rm-card-actions .rm-share-btn { width: 30px; padding: 0; color: var(--foreground); }
.rm-drawer .rm-card-actions .rm-share-btn svg { width: 15px; height: 15px; }
.rm-drawer .rm-card-actions .rm-share-btn:hover { color: var(--primary-text); border-color: rgb(52 199 89 / 0.6); background: rgb(255 255 255 / 0.8); }
.rm-drawer .rm-card-actions .rm-act-label { display: none; }
.rm-drawer .rm-card-here[data-tip]:hover::after { left: auto; right: 0; transform: none; }

.rm-drawer .rm-card-line { margin-top: 0; font-size: 12px; font-weight: 500; letter-spacing: 0.01em; }
.rm-drawer .rm-on-road { color: #15803d; font-weight: 600; }
.rm-drawer .rm-card-bio { margin-top: 6px; font-size: 13px; color: oklch(0.36 0.02 60); }

.rm-drawer .rm-card-label { font-size: 10px; font-weight: 700; letter-spacing: 0.08em; }
.rm-drawer .rm-card-link {
  background: rgb(255 255 255 / 0.55); box-shadow: inset 0 1px 0 rgb(255 255 255 / 0.9), 0 0 0 1px rgb(255 255 255 / 0.7), 0 1px 3px rgb(0 0 0 / 0.08);
}
.rm-drawer .rm-card-link:hover { box-shadow: inset 0 1px 0 rgb(255 255 255 / 0.9), 0 0 0 1px var(--primary); }
.rm-drawer .rm-flag-bubble { border-color: rgb(255 255 255 / 0.9); background: rgb(255 255 255 / 0.6); }
.rm-drawer .rm-journey {
  padding: 8px 12px; border-radius: 12px; border: 1px solid rgb(255 255 255 / 0.6);
  background: rgb(255 255 255 / 0.45); transition: background 0.15s, transform 0.15s;
}
.rm-drawer .rm-journey:hover { background: rgb(255 255 255 / 0.75); transform: translateY(-1px); }
.rm-drawer .rm-journey-title { font-family: var(--font-sans); font-weight: 600; letter-spacing: -0.01em; }

@media (max-width: 1023px) {
  .rm-drawer { padding: 14px; border-radius: 20px; }
  .rm-preview .rm-card-avatar { width: 44px; height: 44px; }
  .rm-drawer .rm-preview a.rm-card-name { font-size: 16px; }
}
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .rm-drawer { background: rgb(255 255 255 / 0.94); }
}

/* Rider card, one size for every rider: the latest journey sits at the
   bottom, whatever the header holds above it. */
.rm-drawer { --rm-card-h: 304px; height: var(--rm-card-h); overflow: hidden; }
.rm-drawer > div, .rm-drawer .rm-card-body { height: 100%; }
.rm-drawer .rm-card-bio { -webkit-line-clamp: 2; }
.rm-card-journey { display: flex; flex-direction: column; gap: 6px; margin-top: auto; }
.rm-card-journey .rm-journey { gap: 2px; }
.rm-journey-empty { margin: 0; font-size: 13px; }
.rm-journey-flags { margin-top: 5px; padding-left: 4px; overflow: visible; }
.rm-journey-flags .rm-flag-bubble { width: 24px; height: 24px; font-size: 13px; }
.rm-flag-more { font: 700 10px var(--font-sans); }
/* Flags sit at the bottom of the card: their names show above them. */
.rm-journey-flags [data-tip]:hover::after { top: auto; bottom: calc(100% + 6px); }
.rm-card-journey .rm-more { display: inline-flex; align-items: center; gap: 2px; padding: 0; text-decoration: none; }
.rm-card-journey .rm-more svg { width: 14px; height: 14px; stroke-width: 2.5; transform: rotate(-90deg); }
.rm-card-journey .rm-more:hover { text-decoration: underline; }
@media (max-width: 1023px) {
  .rm-drawer { --rm-card-h: 226px; }
}

/* Dark liquid glass (the rider card): smoked, saturated glass with a light
   rim and white type, so it reads apart from the light search panel. */
.rm-glass-dark {
  --glass-fg: #fff; --glass-muted: rgb(255 255 255 / 0.68); --glass-chip: rgb(255 255 255 / 0.1); --glass-rim: rgb(255 255 255 / 0.16);
  color: var(--glass-fg); border-color: var(--glass-rim);
  background: linear-gradient(160deg, rgb(28 30 36 / 0.78) 0%, rgb(18 20 26 / 0.66) 50%, rgb(10 12 16 / 0.74) 100%);
  backdrop-filter: blur(24px) saturate(180%); -webkit-backdrop-filter: blur(24px) saturate(180%);
  box-shadow:
    inset 0 1px 0 rgb(255 255 255 / 0.22), inset 0 0 0 1px rgb(255 255 255 / 0.05),
    0 1px 2px rgb(0 0 0 / 0.2), 0 18px 40px -12px rgb(0 0 0 / 0.55);
}
.rm-glass-dark::before { background: radial-gradient(120% 80% at 20% 0%, rgb(255 255 255 / 0.12), transparent 60%); }
.rm-glass-dark a.rm-card-name, .rm-glass-dark .rm-journey-title { color: var(--glass-fg); }
.rm-glass-dark a.rm-card-name:hover, .rm-glass-dark .rm-journey:hover .rm-journey-title { color: #4ade80; }
.rm-glass-dark .rm-card-name svg { opacity: 0.6; }
.rm-glass-dark .rm-card-line, .rm-glass-dark .rm-card-label, .rm-glass-dark .rm-journey-meta,
.rm-glass-dark .rm-journey-empty { color: var(--glass-muted); }
.rm-glass-dark .rm-card-bio { color: rgb(255 255 255 / 0.8); }
.rm-glass-dark .rm-on-road { color: #4ade80; }
.rm-glass-dark .rm-card-avatar { box-shadow: 0 0 0 2px rgb(255 255 255 / 0.85), 0 4px 12px rgb(0 0 0 / 0.4); }
.rm-glass-dark .rm-card-avatar-active { box-shadow: 0 0 0 2px rgb(20 22 28), 0 0 0 4px var(--green), 0 4px 12px rgb(0 0 0 / 0.4); }
.rm-glass-dark .rm-card-here, .rm-glass-dark .rm-card-actions .rm-share-btn, .rm-glass-dark .rm-card-link {
  border: 1px solid var(--glass-rim); background: var(--glass-chip); color: var(--glass-fg);
  box-shadow: inset 0 1px 0 rgb(255 255 255 / 0.14);
}
.rm-glass-dark .rm-card-here { color: #ff7a3d; }
.rm-glass-dark .rm-card-actions .rm-share-btn:hover, .rm-glass-dark .rm-card-link:hover {
  color: #4ade80; border-color: rgb(74 222 128 / 0.6); background: rgb(255 255 255 / 0.16);
  box-shadow: inset 0 1px 0 rgb(255 255 255 / 0.14);
}
.rm-glass-dark .rm-journey { border: 1px solid var(--glass-rim); background: var(--glass-chip); }
.rm-glass-dark .rm-journey:hover { background: rgb(255 255 255 / 0.16); }
.rm-glass-dark .rm-flag-bubble { border-color: rgb(40 42 48); background: rgb(255 255 255 / 0.14); color: var(--glass-fg); }
.rm-glass-dark .rm-more { color: #4ade80; }
.rm-glass-dark .rm-share-pop { color: var(--foreground); }
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .rm-glass-dark { background: rgb(20 22 28 / 0.95); }
}

/* Rider card layout: avatar, name over "Riding in France 🇫🇷 · 3d ago", and a
   labelled Share as tall as those two lines; the bio full width below; then
   "Last journey … All N journeys" over the journey (title + status on one
   line). The whole card opens the rider's page. */
.rm-drawer { --rm-card-h: auto; height: auto; max-height: 70vh; cursor: pointer; }
.rm-drawer .rm-card-body { gap: 10px; }
.rm-drawer .rm-card-header { align-items: center; }
.rm-drawer .rm-card-titles { flex: 1; min-width: 0; padding-top: 0; }
.rm-card-line { display: flex; align-items: center; gap: 6px; }
.rm-card-line-text { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rm-drawer .rm-card-line { font-size: 13px; }
.rm-card-share { flex-shrink: 0; align-self: stretch; }
.rm-drawer .rm-card-share .rm-share-btn {
  height: 100%; min-height: 40px; padding: 0 14px; gap: 6px; border-radius: 14px;
  font-size: 13px; font-weight: 600; cursor: pointer;
}
.rm-drawer .rm-card-share .rm-share-btn svg { width: 16px; height: 16px; }
.rm-drawer .rm-card-share .rm-share-pop { left: auto; right: 0; }
.rm-glass-dark .rm-card-share .rm-share-btn {
  border: 1px solid var(--glass-rim); background: var(--glass-chip); color: var(--glass-fg);
  box-shadow: inset 0 1px 0 rgb(255 255 255 / 0.14);
}
.rm-glass-dark .rm-card-share .rm-share-btn:hover { color: #4ade80; border-color: rgb(74 222 128 / 0.6); background: rgb(255 255 255 / 0.16); }
.rm-drawer .rm-card-bio { margin: -2px 0 0; line-height: 1.45; -webkit-line-clamp: 3; }

.rm-card-journey { gap: 6px; margin-top: 2px; }
.rm-card-journey-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.rm-card-journey-head .rm-card-label { margin: 0; }
.rm-card-journey-head .rm-more { font-size: 12px; }
.rm-journey-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-width: 0; }
.rm-drawer .rm-journey { gap: 3px; padding: 10px 12px; }
.rm-drawer .rm-journey-title { flex: 1; font-size: 16px; font-weight: 700; line-height: 1.25; }
.rm-journey-status {
  flex-shrink: 0; padding: 2px 8px; border-radius: 9999px; font-size: 11px; font-weight: 700;
  letter-spacing: 0.02em; background: rgb(255 255 255 / 0.12); color: var(--glass-muted, var(--muted-foreground));
}
.rm-journey-status-ongoing { background: rgb(74 222 128 / 0.18); color: #4ade80; }
.rm-journey-status-planned { background: rgb(96 165 250 / 0.18); color: #93c5fd; }
@media (max-width: 1023px) {
  .rm-drawer { --rm-card-h: auto; }
  .rm-drawer .rm-preview .rm-card-label { display: block; }
}

/* Join / log-in modal: an intro on why to join (signed out), an animated
   banner, no step counter, and Next / Back buttons that move with you */
.rm-modal:has(.rm-wizard-intro), .rm-modal:has(.rm-login) { padding-top: 0; }
.rm-modal-close { z-index: 2; }
.rm-modal:has(.rm-wizard-intro) .rm-modal-close, .rm-modal:has(.rm-login) .rm-modal-close {
  background: rgb(255 255 255 / 0.7); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); border-radius: 9999px;
}
.rm-hero {
  position: relative; height: 150px; margin: 0 -24px 6px; overflow: hidden;
  border-radius: 0.75rem 0.75rem 0 0;
}
.rm-hero-sm { height: 110px; }
.rm-hero-art { position: absolute; inset: 0; width: 100%; height: 100%; stroke: none; }
.rm-hero-route { stroke: #fc4c02; stroke-dashoffset: 0; animation: rm-route 1.6s linear infinite; }
@keyframes rm-route { to { stroke-dashoffset: -26; } }
.rm-hero-sun { transform-origin: 330px 40px; animation: rm-sun 4s ease-in-out infinite; }
@keyframes rm-sun { 50% { transform: scale(1.12); } }
.rm-hero-pin {
  isolation: isolate;
  position: absolute; width: 40px; height: 40px; margin: -20px 0 0 -20px; padding: 3px; border-radius: 9999px;
  background: #fff; box-shadow: 0 0 0 2px var(--green), 0 6px 14px rgb(0 0 0 / 0.2);
  animation: rm-pin-in 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) calc(0.25s + var(--i) * 0.18s) both,
             rm-bob 3s ease-in-out calc(1s + var(--i) * 0.4s) infinite;
}
.rm-hero-pin::after {
  content: ""; position: absolute; left: 50%; bottom: -7px; width: 10px; height: 10px; margin-left: -5px;
  background: #fff; transform: rotate(45deg); box-shadow: 2px 2px 0 0 var(--green); z-index: -1;
}
.rm-hero-pin img { display: block; width: 100%; height: 100%; border-radius: 9999px; object-fit: cover; }
@keyframes rm-pin-in { from { opacity: 0; transform: translateY(-24px) scale(0.6); } }
@keyframes rm-bob { 50% { transform: translateY(-4px); } }

.rm-intro-title { margin: 6px 32px 0 0; font-size: 24px; font-weight: 800; letter-spacing: -0.02em; line-height: 1.15; }
.rm-intro-lead { margin: 0 0 6px; font-size: 14px; color: var(--muted-foreground); }
.rm-intro-lead strong { color: var(--foreground); }
.rm-perks { display: flex; flex-direction: column; gap: 8px; margin: 6px 0 0; padding: 0; list-style: none; }
.rm-perks li {
  display: flex; align-items: flex-start; gap: 12px; padding: 10px 12px; border-radius: 12px;
  background: var(--card); box-shadow: 0 0 0 1px var(--border);
  animation: rm-rise 0.4s ease-out both;
}
.rm-perks li:nth-child(2) { animation-delay: 0.08s; }
.rm-perks li:nth-child(3) { animation-delay: 0.16s; }
@keyframes rm-rise { from { opacity: 0; transform: translateY(8px); } }
.rm-perk-icon {
  display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; width: 34px; height: 34px;
  border-radius: 10px; background: rgb(52 199 89 / 0.12); font-size: 18px;
}
.rm-perks li > span:last-child { display: flex; flex-direction: column; gap: 1px; font-size: 13px; color: var(--muted-foreground); }
.rm-perks strong { font-size: 14px; color: var(--foreground); }
.rm-intro-login { margin: 4px 0 0; font-size: 13px; color: var(--muted-foreground); }
.rm-intro-login a { color: var(--primary-text); font-weight: 600; }

.rm-step h3 { margin-right: 32px; font-size: 18px; font-weight: 800; letter-spacing: -0.01em; }
.rm-step-forward { animation: rm-step-in-r 0.28s ease-out; }
.rm-step-backward { animation: rm-step-in-l 0.28s ease-out; }
@keyframes rm-step-in-r { from { opacity: 0; transform: translateX(24px); } }
@keyframes rm-step-in-l { from { opacity: 0; transform: translateX(-24px); } }

.rm-wizard-intro .rm-wizard-foot { margin-top: 12px; }
.rm-wizard-intro [data-wizard-target=next], .rm-login .rm-wizard-foot .rm-btn { flex: 1; min-height: 44px; font-size: 15px; }
.rm-login-head { margin-bottom: 4px; }

@media (prefers-reduced-motion: reduce) {
  .rm-hero *, .rm-hero-pin, .rm-perks li, .rm-step-forward, .rm-step-backward { animation: none !important; }
}

/* Journey page: title with its actions (share is just its icon), flags on the
   stops' line, the rider's tag on the map beside the last stop, and a
   teardrop button back to that stop. */
.jm-nav[hidden] { display: none; }
.rm-share-icon .rm-act-label { display: none; }
.rm-share-icon .rm-share-btn { justify-content: center; width: 32px; padding: 0; }
.rm-share-icon .rm-share-btn svg { width: 15px; height: 15px; }
.jm-nav-actions .rm-share-pop { left: auto; right: 0; }
.jm-stops-head { justify-content: flex-start; }
.jm-stops-head .jm-flags { flex: 1; min-width: 0; padding: 0 0 0 2px; }
.jm-stops-head .rm-flag-bubble { width: 24px; height: 24px; font-size: 13px; }
.jm-stops-head .jm-stops-actions { margin-left: auto; }

.jm-rider-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.2; }
.jm-rider-name, .jm-rider-place { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.jm-rider-place { font-size: 10.5px; font-weight: 500; color: var(--muted-foreground); }
.jm-rider-place:empty { display: none; }
.jm-rider-anchor { width: 0; height: 0; z-index: 2; }
.jm-rider-anchor .jm-rider { position: absolute; max-width: 190px; box-shadow: 0 0 0 1px var(--border), 0 4px 12px rgb(0 0 0 / 0.2); }
.jm-rider-anchor .jm-rider:hover { box-shadow: 0 0 0 2px var(--primary), 0 4px 12px rgb(0 0 0 / 0.2); }
/* The same offsets as sideRider() in the map controller. */
.jm-rider-anchor[data-side="right"] .jm-rider { left: 16px; top: -10px; transform: translateY(-50%); }
.jm-rider-anchor[data-side="left"] .jm-rider { right: 16px; top: -10px; transform: translateY(-50%); }
.jm-rider-anchor[data-side="top"] .jm-rider { left: 0; bottom: 34px; transform: translateX(-50%); }
.jm-rider-anchor[data-side="bottom"] .jm-rider { left: 0; top: 8px; transform: translateX(-50%); }

.jm-locate {
  position: absolute; right: 16px; bottom: 44px; z-index: 10; display: flex; justify-content: center; width: 48px; height: 56px;
  padding: 0; border: 0; background: none; cursor: pointer; filter: drop-shadow(0 6px 10px rgb(0 0 0 / 0.3)); transition: transform 0.12s;
}
.jm-locate:hover { transform: translateY(-2px); }
.jm-locate-pin {
  display: flex; align-items: center; justify-content: center; width: 44px; height: 44px; margin-top: 1px;
  border-radius: 50% 50% 0 50%; background: #2563eb; transform: rotate(45deg);
}
.jm-locate-avatar { width: 36px; height: 36px; border-radius: 9999px; object-fit: cover; background: #fff; transform: rotate(-45deg); }
.jm-locate-dot { width: 16px; height: 16px; }

@media (max-width: 1023px) {
  /* Just above the panel's top-right corner. */
  .jm-locate { right: var(--jm-panel-r, 12px); bottom: calc(12px + var(--jm-panel-h, 40dvh) + 8px); }
  .jm-links-form { right: 0; }
}

/* Visitors: one zone to click per stop — its line and the leg that leaves it. */
.jm-stops li.jm-visit { flex-direction: column; align-items: stretch; gap: 0; padding: 2px 4px; cursor: pointer; }
.jm-visit > .jm-stop-item { display: flex; align-items: center; gap: 5px; padding: 0; }
.jm-visit > .jm-leg { margin-left: 9px; }
.jm-visit .jm-stop-row { cursor: inherit; }
.jm-visit .jm-stop-row:hover { background: none; }
.jm-visit .jm-leg-km:hover { background: none; box-shadow: none; }
.jm-visit .jm-leg-km { cursor: inherit; }
.jm-stops li.jm-visit:hover { background: rgb(255 255 255 / 0.7); }
.jm-stops li.jm-visit.jm-row-active { background: rgb(52 199 89 / 0.12); }
.jm-visit.jm-row-active .jm-leg { border-left-style: solid; border-left-color: var(--primary); color: var(--foreground); }
.jm-visit:focus-visible { outline: 2px solid var(--ring); outline-offset: -2px; }
.jm-popup { z-index: 3; }
.jm-stop-tip { display: flex; flex-direction: column; gap: 2px; font-size: 13px; line-height: 1.3; }
.jm-stop-tip time { font-size: 12px; color: var(--muted-foreground); font-variant-numeric: tabular-nums; }

/* Journey page, top-right corner: the layers, then the play button and its
   timeline (the start at the top, the last stop at the bottom). */
.jm-corner { position: absolute; top: 16px; right: 16px; z-index: 10; display: flex; flex-direction: column; align-items: flex-end; gap: 8px; pointer-events: none; }
.jm-corner > * { pointer-events: auto; }
.jm-playbox { display: flex; flex-direction: column; align-items: center; gap: 10px; width: 44px; }
.jm-play {
  display: flex; align-items: center; justify-content: center; width: 44px; height: 44px; padding: 0; border: 0; border-radius: 9999px;
  background: rgb(255 255 255 / 0.9); color: var(--foreground); cursor: pointer; box-shadow: 0 10px 24px -8px rgb(0 0 0 / 0.4);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); transition: transform 0.12s, color 0.12s;
}
.jm-play:hover { transform: scale(1.06); color: #2563eb; }
.jm-play svg { width: 22px; height: 22px; }
.jm-play[aria-pressed="true"] { background: #2563eb; color: #fff; }
.jm-play[aria-pressed="true"] .jm-play-go, .jm-play[aria-pressed="false"] .jm-play-stop { display: none; }
.jm-timeline { position: relative; display: flex; justify-content: center; width: 44px; height: min(240px, 26dvh); }
.jm-timeline-rail {
  position: relative; width: 6px; height: 100%; border-radius: 9999px; background: rgb(255 255 255 / 0.95);
  box-shadow: 0 0 0 1px rgb(0 0 0 / 0.08), 0 4px 12px rgb(0 0 0 / 0.25); cursor: pointer; touch-action: none;
}
.jm-timeline-rail::before { content: ""; position: absolute; inset: -8px -19px; } /* easier to grab */
.jm-timeline-fill { position: absolute; top: 0; left: 0; right: 0; height: 0; border-radius: 9999px; background: #2563eb; }
.jm-timeline-stop {
  position: absolute; left: 50%; width: 10px; height: 10px; margin: -5px 0 0 -5px; border: 2px solid #9ca3af; border-radius: 9999px;
  background: #fff; pointer-events: none;
}
.jm-timeline-passed { border-color: #2563eb; }
.jm-play-marker { display: flex; justify-content: center; width: 48px; height: 56px; filter: drop-shadow(0 6px 10px rgb(0 0 0 / 0.35)); }
@media (max-width: 1023px) {
  .jm-corner { top: 12px; right: 12px; }
}

/* Journey panel header: status tag (top left), Share (top right) and the
   title — laid over the cover photo, a wide strip, when the journey has one. */
.jm-hero { display: flex; flex-direction: column; gap: 8px; }
.jm-hero-top { position: relative; z-index: 2; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.jm-status {
  display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 9999px; white-space: nowrap;
  font-size: 11px; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; line-height: 1.2;
}
.jm-status-ongoing { background: #16a34a; color: #fff; }
.jm-status-completed { background: #111827; color: #fff; }
.jm-status-planned { background: #f59e0b; color: #111827; }
.jm-status-dot { width: 7px; height: 7px; border-radius: 50%; background: #fff; animation: rm-pulse 2s infinite; }
.jm-hero-cover {
  position: relative; justify-content: space-between; min-height: 140px; margin: -14px -14px 0; padding: 10px 12px 10px 14px;
  background: #1f2937;
}
.jm-hero-photo { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
/* Darker at the bottom, under the title, and a touch at the top, under the tag and buttons. */
.jm-hero-cover::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(to top, rgb(0 0 0 / 0.78), rgb(0 0 0 / 0.08) 58%, rgb(0 0 0 / 0.3));
}
.jm-hero-cover .jm-status { box-shadow: 0 2px 8px rgb(0 0 0 / 0.35); }
.jm-hero-cover .jm-title {
  position: relative; z-index: 1; color: #fff; text-shadow: 0 1px 2px rgb(0 0 0 / 0.6), 0 2px 12px rgb(0 0 0 / 0.5);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.jm-hero-cover .rm-share-btn, .jm-hero-cover .rm-btn-outline { border-color: transparent; background: rgb(255 255 255 / 0.92); box-shadow: 0 2px 8px rgb(0 0 0 / 0.3); }
.jm-meta span:not([hidden]) ~ span:not([hidden])::before { content: "·"; margin: 0 6px; }
.jm-meta { gap: 0; font-variant-numeric: tabular-nums; }
@media (max-width: 1023px) {
  .jm-hero-cover { min-height: 104px; }
  .jm-hero-cover .jm-title { font-size: 19px; }
}

/* Journey form: cover photo */
.rm-cover-pick { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.rm-cover-preview { width: 150px; height: 60px; border-radius: 10px; object-fit: cover; background: var(--secondary); }
.rm-cover-preview.rm-cover-removed { opacity: 0.3; filter: grayscale(1); }
.rm-cover-remove { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted-foreground); cursor: pointer; }

/* Under the play button and as wide as it: the menu for how long the replay
   lasts (Auto · 10 s · 20 s). */
.jm-playbox { width: 44px; align-items: center; gap: 8px; }
.jm-play-speed {
  width: 44px; height: 26px; padding: 0; border: 0; border-radius: 9999px; background: rgb(255 255 255 / 0.92); color: var(--foreground);
  font: 600 11px/1 var(--font-sans); text-align: center; text-align-last: center; appearance: none; -webkit-appearance: none;
  box-shadow: 0 6px 18px -6px rgb(0 0 0 / 0.35); cursor: pointer;
}
.jm-timeline-fav { border-color: #e11d48; }
.jm-timeline-fav.jm-timeline-passed { border-color: #e11d48; background: #e11d48; }
/* While the journey plays, the last stop only shows its name; the pin joins it on arrival. */
.jm-rider-waiting .jm-rider { padding: 4px 10px; pointer-events: none; }
.jm-rider-waiting .jm-rider-avatar, .jm-rider-waiting .jm-rider-name { display: none; }
.jm-rider-waiting .jm-rider-place { font-size: 12px; font-weight: 600; color: var(--foreground); }
.jm-rider-arrived .jm-rider { animation: jm-arrive 0.45s cubic-bezier(0.2, 1.4, 0.4, 1); }
@keyframes jm-arrive { from { opacity: 0.4; scale: 0.7; } }
@media (prefers-reduced-motion: reduce) { .jm-rider-arrived .jm-rider { animation: none; } }

/* Map pages: a round button that widens to the left to show its label (back to the map, the account);
   hovered — or always, on wide screens, when expanded. */
.mc-pill {
  display: flex; align-items: center; justify-content: flex-end; height: 44px; min-width: 44px; padding: 0 11px;
  border-radius: 9999px; background: rgb(255 255 255 / 0.92); box-shadow: 0 10px 24px -8px rgb(0 0 0 / 0.4);
  color: var(--foreground); text-decoration: none; transition: color 0.12s;
}
.mc-pill svg { flex-shrink: 0; width: 22px; height: 22px; }
.mc-pill-label {
  max-width: 0; overflow: hidden; white-space: nowrap; opacity: 0; font: 600 13px/1 var(--font-sans);
  transition: max-width 0.22s ease, opacity 0.18s ease, margin 0.22s ease;
}
@media (hover: hover) {
  .mc-pill:hover, .mc-pill:focus-visible { color: var(--primary-text); }
  .mc-pill:hover .mc-pill-label, .mc-pill:focus-visible .mc-pill-label { max-width: 8rem; margin-right: 8px; opacity: 1; }
}

/* Replay: a rail thick enough to see and to drag. */
.jm-timeline { margin-top: 4px; }
.jm-timeline-rail { width: 12px; }
.jm-timeline-rail::before { inset: -10px -16px; }
.jm-timeline-stop { width: 16px; height: 16px; margin: -8px 0 0 -8px; border-width: 3px; }

/* Phones and tablets: the panel folds down to its header and its dates. */
.jm-grip { display: none; }
@media (max-width: 1023px) {
  .jm-timeline { height: min(180px, 21dvh); }
  .jm-hero { touch-action: none; cursor: grab; user-select: none; -webkit-user-select: none; }
  .jm-grip {
    display: block; position: absolute; top: 0; left: 50%; z-index: 3; width: 72px; height: 22px; padding: 0; border: 0;
    background: none; transform: translateX(-50%); cursor: pointer;
  }
  .jm-grip::before {
    content: ""; position: absolute; top: 7px; left: 50%; width: 40px; height: 5px; margin-left: -20px; border-radius: 9999px;
    background: rgb(0 0 0 / 0.22);
  }
  .jm-hero-cover .jm-grip::before { background: rgb(255 255 255 / 0.85); box-shadow: 0 1px 4px rgb(0 0 0 / 0.4); }
  .jm-hero:not(.jm-hero-cover) { position: relative; padding-top: 10px; }
  .jm-hero:not(.jm-hero-cover) .jm-grip { top: -10px; }
  .jm-panel-folded > :not(.jm-hero):not(.jm-meta) { display: none !important; }
}
/* ▶ becomes ↺ once the replay has reached the end. */
.jm-play-again { display: none; }
.jm-play[data-ended][aria-pressed="false"] .jm-play-go { display: none; }
.jm-play[data-ended][aria-pressed="false"] .jm-play-again { display: block; width: 20px; height: 20px; }

/* The rider — photo and name in a glass pill at the top of the map, in the
   middle: a tap brings the map to where they are now. (The teardrop that
   follows the line during a replay keeps its own shape.) */
.jm-locate {
  top: 12px; right: auto; bottom: auto; left: 50%; translate: -50% 0; align-items: center; gap: 8px;
  width: auto; max-width: calc(100% - 136px); height: 44px; padding: 4px 16px 4px 4px;
  border: 1px solid rgb(255 255 255 / 0.65); border-radius: 9999px; background: rgb(255 255 255 / 0.45);
  backdrop-filter: blur(18px) saturate(180%); -webkit-backdrop-filter: blur(18px) saturate(180%);
  box-shadow: inset 0 1px 0 rgb(255 255 255 / 0.85), inset 0 -1px 0 rgb(255 255 255 / 0.25), 0 10px 26px -10px rgb(0 0 0 / 0.45);
  filter: none; color: var(--foreground); font: 600 13px/1 var(--font-sans);
}
.jm-locate:hover { transform: none; background: rgb(255 255 255 / 0.62); }
.jm-locate:active { scale: 0.97; }
.jm-locate .jm-locate-pin {
  flex-shrink: 0; width: 34px; height: 34px; margin: 0; border-radius: 9999px; background: none; transform: none;
  box-shadow: 0 0 0 2px rgb(255 255 255 / 0.9), 0 2px 6px rgb(0 0 0 / 0.25);
}
.jm-locate .jm-locate-avatar { width: 34px; height: 34px; transform: none; }
.jm-locate .jm-locate-dot { width: 14px; height: 14px; background: #2563eb; }
.jm-locate-text { display: block; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }

@media (min-width: 1024px) {
  /* In the middle of what the panel leaves free. */
  .jm-locate { top: 16px; left: calc((100% + 16px + 24rem) / 2); max-width: 22rem; }
}

/* The rider's pill, lighter. */
.jm-locate { height: 34px; gap: 7px; padding: 3px 12px 3px 3px; font-size: 12.5px; max-width: calc(100% - 128px); }
.jm-locate .jm-locate-pin, .jm-locate .jm-locate-avatar { width: 26px; height: 26px; }
.jm-locate .jm-locate-pin { box-shadow: 0 0 0 1.5px rgb(255 255 255 / 0.9), 0 1px 4px rgb(0 0 0 / 0.25); }
@media (max-width: 1023px) {
  .jm-locate { top: 17px; } /* level with the 44px buttons either side */
}
@media (min-width: 1024px) {
  .jm-locate { top: 21px; max-width: 20rem; }
}

/* The rider's pill and, on desktop, their Instagram and Strava logos beside
   it (everywhere, the links are in the panel's Journey tab). */
.jm-top { display: contents; }
.jm-social { display: none; }
.jm-playing .jm-locate { display: none; } /* out of the way while the journey plays */
@media (min-width: 1024px) {
  .jm-top {
    position: absolute; top: 21px; left: calc((100% + 16px + 24rem) / 2); translate: -50% 0; z-index: 10;
    display: flex; align-items: center; gap: 6px; max-width: calc(100% - 24rem - 16px - 160px);
  }
  .jm-top .jm-locate { position: static; translate: none; min-width: 0; max-width: 20rem; }
  .jm-social {
    display: flex; align-items: center; justify-content: center; flex-shrink: 0; width: 34px; height: 34px; border-radius: 9999px;
    border: 1px solid rgb(255 255 255 / 0.65); background: rgb(255 255 255 / 0.45);
    backdrop-filter: blur(18px) saturate(180%); -webkit-backdrop-filter: blur(18px) saturate(180%);
    box-shadow: inset 0 1px 0 rgb(255 255 255 / 0.85), 0 10px 26px -10px rgb(0 0 0 / 0.45); transition: background 0.12s;
  }
  .jm-social:hover { background: rgb(255 255 255 / 0.75); }
  .jm-social:active { scale: 0.95; }
  .jm-social svg { width: 18px; height: 18px; }
  .jm-social.jm-link-instagram { color: #e1306c; }
  .jm-social.jm-link-strava { color: #fc4c02; }
}

/* Above ▶: the layers button and its menu — Map, Satellite, Terrain. */
.mc-layers { position: relative; }
.mc-layers-btn {
  display: flex; align-items: center; justify-content: center; width: 44px; height: 44px; border-radius: 9999px; list-style: none;
  background: rgb(255 255 255 / 0.9); color: var(--foreground); cursor: pointer; box-shadow: 0 10px 24px -8px rgb(0 0 0 / 0.4);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); transition: transform 0.12s, color 0.12s;
}
.mc-layers-btn::-webkit-details-marker { display: none; }
.mc-layers-btn:hover { transform: scale(1.06); color: #2563eb; }
.mc-layers[open] .mc-layers-btn { color: #2563eb; }
.mc-layers-btn svg { width: 22px; height: 22px; }
.mc-layers-menu {
  position: absolute; top: 0; right: calc(100% + 8px); display: flex; gap: 6px; padding: 6px; border-radius: 14px;
  background: rgb(255 255 255 / 0.95); box-shadow: 0 10px 30px -10px rgb(0 0 0 / 0.4);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
}
.mc-layer {
  display: flex; flex-direction: column; align-items: center; gap: 4px; width: 64px; padding: 4px; border: 0; border-radius: 10px;
  background: none; color: var(--foreground); font: 600 11px/1.2 var(--font-sans); cursor: pointer;
}
.mc-layer:hover { background: rgb(0 0 0 / 0.05); }
.mc-layer-swatch { width: 52px; height: 40px; border-radius: 8px; box-shadow: inset 0 0 0 1px rgb(0 0 0 / 0.1); }
.mc-layer[aria-checked="true"] { color: #2563eb; }
.mc-layer[aria-checked="true"] .mc-layer-swatch { box-shadow: 0 0 0 2px #2563eb; }
.mc-layer-map .mc-layer-swatch { background: linear-gradient(135deg, #f4f1ea 0 45%, #fde68a 45% 50%, #f4f1ea 50% 70%, #aad3df 70%); }
.mc-layer-satellite .mc-layer-swatch { background: radial-gradient(circle at 30% 35%, #6b7f4a, transparent 45%), radial-gradient(circle at 75% 70%, #8a7a5a, transparent 50%), linear-gradient(135deg, #3f5a36, #2c3e2a 60%, #1e3a5f); }
.mc-layer-terrain .mc-layer-swatch {
  background: repeating-radial-gradient(circle at 60% 55%, transparent 0 6px, rgb(150 110 70 / 0.45) 6px 7px), linear-gradient(135deg, #cfe3b4, #e8dcb5 55%, #d9c49b);
}

/* Journey panel: two tabs — Journey (the description, the links) and Stops
   (the list, then the countries). Only the tab's content scrolls. */
.jm-tabs { display: flex; gap: 2px; padding: 3px; border-radius: 10px; background: rgb(0 0 0 / 0.05); }
.jm-tab {
  flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 30px; padding: 0 10px;
  border: 0; border-radius: 8px; background: none; color: var(--muted-foreground); font: 600 13px/1 var(--font-sans); cursor: pointer;
}
.jm-tab:hover { color: var(--foreground); }
.jm-tab[aria-selected="true"] { background: #fff; color: var(--foreground); box-shadow: 0 1px 3px rgb(0 0 0 / 0.12); }
.jm-tab-count {
  min-width: 18px; padding: 2px 5px; border-radius: 9999px; background: rgb(0 0 0 / 0.07); font-size: 11px; font-variant-numeric: tabular-nums;
}
.jm-panel > .jm-tabpanel { flex: 1 1 auto; flex-shrink: 1; min-height: 0; display: flex; flex-direction: column; gap: 8px; }
.jm-panel > .jm-tabpanel[hidden] { display: none; }
.jm-info { overflow-y: auto; margin-right: -6px; padding-right: 6px; }
.jm-info > * { flex-shrink: 0; }
.jm-info .jm-description { margin: 0; font-size: 13.5px; line-height: 1.55; color: var(--foreground); white-space: pre-line; }
.jm-stops-panel > :not(.jm-stops) { flex-shrink: 0; }
.jm-stops-head:not(:has(:is(button, label, .rm-card-label):not([hidden]))) { display: none; } /* a visitor's, with nothing in it */

/* The links, in the Journey tab: a row each — the video's thumbnail, the network's logo for the others. */
.jm-info-links { display: flex; flex-direction: column; gap: 6px; }
.jm-info-links .jm-link { gap: 10px; padding: 6px; border-radius: 12px; background: rgb(255 255 255 / 0.7); box-shadow: 0 0 0 1px var(--border); backdrop-filter: none; }
.jm-info-links .jm-link:hover { box-shadow: 0 0 0 2px var(--primary); }
.jm-info-links .jm-thumb { width: 64px; height: 40px; border-radius: 8px; }
.jm-info-links .jm-thumb-icon svg { width: 20px; height: 20px; }
.jm-info-links .jm-thumb-video::after { width: 20px; height: 20px; font-size: 8px; }
.jm-info-links .jm-link-text { min-width: 0; font-size: 12.5px; }
.jm-info-links .jm-link-text > span { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.jm-info-links .jm-link-instagram .jm-thumb-icon, .jm-info-links .jm-link-instagram small { color: #e1306c; }
.jm-info-links .jm-link-strava .jm-thumb-icon, .jm-info-links .jm-link-strava small { color: #fc4c02; }
.jm-info-links .jm-link-youtube small { color: #dc2626; }
.jm-links-edit > summary { list-style: none; cursor: pointer; font-size: 13px; }
.jm-links-edit > summary::-webkit-details-marker { display: none; }

/* Below the stops: the countries' flags — a click frames the map on one, again on the whole journey. */
.jm-countries { display: flex; align-items: center; gap: 10px; padding-top: 8px; border-top: 1px solid var(--border); }
.jm-countries .jm-flags { flex: 1; min-width: 0; gap: 4px; padding: 0; }
.jm-flag { margin: 0; padding: 0; font-family: inherit; cursor: pointer; transition: transform 0.12s, box-shadow 0.12s; }
.jm-flag:hover { transform: scale(1.12); }
.jm-flag[aria-pressed="true"] { box-shadow: 0 0 0 2px var(--primary); }

/* The replay's speed, under ▶: ×1 → ×2 → ×3. */
button.jm-play-speed { font-variant-numeric: tabular-nums; }
/* Paused or over: × beside ▶ leaves the replay. */
.jm-playbox { position: relative; }
.jm-play-exit {
  position: absolute; top: 4px; right: calc(100% + 8px); display: flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; padding: 0; border: 0; border-radius: 9999px; background: rgb(255 255 255 / 0.9); color: var(--foreground);
  box-shadow: 0 10px 24px -8px rgb(0 0 0 / 0.4); cursor: pointer; transition: transform 0.12s, color 0.12s;
}
.jm-play-exit:hover { transform: scale(1.08); color: #dc2626; }
.jm-play-exit svg { width: 18px; height: 18px; stroke-width: 2.4; }

/* Header: the status and the distance on the left; the owner's cover button and Share on the right. */
.jm-hero-top { justify-content: flex-start; }
.jm-hero-top .jm-nav-actions { margin-left: auto; }
.jm-hero-km {
  padding: 4px 9px; border-radius: 9999px; background: rgb(0 0 0 / 0.4); color: #fff; white-space: nowrap;
  font-size: 11.5px; font-weight: 700; line-height: 1.2; font-variant-numeric: tabular-nums;
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
}
.jm-edit-cover {
  display: flex; align-items: center; justify-content: center; width: 32px; height: 32px; border-radius: 9999px;
  background: rgb(255 255 255 / 0.92); color: var(--foreground); box-shadow: 0 2px 8px rgb(0 0 0 / 0.3); transition: transform 0.12s;
}
.jm-edit-cover:hover { transform: scale(1.08); color: var(--primary-text); }
.jm-edit-cover svg { width: 16px; height: 16px; }
/* No photo: the drawn cover (the country the journey starts in). */
.jm-hero-art { display: block; }

/* About: the rider's networks, as small labelled icons. */
.jm-info-socials { display: flex; flex-wrap: wrap; gap: 6px; }
.jm-info-social {
  display: inline-flex; align-items: center; gap: 6px; padding: 5px 11px 5px 8px; border-radius: 9999px; color: var(--foreground);
  background: rgb(255 255 255 / 0.7); box-shadow: 0 0 0 1px var(--border); font-size: 12.5px; font-weight: 600; text-decoration: none;
}
.jm-info-social:hover { box-shadow: 0 0 0 2px var(--primary); }
.jm-info-social svg { width: 16px; height: 16px; }
.jm-info-social.jm-link-instagram svg { color: #e1306c; }
.jm-info-social.jm-link-strava svg { color: #fc4c02; }
.jm-info-social.jm-link-youtube svg { color: #dc2626; }


/* The countries: one line, scrolling sideways when there are many; each name shows in its own tip. */
.jm-countries .jm-flags {
  flex-wrap: nowrap; overflow-x: auto; overflow-y: hidden; gap: 4px; padding: 3px; margin: -3px 0;
  scrollbar-width: thin; scroll-snap-type: x proximity; overscroll-behavior-x: contain;
}
.jm-countries .jm-flag { scroll-snap-align: start; }
.jm-flag-tip {
  position: absolute; z-index: 60; translate: -50% -100%; padding: 3px 8px; border-radius: 6px; pointer-events: none;
  background: var(--foreground); color: #fff; font: 600 11px/1.4 var(--font-sans); white-space: nowrap;
}

/* Stops grouped by country: one aligned row each — flag, country, how many
   stops, and the dates (short) at the far right. */
.jm-group-head { display: grid; grid-template-columns: 10px 20px minmax(0, 1fr) 4.2rem 7.6rem; gap: 6px; }
.jm-group-name { min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.jm-group-range { font-size: 12px; text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.jm-group-dates {
  font-size: 12px; font-weight: 500; color: var(--muted-foreground); text-align: right; white-space: nowrap;
  font-variant-numeric: tabular-nums; overflow: hidden; text-overflow: ellipsis;
}
.jm-stops .jm-date { min-width: 4.4rem; text-align: right; }
.jm-stops li > .jm-group { flex: 1; min-width: 0; } /* as wide as the list, so the dates line up at its right edge */

/* A stop dropped on the map: "New stop" and ×, the place (the nearest town, filled in), the date (the list's calendar), Save. */
.jm-stop-form { gap: 8px; width: 15rem; }
.jm-stop-form-head { display: flex; align-items: center; justify-content: space-between; font-size: 13px; }
.jm-stop-form-close {
  display: flex; align-items: center; justify-content: center; width: 26px; height: 26px; padding: 0; border: 0; border-radius: 9999px;
  background: var(--secondary); color: var(--muted-foreground); cursor: pointer;
}
.jm-stop-form-close:hover { color: var(--foreground); background: rgb(0 0 0 / 0.08); }
.jm-stop-form-close svg { width: 14px; height: 14px; stroke-width: 2.4; }
.jm-stop-form-field { display: flex; flex-direction: column; gap: 3px; }
.jm-stop-form-field > span { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted-foreground); }
.jm-stop-form-date {
  display: flex; align-items: center; gap: 8px; height: 34px; padding: 0 10px; border: 1px solid var(--border); border-radius: 8px;
  background: #fff; color: var(--foreground); font: 500 13px/1 var(--font-sans); cursor: pointer; text-align: left;
}
.jm-stop-form-date:hover { border-color: var(--primary); }
.jm-stop-form-date svg { width: 15px; height: 15px; color: var(--muted-foreground); }
.jm-stop-form-save { align-self: stretch; justify-content: center; }

/* ▶ while the map's tiles along the way load: a spinning ring. */
.jm-play[data-loading] svg { visibility: hidden; }
.jm-play[data-loading]::after {
  content: ""; position: absolute; width: 20px; height: 20px; border: 2.5px solid currentColor; border-right-color: transparent;
  border-radius: 9999px; animation: jm-spin 0.8s linear infinite;
}
.jm-play { position: relative; }
@keyframes jm-spin { to { transform: rotate(360deg); } }
/* The timeline shown ahead of the replay (▶ hovered): lighter until it plays. */
.jm-timeline-peek { opacity: 0.85; }

.jm-about-add { font-size: 13px; font-weight: 600; color: var(--primary-text); text-decoration: none; }
.jm-about-add:hover { text-decoration: underline; }

/* The links form: two groups (this journey · your networks), a network's logo on each field. */
.jm-links-toggle { display: inline-flex; align-items: center; gap: 6px; color: var(--primary-text); font-weight: 600; }
.jm-links-toggle svg { width: 15px; height: 15px; }
.jm-links-edit[open] > .jm-links-toggle { display: none; }
.jm-links-form { gap: 12px; margin-top: 0; padding: 12px; }
.jm-links-group { display: flex; flex-direction: column; gap: 6px; min-width: 0; margin: 0; padding: 0; border: 0; }
.jm-links-group legend { padding: 0 0 4px; font-size: 12px; font-weight: 700; }
.jm-links-group legend small { display: block; font-weight: 500; color: var(--muted-foreground); }
.jm-links-group:disabled { opacity: 0.5; }
.jm-links-field { display: grid; grid-template-columns: 28px minmax(0, 1fr); grid-template-rows: auto auto; column-gap: 8px; align-items: center; }
.jm-links-icon {
  grid-row: span 2; display: flex; align-items: center; justify-content: center; width: 28px; height: 28px; border-radius: 8px;
  background: var(--secondary); color: var(--muted-foreground);
}
.jm-links-icon svg { width: 15px; height: 15px; }
.jm-links-name { font-size: 11px; font-weight: 600; color: var(--muted-foreground); }
.jm-links-video .jm-links-icon, .jm-links-youtube .jm-links-icon { color: #dc2626; }
.jm-links-fundraiser .jm-links-icon { color: #e11d48; }
.jm-links-instagram .jm-links-icon { color: #e1306c; }
.jm-links-strava .jm-links-icon { color: #fc4c02; }
.jm-links-actions { display: flex; justify-content: flex-end; gap: 6px; }
.jm-links-form .jm-links-actions .rm-btn { align-self: auto; }

/* The layers menu: the three looks, then the 3D switch across them. */
.mc-layers-menu { flex-wrap: wrap; width: max-content; max-width: 222px; }
.mc-switch-row {
  flex-basis: 100%; display: flex; align-items: center; gap: 8px; padding: 6px 6px 4px; border: 0; border-top: 1px solid var(--border);
  background: none; color: var(--foreground); font: 600 12px/1 var(--font-sans); cursor: pointer;
}
.mc-switch-icon {
  display: flex; align-items: center; justify-content: center; width: 26px; height: 20px; border-radius: 6px;
  background: var(--secondary); font-size: 10px; font-weight: 800; letter-spacing: 0.02em;
}
.mc-switch {
  position: relative; width: 30px; height: 18px; margin-left: auto; border-radius: 9999px; background: rgb(0 0 0 / 0.18); transition: background 0.15s;
}
.mc-switch::after {
  content: ""; position: absolute; top: 2px; left: 2px; width: 14px; height: 14px; border-radius: 9999px; background: #fff;
  box-shadow: 0 1px 2px rgb(0 0 0 / 0.3); transition: transform 0.15s;
}
.mc-switch-row[aria-checked="true"] .mc-switch { background: #2563eb; }
.mc-switch-row[aria-checked="true"] .mc-switch::after { transform: translateX(12px); }
.mc-switch-row[aria-checked="true"] .mc-switch-icon { background: #2563eb; color: #fff; }

/* About: room around its content, so the rings of its buttons aren't cut by the scrolling edge. */
.jm-info { gap: 12px; margin: -4px -10px 0 -4px; padding: 4px 10px 8px 4px; }
/* When: start, end, how long — three small tiles. */
.jm-about-dates { display: grid; grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); gap: 6px; margin: 0; }
.jm-about-dates > div { padding: 8px 10px; border-radius: 10px; background: rgb(255 255 255 / 0.6); box-shadow: 0 0 0 1px var(--border); }
.jm-about-dates dt { font-size: 10.5px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted-foreground); }
.jm-about-dates dd { margin: 2px 0 0; font-size: 13px; font-weight: 600; white-space: nowrap; font-variant-numeric: tabular-nums; }
/* The video: its whole thumbnail (16:9), ▶ in the middle, the title over the bottom-left corner. */
.jm-video {
  position: relative; display: block; aspect-ratio: 16 / 9; overflow: hidden; border-radius: 12px; background: #111827; color: #fff;
  text-decoration: none; box-shadow: 0 6px 18px -8px rgb(0 0 0 / 0.5);
}
.jm-video-thumb { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform 0.3s; }
.jm-video:hover .jm-video-thumb { transform: scale(1.03); }
.jm-video::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to top, rgb(0 0 0 / 0.75), transparent 55%); }
.jm-video-play {
  position: absolute; top: 50%; left: 50%; z-index: 1; display: flex; align-items: center; justify-content: center; width: 52px; height: 36px;
  border-radius: 10px; background: #ff0000; translate: -50% -50%; box-shadow: 0 4px 12px rgb(0 0 0 / 0.35);
}
.jm-video-play svg { width: 20px; height: 20px; fill: #fff; stroke: none; }
.jm-video-title {
  position: absolute; left: 12px; right: 12px; bottom: 10px; z-index: 1; display: flex; flex-direction: column; gap: 2px;
  font-size: 13.5px; font-weight: 700; line-height: 1.3; text-shadow: 0 1px 3px rgb(0 0 0 / 0.6);
}
.jm-video-title > span { overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.jm-video-title small { display: flex; align-items: center; gap: 4px; font-size: 11px; font-weight: 600; opacity: 0.9; }
.jm-video-title small svg { width: 13px; height: 13px; }


/* The riders' gallery: everyone on the map, a community of adventurers. */
.rg { max-width: 64rem; min-height: 100%; margin: 0 auto; padding: 16px 16px 48px; display: flex; flex-direction: column; gap: 18px; }
body:has(.rg) { overflow-y: auto; background: linear-gradient(oklch(0.95 0.03 150), var(--background) 360px); }
.rg-nav { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.rg-head { display: flex; flex-direction: column; gap: 6px; }
.rg-head h1 { margin: 0; font-family: var(--font-serif); font-size: 34px; line-height: 1.1; }
.rg-head p { margin: 0; color: var(--muted-foreground); font-size: 14px; }
.rg-riding { display: inline-flex; align-items: center; gap: 6px; color: var(--green, #16a34a); font-weight: 600; }
.rg-filter { align-self: flex-start; margin-top: 6px; }
.rg-filter a {
  display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 8px; color: var(--muted-foreground);
  font-size: 13px; font-weight: 600; text-decoration: none;
}
.rg-filter a[aria-current] { background: #fff; color: var(--foreground); box-shadow: 0 1px 3px rgb(0 0 0 / 0.12); }
.rg-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(13.5rem, 1fr)); gap: 14px; margin: 0; padding: 0; list-style: none; }
.rg-card {
  position: relative; display: flex; flex-direction: column; align-items: center; gap: 4px; height: 100%; padding: 0 14px 14px;
  overflow: hidden; border-radius: 18px; background: rgb(255 255 255 / 0.9); color: var(--foreground); text-align: center;
  text-decoration: none; box-shadow: 0 0 0 1px rgb(0 0 0 / 0.05), 0 12px 28px -16px rgb(0 0 0 / 0.35);
  transition: transform 0.15s, box-shadow 0.15s;
}
.rg-card:hover { transform: translateY(-3px); box-shadow: 0 0 0 2px var(--primary), 0 18px 34px -16px rgb(0 0 0 / 0.4); }
.rg-band {
  align-self: stretch; height: 64px; margin: 0 -14px; flex-shrink: 0;
  background: linear-gradient(135deg, color-mix(in oklch, var(--rg-tint, #34c759) 70%, white), color-mix(in oklch, var(--rg-tint, #34c759) 85%, black));
}
.rg-card-road .rg-band { background: linear-gradient(135deg, #44d870, #17904a); }
.rg-avatar { margin-top: -38px; padding: 4px; border-radius: 9999px; background: #fff; box-shadow: 0 4px 12px rgb(0 0 0 / 0.18); }
.rg-card-road .rg-avatar { box-shadow: 0 0 0 3px var(--green, #16a34a), 0 4px 12px rgb(0 0 0 / 0.18); }
.rg-avatar-img { display: block; width: 72px; height: 72px; border-radius: 9999px; object-fit: cover; background: #fff; }
.rg-name { margin-top: 6px; font-size: 16px; font-weight: 700; line-height: 1.25; }
.rg-status { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--muted-foreground); }
.rg-status.rm-on-road { color: var(--green, #16a34a); font-weight: 600; }
.rg-place { font-size: 12.5px; color: var(--muted-foreground); }
.rg-foot { display: flex; align-items: center; justify-content: center; gap: 8px; flex-wrap: wrap; margin-top: auto; padding-top: 8px; }
.rg-flags { font-size: 15px; letter-spacing: 2px; }
.rg-journeys { padding: 3px 9px; border-radius: 9999px; background: var(--secondary); font-size: 11.5px; font-weight: 600; }
.rg-join {
  display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 22px; border-radius: 18px; text-align: center;
  background: linear-gradient(135deg, #44d870, #17904a); color: #fff;
}
.rg-join strong { font-family: var(--font-serif); font-size: 22px; }
.rg-join .rm-btn { background: #fff; color: #17904a; }
@media (max-width: 639px) {
  .rg-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .rg-avatar-img { width: 60px; height: 60px; }
  .rg-head h1 { font-size: 28px; }
}

/* The search bar, in WeBikepack's colours: white, a soft green edge, green when in use. */
.rm-searchbar {
  border: 1px solid rgb(52 199 89 / 0.28); background: #fff;
  box-shadow: inset 0 1px 2px rgb(0 0 0 / 0.04), 0 1px 0 rgb(255 255 255 / 0.8);
}
.rm-searchbar:focus-within { border-color: var(--primary); box-shadow: 0 0 0 3px rgb(52 199 89 / 0.18); }
.rm-country-btn { background: rgb(52 199 89 / 0.1); color: #17904a; }
.rm-country-btn:hover, .rm-country-btn[aria-expanded="true"] { background: rgb(52 199 89 / 0.18); color: #17904a; }
.rm-segment button[aria-checked="true"] { color: #17904a; }
.rm-scope-select { background-color: rgb(52 199 89 / 0.12); color: #17904a; box-shadow: none; }

/* Riders in view: "View all" — the gallery of every rider. */
.rm-strip-head { gap: 8px; }
.rm-strip-all { margin-left: auto; font-size: 12px; font-weight: 700; color: var(--primary-text); text-decoration: none; white-space: nowrap; }
.rm-strip-all:hover { text-decoration: underline; }
.rm-strip-all + .rm-strip-nav { margin-left: 2px; }

/* Phones and tablets: as on a journey — the riders in view docked at the bottom, the map's buttons just above them
   (bottom-right), the account and the layers under the panel (right). */
@media (max-width: 1023px) {
  .rm-left .rm-panel { backdrop-filter: none; -webkit-backdrop-filter: none; background: rgb(255 255 255 / 0.94); }
  .rm-strip {
    position: fixed; left: 12px; right: 12px; bottom: max(12px, env(safe-area-inset-bottom)); z-index: 20;
    padding: 6px 8px; border: 1px solid rgb(255 255 255 / 0.7); border-radius: 14px;
    background: rgb(255 255 255 / 0.88); box-shadow: 0 10px 30px -10px rgb(0 0 0 / 0.3);
  }
  .rm-strip-nav { display: none; }
  .rm:has(.rm-drawer-open) .rm-strip { display: none; }
  .rm-topright { right: 12px; top: calc(var(--panel-bottom, 140px) + 8px); } /* under the panel, which spans the width */
  .rm .mc-buttons { right: 12px; bottom: calc(var(--bottom-inset, 0px) + 12px); }
}
.rm-brand-name span { color: #17904a; }
@media (max-width: 1023px) { .jm-panel-dragging { transition: none; user-select: none; -webkit-user-select: none; } }

/* Map controls shared by every map page (shared/_map_pill, _map_layers, _map_buttons): one design everywhere. */
.mc-btn {
  display: flex; align-items: center; justify-content: center; width: 40px; height: 40px; padding: 0; border: 0; border-radius: 9999px;
  background: rgb(255 255 255 / 0.94); color: var(--foreground); box-shadow: 0 8px 20px -8px rgb(0 0 0 / 0.45);
  cursor: pointer; list-style: none; transition: transform 0.12s, color 0.12s;
}
.mc-btn::-webkit-details-marker { display: none; }
.mc-btn:hover { color: #2563eb; transform: scale(1.06); }
.mc-btn:focus-visible { outline: 2px solid var(--ring); outline-offset: 2px; }
.mc-btn svg { width: 20px; height: 20px; }
.mc-layers-btn { width: 44px; height: 44px; } /* the right-hand column's size, as ▶ and the pill */
.mc-layers-btn svg { width: 22px; height: 22px; }
.mc-pill { height: 44px; }
/* The account (the rider map): widened on wide screens — the rider's photo, their name on its left; or "Join the map". */
.mc-pill-avatar { width: 30px; height: 30px; margin-right: -4px; flex-shrink: 0; border-radius: 9999px; object-fit: cover; box-shadow: 0 0 0 2px #fff; }
.mc-pill-cta { background: var(--primary); color: #fff; box-shadow: 0 8px 20px -6px rgb(52 199 89 / 0.6); }
@media (hover: hover) { .mc-pill-cta:hover, .mc-pill-cta:focus-visible { color: #fff; background: #2db14e; } }
@media (min-width: 1024px) {
  .mc-pill-expanded .mc-pill-label { max-width: 14rem; margin-right: 8px; opacity: 1; text-overflow: ellipsis; }
  .mc-pill-expanded { padding-left: 16px; }
}

/* Bottom-right: + and −, my location. */
.mc-buttons { position: absolute; right: 16px; bottom: 16px; z-index: 10; display: flex; flex-direction: column; align-items: flex-end; gap: 8px; }
.mc-credit-esri { display: none; }
[data-basemap="satellite"] .mc-credit-esri { display: inline; } /* Esri's photos, credited while shown */
@media (max-width: 1023px) {
  .jm .mc-buttons { right: 12px; bottom: calc(12px + var(--jm-panel-h, 0px) + 8px); } /* above the journey's panel */
}

/* Rider map, desktop: one line at the top — the logo, the search bar, All / Riding floating on its right; the name
   at the top right, beside the account. At the bottom, the riders in view float over a fade (not part of the map);
   a selected rider's card opens on the left of that line, the gallery carrying on beside it. */
.rm-topright-row { display: flex; align-items: center; gap: 8px; }
.rm-brand-side { display: none; }
.rm-bottom { display: contents; } /* phones and tablets: the card and the riders dock on their own */
@media (min-width: 1024px) {
  .rm-left { right: auto; max-width: none; }
  .rm-left .rm-panel {
    flex-direction: row; align-items: center; gap: 10px; padding: 0; border: 0; border-radius: 0;
    background: none; box-shadow: none; backdrop-filter: none; -webkit-backdrop-filter: none;
  }
  .rm-panel .rm-brand { align-self: center; padding: 0; }
  .rm-panel .rm-brand-name { display: none; }
  .rm-panel .rm-brand-mark { width: 44px; height: 44px; border-radius: 13px; box-shadow: 0 8px 20px -8px rgb(0 0 0 / 0.45); }
  .rm-searchbar { width: 26rem; height: 44px; box-shadow: 0 10px 24px -10px rgb(0 0 0 / 0.4); }
  .rm-searchbar:focus-within { box-shadow: 0 0 0 3px rgb(52 199 89 / 0.18), 0 10px 24px -10px rgb(0 0 0 / 0.4); }
  .rm-panel > .rm-segment {
    align-items: center; height: 44px; padding: 4px; border-radius: 9999px;
    background: rgb(255 255 255 / 0.94); box-shadow: 0 10px 24px -10px rgb(0 0 0 / 0.4);
  }
  .rm-panel > .rm-segment button { height: 36px; padding: 0 14px; border-radius: 9999px; }
  .rm-panel > .rm-segment button[aria-checked="true"] { background: rgb(52 199 89 / 0.14); box-shadow: none; }

  .rm-brand-side {
    display: inline-flex; align-items: center; height: 44px; padding: 0 16px; border-radius: 9999px;
    background: rgb(255 255 255 / 0.92); box-shadow: 0 10px 24px -8px rgb(0 0 0 / 0.4);
  }
  .rm-brand-side .rm-brand-name { font-size: 18px; }

  .rm-bottom {
    position: absolute; left: 0; right: 0; bottom: 0; z-index: 10; display: flex; align-items: flex-end; gap: 12px;
    padding: 72px 72px 16px 16px; pointer-events: none;
  }
  .rm-bottom > * { pointer-events: auto; }
  /* The fade: darker at the bottom edge, gone at the top — a shelf the riders sit on, over the map. */
  .rm-bottom::before {
    content: ""; position: absolute; inset: auto 0 0; height: 220px; z-index: -1; pointer-events: none;
    background: linear-gradient(to top, rgb(12 14 18 / 0.58), rgb(12 14 18 / 0.28) 50%, rgb(12 14 18 / 0));
  }
  .rm-bottom .rm-drawer { flex: 0 0 28rem; transform: translateY(8px); }
  .rm-bottom .rm-drawer.rm-drawer-open { transform: none; }

  .rm-bottom .rm-strip { flex: 1; min-width: 0; padding: 0; border: 0; }
  .rm-bottom .rm-strip-head { padding: 0 4px 2px; }
  .rm-bottom .rm-strip-head .rm-card-label { color: rgb(255 255 255 / 0.85); text-shadow: 0 1px 2px rgb(0 0 0 / 0.4); }
  .rm-bottom .rm-strip-all { color: #4ade80; }
  .rm-bottom .rm-strip-nav .rm-icon-btn { width: 28px; height: 28px; border-radius: 9999px; color: #fff; background: rgb(255 255 255 / 0.14); }
  .rm-bottom .rm-strip-nav .rm-icon-btn:hover { background: rgb(255 255 255 / 0.26); }
  .rm-bottom .rm-strip-empty { color: rgb(255 255 255 / 0.75); }
  .rm-bottom .rm-strip-list { flex-wrap: nowrap; gap: 6px; }
  .rm-bottom .rm-thumb { flex-basis: 84px; padding: 10px 4px 8px; }
  .rm-bottom .rm-thumb-avatar { width: 56px; height: 56px; }
  .rm-bottom .rm-thumb-img { font-size: 24px; }
  .rm-bottom .rm-thumb-name { font-size: 12.5px; color: #fff; text-shadow: 0 1px 3px rgb(0 0 0 / 0.55); }
  .rm-bottom .rm-thumb:hover { background: rgb(255 255 255 / 0.14); box-shadow: none; }
  .rm-bottom .rm-thumb:hover .rm-thumb-name { color: #4ade80; }
}

/* Places: the pin form (rider_places/_form, pin-form controller) */
.pf-search .rm-place-list { z-index: 5; }
.pf-option { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; }
.pf-option-emoji { font-size: 18px; line-height: 1; }
.pf-option-text { display: flex; flex-direction: column; min-width: 0; }
.pf-option-text strong { overflow: hidden; font-size: 14px; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.pf-option-text small { overflow: hidden; font-size: 12px; color: var(--muted-foreground); text-overflow: ellipsis; white-space: nowrap; }
.pf-option-ours .pf-option-text small { color: var(--primary-text); font-weight: 600; }
.pf-map { height: 200px; margin-top: 8px; border: 1px solid var(--border); border-radius: 12px; overflow: hidden; cursor: crosshair; }
.pf-map-hint { margin: 4px 0 0; font-size: 12px; }
.pf-marker {
  width: 26px; height: 26px; border: 3px solid #fff; border-radius: 50% 50% 50% 0; background: var(--primary);
  transform: rotate(-45deg); box-shadow: 0 3px 8px rgb(0 0 0 / 0.35); cursor: grab;
}
.pf-nearby { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.pf-nearby .rm-hint { flex-basis: 100%; margin: 0; }
.pf-nearby-option, .pf-cat span {
  display: inline-block; padding: 5px 10px; border: 1px solid var(--border); border-radius: 999px;
  background: var(--card); font-size: 13px; cursor: pointer;
}
.pf-nearby-option:hover { border-color: var(--primary); }
.pf-cats { display: flex; flex-wrap: wrap; gap: 6px; }
.pf-cat { position: relative; }
.pf-cat input { position: absolute; opacity: 0; }
.pf-cat input:checked + span { border-color: var(--cat); background: color-mix(in oklch, var(--cat) 14%, white); font-weight: 600; }
.pf-cat input:focus-visible + span { outline: 2px solid var(--ring); outline-offset: 1px; }
.pf-place, .pf-reused {
  display: flex; align-items: center; gap: 12px; margin-top: 8px; padding: 10px 12px;
  border: 1px solid var(--border); border-radius: 12px; background: var(--card);
}
.pf-place-emoji {
  display: grid; place-items: center; flex-shrink: 0; width: 36px; height: 36px; border-radius: 50%;
  background: color-mix(in oklch, var(--cat, #6b7280) 18%, white); font-size: 18px;
}
.pf-place-text { display: flex; flex: 1; flex-direction: column; min-width: 0; }
.pf-place-text small { font-size: 12px; color: var(--muted-foreground); }
.pf-status { margin-top: 14px; }
.pf-when { display: flex; flex-direction: column; gap: 6px; }
.pf-month { max-width: 200px; }
.pf-share { display: flex; align-items: flex-start; gap: 10px; margin-top: 14px; cursor: pointer; }
.pf-share input { flex-shrink: 0; width: 18px; height: 18px; margin: 2px 0 0; accent-color: var(--primary); }
.pf-share-text { display: flex; flex-direction: column; gap: 2px; font-size: 14px; }
.pf-share-text small { font-size: 12px; color: var(--muted-foreground); }
.pf-more { margin-top: 12px; }
.pf-more summary { color: var(--primary-text); font-size: 14px; font-weight: 600; cursor: pointer; }
.pf-more[open] { display: flex; flex-direction: column; gap: 6px; }

/* Places: a rider's places on their map (riders/_places): category chips, scrolled sideways on phones */
.rp-places-chips { display: flex; gap: 6px; margin: 0 0 10px; }
.rp-chip {
  flex-shrink: 0; padding: 4px 10px; border: 1px solid var(--border); border-radius: 999px; background: var(--card);
  font-size: 13px; white-space: nowrap; cursor: pointer;
}
.rp-chip span { margin-left: 2px; font-weight: 700; color: var(--muted-foreground); }
.rp-chip[aria-pressed="true"] { border-color: var(--foreground); background: var(--foreground); color: var(--background); font-weight: 600; }
.rp-chip[aria-pressed="true"] span { color: inherit; }
.rp-places-empty { margin: 0 0 10px; }
@media (max-width: 640px) {
  .rp-places-chips {
    margin-inline: -18px; padding: 0 18px 2px; overflow-x: auto; scrollbar-width: none; scroll-snap-type: x proximity;
  }
  .rp-places-chips::-webkit-scrollbar { display: none; }
  .rp-chip { scroll-snap-align: start; }
}
.rp-position .rp-card-head { flex-wrap: wrap; align-items: center; }
.rp-position .rp-card-head h2 { flex: 1 1 auto; }

/* Places: a place's card (places/show, in the modal) */
.pc { display: flex; flex-direction: column; gap: 10px; }
.pc-head { display: flex; align-items: center; gap: 12px; margin-right: 32px; }
.pc-head h2 { margin: 0; font-family: var(--font-serif); font-size: 22px; font-weight: 600; }
.pc-emoji { width: 44px; height: 44px; font-size: 22px; }
.pc-meta { margin: 2px 0 0; font-size: 13px; color: var(--muted-foreground); }
.pc-fresh { margin: 0; font-size: 14px; }
.pc-stale { color: var(--muted-foreground); }
.pc-stale-tag { margin-left: 6px; padding: 1px 8px; border-radius: 999px; background: #f9eeda; color: #8a5a00; font-size: 12px; font-weight: 600; }
.pc-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.pc-pins { display: flex; flex-direction: column; gap: 12px; margin: 6px 0 0; padding: 12px 0 0; border-top: 1px solid var(--border); list-style: none; }
.pc-pin { display: flex; flex-direction: column; gap: 3px; }
.pc-rider { display: flex; align-items: center; gap: 8px; color: inherit; font-size: 14px; font-weight: 600; text-decoration: none; }
.pc-avatar { width: 26px; height: 26px; border-radius: 50%; object-fit: cover; }
.pc-pin-status { margin-left: 34px; font-size: 12px; color: var(--muted-foreground); }
.pc-note { margin: 0 0 0 34px; font-size: 14px; }
.pc-link { margin-left: 34px; color: var(--primary-text); font-size: 13px; }

/* Admin: places */
.ad-sub { display: block; font-size: 12px; color: var(--muted-foreground); }
.ad-note { max-width: 360px; font-size: 13px; color: var(--muted-foreground); }
.ad-row-hidden td { opacity: 0.55; }
@media (max-width: 640px) {
  .pf-map { height: 150px; }
}

/* ---------------------------------------------------------------------------------------------------------------
   Rider map top bar, design system v2 ("Trail" palette above): every control a 44px rounded square (12px corners),
   white on the map, ink icons, pine when active. Left: logo · filter · a compact search that widens when in use.
   Right: the WeBikepack name · Join the map. All / Riding now sits above the riders' gallery.
   --------------------------------------------------------------------------------------------------------------- */
.mc-btn, .mc-pill, .mc-layers-btn { border-radius: var(--radius-ctrl); box-shadow: var(--shadow-ctrl); color: var(--ink); }
.mc-btn:hover { color: var(--pine); transform: translateY(-1px); }
.mc-pill-cta { background: var(--pine); color: #fff; box-shadow: 0 8px 20px -8px rgb(31 122 76 / 0.7); }
@media (hover: hover) { .mc-pill-cta:hover, .mc-pill-cta:focus-visible { color: #fff; background: var(--pine-strong); } }
.mc-pill-avatar { border-radius: 8px; }
.rm-brand-name span { color: var(--pine); }
.rm-brand-mark { box-shadow: 0 2px 6px rgb(31 122 76 / 0.4); }

.rm-tools { position: relative; display: flex; align-items: center; gap: 8px; min-width: 0; }
.rm-tools .rm-picker { flex-shrink: 0; position: static; }
.rm-tools .rm-popover { left: 0; right: auto; top: calc(100% + 8px); border-radius: 14px; }
.rm-ctrl {
  display: inline-flex; align-items: center; justify-content: center; gap: 2px; width: 44px; height: 44px; padding: 0;
  border: 0; border-radius: var(--radius-ctrl); background: #fff; color: var(--ink); box-shadow: var(--shadow-ctrl);
  cursor: pointer; transition: color 0.12s, transform 0.12s, background 0.12s;
}
.rm-ctrl svg { width: 20px; height: 20px; }
.rm-country-btn.rm-ctrl:hover, .rm-country-btn.rm-ctrl[aria-expanded="true"] { background: #fff; color: var(--pine); transform: translateY(-1px); }
.rm-country-btn.rm-ctrl.rm-picker-selected { width: auto; min-width: 44px; padding: 0 10px; background: var(--moss); box-shadow: inset 0 0 0 1.5px var(--pine), var(--shadow-ctrl); font-size: 20px; }
.rm-country-btn.rm-ctrl:focus-visible { outline: 2px solid var(--pine); outline-offset: 2px; }

/* The search: small and quiet, a little wider once focused (or holding a name). */
.rm-searchbar {
  display: flex; align-items: center; gap: 6px; width: 12.5rem; height: 44px; padding: 0 6px 0 12px;
  border: 1px solid transparent; border-radius: var(--radius-ctrl); background: #fff; color: var(--ink);
  box-shadow: var(--shadow-ctrl); cursor: text; transition: width 0.22s ease, border-color 0.15s, box-shadow 0.15s;
}
.rm-searchbar > svg { flex-shrink: 0; width: 15px; height: 15px; color: rgb(23 32 27 / 0.55); }
.rm-searchbar:focus-within, .rm-searchbar:has(.rm-search-input:not(:placeholder-shown)) { width: 17rem; }
.rm-searchbar:focus-within { border-color: var(--pine); box-shadow: 0 0 0 3px rgb(31 122 76 / 0.16), var(--shadow-ctrl); }
.rm-searchbar:focus-within > svg { color: var(--pine); }
.rm-search-input { height: 100%; padding: 0; font-size: 13px; }
.rm-search-input::placeholder { color: rgb(23 32 27 / 0.5); }
.rm-searchbar .rm-icon-btn { width: 26px; height: 26px; border-radius: 8px; }

/* All / Riding, above the gallery */
.rm-strip-head { gap: 10px; }
.rm-strip-head .rm-segment { order: -1; padding: 3px; border-radius: 10px; background: var(--stone); }
.rm-strip-head .rm-segment button { height: 26px; padding: 0 10px; border-radius: 7px; font-size: 12px; }
.rm-strip-head .rm-segment button[aria-checked="true"] { background: #fff; color: var(--pine-strong); box-shadow: 0 1px 3px rgb(0 0 0 / 0.12); }
.rm-strip-head .rm-card-label { margin-right: auto; }
.rm-strip-head .rm-strip-all { margin-left: 0; }
.rm-strip-nav .rm-icon-btn { border-radius: 8px; }

@media (min-width: 1024px) {
  .rm-left .rm-panel { gap: 8px; }
  .rm-panel .rm-brand-mark { border-radius: var(--radius-ctrl); box-shadow: var(--shadow-ctrl); }
  .rm-searchbar { box-shadow: var(--shadow-ctrl); }
  .rm-searchbar:focus-within { box-shadow: 0 0 0 3px rgb(31 122 76 / 0.16), var(--shadow-ctrl); }
  .rm-brand-side { border-radius: var(--radius-ctrl); background: #fff; box-shadow: var(--shadow-ctrl); }
  .rm-brand-side .rm-brand-name { font-size: 17px; }

  /* On the dark shelf at the bottom: glass, the chosen one white. */
  .rm-bottom .rm-strip-head { padding: 0 4px 4px; }
  .rm-bottom .rm-strip-head .rm-segment { background: rgb(255 255 255 / 0.16); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
  .rm-bottom .rm-strip-head .rm-segment button { color: rgb(255 255 255 / 0.85); }
  .rm-bottom .rm-strip-head .rm-segment button[aria-checked="true"] { background: #fff; color: var(--pine-strong); }
  .rm-bottom .rm-strip-all { color: var(--pine-bright); }
  .rm-bottom .rm-strip-nav .rm-icon-btn { border-radius: 8px; }
  .rm-bottom .rm-thumb:hover .rm-thumb-name { color: var(--pine-bright); }
}

/* Phones and tablets: logo above, then filter + search spanning the width. */
@media (max-width: 1023px) {
  .rm-tools .rm-ctrl { width: 40px; height: 40px; box-shadow: none; background: var(--stone); }
  .rm-searchbar, .rm-searchbar:focus-within, .rm-searchbar:has(.rm-search-input:not(:placeholder-shown)) { flex: 1; width: auto; height: 40px; box-shadow: none; background: var(--stone); }
  .rm-searchbar:focus-within { background: #fff; box-shadow: 0 0 0 3px rgb(31 122 76 / 0.16); }
  .rm-strip-head .rm-segment button { height: 24px; padding: 0 8px; font-size: 11.5px; }
  .rm-search-input { font-size: 16px; } /* under 16px, iOS zooms in on focus */
}

/* The map's credits, at the bottom of the layers menu (every map page). */
.mc-layers-credits {
  flex-basis: 100%; margin: 0; padding: 7px 6px 2px; border-top: 1px solid var(--border);
  font: 500 10.5px/1.5 var(--font-sans); color: var(--muted-foreground);
}
.mc-layers-credits a { color: inherit; text-decoration: none; white-space: nowrap; }
.mc-layers-credits a:hover { color: var(--ink); text-decoration: underline; }
.mc-layers[open] .mc-layers-btn { color: var(--pine); }
.mc-layers-btn:hover { color: var(--pine); transform: translateY(-1px); }
.mc-layer[aria-checked="true"] { color: var(--pine); }
.mc-layer[aria-checked="true"] .mc-layer-swatch { box-shadow: 0 0 0 2px var(--pine); }

/* Rider map, phones and tablets (iPhone, iPad): the desktop's floating controls on one line at the top — the logo,
   the filter and the search (filling what's left) — and, in the top-right corner, the account with the layers under
   it. A rider's card tall enough to reach that corner hides them while it's open. */
@media (max-width: 1023px) {
  .rm-left { top: 12px; left: 12px; right: 64px; max-width: none; }
  .rm-left .rm-panel {
    flex-direction: row; align-items: center; gap: 8px; padding: 0; border: 0; border-radius: 0;
    background: none; box-shadow: none; backdrop-filter: none; -webkit-backdrop-filter: none;
  }
  .rm-panel .rm-brand { flex-shrink: 0; align-self: center; padding: 0; }
  .rm-panel .rm-brand-name { display: none; }
  .rm-panel .rm-brand-mark { width: 44px; height: 44px; border-radius: var(--radius-ctrl); box-shadow: var(--shadow-ctrl); }
  .rm-tools { flex: 1; }
  .rm-tools .rm-ctrl { width: 44px; height: 44px; background: #fff; box-shadow: var(--shadow-ctrl); }
  .rm-searchbar, .rm-searchbar:focus-within, .rm-searchbar:has(.rm-search-input:not(:placeholder-shown)) {
    flex: 1; width: auto; max-width: 22rem; height: 44px; background: #fff; box-shadow: var(--shadow-ctrl);
  }
  .rm-searchbar:focus-within { box-shadow: 0 0 0 3px rgb(31 122 76 / 0.16), var(--shadow-ctrl); }
  .rm-tools .rm-popover { max-width: calc(100vw - 24px); }

  .rm-topright { top: 12px; right: 12px; transition: opacity 0.2s, visibility 0.2s; }
  .rm-corner-covered .rm-topright { opacity: 0; visibility: hidden; pointer-events: none; }
  .rm-topright .mc-layers-menu { max-width: min(222px, calc(100vw - 80px)); }
}
/* Phones: a little tighter. */
@media (max-width: 639px) {
  .rm-tools, .rm-left .rm-panel { gap: 6px; }
}

/* Rider page: the profile and the journeys in the map's rider card's dark liquid glass (.rm-glass-dark), over a soft
   pine-and-sky wash so the glass has something to frost. Each journey is one tile that opens it. */
body:has(.rp) {
  background:
    radial-gradient(60rem 28rem at 15% -10%, rgb(63 191 122 / 0.28), transparent 70%),
    radial-gradient(50rem 26rem at 95% 0%, rgb(120 170 210 / 0.25), transparent 70%),
    linear-gradient(var(--stone), var(--background) 420px);
  background-attachment: fixed;
}
.rp-card.rm-glass-dark { position: relative; border-radius: 22px; }
.rp-card.rm-glass-dark::before {
  content: ""; position: absolute; inset: 0 0 auto; height: 55%; border-radius: inherit; pointer-events: none;
}
.rp-card.rm-glass-dark > * { position: relative; }
.rm-glass-dark h1, .rm-glass-dark h2 { color: var(--glass-fg); }
.rm-glass-dark.rp-card h2 span { color: var(--glass-muted); }
.rm-glass-dark .rp-line { color: var(--glass-muted); }
.rm-glass-dark .rp-line.rm-on-road { color: #4ade80; }
.rm-glass-dark .rp-bio { color: rgb(255 255 255 / 0.82); }
.rm-glass-dark .rm-hint, .rm-glass-dark .rm-link { color: var(--glass-muted); }

/* The profile: photo, name and status, the links as glass chips, the bio. */
.rp-hero { flex-wrap: wrap; }
.rp-hero .rp-avatar { box-shadow: 0 0 0 3px rgb(255 255 255 / 0.85), 0 8px 20px rgb(0 0 0 / 0.4); }
.rp-hero .rp-avatar.rm-card-avatar-active { box-shadow: 0 0 0 3px rgb(20 22 28), 0 0 0 6px var(--green), 0 8px 20px rgb(0 0 0 / 0.4); }
.rp-links { flex-basis: 100%; flex-wrap: wrap; gap: 8px; }
.rp-links .rm-card-link { width: 40px; height: 40px; border-radius: var(--radius-ctrl); transition: transform 0.12s, color 0.12s; }
.rp-links .rm-card-link svg { width: 18px; height: 18px; }
.rp-links .rm-card-link:hover { transform: translateY(-1px); }
.rp-links-add {
  display: inline-flex; align-items: center; height: 40px; padding: 0 14px; border: 1px dashed var(--glass-rim); border-radius: var(--radius-ctrl);
  color: var(--glass-muted); font-size: 13px; font-weight: 600; text-decoration: none;
}
.rp-links-add:hover { color: #4ade80; border-color: rgb(74 222 128 / 0.6); }
.rp-hero > .rp-bio { flex-basis: 100%; margin: 0; font-size: 14.5px; }
@media (max-width: 639px) { .rp-links { justify-content: center; } .rp-hero > .rp-bio { text-align: center; } }

/* The journeys: one glass tile each — title and status, the dates, the flags; an arrow that moves on hover. */
.rp-journeys-card .rm-journeys { gap: 8px; }
.rp .rp-journey {
  flex-direction: row; align-items: center; gap: 12px; padding: 12px 12px 12px 16px; border-radius: 16px;
  border: 1px solid var(--glass-rim); background: var(--glass-chip); box-shadow: inset 0 1px 0 rgb(255 255 255 / 0.12);
  transition: background 0.15s, transform 0.15s, border-color 0.15s;
}
.rp .rp-journey:hover { background: rgb(255 255 255 / 0.16); border-color: rgb(74 222 128 / 0.45); transform: translateY(-1px); }
.rp .rp-journey:focus-visible { outline: 2px solid #4ade80; outline-offset: 2px; }
.rp-journey-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.rp-journey .rm-journey-title { font-size: 16px; font-weight: 700; line-height: 1.25; color: var(--glass-fg); }
.rp-journey .rm-journey-meta { font-size: 13px; }
.rp-journey .rm-journey-flags { display: flex; margin-top: 4px; padding-left: 4px; }
.rp-journey .rm-flag-bubble { width: 24px; height: 24px; font-size: 13px; }
.rp-journey-go {
  display: flex; align-items: center; justify-content: center; flex-shrink: 0; width: 32px; height: 32px; border-radius: 10px;
  background: rgb(255 255 255 / 0.1); color: var(--glass-fg); transition: transform 0.15s, background 0.15s, color 0.15s;
}
.rp-journey-go svg { transform: rotate(-90deg); }
.rp-journey:hover .rp-journey-go { transform: translateX(3px); background: #4ade80; color: #0b2a18; }
.rp-journeys-card .rp-badge { background: rgb(250 204 21 / 0.22); color: #fde68a; }
.rp-journeys-card .rp-draft { gap: 10px; }

/* The map's credits behind a © button (shared/_map_buttons, credits: true): a small card opening on its left. */
.mc-credits { position: relative; }
.mc-credits > summary { list-style: none; }
.mc-credits > summary::-webkit-details-marker { display: none; }
.mc-credits[open] > summary { color: var(--pine); }
.mc-credits .mc-credits-menu {
  position: absolute; bottom: 0; right: calc(100% + 8px); width: max-content; max-width: min(222px, calc(100vw - 80px));
  padding: 8px 10px; border-top: 0; border-radius: 14px; background: rgb(255 255 255 / 0.95);
  box-shadow: 0 10px 30px -10px rgb(0 0 0 / 0.4); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
}

/* Rider map, tablets and desktops: + / −, my location and © in the right-hand column, under the layers button,
   the column's size. Phones keep them bottom-right, above the riders. */
@media (min-width: 640px) {
  .rm-topright .mc-buttons { position: static; }
  .rm-topright .mc-buttons .mc-btn { width: 44px; height: 44px; }
}
@media (max-width: 639px) {
  .rm-topright .mc-buttons { position: fixed; right: 12px; bottom: calc(var(--bottom-inset, 0px) + 12px); }
}

/* Admin portal: shell — sidebar on the left (a top bar on small screens), the page on the right */
.ad-shell { display: grid; grid-template-columns: 232px minmax(0, 1fr); gap: 0; min-height: 100dvh; padding: 0; }
.ad-side {
  position: sticky; top: 0; height: 100dvh; display: flex; flex-direction: column; gap: 20px; padding: 20px 14px;
  background: var(--ink); color: rgb(255 255 255 / 0.72);
}
.ad-brand { padding: 4px 10px; color: #fff; font-family: var(--font-serif); font-size: 20px; font-weight: 600; text-decoration: none; }
.ad-brand span { margin-left: 4px; padding: 2px 7px; border-radius: 6px; background: var(--pine); font-family: var(--font-sans); font-size: 10px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; vertical-align: 3px; }
.ad-nav, .ad-side-foot { display: flex; flex-direction: column; gap: 2px; }
.ad-side-foot { margin-top: auto; padding-top: 12px; border-top: 1px solid rgb(255 255 255 / 0.1); }
.ad-side-foot form { display: contents; }
.ad-nav a, .ad-side-foot a, .ad-side-foot button {
  display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 10px; border: 0; border-radius: 9px;
  background: none; color: inherit; font: 500 14px/1.2 var(--font-sans); text-align: left; text-decoration: none; cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.ad-nav a:hover, .ad-side-foot a:hover, .ad-side-foot button:hover { background: rgb(255 255 255 / 0.07); color: #fff; }
.ad-nav a[aria-current="page"] { background: rgb(255 255 255 / 0.12); color: #fff; font-weight: 600; box-shadow: inset 3px 0 0 var(--pine-bright); }
.ad-side svg { width: 18px; height: 18px; flex-shrink: 0; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.ad-side a:focus-visible, .ad-side button:focus-visible { outline: 2px solid var(--pine-bright); outline-offset: 1px; }
.ad-main { display: flex; flex-direction: column; gap: 16px; width: 100%; max-width: 1360px; padding: 28px 32px 56px; font-size: 14px; }
.ad-page { display: flex; flex-direction: column; gap: 16px; }
.ad-count { margin-left: 4px; padding: 2px 9px; border-radius: 9999px; background: var(--secondary); font-family: var(--font-sans); font-size: 13px; font-weight: 600; color: var(--muted-foreground); vertical-align: 4px; font-variant-numeric: tabular-nums; }
.ad-head-action, .ad-head-actions { margin-left: auto; }
.ad-head-actions { display: flex; gap: 8px; }
.ad-head .rm-btn svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2.25; stroke-linecap: round; }
.ad-head .rm-btn { gap: 4px; }

.ad-toolbar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.ad-search { position: relative; display: flex; align-items: center; margin-left: auto; width: min(100%, 300px); }
.ad-search svg { position: absolute; left: 11px; width: 16px; height: 16px; fill: none; stroke: var(--muted-foreground); stroke-width: 2; pointer-events: none; }
.ad-search .rm-input { width: 100%; height: 38px; padding: 6px 34px; background: #fff; }
.ad-search kbd {
  position: absolute; right: 9px; padding: 1px 6px; border-radius: 5px; box-shadow: inset 0 0 0 1px var(--border);
  font: 600 11px/1.5 var(--font-sans); color: var(--muted-foreground); pointer-events: none;
}
.ad-search:focus-within kbd { display: none; }

.ad-table-wrap { overflow: auto; max-height: calc(100dvh - 190px); border-radius: 14px; background: #fff; box-shadow: 0 0 0 1px var(--border); }
.ad-table th:first-child, .ad-table td:first-child { padding-left: 18px; }
.ad-table th:last-child, .ad-table td:last-child { padding-right: 14px; }
.ad-table th button {
  display: inline-flex; align-items: center; gap: 4px; padding: 0; border: 0; background: none; cursor: pointer;
  font: inherit; letter-spacing: inherit; text-transform: inherit; color: inherit;
}
.ad-table th button:hover { color: var(--foreground); }
.ad-table th button svg { width: 12px; height: 12px; fill: none; stroke: currentColor; stroke-width: 2.5; opacity: 0.35; }
.ad-table th[aria-sort="ascending"] button, .ad-table th[aria-sort="descending"] button { color: var(--foreground); }
.ad-table th[aria-sort="ascending"] svg, .ad-table th[aria-sort="descending"] svg { opacity: 1; }
.ad-table th[aria-sort="ascending"] svg path { d: path("m7 15 5 5 5-5"); }
.ad-table th[aria-sort="descending"] svg path { d: path("M7 9l5-5 5 5"); }
.ad-table tbody tr[data-href] { cursor: pointer; }
.ad-table tbody tr { transition: background 0.1s; }
.ad-table tbody tr:hover td { background: oklch(0.975 0.012 85); }
.ad-table td { white-space: nowrap; }
.ad-table td.ad-note { white-space: normal; min-width: 220px; }
.ad-row-link { color: var(--foreground); font-weight: 600; text-decoration: none; }
.ad-row-link:hover { color: var(--primary-text); text-decoration: underline; }
.ad-table time { color: var(--muted-foreground); font-variant-numeric: tabular-nums; }
.ad-actions-col { width: 1%; }
.ad-icon-btn {
  display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; padding: 0; border: 0; border-radius: 8px;
  background: none; color: var(--muted-foreground); cursor: pointer; transition: background 0.15s, color 0.15s;
}
.ad-icon-btn svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.ad-icon-btn:hover { background: var(--secondary); color: var(--foreground); }
.ad-icon-danger:hover { background: oklch(0.95 0.04 27); color: oklch(0.5 0.2 27); }
.ad-icon-btn:focus-visible { outline: 2px solid var(--ring); outline-offset: 1px; }
@media (hover: hover) {
  .ad-table .ad-actions { opacity: 0.45; transition: opacity 0.15s; }
  .ad-table tr:hover .ad-actions, .ad-table .ad-actions:focus-within { opacity: 1; }
}
.ad-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

.ad-badge {
  display: inline-flex; align-items: center; gap: 6px; padding: 2px 9px 2px 8px; border-radius: 9999px;
  font-size: 12px; font-weight: 600; line-height: 1.5; white-space: nowrap;
}
.ad-badge::before { content: ""; width: 6px; height: 6px; border-radius: 9999px; background: currentColor; }
.ad-badge + .ad-badge { margin-left: 4px; }
.ad-badge-green { background: oklch(0.95 0.045 150); color: oklch(0.45 0.12 150); }
.ad-badge-amber { background: oklch(0.95 0.06 85); color: oklch(0.5 0.12 65); }
.ad-badge-blue { background: oklch(0.95 0.035 245); color: oklch(0.48 0.13 250); }
.ad-badge-red { background: oklch(0.95 0.04 27); color: oklch(0.52 0.19 27); }
.ad-badge-gray { background: oklch(0.95 0.008 80); color: var(--muted-foreground); }
.ad-place { display: inline-flex; align-items: center; gap: 10px; }
.ad-place-icon { display: flex; align-items: center; justify-content: center; width: 32px; height: 32px; flex-shrink: 0; border-radius: 9px; background: var(--stone); font-size: 16px; }
.ad-ellipsis { max-width: 320px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

@media (max-width: 900px) {
  .ad-shell { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto 1fr; }
  .ad-side { position: sticky; z-index: 30; height: auto; flex-direction: row; align-items: center; gap: 8px; padding: 8px 12px; overflow-x: auto; scrollbar-width: none; }
  .ad-brand { flex-shrink: 0; font-size: 17px; padding: 4px; }
  .ad-brand span { display: none; }
  .ad-nav, .ad-side-foot { flex-direction: row; }
  .ad-side-foot { margin: 0 0 0 auto; padding: 0 0 0 8px; border-top: 0; border-left: 1px solid rgb(255 255 255 / 0.1); }
  .ad-nav a, .ad-side-foot a, .ad-side-foot button { width: auto; padding: 8px 10px; white-space: nowrap; }
  .ad-nav a[aria-current="page"] { box-shadow: inset 0 -2px 0 var(--pine-bright); }
  .ad-side-foot span { display: none; }
  .ad-main { padding: 20px 16px 48px; }
  .ad-table-wrap { max-height: none; }
  .ad-search { width: 100%; margin-left: 0; }
}
@media (max-width: 560px) {
  .ad-nav span { display: none; }
}

/* A modal's content opened as its own page (e.g. a place's card from the admin's Places list) */
body > turbo-frame#modal { display: block; max-width: 30rem; margin: 8vh auto; padding: 24px; border-radius: 16px; background: #fff; box-shadow: var(--shadow); }

/* Journey replay: every stop on the timeline (the start and the last one named beside it), × under the timeline,
   and the card of the stretch the pin is on — ‹ › step from stop to stop. */
.jm-playbox .jm-play-exit { position: static; flex-shrink: 0; margin-top: 4px; }
.jm-timeline-stop { width: 10px; height: 10px; margin: -5px 0 0 -5px; border-width: 2px; transition: box-shadow 0.15s, background 0.15s; }
.jm-timeline-passed { background: #2563eb; border-color: #fff; }
.jm-timeline-fav { width: 13px; height: 13px; margin: -6.5px 0 0 -6.5px; border-color: #e11d48; }
.jm-timeline-fav.jm-timeline-passed { background: #e11d48; border-color: #fff; }
.jm-timeline-start, .jm-timeline-end { z-index: 1; width: 18px; height: 18px; margin: -9px 0 0 -9px; border-width: 3px; }
.jm-timeline-start { border-color: #34c759; }
.jm-timeline-start.jm-timeline-passed { background: #34c759; border-color: #fff; }
.jm-timeline-end { border-color: var(--ink); }
.jm-timeline-end.jm-timeline-passed { background: var(--ink); border-color: #fff; }
.jm-timeline-dense .jm-timeline-stop:not(.jm-timeline-start, .jm-timeline-end, .jm-timeline-fav) { width: 6px; height: 6px; margin: -3px 0 0 -3px; border-width: 1.5px; }
.jm-timeline-current { z-index: 2; box-shadow: 0 0 0 4px rgb(37 99 235 / 0.3), 0 1px 4px rgb(0 0 0 / 0.3); }
.jm-timeline-label {
  position: absolute; right: calc(100% + 14px); max-width: 8.5rem; padding: 3px 9px; translate: 0 -50%; border-radius: 9999px;
  background: rgb(255 255 255 / 0.94); box-shadow: 0 4px 14px -4px rgb(0 0 0 / 0.35); color: var(--ink); pointer-events: none;
  font: 600 11px/1.35 var(--font-sans); white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.jm-segment {
  position: absolute; z-index: 11; bottom: 16px; left: calc((100% + 16px + 24rem) / 2); translate: -50% 0;
  display: flex; align-items: center; gap: 6px; width: min(26rem, calc(100% - 24rem - 140px)); padding: 8px;
  border: 1px solid rgb(255 255 255 / 0.6); border-radius: 18px; background: rgb(255 255 255 / 0.9);
  backdrop-filter: blur(18px) saturate(170%); -webkit-backdrop-filter: blur(18px) saturate(170%);
  box-shadow: 0 14px 34px -12px rgb(0 0 0 / 0.42);
}
.jm-segment[hidden] { display: none; }
.jm-segment-body { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: center; gap: 1px; text-align: center; }
.jm-segment-body > * { max-width: 100%; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.jm-segment-kicker { font-size: 10.5px; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; color: var(--muted-foreground); font-variant-numeric: tabular-nums; }
.jm-segment-name { font-size: 15px; line-height: 1.3; color: var(--ink); }
.jm-segment-leg { display: flex; justify-content: center; gap: 6px; font-size: 12.5px; color: var(--muted-foreground); font-variant-numeric: tabular-nums; }
.jm-segment-to { min-width: 0; overflow: hidden; text-overflow: ellipsis; font-weight: 600; color: var(--foreground); }
.jm-segment-facts { flex-shrink: 0; }
.jm-segment-nav {
  display: flex; align-items: center; justify-content: center; flex-shrink: 0; width: 42px; height: 42px; padding: 0; border: 0;
  border-radius: 9999px; background: rgb(0 0 0 / 0.05); color: var(--ink); cursor: pointer; transition: background 0.12s, opacity 0.12s, scale 0.12s;
  -webkit-tap-highlight-color: transparent;
}
.jm-segment-nav svg { width: 22px; height: 22px; }
.jm-segment-nav:active:not(:disabled) { scale: 0.92; }
.jm-segment-nav:disabled { opacity: 0.3; cursor: default; }
@media (hover: hover) { .jm-segment-nav:hover:not(:disabled) { background: rgb(0 0 0 / 0.09); color: var(--pine); } }
.jm-segment-nav:focus-visible { outline: 2px solid var(--ring); outline-offset: 1px; }

@media (max-width: 1023px) {
  /* The card takes the panel's place at the bottom while the replay is out. */
  .jm-replay .jm-panel { display: none; }
  .jm-segment { left: 12px; right: 12px; bottom: 12px; width: auto; translate: none; }
  .jm-replay .jm-timeline { height: min(280px, 34dvh); }
}

/* Phones: the map first, as in a native maps app — a sheet docked to the bottom edge, opening folded to the journey's
   header (a tap or a drag opens it), the map's corner buttons clear of the notch, no zoom buttons (pinch) but in the replay. */
.jm { overscroll-behavior: none; -webkit-tap-highlight-color: transparent; }
@media (max-width: 639px) {
  .jm-panel {
    left: 0; right: 0; bottom: 0; max-height: 46dvh; border-width: 1px 0 0; border-radius: 22px 22px 0 0;
    padding-bottom: max(14px, env(safe-area-inset-bottom)); background: rgb(255 255 255 / 0.95);
    box-shadow: 0 -10px 30px -14px rgb(0 0 0 / 0.35);
  }
  .jm-hero-cover { min-height: 84px; }
  .jm-hero-cover .jm-title { font-size: 18px; }
  .jm-panel-folded .jm-meta { padding-bottom: 2px; }
  .jm-corner { top: max(12px, env(safe-area-inset-top)); }
  .jm-timeline { height: min(150px, 20dvh); }
  .jm-segment {
    left: 0; right: 0; bottom: 0; padding: 10px 10px max(10px, env(safe-area-inset-bottom)); border-width: 1px 0 0;
    border-radius: 22px 22px 0 0; background: rgb(255 255 255 / 0.95); box-shadow: 0 -10px 30px -14px rgb(0 0 0 / 0.35);
  }
  .jm-segment-name { font-size: 16px; }
  .jm-segment-nav { width: 46px; height: 46px; }
  .jm-timeline-label { max-width: 7rem; }
}
@media (max-width: 639px) and (pointer: coarse) {
  .jm:not(.jm-replay) .mc-buttons { display: none; }
}

/* Journey About: one card — the dates on a line, the story, the video and links, the networks; parts split by hairlines.
   Phones: as small as it gets — the video a row like the other links, the networks icons only. */
.jm-about {
  display: flex; flex-direction: column; flex-shrink: 0; border-radius: 14px; background: rgb(255 255 255 / 0.7);
  box-shadow: 0 0 0 1px var(--border);
}
.jm-about > * { margin: 0; padding: 10px 12px; }
.jm-about > * + * { border-top: 1px solid var(--border); }
.jm-about .jm-about-dates { display: flex; flex-wrap: wrap; gap: 4px 0; }
.jm-about .jm-about-dates > div { flex: 1 1 0; min-width: 0; padding: 0 10px; border-radius: 0; background: none; box-shadow: none; }
.jm-about .jm-about-dates > div:first-child { padding-left: 0; }
.jm-about .jm-about-dates > div + div { border-left: 1px solid var(--border); }
.jm-about .jm-about-dates dd { overflow: hidden; text-overflow: ellipsis; }
.jm-about .jm-description { font-size: 13.5px; }
.jm-about .jm-about-add { display: block; }
.jm-about .jm-info-links { gap: 8px; }
.jm-about .jm-info-links .jm-link { padding: 0; border-radius: 10px; background: none; box-shadow: none; }
.jm-about .jm-info-links .jm-link:hover .jm-link-text > span { color: var(--primary-text); }
.jm-about .jm-video { box-shadow: none; border-radius: 10px; }
.jm-about .jm-info-socials { gap: 6px; }
.jm-about .jm-info-social { padding: 4px 10px 4px 7px; background: rgb(0 0 0 / 0.04); box-shadow: none; }
.jm-about .jm-info-social:hover { box-shadow: 0 0 0 1px var(--primary); }
@media (max-width: 639px) {
  .jm-about > * { padding: 8px 10px; }
  .jm-about .jm-about-dates dt { font-size: 10px; }
  .jm-about .jm-about-dates dd { font-size: 12.5px; }
  .jm-about .jm-description { font-size: 13px; line-height: 1.5; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 4; overflow: hidden; }
  /* The video: a row with a small thumbnail, like the other links. */
  .jm-about .jm-video {
    display: flex; align-items: center; gap: 10px; aspect-ratio: auto; overflow: visible; background: none; color: var(--foreground);
  }
  .jm-about .jm-video::after { display: none; }
  .jm-about .jm-video-thumb { position: static; flex-shrink: 0; width: 64px; height: 40px; border-radius: 8px; background: #111827; }
  .jm-about .jm-video:hover .jm-video-thumb { transform: none; }
  .jm-about .jm-video-play { top: 20px; left: 32px; width: 24px; height: 17px; border-radius: 5px; }
  .jm-about .jm-video-play svg { width: 11px; height: 11px; }
  .jm-about .jm-video-title { position: static; min-width: 0; font-size: 12.5px; font-weight: 600; text-shadow: none; }
  .jm-about .jm-video-title > span { -webkit-line-clamp: 1; }
  .jm-about .jm-video-title small { color: #dc2626; opacity: 1; font-weight: 500; }
  /* The networks: icons only, side by side. */
  .jm-about .jm-info-social { width: 34px; height: 34px; padding: 0; justify-content: center; }
  .jm-about .jm-info-social span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
}

/* Rider page, open and light: no boxes — the profile across the top, then the map and the journeys, split by space.
   Rows highlight under the pointer and press down on tap; the page scrolls smoothly. Phones: one centred column. */
html:has(.rp) { scroll-behavior: smooth; background: var(--background); }
body:has(.rp) {
  background: radial-gradient(70rem 30rem at 20% -12%, rgb(63 191 122 / 0.12), transparent 70%) no-repeat, var(--background);
  background-attachment: scroll; -webkit-tap-highlight-color: transparent;
}
.rp { max-width: 84rem; gap: 0; padding: 0 24px 64px; }
.rp-nav {
  position: sticky; top: 0; z-index: 20; margin: 0 -24px; padding: 10px 24px;
  background: color-mix(in oklch, var(--background) 82%, transparent);
  backdrop-filter: blur(14px) saturate(160%); -webkit-backdrop-filter: blur(14px) saturate(160%);
}
.rp-back { display: inline-flex; align-items: center; height: 34px; padding: 0 12px 0 8px; margin-left: -8px; border-radius: 9999px; transition: background 0.15s; }
.rp-back:hover { background: rgb(0 0 0 / 0.05); color: var(--foreground); }

/* The profile: photo · name and status · (far right) networks, Share, the rider's buttons; the bio under. */
.rp-hero {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 6px 20px; padding: 12px 0 32px;
  border: 0; background: none; box-shadow: none; text-align: left;
}
.rp-hero::before { content: none; }
.rp-hero .rp-avatar, .rp-hero .rp-avatar.rm-card-avatar-active { width: 88px; height: 88px; box-shadow: 0 0 0 4px var(--background), 0 10px 24px -8px rgb(0 0 0 / 0.3); }
.rp-hero .rp-avatar.rm-card-avatar-active { box-shadow: 0 0 0 3px var(--background), 0 0 0 6px var(--green), 0 10px 24px -8px rgb(0 0 0 / 0.3); }
.rp-hero-text { align-items: flex-start; gap: 4px; }
.rp-hero h1 { color: var(--foreground); font-size: 32px; letter-spacing: -0.01em; }
.rp-hero .rp-line { color: var(--muted-foreground); }
.rp-hero .rp-line.rm-on-road { color: #15803d; }
.rp-hero-actions { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 8px; }
.rp-hero-actions .rp-links + .rp-actions { padding-left: 8px; border-left: 1px solid var(--border); }
.rp-links { flex-basis: auto; gap: 6px; }
.rp-links .rm-card-link {
  width: 38px; height: 38px; border: 0; border-radius: 9999px; background: rgb(0 0 0 / 0.05); color: var(--foreground); box-shadow: none;
  transition: background 0.15s, color 0.15s, transform 0.15s;
}
.rp-links .rm-card-link:hover { background: rgb(0 0 0 / 0.09); color: var(--pine); box-shadow: none; transform: none; }
.rp-links .rm-card-link:active, .rp-actions .rm-btn:active, .rp-actions .rm-share-btn:active { transform: scale(0.94); }
.rp-links-add { height: 38px; border-color: var(--border); color: var(--muted-foreground); border-radius: 9999px; }
.rp-links-add:hover { color: var(--pine); border-color: var(--pine); }
.rp-actions { align-items: center; }
.rp-actions .rm-share-btn { height: 38px; padding: 0 14px; border: 0; background: rgb(0 0 0 / 0.05); transition: background 0.15s, transform 0.12s; }
.rp-actions .rm-share-btn:hover { background: rgb(0 0 0 / 0.09); color: var(--foreground); }
.rp-actions .rm-btn { height: 38px; border-radius: 9999px; }
.rp-hero > .rp-bio { grid-column: 2 / -1; max-width: 40rem; margin: 4px 0 0; color: var(--foreground); font-size: 15px; line-height: 1.65; text-align: left; }

/* Below: the map (the wider) and the journeys side by side on desktop, stacked under. */
.rp-grid { gap: 40px; padding-top: 0; }
.rp-col { gap: 40px; }
.rp-section { min-width: 0; }
.rp-section h2 { display: flex; align-items: baseline; gap: 8px; margin: 0 0 14px; font-size: 18px; font-weight: 700; letter-spacing: -0.01em; color: var(--foreground); }
.rp-section h2 span { font-size: 13px; font-weight: 600; color: var(--muted-foreground); white-space: nowrap; }

/* The map's head: the title, where they are, and every country's flag on the same line. */
.rp-position .rp-card-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-start; gap: 6px 12px; margin-bottom: 12px; }
.rp-position .rp-card-head h2 { flex: none; margin: 0; }
.rp-card-head .rp-flags { display: flex; flex-wrap: wrap; gap: 3px; margin: 0; }
.rp-flags .rm-flag-bubble { width: 24px; height: 24px; margin: 0; font-size: 13px; border-color: var(--background); background: oklch(0.95 0.01 80); }

/* The filters, and the community map on their right. */
.rp-map-bar { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.rp-map-bar .rp-places { flex: 1; min-width: 0; }
.rp-map-bar .rp-places-chips, .rp-map-bar .rp-places-empty { margin: 0; }
.rp-map-bar .rp-places-chips { flex-wrap: wrap; }
.rp-map-bar-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; margin-left: auto; }
.rp-map-link {
  display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 14px 0 11px; border-radius: 9999px;
  background: var(--pine); color: #fff; font-size: 13px; font-weight: 600; text-decoration: none; white-space: nowrap;
  box-shadow: 0 4px 12px -4px rgb(31 122 76 / 0.5); transition: filter 0.15s, transform 0.12s;
}
.rp-map-link svg { width: 15px; height: 15px; }
.rp-map-link:hover { filter: brightness(1.1); text-decoration: none; }
.rp-map-link:active { transform: scale(0.96); }
.rp-chip { height: 32px; padding: 0 12px; border: 0; background: rgb(0 0 0 / 0.05); transition: background 0.15s, color 0.15s, transform 0.12s; }
.rp-chip:hover { background: rgb(0 0 0 / 0.09); }
.rp-chip:active { transform: scale(0.96); }
.rp-chip[aria-pressed="true"] { background: var(--foreground); color: var(--background); }
.rp-minimap { height: 340px; margin: 0; border-radius: 18px; box-shadow: 0 0 0 1px rgb(0 0 0 / 0.06); }

/* The journeys: a light tile each — title and status, the dates, the flags; the whole tile opens it. */
.rp-journeys-card .rm-journeys { gap: 10px; }
.rp .rp-journey {
  margin: 0; padding: 14px 14px 14px 18px; border: 1px solid rgb(0 0 0 / 0.07); border-radius: 16px;
  background: rgb(255 255 255 / 0.8); box-shadow: 0 1px 2px rgb(0 0 0 / 0.04), 0 8px 20px -14px rgb(0 0 0 / 0.25);
  transition: border-color 0.15s, box-shadow 0.15s, transform 0.12s;
}
.rp .rp-journey:hover { background: #fff; border-color: rgb(31 122 76 / 0.35); box-shadow: 0 1px 2px rgb(0 0 0 / 0.04), 0 14px 28px -16px rgb(0 0 0 / 0.35); transform: translateY(-1px); }
.rp .rp-journey:active { transform: scale(0.99); }
.rp .rp-journey:focus-visible { outline: 2px solid var(--pine); outline-offset: 2px; }
.rp-journey-body { gap: 3px; }
.rp-journey .rm-journey-top { align-items: center; gap: 4px 10px; flex-wrap: wrap; }
.rp-journey .rm-journey-title { color: var(--foreground); font-family: var(--font-serif); font-size: 18px; font-weight: 600; line-height: 1.25; }
.rp .rp-journey:hover .rm-journey-title { color: var(--foreground); }
.rp-journey .rm-journey-meta { color: var(--muted-foreground); font-size: 13px; }
.rp-journey .rm-journey-flags { margin-top: 6px; padding-left: 4px; }
.rp-journey .rm-flag-bubble { width: 24px; height: 24px; font-size: 13px; border-color: #fff; background: oklch(0.95 0.01 80); }
.rp-journey-go { width: 34px; height: 34px; border-radius: 9999px; background: rgb(0 0 0 / 0.05); color: var(--foreground); }
.rp-journey:hover .rp-journey-go { transform: translateX(3px); background: var(--pine); color: #fff; }
.rp-journeys-card .rp-badge { background: oklch(0.8 0.12 85 / 0.35); color: var(--foreground); }
.rp-journeys-card .rp-draft { gap: 10px; }
.rp-journeys-card .rm-link, .rp-journeys-card .rm-hint { color: var(--muted-foreground); }

@media (min-width: 1024px) {
  .rp { max-width: 84rem; padding: 0 32px 64px; }
  .rp-nav { margin: 0 -32px; padding: 10px 32px; }
  .rp-grid { grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 40px; align-items: start; }
  .rp-col-side { position: static; }
  .rp-minimap { height: 420px; }
}
@media (min-width: 640px) and (max-width: 1023px) {
  .rp { max-width: none; }
}
@media (max-width: 639px) {
  .rp { padding: 0 16px 48px; }
  .rp-nav { margin: 0 -16px; padding: 10px 16px; }
  .rp-grid, .rp-col { gap: 32px; }
  .rp-hero { grid-template-columns: minmax(0, 1fr); justify-items: center; gap: 12px; padding: 4px 0 28px; text-align: center; }
  .rp-hero-text { align-items: center; }
  .rp-hero h1 { font-size: 26px; }
  .rp-hero-actions { justify-content: center; }
  .rp-hero > .rp-bio { grid-column: 1; text-align: center; }
  .rp-position .rp-card-head { gap: 8px; }
  /* The filters scroll sideways; the community map under them. */
  .rp-map-bar { flex-direction: column; align-items: stretch; }
  .rp-map-bar .rp-places-chips { flex-wrap: nowrap; margin-inline: -16px; padding-inline: 16px; }
  .rp-map-bar-actions { margin-left: 0; }
  .rp-minimap { height: 260px; margin-inline: -16px; border-radius: 0; box-shadow: none; }
  .rp .rp-journey { padding: 12px 10px 12px 14px; }
  .rp-journey .rm-journey-title { font-size: 17px; }
  .rp-actions { gap: 6px; }
}


/* Rider map, top right: the account as one card — the rider's name, "WeBikepack" small under it, their photo filling
   the card's end (no margin around it); signed out, the same card in green with the person icon. Phones and tablets:
   the photo or the icon alone. */
.rm-account {
  display: inline-flex; align-items: stretch; height: 44px; overflow: hidden; border-radius: var(--radius-ctrl);
  background: #fff; box-shadow: var(--shadow-ctrl); color: var(--ink); text-decoration: none; transition: transform 0.12s, box-shadow 0.12s;
}
.rm-account:hover { transform: translateY(-1px); }
.rm-account:focus-visible { outline: 2px solid var(--ring); outline-offset: 2px; }
.rm-account-text { display: flex; flex-direction: column; justify-content: center; align-items: flex-end; gap: 2px; min-width: 0; padding: 0 12px 0 14px; }
.rm-account-title { max-width: 14rem; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font: 700 13px/1.15 var(--font-sans); }
.rm-account-brand { font: 600 10.5px/1 var(--font-sans); letter-spacing: 0.01em; color: var(--muted-foreground); }
.rm-account-brand span { color: var(--pine); }
.rm-account-picture { display: flex; align-items: center; justify-content: center; flex-shrink: 0; width: 44px; height: 44px; }
.rm-account-picture svg { width: 22px; height: 22px; }
.rm-account-avatar { display: block; width: 100%; height: 100%; object-fit: cover; background: #fff; }
.rm-account-cta { background: var(--pine); color: #fff; box-shadow: 0 8px 20px -8px rgb(31 122 76 / 0.7); }
.rm-account-cta .rm-account-brand, .rm-account-cta .rm-account-brand span { color: rgb(255 255 255 / 0.78); }
.rm-account-cta .rm-account-picture { background: var(--pine-strong); }
@media (hover: hover) { .rm-account-cta:hover { background: var(--pine-strong); } }
@media (max-width: 1023px) { .rm-account-text { display: none; } }

/* The layers menu with Night as a fourth look. */
.mc-layer-night .mc-layer-swatch {
  background: radial-gradient(circle at 74% 28%, #f6ecc0 0 4px, transparent 5px),
              linear-gradient(135deg, #2f3848 0 45%, #48506a 45% 50%, #2a3140 50% 70%, #1a2130 70%);
}
.mc-layers-menu:has(.mc-layer-night) { max-width: 290px; }
@media (max-width: 1023px) { .rm-topright .mc-layers-menu:has(.mc-layer-night) { max-width: min(290px, calc(100vw - 80px)); } }
