/* ─────────────────────────────────────────────────────────────
   RACE PICKER — inline mini-pickers + bottom-sheet <dialog> for
   full discovery. All classes prefixed .rp-* for isolation; no
   global token bleed.

   The picker now lives in `.race-toolbar` (a sticky utility band
   between the hero and the chamber verdict), NOT in the hero
   eyebrow. See _race_toolbar.html.
───────────────────────────────────────────────────────────── */

/* ── Race toolbar wrapper ──────────────────────────────────────
   Sticky band sitting below the navbar. Distinct visual register
   from the hero (flat, utilitarian) so it reads as a TOOL surface,
   not an editorial element. */
.race-toolbar {
  position: sticky;
  top: var(--nav-h, 60px);
  z-index: 50;
  background: rgba(8, 10, 16, 0.92);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(212, 175, 55, 0.16);
  border-top: 1px solid rgba(255, 255, 255, 0.04);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.18);
}
.race-toolbar__inner {
  display: flex;
  align-items: center;
  min-height: 56px;
  padding-top: 10px;
  padding-bottom: 10px;
}

/* .rp stacks its rows vertically (inline picker + Up next ribbon).
   Was display:contents; switched to flex-column so the ribbon can't
   get squeezed onto the same row by the parent toolbar's flex. */
.rp {
  position: relative;
  display: flex;
  flex-direction: column;
  width: 100%;
  flex: 1 1 100%;
  min-width: 0;
}

/* ── Inline row ────────────────────────────────────────────── */
.rp-inline {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  width: 100%;
  margin: 0;
}

/* ── Next-off pill ─────────────────────────────────────────── */
.rp-next-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 12px 5px 9px;
  border-radius: 99px;
  background: rgba(45, 189, 122, 0.10);
  border: 1px solid rgba(45, 189, 122, 0.30);
  color: #79e0ad;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-decoration: none;
  transition: background 0.18s, border-color 0.18s, transform 0.18s;
}
.rp-next-pill:hover {
  background: rgba(45,189,122,0.18);
  border-color: rgba(45,189,122,0.55);
  transform: translateY(-1px);
}
.rp-next-pill__dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: #2DBD7A;
  box-shadow: 0 0 8px rgba(45,189,122,0.65);
  animation: rpNextPulse 1.6s ease-in-out infinite;
}
@keyframes rpNextPulse {
  0%,100% { opacity: 1;   transform: scale(1);    }
  50%     { opacity: 0.6; transform: scale(1.35); }
}
.rp-next-pill__label    { font-weight: 700; letter-spacing: 0.10em; text-transform: uppercase; opacity: 0.85; }
.rp-next-pill__name     { color: #ffffff; font-weight: 700; }
.rp-next-pill__countdown {
  padding-left: 8px;
  border-left: 1px solid rgba(45,189,122,0.30);
  margin-left: 2px;
  color: rgba(255,255,255,0.78);
  font-variant-numeric: tabular-nums;
}

/* ── Chip + popover (meeting / time) ───────────────────────── */
.rp-chip {
  position: relative;
  display: inline-flex;
}
.rp-chip__btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px 5px 13px;
  border-radius: 4px;
  background: rgba(212, 175, 55, 0.06);
  border: 1px solid rgba(212, 175, 55, 0.32);
  color: var(--c-gold);
  font-family: inherit;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 0.16s, border-color 0.16s;
}
.rp-chip__btn:hover,
.rp-chip__btn[aria-expanded="true"] {
  background: rgba(212, 175, 55, 0.14);
  border-color: var(--c-gold);
}
.rp-chip__chev {
  display: inline-block;
  font-size: 9px;
  letter-spacing: 0;
  transition: transform 0.16s;
  opacity: 0.7;
}
.rp-chip__btn[aria-expanded="true"] .rp-chip__chev { transform: rotate(180deg); }

.rp-pop {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  z-index: 50;
  min-width: 240px;
  max-width: 360px;
  max-height: 60vh;
  overflow-y: auto;
  padding: 6px 0 8px;
  background: #0d111d;
  border: 1px solid rgba(212, 175, 55, 0.20);
  border-radius: 10px;
  box-shadow: 0 14px 44px rgba(0, 0, 0, 0.55);
  animation: rpPopIn 0.16s ease-out;
}
@keyframes rpPopIn {
  from { opacity: 0; transform: translateY(-4px); }
  to   { opacity: 1; transform: translateY(0);   }
}
.rp-pop[hidden] { display: none; }

