:root {
  --ink: #18312d;
  --muted: #5d6f6a;
  --panel: #fffaf0;
  --line: #d9cfb7;
  --forest: #2f7d57;
  --clay: #b74e37;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  font-family: Avenir Next, Trebuchet MS, Verdana, sans-serif;
  color: var(--ink);
}

#map {
  position: absolute;
  inset: 0;
}

.bar {
  position: absolute;
  top: max(12px, env(safe-area-inset-top));
  left: 12px;
  right: 12px;
  z-index: 500;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 999px;
  background: rgba(255, 250, 240, 0.94);
  border: 1px solid var(--line);
  box-shadow: 0 10px 30px rgba(24, 49, 45, 0.18);
}

.back {
  text-decoration: none;
  font-size: 1.2rem;
  line-height: 1;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: inherit;
}

.bar-title {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
  margin-right: auto;
  overflow: hidden;
}

.bar-title strong { font-size: 0.95rem; white-space: nowrap; }
.bar-title small { color: var(--muted); }

.follow {
  font: inherit;
  font-weight: 800;
  font-size: 0.85rem;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--muted);
  cursor: pointer;
  white-space: nowrap;
}

.follow.is-on {
  background: var(--forest);
  border-color: var(--forest);
  color: #fffaf0;
}

.panel {
  position: absolute;
  z-index: 500;
  left: 12px;
  bottom: max(12px, env(safe-area-inset-bottom));
  width: min(340px, calc(100% - 24px));
  max-height: 46vh;
  overflow-y: auto;
  padding: 14px 16px;
  border-radius: 14px;
  background: rgba(255, 250, 240, 0.95);
  border: 1px solid var(--line);
  box-shadow: 0 14px 40px rgba(24, 49, 45, 0.22);
}

.empty {
  margin: 0;
  color: var(--muted);
}

.riders {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 10px;
}

.riders li {
  display: flex;
  align-items: center;
  gap: 10px;
}

.swatch {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  flex: none;
}

.who strong { display: block; }
.who small { color: var(--muted); }

.foot {
  margin: 12px 0 0;
  font-size: 0.85rem;
}

.foot a { color: var(--forest); font-weight: 800; }

.rider-marker .dot {
  display: block;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 3px solid #fffaf0;
  box-shadow: 0 2px 8px rgba(24, 49, 45, 0.4);
}

.rider-marker .tag {
  position: absolute;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  white-space: nowrap;
  font-size: 0.72rem;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(255, 250, 240, 0.92);
  border: 1px solid var(--line);
}

.hub-marker {
  display: grid;
  place-items: center;
  font-size: 0.7rem;
  font-weight: 800;
  border-radius: 999px;
  background: var(--ink);
  color: #fffaf0;
  border: 2px solid #fffaf0;
}

@media (max-width: 620px) {
  .panel { max-height: 38vh; }
  .bar-title strong { font-size: 0.85rem; }
}
