.race-map-drawer__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}
.race-map-settings-wrap {
  position: relative;
}
.race-map-units-popover {
  position: absolute;
  top: calc(100% + 0.35rem);
  right: 0;
  left: auto;
  z-index: 1200;
  width: min(18.5rem, calc(100vw - 1.5rem));
  max-height: min(70vh, 32rem);
  overflow: auto;
  padding: 0.85rem 0.95rem 0.95rem;
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 12px;
  background: var(--bg-card, #fff);
  box-shadow: 0 12px 40px rgba(15, 23, 42, 0.14);
}
.race-map-units-popover[hidden] {
  display: none !important;
}
.race-map-units-popover__title {
  margin: 0 0 0.65rem;
  font-size: 0.8125rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-muted, #64748b);
}
.race-map-units-popover__group {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin-bottom: 0.75rem;
}
.race-map-units-popover__group:last-child {
  margin-bottom: 0;
}
.race-map-units-popover__label {
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-muted, #64748b);
}
.race-map-units-popover__options {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}
.race-map-units-popover__opt {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.8125rem;
  color: var(--text, #0f172a);
  cursor: pointer;
  padding: 0.28rem 0.35rem;
  border-radius: 6px;
}
.race-map-units-popover__opt:hover {
  background: var(--bg-subtle, #f8fafc);
}
.race-map-units-popover__hint {
  margin: 0.65rem 0 0;
  font-size: 0.6875rem;
  line-height: 1.4;
  color: var(--text-muted, #64748b);
}
.race-map-units-popover__hint--tight {
  margin-top: 0.15rem;
}

/* Running mode — neutral zone is a cycling concept, hide it entirely. */
html.nor-running-mode #race-feat-neutral-zone-label,
html.nor-running-mode #race-neutral-zone-group {
  display: none !important;
}

/* Running mode timetable cells carry "clock\nelapsed" — render both lines. */
html.nor-running-mode #race-timetable-table td[data-col^='pace'] {
  white-space: pre-line;
  line-height: 1.25;
}
html.nor-running-mode #race-timetable-table th[data-col^='pace'] {
  min-width: 5.25rem;
}

/* Running waves carry one pace — hide the Slow/Fast fields on wave cards. */
html.nor-running-mode .race-start-wave-card__speeds label:has(input[data-speed-role='Slow']),
html.nor-running-mode .race-start-wave-card__speeds label:has(input[data-speed-role='Fast']) {
  display: none !important;
}

/* "Play simulation" launcher in the start waves panel. */
.nor-sim-launch {
  display: block;
  width: 100%;
  margin: 0 0 0.6rem;
  font-weight: 700;
}

/* "Several passes here" chooser — out-and-back roads under one click. */
.race-map-popup__rowbtns {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  margin-top: 0.45rem;
}
.race-map-popup__rowbtn {
  display: block;
  width: 100%;
  text-align: left;
  padding: 0.38rem 0.55rem;
  border: 1px solid #e2e8f0;
  border-radius: 0.4rem;
  background: #fff;
  font: inherit;
  font-size: 0.8125rem;
  color: #0f172a;
  cursor: pointer;
}
.race-map-popup__rowbtn strong {
  font-variant-numeric: tabular-nums;
  margin-right: 0.3rem;
}
.race-map-popup__rowbtn:hover {
  border-color: var(--accent, #5ba8d4);
  background: #f0f7fc;
}

/* Drag handle to resize the left map rail. */
#race-map-shell {
  position: relative;
}
.nor-rail-resize {
  position: absolute;
  top: 0;
  bottom: 0;
  left: calc(var(--race-map-rail-left) - 4px);
  width: 8px;
  cursor: col-resize;
  z-index: 60;
  touch-action: none;
}
.nor-rail-resize::after {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  left: 3px;
  width: 2px;
  background: transparent;
  transition: background 0.12s;
}
.nor-rail-resize:hover::after,
body.nor-rail-resizing .nor-rail-resize::after {
  background: var(--accent, #5ba8d4);
}
body.nor-rail-resizing {
  cursor: col-resize;
  user-select: none;
}
body.nor-rail-resizing .race-map-container {
  pointer-events: none;
}
@media (max-width: 960px) {
  .nor-rail-resize {
    display: none;
  }
}

/* "Waves for distance" picker inside the start waves panel. */
.nor-wave-track-pick {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  margin: 0 0 0.6rem;
}
.nor-wave-track-pick .race-map-neutral-field__label {
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-muted, #64748b);
}