.rp-pop__head {
  padding: 8px 14px 6px;
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.40);
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.rp-pop__list {
  list-style: none;
  margin: 0;
  padding: 4px 0 0;
  display: flex;
  flex-direction: column;
}
.rp-pop__item {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 8px 14px;
  text-decoration: none;
  color: rgba(255,255,255,0.80);
  font-size: 13px;
  border-left: 2px solid transparent;
  transition: background 0.14s, border-color 0.14s;
}
.rp-pop__item:hover,
.rp-pop__item:focus-visible {
  background: rgba(212,175,55,0.06);
  border-left-color: rgba(212,175,55,0.35);
  outline: none;
}
.rp-pop__item.is-current {
  background: rgba(212,175,55,0.08);
  border-left-color: var(--c-gold);
  color: #ffffff;
  font-weight: 600;
}
.rp-pop__item--time {
  display: grid;
  grid-template-columns: 50px 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 7px 14px;
}
.rp-pop__time {
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--c-gold);
  font-size: 14px;
  font-variant-numeric: tabular-nums;
}
.rp-pop__name {
  font-size: 12.5px;
  color: rgba(255,255,255,0.78);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.rp-pop__sub {
  font-size: 11px;
  color: rgba(255,255,255,0.45);
}
.rp-pop__result {
  font-size: 10.5px;
  font-weight: 600;
  color: #2DBD7A;
  letter-spacing: 0.04em;
  white-space: nowrap;
}
.rp-pop__badge {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  padding: 2px 7px;
  border-radius: 99px;
  background: rgba(45,189,122,0.14);
  color: #79e0ad;
  border: 1px solid rgba(45,189,122,0.35);
}
.rp-pop__badge--viewing {
  background: rgba(212,175,55,0.14);
  color: var(--c-gold);
  border-color: rgba(212,175,55,0.35);
}

/* ── Switch race trigger ───────────────────────────────────── */
.rp-switch {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  background: transparent;
  border: 1px dashed rgba(255,255,255,0.22);
  border-radius: 99px;
  color: rgba(255,255,255,0.78);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
  transition: border-color 0.16s, color 0.16s, background 0.16s;
}
.rp-switch:hover {
  border-color: var(--c-gold);
  border-style: solid;
  color: var(--c-gold);
  background: rgba(212,175,55,0.04);
}

.rp-date-tail {
  font-size: 11px;
  color: rgba(255,255,255,0.40);
  letter-spacing: 0.04em;
  margin-left: 2px;
}

/* ── Bottom-sheet dialog ───────────────────────────────────── */
.rp-sheet {
  width: min(96vw, 920px);
  max-height: 88vh;
  margin: auto;
  padding: 0;
  border: 1px solid rgba(212, 175, 55, 0.18);
  border-radius: 16px;
  background: #0a0e1c;
  color: rgba(255,255,255,0.85);
  box-shadow: 0 30px 90px rgba(0,0,0,0.7);
  overflow: hidden;
}
.rp-sheet::backdrop {
  background: rgba(2, 4, 10, 0.78);
  backdrop-filter: blur(4px);
}

.rp-sheet__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 24px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  position: sticky;
  top: 0;
  background: linear-gradient(180deg, #0a0e1c, rgba(10,14,28,0.92));
  z-index: 5;
}
.rp-sheet__title-block { display: flex; flex-direction: column; gap: 2px; }
.rp-sheet__eyebrow {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--c-gold);
  opacity: 0.75;
}
.rp-sheet__title {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 700;
  color: #ffffff;
  margin: 0;
  line-height: 1.1;
}
.rp-sheet__close {
  width: 36px; height: 36px;
  border: 1px solid rgba(255,255,255,0.12);
  background: transparent;
  border-radius: 50%;
  color: rgba(255,255,255,0.62);
  font-size: 14px;
  cursor: pointer;
  transition: background 0.18s, color 0.18s, border-color 0.18s;
}
.rp-sheet__close:hover {
  background: rgba(255,255,255,0.06);
  color: #ffffff;
  border-color: rgba(255,255,255,0.30);
}

.rp-sheet__body {
  padding: 18px 24px 24px;
  overflow-y: auto;
  max-height: calc(88vh - 76px);
}

/* ── Quick-jump (featured race) ────────────────────────────── */
.rp-quick {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 20px;
  border: 1px solid rgba(212, 175, 55, 0.32);
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(212,175,55,0.10), rgba(212,175,55,0.02));
  color: inherit;
  text-decoration: none;
  margin-bottom: 18px;
  transition: border-color 0.18s, transform 0.18s;
}
.rp-quick:hover {
  border-color: var(--c-gold);
  transform: translateY(-1px);
}
.rp-quick__star {
  font-size: 28px;
  color: var(--c-gold);
  line-height: 1;
}
.rp-quick__body { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0; }
.rp-quick__label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--c-gold);
}
.rp-quick__name {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 700;
  color: #ffffff;
  line-height: 1.1;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.rp-quick__meta { font-size: 12px; color: rgba(255,255,255,0.55); }
.rp-quick__arrow { color: var(--c-gold); font-size: 18px; }

/* ── Date strip ────────────────────────────────────────────── */
.rp-dates {
  display: flex;
  gap: 8px;
  margin-bottom: 18px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 4px;
}
.rp-date-chip {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 10px 18px;
  border: 1px solid rgba(255,255,255,0.10);
  border-radius: 10px;
  background: rgba(255,255,255,0.025);
  color: rgba(255,255,255,0.85);
  text-decoration: none;
  text-align: center;
  min-width: 100px;
  transition: border-color 0.18s, background 0.18s;
}
.rp-date-chip:hover {
  border-color: rgba(212,175,55,0.40);
  background: rgba(212,175,55,0.06);
}
.rp-date-chip.is-current {
  border-color: var(--c-gold);
  background: rgba(212,175,55,0.12);
}
.rp-date-chip__label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--c-gold);
}
.rp-date-chip__date {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 16px;
  color: #ffffff;
}
.rp-date-chip__count { font-size: 11px; color: rgba(255,255,255,0.50); }

/* ── Meeting timetable grid ────────────────────────────────── */
.rp-grid {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.rp-meeting {
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 12px;
  padding: 16px 18px;
  background: rgba(255,255,255,0.015);
  transition: border-color 0.18s;
}
.rp-meeting.is-current {
  border-color: rgba(212,175,55,0.30);
  background: rgba(212,175,55,0.04);
}

.rp-meeting__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.rp-meeting__name {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 700;
  color: #ffffff;
  margin: 0;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.rp-meeting__sub {
  font-size: 11px;
  color: rgba(255,255,255,0.45);
  font-variant-numeric: tabular-nums;
}

.rp-races {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 6px;
}

.rp-race {
  position: relative;
  display: grid;
  grid-template-columns: 56px 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 8px;
  background: rgba(255,255,255,0.015);
  text-decoration: none;
  color: rgba(255,255,255,0.85);
  transition: border-color 0.16s, background 0.16s, transform 0.14s;
}
.rp-race:hover {
  border-color: rgba(212,175,55,0.40);
  background: rgba(212,175,55,0.06);
  transform: translateX(2px);
}
.rp-race--viewing {
  border-color: var(--c-gold);
  background: rgba(212,175,55,0.10);
  box-shadow: 0 0 0 1px rgba(212,175,55,0.30);
}
.rp-race--next {
  border-color: rgba(45,189,122,0.45);
  background: rgba(45,189,122,0.06);
}
.rp-race--result { opacity: 0.85; }

.rp-race__time {
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--c-gold);
  font-size: 16px;
  font-variant-numeric: tabular-nums;
}
.rp-race__name {
  font-size: 12.5px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  color: rgba(255,255,255,0.78);
}
.rp-race__chips {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.rp-race__badge {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  padding: 2px 7px;
  border-radius: 99px;
  background: rgba(45,189,122,0.16);
  color: #79e0ad;
  border: 1px solid rgba(45,189,122,0.40);
}
.rp-race__badge--viewing {
  background: rgba(212,175,55,0.14);
  color: var(--c-gold);
  border-color: rgba(212,175,55,0.40);
}
/* Spoiler-aware reveal chip — sits on resulted-race tiles inside the
 * picker sheet. Default state shows "👁 Reveal" (winner hidden); on
 * click it flips to "🏆 <winner name>". Persisted via
 * sr_revealed_races localStorage so reveals stay across sessions and
 * surfaces (sheet + popover + meeting-full + meetings-browse). */
.rp-race__result {
  display: inline-flex;
  align-items: center;
  position: relative;
  padding: 3px 9px;
  border-radius: 999px;
  background: rgba(45, 189, 122, 0.10);
  border: 1px solid rgba(45, 189, 122, 0.35);
  cursor: pointer;
  user-select: none;
  font-size: 10px;
  font-weight: 600;
  color: #2DBD7A;
  letter-spacing: 0.04em;
  white-space: nowrap;
  transition: background .15s, border-color .15s, color .15s;
}
.rp-race__result:hover,
.rp-race__result:focus-visible {
  background: rgba(45, 189, 122, 0.18);
  border-color: rgba(45, 189, 122, 0.55);
  outline: none;
}
.rp-race__result:focus-visible {
  box-shadow: 0 0 0 2px rgba(45, 189, 122, 0.35);
}
/* Face swap via aria-pressed — hidden by default, revealed when set. */
.rp-race__result-face--hidden,
.rp-race__result-face--revealed {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.rp-race__result-face--revealed { display: none; }
.rp-race__result[aria-pressed="true"] .rp-race__result-face--hidden { display: none; }
.rp-race__result[aria-pressed="true"] .rp-race__result-face--revealed { display: inline-flex; }
.rp-race__result[aria-pressed="true"] {
  background: rgba(45, 189, 122, 0.18);
  border-color: rgba(45, 189, 122, 0.55);
}

/* Same treatment for the inline minute popover. The chip sits inside
 * a tighter row (rp-pop__item) so we trim the padding a touch. */
.rp-pop__result {
  display: inline-flex;
  align-items: center;
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(45, 189, 122, 0.10);
  border: 1px solid rgba(45, 189, 122, 0.35);
  color: #2DBD7A;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.04em;
  white-space: nowrap;
  cursor: pointer;
  user-select: none;
  transition: background .15s, border-color .15s;
}
.rp-pop__result:hover { background: rgba(45, 189, 122, 0.18); border-color: rgba(45, 189, 122, 0.55); }
.rp-pop__result-face--hidden,
.rp-pop__result-face--revealed { display: inline-flex; align-items: center; gap: 4px; }
.rp-pop__result-face--revealed { display: none; }
.rp-pop__result[aria-pressed="true"] .rp-pop__result-face--hidden { display: none; }
.rp-pop__result[aria-pressed="true"] .rp-pop__result-face--revealed { display: inline-flex; }
.rp-pop__result[aria-pressed="true"] {
  background: rgba(45, 189, 122, 0.18);
  border-color: rgba(45, 189, 122, 0.55);
}

/* Star — used in chips / pop-items / quick-jump */
.rp-star {
  display: inline-block;
  color: var(--c-gold);
  filter: drop-shadow(0 0 4px rgba(212,175,55,0.4));
}

/* ── Hover preview tooltip (desktop) ───────────────────────── */
@media (hover: hover) and (pointer: fine) {
  .rp-race[data-tooltip]::after {
    content: attr(data-tooltip);
    position: absolute;
    left: 50%;
    bottom: calc(100% + 8px);
    transform: translateX(-50%);
    padding: 8px 12px;
    background: #06081a;
    border: 1px solid rgba(212,175,55,0.30);
    border-radius: 8px;
    font-size: 11px;
    font-weight: 500;
    color: rgba(255,255,255,0.92);
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.18s 0.4s;
    z-index: 10;
    box-shadow: 0 8px 24px rgba(0,0,0,0.55);
  }
  .rp-race[data-tooltip]:hover::after { opacity: 1; }
}

/* ── Recent races (P4) ─────────────────────────────────────── */
.rp-recent {
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid rgba(255,255,255,0.06);
}
.rp-recent__title {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.50);
  margin: 0 0 10px;
}
.rp-recent__list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.rp-recent__chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border: 1px solid rgba(255,255,255,0.10);
  border-radius: 99px;
  background: rgba(255,255,255,0.02);
  color: rgba(255,255,255,0.78);
  text-decoration: none;
  font-size: 12px;
  transition: border-color 0.16s;
}
.rp-recent__chip:hover { border-color: rgba(212,175,55,0.40); color: #ffffff; }
.rp-recent__chip-time {
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--c-gold);
}

/* ── Mobile ────────────────────────────────────────────────── */
@media (max-width: 720px) {
  /* Inline picker collapses to one tap target — Switch race opens
     the bottom sheet directly. Hide the desktop chips. */
  .rp-chip,
  .rp-date-tail { display: none; }
  .rp-switch {
    flex: 1;
    justify-content: space-between;
    padding: 9px 14px;
    border-style: solid;
    border-color: rgba(212,175,55,0.32);
    background: rgba(212,175,55,0.06);
    color: var(--c-gold);
    font-size: 12px;
  }
  .rp-switch::before {
    content: attr(data-mobile-label);
  }

  /* Toolbar — tighter padding on mobile. The inner already uses
     gn-container which collapses its side padding on narrow screens. */
  .race-toolbar__inner { min-height: 48px; padding-top: 6px; padding-bottom: 6px; }
  .rp-inline { gap: 8px; }

  .rp-sheet {
    width: 100vw;
    max-width: 100vw;
    max-height: 92vh;
    margin: auto auto 0;
    border-radius: 16px 16px 0 0;
    border-bottom: none;
  }
  .rp-sheet__body { padding: 16px; }
  .rp-races { grid-template-columns: 1fr; }

  /* Hide the desktop hover-preview tooltip on touch — long-press
     would be confusing and tap already navigates. */
  .rp-race[data-tooltip]::after { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .rp-pop, .rp-next-pill__dot, .rp-race { animation: none; transition: none; }
}


/* Phase 4: gold-pill Switch button + Up next chip ribbon. */

.rp-switch--primary {
  /* margin-left: auto pushes Browse to the right edge of .rp-inline
     so the left-aligned NEXT pill + meeting/time chips have a clear
     gap from the marquee CTA. Falls back gracefully when chips wrap. */
  margin-left: auto;
  border: 1px solid var(--c-gold, #D4AF37);
  border-style: solid;
  background: rgba(212, 175, 55, 0.10);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: none;
  padding: 8px 14px;
  box-shadow: 0 2px 6px rgba(212, 175, 55, 0.18);
  white-space: nowrap;
}
.rp-switch--primary:hover {
  background: rgba(212, 175, 55, 0.20);
  border-color: var(--c-gold, #D4AF37);
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(212, 175, 55, 0.32);
}
.rp-switch--primary:active { transform: translateY(0); }

.rp-switch__icon {
  font-size: 13px;
  line-height: 1;
}
.rp-switch__chev {
  margin-left: 2px;
  color: var(--c-gold, #D4AF37);
  font-weight: 700;
}

/* ── Up next ribbon ─────────────────────────────────────────── */
.rp-upnext {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 10px;
  padding: 8px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  overflow: hidden;
}
.rp-upnext__label {
  flex-shrink: 0;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.50);
}
.rp-upnext__list {
  list-style: none;
  margin: 0; padding: 0 4px 0 0;
  display: flex;
  gap: 8px;
  overflow-x: auto;
  flex: 1 1 auto;
  /* min-width:0 lets the flex item shrink below its content size so
     the horizontal scrollbar appears inside the container instead
     of pushing the strip off the viewport. */
  min-width: 0;
  scrollbar-width: thin;
  scrollbar-color: rgba(212, 175, 55, 0.30) transparent;
}
.rp-upnext__list::-webkit-scrollbar { height: 6px; }
.rp-upnext__list::-webkit-scrollbar-thumb {
  background: rgba(212, 175, 55, 0.30); border-radius: 4px;
}

.rp-upnext__item { flex-shrink: 0; }
.rp-upnext__chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.10);
  border-radius: 99px;
  color: rgba(255, 255, 255, 0.86);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  text-decoration: none;
  transition: background 0.14s, border 0.14s, transform 0.10s;
}
.rp-upnext__chip:hover {
  background: rgba(255, 255, 255, 0.10);
  border-color: rgba(212, 175, 55, 0.45);
  transform: translateY(-1px);
}
.rp-upnext__time {
  font-weight: 800;
  color: #fff;
  font-variant-numeric: tabular-nums;
}
.rp-upnext__course {
  color: rgba(255, 255, 255, 0.78);
}

/* "Next off" chip pops out so the imminent race is unmissable. */
.rp-upnext__chip--next {
  background: rgba(26, 125, 74, 0.18);
  border-color: rgba(26, 125, 74, 0.55);
}
.rp-upnext__chip--next .rp-upnext__time { color: #4ade80; }
.rp-upnext__next-badge {
  margin-left: 4px;
  padding: 1px 7px;
  border-radius: 99px;
  background: rgba(26, 125, 74, 0.55);
  color: #fff;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

/* Featured (big-race) star chip — gold accents. */
.rp-upnext__chip--featured {
  border-color: rgba(212, 175, 55, 0.55);
}
.rp-upnext__chip--featured .rp-upnext__star {
  color: var(--c-gold, #D4AF37);
  font-size: 11px;
}

/* ── Mobile: stack label above scroll strip, slim chip padding ── */
@media (max-width: 640px) {
  .rp-upnext {
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
    padding: 8px 0 6px;
  }
  .rp-upnext__label { padding-left: 4px; }
  .rp-upnext__list  { padding-right: 12px; }
  .rp-upnext__chip  { padding: 5px 10px; font-size: 11.5px; }

  .rp-switch--primary {
    padding: 7px 12px;
    font-size: 11.5px;
  }
}
