/**
 * Race Day v3 — Styles
 *
 * Built from logging-specimen.html patterns, mapped to production token system.
 * Uses semantic tokens from tokens.css — no hardcoded colors.
 *
 * Phase 3 — Race Day (Runner View)
 */

/* ========================================
   LAYOUT
   ======================================== */
.race-day-app {
  font-family: var(--font-base);
  background: var(--bg-deep);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  height: 100dvh;
  width: 100%;
  max-width: 430px;
  margin: 0 auto;
  position: relative;
  overflow: hidden;
}

/* ========================================
   DASHBOARD
   ======================================== */
.rd-dashboard {
  position: absolute;
  inset: 0;
  padding: var(--space-3) var(--space-4);
  padding-bottom: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  opacity: 1;
  transition: opacity var(--transition-slow);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
.rd-dashboard.dimmed { opacity: 0.15; pointer-events: none; }

/* -- Hero: Clock + Lap + Countdown -- */
.rd-hero { text-align: center; padding: var(--space-4) 0 var(--space-2); }
.rd-hero__title {
  font-family: var(--font-condensed);
  font-size: 11px; font-weight: 500; letter-spacing: 1.5px;
  text-transform: uppercase; color: var(--text-muted); margin-bottom: var(--space-1);
}
.rd-hero__clock {
  font-family: var(--font-condensed);
  font-size: 52px; font-weight: 500; color: var(--text); letter-spacing: -1px; line-height: 1;
}
.rd-hero__lap { font-size: 16px; color: var(--primary); font-weight: 600; margin-top: var(--space-1); }
.rd-hero__countdown { font-size: 13px; color: var(--text-secondary); margin-top: 3px; }
.rd-hero__countdown.warning { color: var(--warning); }
.rd-hero__countdown.danger { color: var(--danger); animation: rd-pulse-text 1s infinite; }
.rd-hero__status {
  display: flex; align-items: center; gap: var(--space-1);
  justify-content: center; margin-top: var(--space-2);
}
.rd-hero__status-dot {
  width: 7px; height: 7px; border-radius: 50%; background: var(--success);
  animation: rd-pulse-dot 2s infinite;
}
.rd-hero__status-dot.offline { background: var(--warning); animation: none; }
.rd-hero__status-text { font-size: 11px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 1px; }

@keyframes rd-pulse-dot { 0%,100%{opacity:1} 50%{opacity:0.4} }
@keyframes rd-pulse-text { 0%,100%{opacity:1} 50%{opacity:0.6} }

/* -- Dashboard Card -- */
.rd-card {
  padding: var(--space-3);
  background: var(--surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  display: flex; flex-direction: column; gap: var(--space-2);
}
.rd-card__title {
  font-size: 10px; font-weight: 600; text-transform: uppercase;
  letter-spacing: 1px; color: var(--text-muted);
}

/* -- Macro Progress Bars -- */
.rd-macro { display: flex; align-items: center; gap: var(--space-2); }
.rd-macro__label {
  font-size: 11px; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.5px; color: var(--text-secondary); width: 52px; flex-shrink: 0;
}
.rd-macro__bar-wrap { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.rd-macro__bar { height: 8px; background: var(--surface-alt); border-radius: var(--radius-sm); overflow: hidden; }
.rd-macro__fill { height: 100%; border-radius: var(--radius-sm); transition: width 0.5s ease; }
.rd-macro__fill--carbs { background: var(--carbs); }
.rd-macro__fill--fluids { background: var(--fluids); }
.rd-macro__fill--sodium { background: var(--sodium); }
.rd-macro__fill--caffeine { background: var(--caffeine); }
.rd-macro__fill--protein { background: var(--protein); }
.rd-macro__fill--fiber { background: var(--fiber); }
.rd-macro__values { display: flex; justify-content: space-between; }
.rd-macro__cumulative { font-size: 11px; font-weight: 600; color: var(--text-secondary); }
.rd-macro__perlap { font-size: 10px; color: var(--text-muted); }

/* -- Last Lap Summary -- */
.rd-lastlap {
  display: flex; justify-content: space-around; text-align: center;
  padding: var(--space-2) 0;
}
.rd-lastlap__item { display: flex; flex-direction: column; gap: 1px; }
.rd-lastlap__value {
  font-family: var(--font-condensed);
  font-size: 18px; font-weight: 600; color: var(--text);
}
.rd-lastlap__label {
  font-size: 9px; text-transform: uppercase; letter-spacing: 0.8px; color: var(--text-muted);
}

/* -- Intake Trend (3-lap moving average) -- */
.rd-trend { display: flex; flex-direction: column; gap: var(--space-2); }
.rd-trend__row {
  display: flex; align-items: center; gap: var(--space-2);
  padding: var(--space-1) 0;
}
.rd-trend__label {
  font-size: 11px; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.5px; color: var(--text-secondary); width: 52px; flex-shrink: 0;
}
.rd-trend__spark {
  flex: 1; height: 24px; display: flex; align-items: flex-end; gap: 3px;
}
.rd-trend__bar {
  flex: 1; border-radius: 2px 2px 0 0; min-height: 2px;
  transition: height var(--transition-slow);
}
.rd-trend__avg {
  font-family: var(--font-condensed);
  font-size: 13px; font-weight: 600; width: 50px; text-align: right; flex-shrink: 0;
}
.rd-trend__dir {
  font-size: 12px; width: 20px; text-align: center; flex-shrink: 0; font-weight: 700;
}
.rd-trend__dir--up { color: var(--success); }
.rd-trend__dir--down { color: var(--danger); }
.rd-trend__dir--flat { color: var(--text-muted); }
.rd-trend__note {
  font-size: 11px; color: var(--text-muted); text-align: center;
  padding-top: var(--space-1); border-top: 1px solid var(--border);
}
.rd-trend__note strong { color: var(--warning); font-weight: 600; }

/* -- Per-Lap Breakdown (expandable) -- */
.rd-expand {
  border: 1px solid var(--border); border-radius: var(--radius-md); overflow: hidden;
}
.rd-expand__trigger {
  width: 100%; display: flex; align-items: center; justify-content: space-between;
  padding: var(--space-2) var(--space-3); background: var(--surface); border: none;
  color: var(--text-secondary); font-family: var(--font-base);
  font-size: 12px; font-weight: 600; cursor: pointer; -webkit-tap-highlight-color: transparent;
}
.rd-expand__trigger:active { background: var(--surface-alt); }
.rd-expand__arrow { font-size: 11px; transition: transform 0.2s ease; color: var(--text-muted); }
.rd-expand.open .rd-expand__arrow { transform: rotate(180deg); }
.rd-expand__content { max-height: 0; overflow: hidden; transition: max-height 0.3s ease-out; }
.rd-expand__inner { padding: var(--space-2) var(--space-3) var(--space-3); border-top: 1px solid var(--border); }

.rd-perlap { display: flex; flex-direction: column; gap: var(--space-2); }
.rd-perlap__row { display: flex; align-items: center; gap: var(--space-2); }
.rd-perlap__label {
  font-family: var(--font-condensed);
  font-size: 11px; font-weight: 500; color: var(--text-muted); width: 32px; flex-shrink: 0; text-align: right;
}
.rd-perlap__bars { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.rd-perlap__bar { height: 5px; border-radius: 3px; }
.rd-perlap__bar--carbs { background: var(--carbs); }
.rd-perlap__bar--fluids { background: var(--fluids); }
.rd-perlap__bar--sodium { background: var(--sodium); }
.rd-perlap__totals { font-size: 9px; color: var(--text-muted); width: 90px; flex-shrink: 0; text-align: right; }
.rd-perlap__legend { display: flex; gap: var(--space-3); justify-content: center; margin-top: var(--space-2); }
.rd-perlap__legend-item { display: flex; align-items: center; gap: 4px; font-size: 9px; color: var(--text-muted); }
.rd-perlap__legend-dot { width: 6px; height: 6px; border-radius: 50%; }

/* -- Runner In Button (dashboard) -- */
.rd-runner-in-btn {
  margin-top: auto; flex-shrink: 0;
  padding: var(--space-4) var(--space-5);
  background: var(--primary); color: var(--text-on-primary); border: none;
  border-radius: var(--radius-lg); font-family: var(--font-base);
  font-size: 18px; font-weight: 700; letter-spacing: 0.5px;
  text-transform: uppercase; cursor: pointer;
  -webkit-tap-highlight-color: transparent; transition: all var(--transition-fast);
  position: sticky; bottom: var(--space-3);
  box-shadow: var(--shadow-glow-cyan);
}
.rd-runner-in-btn:active { transform: scale(0.97); opacity: 0.9; }

/* -- Go to Dashboard button (for crew, separate from Runner In) -- */
.rd-goto-dashboard-btn {
  padding: var(--space-3) var(--space-4);
  background: var(--surface); color: var(--text-secondary); border: 1px solid var(--border);
  border-radius: var(--radius-md); font-family: var(--font-base);
  font-size: 14px; font-weight: 600; cursor: pointer;
  -webkit-tap-highlight-color: transparent; transition: all var(--transition-fast);
}
.rd-goto-dashboard-btn:active { background: var(--surface-alt); }

/* ========================================
   LOGGING OVERLAY
   ======================================== */
.rd-overlay {
  position: fixed; inset: 0;
  max-width: 430px; margin: 0 auto;
  background: var(--bg-deep); z-index: var(--z-overlay);
  display: flex; flex-direction: column;
  transform: translateY(100%);
  transition: transform 0.35s cubic-bezier(0.32, 0.72, 0, 1);
  overflow: hidden;
}
.rd-overlay.open { transform: translateY(0); }

/* -- Runner In Banner (inside overlay) -- */
.rd-rib {
  flex-shrink: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: var(--space-3);
  padding: var(--space-12) var(--space-4);
  background: var(--bg-deep);
  position: absolute; inset: 0;
  z-index: 10;
  transition: opacity var(--transition-slow), transform var(--transition-slow);
}
.rd-rib.dismissed {
  opacity: 0; transform: translateY(-20px); pointer-events: none;
}
.rd-rib__lap {
  font-family: var(--font-condensed);
  font-size: 16px; font-weight: 500; letter-spacing: 1.5px;
  text-transform: uppercase; color: var(--text-muted);
}
.rd-rib__countdown {
  font-family: var(--font-condensed);
  font-size: 48px; font-weight: 600; color: var(--text); line-height: 1;
}
.rd-rib__countdown.warning { color: var(--warning); }
.rd-rib__countdown.danger { color: var(--danger); animation: rd-pulse-text 1s infinite; }
.rd-rib__btn {
  width: 100%; max-width: 320px;
  padding: var(--space-5) var(--space-8);
  background: var(--primary); color: var(--text-on-primary); border: none;
  border-radius: var(--radius-xl);
  font-family: var(--font-base); font-size: 22px; font-weight: 700;
  letter-spacing: 1px; text-transform: uppercase;
  cursor: pointer; -webkit-tap-highlight-color: transparent;
  transition: all 0.12s ease;
  box-shadow: var(--shadow-glow-cyan);
}
.rd-rib__btn:active { transform: scale(0.96); opacity: 0.9; }
.rd-rib__hint { font-size: 12px; color: var(--text-muted); margin-top: var(--space-2); }
.rd-rib__close {
  position: absolute; top: var(--space-4); right: var(--space-4);
  width: 36px; height: 36px; border-radius: 50%;
  border: 1px solid var(--border-strong); background: transparent;
  color: var(--text-secondary); font-size: 18px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; -webkit-tap-highlight-color: transparent;
}
.rd-rib__close:active { background: var(--surface-alt); }

/* -- Context Bar -- */
.rd-context {
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: space-between;
  padding: var(--space-2) var(--space-4);
  background: var(--surface); border-bottom: 1px solid var(--border);
}
.rd-context__left { display: flex; flex-direction: column; gap: 2px; }
.rd-context__lap {
  font-family: var(--font-condensed);
  font-size: 17px; font-weight: 600; color: var(--primary);
}
.rd-context__rest { font-size: 12px; color: var(--text-muted); }
.rd-context__rest strong { color: var(--text-secondary); font-weight: 600; }
.rd-context__close {
  width: 30px; height: 30px; border-radius: 50%;
  border: 1px solid var(--border-strong); background: transparent;
  color: var(--text-secondary); display: flex; align-items: center; justify-content: center;
  cursor: pointer; -webkit-tap-highlight-color: transparent;
}
.rd-context__close:active { background: var(--surface-alt); }

/* -- Targets Strip -- */
.rd-targets {
  flex-shrink: 0;
  padding: var(--space-1) var(--space-4) var(--space-2);
  background: var(--surface-alt); border-bottom: 1px solid var(--border);
  display: flex; flex-direction: column; gap: 3px;
}
.rd-targets__row { display: flex; justify-content: space-around; }
.rd-target { text-align: center; flex: 1; }
.rd-target__value {
  font-family: var(--font-condensed);
  font-size: 14px; font-weight: 600; color: var(--text);
}
.rd-target__value span { color: var(--text-muted); font-weight: 400; }
.rd-target__label {
  font-size: 10px; text-transform: uppercase; letter-spacing: 0.8px;
  color: var(--text-muted); margin-top: 1px;
}
.rd-target--ok .rd-target__value { color: var(--success); }
.rd-target--behind .rd-target__value { color: var(--warning); }
.rd-target--critical .rd-target__value { color: var(--danger); }
.rd-target__projected {
  font-family: var(--font-condensed);
  font-size: 11px; font-weight: 600; margin-top: 1px;
  min-height: 16px;
  opacity: 0; transition: opacity var(--transition-fast);
}
.rd-target__projected.visible { opacity: 1; }
.rd-target__projected--ahead { color: var(--success); }
.rd-target__projected--behind { color: var(--warning); }
.rd-target__projected--critical { color: var(--danger); }
.rd-target__projected--even { color: var(--text-muted); }
.rd-targets__hint {
  font-size: 11px; color: var(--text-secondary); text-align: center;
  line-height: 1.2; padding: 0 var(--space-2);
}

/* -- Scrollable Content -- */
.rd-content {
  flex: 1; overflow-y: scroll; overflow-x: hidden;
  padding: var(--space-3) var(--space-4);
  display: flex; flex-direction: column; gap: var(--space-3);
  touch-action: pan-y;
  -webkit-overflow-scrolling: touch;
}

/* -- Category Sections -- */
.rd-category { display: flex; flex-direction: column; gap: 4px; }
.rd-category__header {
  font-size: 10px; font-weight: 600; text-transform: uppercase;
  letter-spacing: 1.2px; color: var(--text-muted); padding-left: 2px;
}
.rd-category__grid { display: grid; grid-template-columns: repeat(3, 1fr); grid-auto-rows: 62px; gap: 5px; }

/* -- Fuel Item -- */
.rd-fuel {
  position: relative; display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  padding: var(--space-2) var(--space-1); height: 62px;
  background: var(--surface); border: 2px solid var(--border);
  border-radius: var(--radius-md); cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: border-color 0.12s ease, background 0.12s ease; user-select: none;
  touch-action: pan-y; overflow: hidden;
}
.rd-fuel:active { transform: scale(0.96); }
.rd-fuel.selected { border-color: var(--primary); background: var(--primary-subtle); }
.rd-fuel.selected .rd-fuel__color,
.rd-fuel.selected .rd-fuel__name,
.rd-fuel.selected .rd-fuel__macro { transform: translateY(-10px); }

.rd-fuel__color { width: 6px; height: 6px; border-radius: 50%; margin-bottom: 2px; transition: transform var(--transition-fast); }
.rd-fuel__name { font-size: 12px; font-weight: 600; color: var(--text); text-align: center; line-height: 1.2; transition: transform var(--transition-fast); }
.rd-fuel__macro { font-size: 9px; color: var(--text-muted); margin-top: 1px; transition: transform var(--transition-fast); }

/* Quantity badge */
.rd-fuel__badge {
  position: absolute; top: -1px; right: -1px;
  min-width: 28px; height: 22px; padding: 0 6px;
  background: var(--primary); color: var(--text-on-primary);
  font-size: 11px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  border-radius: 0 var(--radius-md) 0 var(--radius-sm);
  opacity: 0; transform: scale(0.5); transition: all var(--transition-fast);
}
.rd-fuel.selected .rd-fuel__badge { opacity: 1; transform: scale(1); }

/* Count controls */
.rd-fuel__controls {
  position: absolute; bottom: 0; left: 0; right: 0;
  display: flex; height: 0; overflow: hidden;
  transition: height var(--transition-fast);
  background: var(--surface-alt);
  border-top: 1px solid var(--border);
}
.rd-fuel.selected .rd-fuel__controls { height: 22px; }
.rd-fuel__ctrl {
  flex: 1; display: flex; align-items: center; justify-content: center;
  border: none; background: transparent; color: var(--primary);
  font-size: 16px; font-weight: 700; cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.rd-fuel__ctrl:active { background: var(--surface-raised); }
.rd-fuel__ctrl-divider { width: 1px; background: var(--border); }

/* Swipe-to-remove */
.rd-fuel__swipe {
  position: absolute; right: 0; top: 0; bottom: 0; width: 0;
  background: var(--danger); display: flex; align-items: center; justify-content: center;
  overflow: hidden; transition: width 0.2s ease;
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
}
.rd-fuel.swiping .rd-fuel__swipe { width: 56px; }
.rd-fuel__swipe svg { width: 20px; height: 20px; fill: white; opacity: 0.9; }
@media (hover: hover) and (pointer: fine) {
  .rd-fuel__swipe { display: none; }
}

/* -- Drag handle for sortable -- */
.rd-fuel__drag {
  display: none;
  position: absolute; top: 2px; left: 2px;
  width: 16px; height: 16px;
  color: var(--text-muted); opacity: 0.5; cursor: grab;
}
.rd-category__grid.sortable .rd-fuel__drag { display: flex; }

/* -- Mood -- */
.rd-mood { display: flex; flex-direction: column; gap: 4px; }
.rd-mood__header {
  font-size: 10px; font-weight: 600; text-transform: uppercase;
  letter-spacing: 1.2px; color: var(--text-muted); padding-left: 2px;
}
.rd-mood__grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 5px; }
.rd-mood-btn {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: var(--space-2) var(--space-1); min-height: 52px;
  border: 2px solid transparent; border-radius: var(--radius-md);
  cursor: pointer; -webkit-tap-highlight-color: transparent; background: transparent;
  transition: all 0.12s ease; user-select: none;
}
.rd-mood-btn:active { transform: scale(0.94); }
.rd-mood-btn__label { font-size: 9px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; margin-top: 3px; }
.rd-mood-btn__icon { font-size: 20px; line-height: 1; }

.rd-mood-btn--1 { background: var(--danger-subtle); }
.rd-mood-btn--1 .rd-mood-btn__label { color: var(--danger); }
.rd-mood-btn--1.selected { border-color: var(--danger); background: rgba(239,68,68,0.3); }

.rd-mood-btn--2 { background: rgba(249,115,22,0.15); }
.rd-mood-btn--2 .rd-mood-btn__label { color: #FB923C; }
.rd-mood-btn--2.selected { border-color: #FB923C; background: rgba(249,115,22,0.3); }

.rd-mood-btn--3 { background: var(--warning-subtle); }
.rd-mood-btn--3 .rd-mood-btn__label { color: var(--warning); }
.rd-mood-btn--3.selected { border-color: var(--warning); background: rgba(251,191,36,0.3); }

.rd-mood-btn--4 { background: var(--success-subtle); }
.rd-mood-btn--4 .rd-mood-btn__label { color: var(--success); }
.rd-mood-btn--4.selected { border-color: var(--success); background: rgba(74,222,128,0.3); }

.rd-mood-btn--5 { background: var(--info-subtle); }
.rd-mood-btn--5 .rd-mood-btn__label { color: var(--info); }
.rd-mood-btn--5.selected { border-color: var(--info); background: rgba(96,165,250,0.3); }

/* -- Collapsible -- */
.rd-collapsible { border: 1px solid var(--border); border-radius: var(--radius-md); overflow: hidden; }
.rd-collapsible__trigger {
  width: 100%; display: flex; align-items: center; justify-content: space-between;
  padding: var(--space-2) var(--space-4); background: var(--surface); border: none;
  color: var(--text-secondary); font-family: var(--font-base);
  font-size: 13px; font-weight: 600; cursor: pointer; -webkit-tap-highlight-color: transparent;
}
.rd-collapsible__trigger:active { background: var(--surface-alt); }
.rd-collapsible__arrow { font-size: 12px; transition: transform 0.2s ease; color: var(--text-muted); }
.rd-collapsible.open .rd-collapsible__arrow { transform: rotate(180deg); }
.rd-collapsible__content { max-height: 0; overflow: hidden; transition: max-height 0.3s ease-out; }
.rd-collapsible__inner { padding: var(--space-3) var(--space-4) var(--space-4); border-top: 1px solid var(--border); }

/* Crew Tags */
.rd-tags { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.rd-tags__group-label {
  font-size: 10px; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.8px; color: var(--text-muted); width: 100%;
  margin-top: var(--space-2); margin-bottom: 2px;
}
.rd-tags__group-label:first-child { margin-top: 0; }
.rd-tag {
  padding: 6px 12px; background: var(--surface-alt);
  border: 1px solid var(--border); border-radius: var(--radius-pill);
  font-size: 12px; font-weight: 500; color: var(--text-secondary);
  cursor: pointer; -webkit-tap-highlight-color: transparent; transition: all 0.12s ease;
}
.rd-tag:active { transform: scale(0.95); }
.rd-tag.selected { background: var(--primary-subtle); border-color: var(--primary); color: var(--primary-hover); }

/* -- Voice Note -- */
.rd-voice {
  display: flex; align-items: center; gap: var(--space-2);
  padding: var(--space-2) var(--space-4); background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius-md);
  cursor: pointer; -webkit-tap-highlight-color: transparent; transition: all var(--transition-fast);
}
.rd-voice:active { background: var(--surface-alt); }
.rd-voice.recording { border-color: var(--danger); background: var(--danger-subtle); }
.rd-voice__icon {
  width: 30px; height: 30px; border-radius: 50%;
  background: var(--surface-alt); display: flex; align-items: center;
  justify-content: center; flex-shrink: 0; transition: all var(--transition-fast);
}
.rd-voice.recording .rd-voice__icon { background: var(--danger); animation: rd-pulse-record 1s infinite; }
@keyframes rd-pulse-record { 0%,100%{box-shadow:0 0 0 0 rgba(239,68,68,0.4)} 50%{box-shadow:0 0 0 8px rgba(239,68,68,0)} }
.rd-voice__icon svg { width: 18px; height: 18px; fill: var(--text-secondary); }
.rd-voice.recording .rd-voice__icon svg { fill: white; }
.rd-voice__text { font-size: 13px; color: var(--text-secondary); }
.rd-voice.recording .rd-voice__text { color: var(--danger); }
.rd-voice__duration {
  margin-left: auto; font-family: var(--font-condensed);
  font-size: 16px; font-weight: 500; color: var(--danger); display: none;
}
.rd-voice.recording .rd-voice__duration { display: block; }
/* Transcription result */
.rd-voice__transcript {
  font-size: 12px; color: var(--text-secondary); font-style: italic;
  margin-top: var(--space-1);
}

/* -- Custom Entry -- */
.rd-custom-btn {
  display: flex; align-items: center; justify-content: center; gap: var(--space-2);
  padding: var(--space-2) var(--space-4); width: 100%;
  background: var(--surface); border: 2px dashed var(--primary);
  border-radius: var(--radius-md); cursor: pointer;
  -webkit-tap-highlight-color: transparent; transition: all 0.12s ease; user-select: none;
  margin-top: var(--space-2);
}
.rd-custom-btn:active { transform: scale(0.96); background: var(--surface-alt); }
.rd-custom-btn__icon { font-size: 20px; color: var(--primary); font-weight: 700; line-height: 1; }
.rd-custom-btn__label { font-size: 14px; font-weight: 600; color: var(--primary); }
.rd-custom-btn__hint { font-size: 12px; color: var(--text-muted); margin-left: var(--space-1); }

.rd-custom-panel {
  display: none; flex-direction: column; gap: var(--space-3);
  padding: var(--space-4); background: var(--surface);
  border: 1px solid var(--primary); border-radius: var(--radius-lg);
}
.rd-custom-panel.open { display: flex; }
.rd-custom-panel__header { display: flex; align-items: center; justify-content: space-between; }
.rd-custom-panel__title {
  font-size: 13px; font-weight: 600; text-transform: uppercase;
  letter-spacing: 1px; color: var(--primary);
}
.rd-custom-panel__close {
  width: 28px; height: 28px; border-radius: 50%;
  border: 1px solid var(--border-strong); background: transparent;
  color: var(--text-muted); font-size: 14px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; -webkit-tap-highlight-color: transparent;
}
.rd-custom-panel__close:active { background: var(--surface-alt); }
.rd-custom-panel__name {
  width: 100%; padding: var(--space-2) var(--space-3);
  background: var(--surface-alt); border: 1px solid var(--border);
  border-radius: var(--radius-sm); color: var(--text);
  font-family: var(--font-base); font-size: 14px; outline: none;
}
.rd-custom-panel__name:focus { border-color: var(--primary); }
.rd-custom-panel__name::placeholder { color: var(--text-muted); }
.rd-custom-panel__save-row { display: flex; align-items: center; gap: var(--space-3); flex-wrap: wrap; }
.rd-custom-panel__save-check {
  display: flex; align-items: center; gap: var(--space-2);
  cursor: pointer; -webkit-tap-highlight-color: transparent; user-select: none;
}
.rd-custom-panel__save-check input { display: none; }
.rd-custom-panel__save-checkmark {
  width: 20px; height: 20px; border-radius: var(--radius-sm);
  border: 2px solid var(--border-strong); background: var(--surface-alt);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; transition: all 0.12s ease;
}
.rd-custom-panel__save-check input:checked + .rd-custom-panel__save-checkmark {
  background: var(--primary); border-color: var(--primary);
}
.rd-custom-panel__save-check input:checked + .rd-custom-panel__save-checkmark::after {
  content: '\2713'; color: var(--text-on-primary); font-size: 13px; font-weight: 700;
}
.rd-custom-panel__save-label { font-size: 12px; font-weight: 500; color: var(--text-secondary); }
.rd-custom-panel__save-cats {
  display: flex; gap: var(--space-1);
  opacity: 0.3; pointer-events: none; transition: opacity var(--transition-fast);
}
.rd-custom-panel__save-cats.active { opacity: 1; pointer-events: auto; }
.rd-custom-panel__cat {
  padding: 4px 12px; border: 1px solid var(--border);
  border-radius: var(--radius-pill); background: var(--surface-alt);
  font-family: var(--font-base); font-size: 11px; font-weight: 600;
  color: var(--text-muted); cursor: pointer;
  -webkit-tap-highlight-color: transparent; transition: all 0.12s ease;
}
.rd-custom-panel__cat:active { transform: scale(0.95); }
.rd-custom-panel__cat.selected {
  background: var(--primary-subtle); border-color: var(--primary); color: var(--primary-hover);
}

.rd-stepper-grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-2); }
.rd-stepper {
  display: flex; align-items: center; gap: 0;
  background: var(--surface-alt); border: 1px solid var(--border);
  border-radius: var(--radius-md); overflow: hidden; height: 48px;
}
.rd-stepper__label {
  width: 54px; text-align: center; flex-shrink: 0;
  font-size: 10px; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.5px; color: var(--text-muted); padding: 0 2px;
}
.rd-stepper__minus, .rd-stepper__plus {
  width: 44px; height: 100%; border: none; background: transparent;
  color: var(--primary); font-size: 20px; font-weight: 700;
  cursor: pointer; -webkit-tap-highlight-color: transparent;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.rd-stepper__minus:active, .rd-stepper__plus:active { background: var(--surface-raised); }
.rd-stepper__value {
  flex: 1; text-align: center;
  font-family: var(--font-condensed);
  font-size: 18px; font-weight: 600; color: var(--text); min-width: 36px;
}
.rd-custom-panel__add {
  width: 100%; padding: var(--space-3);
  background: var(--primary); color: var(--text-on-primary); border: none;
  border-radius: var(--radius-md); font-family: var(--font-base);
  font-size: 14px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.5px; cursor: pointer;
  -webkit-tap-highlight-color: transparent; transition: all 0.12s ease;
}
.rd-custom-panel__add:active { transform: scale(0.97); opacity: 0.9; }

/* -- Summary Card -- */
.rd-summary {
  flex-shrink: 0;
  background: var(--surface); border-top: 1px solid var(--border);
  padding: var(--space-2) var(--space-4) var(--space-3);
  display: flex; flex-direction: column; gap: var(--space-2);
}
.rd-summary__items { display: flex; flex-wrap: wrap; gap: 6px; min-height: 24px; }
.rd-summary__chip {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 4px 10px; background: var(--surface-alt); border-radius: var(--radius-pill);
  font-size: 12px; color: var(--text);
}
.rd-summary__chip-qty { font-weight: 600; color: var(--primary); }
.rd-summary__empty { font-size: 12px; color: var(--text-muted); padding: 4px 0; }
.rd-summary__totals { display: flex; justify-content: space-around; }
.rd-summary__total { text-align: center; }
.rd-summary__total-value { font-family: var(--font-condensed); font-size: 20px; font-weight: 600; }
.rd-summary__total-target { font-size: 11px; color: var(--text-muted); }
.rd-summary__total-label { font-size: 10px; text-transform: uppercase; letter-spacing: 0.8px; color: var(--text-muted); margin-top: 2px; }
.rd-summary__total--ok .rd-summary__total-value { color: var(--success); }
.rd-summary__total--warn .rd-summary__total-value { color: var(--warning); }
.rd-summary__total--low .rd-summary__total-value { color: var(--primary); }

.rd-summary__nudge {
  display: none; align-items: center; gap: var(--space-2);
  padding: var(--space-2) var(--space-3);
  background: var(--warning-subtle); border: 1px solid rgba(251,191,36,0.2);
  border-radius: var(--radius-sm); font-size: 12px; color: var(--warning);
}
.rd-summary__nudge.visible { display: flex; }
.rd-summary__nudge-icon { flex-shrink: 0; }

.rd-confirm-btn {
  width: 100%; padding: var(--space-3);
  background: var(--success); color: var(--text-on-primary); border: none;
  border-radius: var(--radius-lg); font-family: var(--font-base);
  font-size: 15px; font-weight: 700; letter-spacing: 0.5px;
  text-transform: uppercase; cursor: pointer;
  -webkit-tap-highlight-color: transparent; transition: all 0.12s ease;
}
.rd-confirm-btn:active { transform: scale(0.97); }

/* -- Undo Toast -- */
.rd-undo {
  position: fixed; bottom: var(--space-4); left: 50%; transform: translateX(-50%) translateY(20px);
  max-width: 400px; width: calc(100% - 32px);
  display: flex; align-items: center; justify-content: space-between;
  padding: var(--space-3) var(--space-4);
  background: var(--surface-alt); border: 1px solid var(--border-strong);
  border-radius: var(--radius-md); z-index: var(--z-toast);
  opacity: 0; pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
}
.rd-undo.visible { opacity: 1; pointer-events: auto; transform: translateX(-50%) translateY(0); }
.rd-undo__text { font-size: 13px; color: var(--text-secondary); }
.rd-undo__text strong { color: var(--text); }
.rd-undo__bar {
  position: absolute; bottom: 0; left: 0; height: 3px;
  background: var(--primary); border-radius: 0 0 var(--radius-md) var(--radius-md);
  transition: width linear;
}
.rd-undo__btn {
  padding: var(--space-1) var(--space-3); background: transparent;
  border: 1px solid var(--primary); border-radius: var(--radius-sm);
  color: var(--primary); font-family: var(--font-base);
  font-size: 12px; font-weight: 700; text-transform: uppercase;
  cursor: pointer; -webkit-tap-highlight-color: transparent; flex-shrink: 0;
}
.rd-undo__btn:active { background: var(--primary-subtle); }

/* -- Success Flash -- */
.rd-success {
  position: fixed; inset: 0;
  max-width: 430px; margin: 0 auto;
  background: var(--bg-deep); z-index: var(--z-modal);
  display: flex; flex-direction: column; align-items: center;
  justify-content: center; gap: var(--space-4);
  opacity: 0; pointer-events: none; transition: opacity 0.2s ease;
}
.rd-success.visible { opacity: 1; pointer-events: auto; }
.rd-success__check {
  width: 80px; height: 80px; border-radius: 50%;
  background: var(--success-subtle);
  display: flex; align-items: center; justify-content: center;
  animation: rd-pop-in 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes rd-pop-in { 0%{transform:scale(0)} 100%{transform:scale(1)} }
.rd-success__check svg { width: 40px; height: 40px; stroke: var(--success); fill: none; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.rd-success__title { font-family: var(--font-condensed); font-size: 28px; font-weight: 600; color: var(--success); }
.rd-success__details { display: flex; gap: var(--space-5); color: var(--text-secondary); font-size: 14px; }
.rd-success__detail-value { font-weight: 600; color: var(--text); }
.rd-success__rest { font-size: 13px; color: var(--text-muted); }
.rd-success__back {
  margin-top: var(--space-5);
  padding: var(--space-3) var(--space-8);
  background: var(--surface); border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg); color: var(--text-secondary);
  font-family: var(--font-base); font-size: 14px; font-weight: 600;
  cursor: pointer; -webkit-tap-highlight-color: transparent; transition: all 0.12s ease;
}
.rd-success__back:active { background: var(--surface-alt); }

/* -- Preset Quick Log -- */
.rd-presets { display: flex; flex-direction: column; gap: var(--space-2); }
.rd-presets__header {
  font-size: 10px; font-weight: 600; text-transform: uppercase;
  letter-spacing: 1.2px; color: var(--text-muted); padding-left: 2px;
}
.rd-preset {
  display: flex; align-items: center; gap: var(--space-3);
  padding: var(--space-2) var(--space-3);
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-md); cursor: pointer;
  -webkit-tap-highlight-color: transparent; transition: all 0.12s ease;
}
.rd-preset:active { background: var(--surface-alt); }
.rd-preset.selected { border-color: var(--primary); background: var(--primary-subtle); }
.rd-preset__name { font-size: 13px; font-weight: 600; color: var(--text); }
.rd-preset__items { font-size: 11px; color: var(--text-muted); margin-top: 1px; }
.rd-preset__macros {
  margin-left: auto; font-family: var(--font-condensed);
  font-size: 11px; color: var(--text-secondary); text-align: right;
}

/* ========================================
   TAB BAR (Phase 4A)
   ======================================== */
.rd-tab-bar {
  display: flex;
  gap: 0;
  padding: var(--space-2) var(--space-3) 0;
  background: var(--bg-deep);
  position: relative;
  z-index: 2;
  transition: opacity var(--transition-fast);
}
.rd-tab-bar.dimmed {
  opacity: 0.3;
  pointer-events: none;
}
.rd-tab {
  flex: 1;
  padding: var(--space-2) var(--space-3);
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--text-muted);
  font-family: var(--font-condensed);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  cursor: pointer;
  transition: color var(--transition-fast), border-color var(--transition-fast);
  position: relative;
  -webkit-tap-highlight-color: transparent;
}
.rd-tab.active {
  color: var(--text);
  border-bottom-color: var(--primary);
}
.rd-tab__dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--primary);
  margin-left: var(--space-1);
  vertical-align: middle;
}

/* ========================================
   SOCIAL FEED (Phase 4A)
   ======================================== */
.rd-feed {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  padding: var(--space-3);
  padding-top: calc(var(--space-3) + 40px); /* Account for tab bar height */
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  transition: opacity var(--transition-fast);
}
.rd-feed.dimmed {
  opacity: 0.3;
  pointer-events: none;
}
.rd-feed__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-3);
}
.rd-feed__title {
  font-family: var(--font-condensed);
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.01em;
}
.rd-feed__cheers {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  padding: var(--space-1) var(--space-2);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  font-size: 13px;
  color: var(--text-secondary);
}
.rd-feed__cheers-icon {
  font-size: 14px;
}
.rd-feed__cheers-count {
  font-weight: 600;
  font-family: var(--font-condensed);
}

/* Cheer button row */
.rd-feed__cheer-row {
  margin-bottom: var(--space-3);
}
.rd-cheer-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  width: 100%;
  padding: var(--space-3);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text);
  font-family: var(--font-base);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: background var(--transition-fast), transform 0.1s ease;
  -webkit-tap-highlight-color: transparent;
}
.rd-cheer-btn:active:not(:disabled) {
  transform: scale(0.97);
  background: var(--surface-alt);
}
.rd-cheer-btn.sending {
  opacity: 0.6;
  cursor: default;
}
.rd-cheer-btn__icon {
  font-size: 18px;
}

/* Spectator cheer (standalone, outside feed) */
.rd-spectator-cheer {
  position: fixed;
  bottom: var(--space-4);
  left: 50%;
  transform: translateX(-50%);
  width: calc(100% - var(--space-6));
  max-width: 400px;
  z-index: var(--z-toast);
}

/* Feed list */
.rd-feed__list {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  flex: 1;
}
.rd-feed__loading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-6);
  color: var(--text-muted);
  font-size: 13px;
}
.rd-feed__spinner {
  width: 20px;
  height: 20px;
  border: 2px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: rd-spin 0.8s linear infinite;
}
.rd-feed__empty {
  text-align: center;
  padding: var(--space-8) var(--space-4);
  color: var(--text-muted);
  font-size: 14px;
  line-height: 1.5;
}

/* Feed entry cards */
.rd-feed-card {
  display: flex;
  gap: var(--space-3);
  padding: var(--space-3);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  transition: background var(--transition-fast);
}
.rd-feed-card--cheer {
  border-left: 3px solid var(--primary);
}
.rd-feed-card--photo {
  border-left: 3px solid var(--info);
}
.rd-feed-card--milestone {
  border-left: 3px solid var(--warning);
}
.rd-feed-card--system {
  border-left: 3px solid var(--text-muted);
}
.rd-feed-card__icon {
  font-size: 20px;
  flex-shrink: 0;
  line-height: 1.2;
}
.rd-feed-card__body {
  flex: 1;
  min-width: 0;
}
.rd-feed-card__text {
  font-size: 14px;
  color: var(--text);
  line-height: 1.4;
  word-wrap: break-word;
}
.rd-feed-card__time {
  font-size: 11px;
  color: var(--text-muted);
  font-family: var(--font-condensed);
  margin-top: var(--space-1);
  letter-spacing: 0.02em;
}

/* Load more button */
.rd-feed__load-more {
  padding: var(--space-3);
  background: transparent;
  border: 1px dashed var(--border);
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-family: var(--font-condensed);
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: background var(--transition-fast);
  -webkit-tap-highlight-color: transparent;
}
.rd-feed__load-more:hover:not(:disabled) {
  background: var(--surface);
}
.rd-feed__load-more:disabled {
  opacity: 0.5;
  cursor: default;
}

/* Offline indicator */
.rd-feed__offline {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-3);
  background: var(--surface-alt);
  border-radius: var(--radius-sm);
  font-size: 12px;
  color: var(--text-muted);
  margin-top: var(--space-2);
}
.rd-feed__offline-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--danger);
  flex-shrink: 0;
}

/* ========================================
   CHEER TOAST (Phase 4A)
   ======================================== */
.rd-cheer-toast {
  position: fixed;
  top: var(--space-4);
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-4);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
  z-index: 9999;
  max-width: 90vw;
  min-width: 280px;
  cursor: pointer;
}
.rd-cheer-toast__icon {
  font-size: 18px;
  flex-shrink: 0;
}
.rd-cheer-toast__text {
  flex: 1;
  font-size: 14px;
  color: var(--text);
  line-height: 1.3;
}
.rd-cheer-toast__close {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 18px;
  cursor: pointer;
  padding: 0;
  line-height: 1;
  -webkit-tap-highlight-color: transparent;
}

/* Toast slide transition */
.rd-toast-slide-enter-active {
  transition: all 0.3s ease-out;
}
.rd-toast-slide-leave-active {
  transition: all 0.25s ease-in;
}
.rd-toast-slide-enter-from {
  opacity: 0;
  transform: translateX(-50%) translateY(-20px);
}
.rd-toast-slide-leave-to {
  opacity: 0;
  transform: translateX(-50%) translateY(-20px);
}

/* ========================================
   PULL-TAB HANDLE (Phase 4B)
   ======================================== */
.rd-pull-tab {
  position: fixed;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  z-index: calc(var(--z-overlay) + 1);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-1);
  width: 24px;
  height: 72px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-right: none;
  border-radius: var(--radius-md) 0 0 var(--radius-md);
  cursor: pointer;
  touch-action: pan-y;
  -webkit-tap-highlight-color: transparent;
  transition: transform 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94), background var(--transition-fast);
}
.rd-pull-tab:active {
  background: var(--surface-alt);
}
.rd-pull-tab.open {
  /* When panel is open, tab moves left by panel width (85%) */
  transform: translateY(-50%) translateX(-85vw);
}
.rd-pull-tab__bar {
  width: 3px;
  height: 24px;
  border-radius: 2px;
  background: var(--text-muted);
}
.rd-pull-tab__chevron {
  font-size: 8px;
  color: var(--text-muted);
  line-height: 1;
  transition: transform 0.3s ease;
}
.rd-pull-tab.open .rd-pull-tab__chevron {
  transform: rotate(180deg);
}

/* ========================================
   CREW PANEL BACKDROP (Phase 4B)
   ======================================== */
.rd-crew-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: calc(var(--z-overlay) + 2);
}

/* ========================================
   CREW PANEL (Phase 4B)
   ======================================== */
.rd-crew-panel {
  position: fixed;
  /* Below hero: top offset ~120px to leave clock/lap/countdown visible */
  top: 120px;
  right: 0;
  bottom: 0;
  width: 85vw;
  max-width: 400px;
  background: var(--bg-deep);
  border-left: 1px solid var(--border);
  z-index: calc(var(--z-overlay) + 3);
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.35s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  will-change: transform;
}
.rd-crew-panel.open {
  transform: translateX(0);
}

/* Crew Panel Header */
.rd-crew-panel__header {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-3);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.rd-crew-panel__title {
  font-family: var(--font-condensed);
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.01em;
}
.rd-crew-panel__context {
  flex: 1;
  font-size: 12px;
  color: var(--text-secondary);
  font-family: var(--font-condensed);
  text-align: right;
}
.rd-crew-panel__close {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 22px;
  cursor: pointer;
  padding: 0;
  line-height: 1;
  flex-shrink: 0;
  -webkit-tap-highlight-color: transparent;
}

/* Crew Panel Content (scrollable stack) */
.rd-crew-panel__content {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: var(--space-3);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

/* Crew Section Cards */
.rd-crew-section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
}
.rd-crew-section__header {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-3);
  border-bottom: 1px solid var(--border);
}
.rd-crew-section__icon {
  font-size: 16px;
  flex-shrink: 0;
}
.rd-crew-section__title {
  font-family: var(--font-condensed);
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: 0.02em;
  text-transform: uppercase;
}
.rd-crew-section__body {
  padding: var(--space-3);
}
.rd-crew-section__placeholder {
  color: var(--text-muted);
  font-size: 13px;
  line-height: 1.5;
  font-style: italic;
}

/* ========================================
   CREW RUNNER IN FLASH (Phase 4B)
   ======================================== */
.rd-crew-flash {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.rd-crew-flash__content {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-3);
}
.rd-crew-flash__icon {
  font-size: 48px;
  animation: rd-flash-pulse 1s ease-in-out infinite;
}
.rd-crew-flash__title {
  font-family: var(--font-condensed);
  font-size: 36px;
  font-weight: 800;
  color: var(--primary);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.rd-crew-flash__lap {
  font-family: var(--font-condensed);
  font-size: 20px;
  color: var(--text);
  font-weight: 600;
}
.rd-crew-flash__subtitle {
  font-size: 14px;
  color: var(--text-secondary);
}
.rd-crew-flash__btn {
  padding: var(--space-3) var(--space-6);
  background: var(--primary);
  color: white;
  border: none;
  border-radius: var(--radius-md);
  font-family: var(--font-condensed);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  cursor: pointer;
  margin-top: var(--space-2);
  -webkit-tap-highlight-color: transparent;
}
.rd-crew-flash__btn:active {
  opacity: 0.85;
}
.rd-crew-flash__dismiss {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 13px;
  cursor: pointer;
  padding: var(--space-2);
  -webkit-tap-highlight-color: transparent;
}

@keyframes rd-flash-pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.15); }
}

/* Fade transition (for backdrop + flash) */
.rd-fade-enter-active { transition: opacity 0.25s ease-out; }
.rd-fade-leave-active { transition: opacity 0.2s ease-in; }
.rd-fade-enter-from, .rd-fade-leave-to { opacity: 0; }

/* ========================================
   RESPONSIVE
   ======================================== */
@media (min-width: 768px) {
  .race-day-app { max-width: 600px; }
  .rd-category__grid { grid-template-columns: repeat(4, 1fr); }
  .rd-crew-panel { max-width: 360px; }
  .rd-pull-tab.open { transform: translateY(-50%) translateX(-360px); }
}

/* ========================================
   PHASE 4C: CREW PANEL INTERNALS
   ======================================== */

/* --- Panel Settings Toggle --- */
.rd-crew-panel__settings {
  padding: 0 12px 8px;
  position: relative;
}
.rd-crew-panel__settings-btn {
  background: none;
  border: 1px solid var(--border);
  color: var(--text-secondary);
  font-size: 0.75rem;
  padding: 4px 10px;
  border-radius: 12px;
  cursor: pointer;
}
.rd-crew-panel__settings-btn:active {
  background: var(--surface-alt);
}
.rd-crew-settings-menu {
  display: none;
  flex-direction: column;
  gap: 6px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px;
  margin-top: 6px;
  position: absolute;
  z-index: 10;
  left: 12px;
  right: 12px;
}
.rd-crew-settings-menu.open {
  display: flex;
}
.rd-crew-settings-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  color: var(--text);
  cursor: pointer;
}
.rd-crew-settings-item input[type="checkbox"] {
  accent-color: var(--primary);
}

/* --- Section Badge --- */
.rd-crew-section__badge {
  margin-left: auto;
  font-size: 0.7rem;
  background: var(--surface-alt);
  color: var(--text-secondary);
  padding: 2px 7px;
  border-radius: 10px;
}
.rd-crew-section__badge--alert {
  background: var(--danger);
  color: #fff;
}
.rd-crew-section__meta {
  margin-left: auto;
  font-size: 0.7rem;
  color: var(--text-secondary);
}

/* --- Section Drag State --- */
.rd-crew-section--dragging {
  opacity: 0.7;
  border-color: var(--primary);
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
  transform: scale(1.02);
  transition: transform 0.15s ease, opacity 0.15s ease;
  touch-action: none;
}

/* --- Checklist --- */
.rd-checklist-progress {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}
.rd-checklist-progress__bar {
  flex: 1;
  height: 6px;
  background: var(--surface-alt);
  border-radius: 3px;
  overflow: hidden;
}
.rd-checklist-progress__fill {
  height: 100%;
  background: var(--success);
  border-radius: 3px;
  transition: width 0.3s ease;
}
.rd-checklist-progress__label {
  font-size: 0.7rem;
  color: var(--text-secondary);
  min-width: 32px;
  text-align: right;
}
.rd-checklist-items {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.rd-checklist-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 6px;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.15s ease;
}
.rd-checklist-item:active {
  background: var(--surface-alt);
}
.rd-checklist-item--done {
  opacity: 0.6;
}
.rd-checklist-item--done .rd-checklist-item__label {
  text-decoration: line-through;
}
.rd-checklist-item__check {
  width: 18px;
  height: 18px;
  accent-color: var(--success);
  flex-shrink: 0;
}
.rd-checklist-item__label {
  font-size: 0.85rem;
  color: var(--text);
  flex: 1;
}
.rd-checklist-item__by {
  font-size: 0.65rem;
  color: var(--text-secondary);
  font-style: italic;
}

/* --- Alerts --- */
.rd-alert-stack {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.rd-alert {
  padding: 10px 12px;
  border-radius: 8px;
  border-left: 4px solid transparent;
  transition: opacity 0.5s ease;
}
.rd-alert--critical {
  background: rgba(239, 68, 68, 0.12);
  border-left-color: var(--danger);
}
.rd-alert--warning {
  background: rgba(251, 146, 60, 0.12);
  border-left-color: var(--warning);
}
.rd-alert--info {
  background: rgba(59, 130, 246, 0.12);
  border-left-color: var(--info);
}
.rd-alert--faded {
  opacity: 0.35;
}
.rd-alert__header {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 4px;
}
.rd-alert__icon {
  font-size: 0.85rem;
}
.rd-alert__title {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text);
  flex: 1;
}
.rd-alert__severity {
  font-size: 0.6rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-secondary);
}
.rd-alert__message {
  font-size: 0.75rem;
  color: var(--text-secondary);
  line-height: 1.4;
}

/* --- GPS Map --- */
.rd-gps-minimap {
  text-align: center;
  padding: 6px;
}
.rd-gps-minimap--clickable {
  cursor: pointer;
}
.rd-gps-minimap--clickable:active {
  opacity: 0.8;
}
.rd-gps-minimap__svg {
  display: flex;
  justify-content: center;
}
.rd-gps-minimap__svg svg {
  max-width: 100%;
  height: auto;
}
.rd-gps-minimap__info {
  font-size: 0.75rem;
  color: var(--text);
  margin-top: 6px;
}
.rd-gps-minimap__hint {
  font-size: 0.65rem;
  color: var(--text-secondary);
  margin-top: 4px;
}
.rd-gps-expanded {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.rd-gps-map-container {
  width: 100%;
  height: 240px;
  border-radius: 8px;
  overflow: hidden;
  background: #1a1a2e;
}
.rd-gps-collapse-btn {
  align-self: center;
  background: none;
  border: 1px solid var(--border);
  color: var(--text-secondary);
  font-size: 0.75rem;
  padding: 4px 14px;
  border-radius: 12px;
  cursor: pointer;
}
.rd-gps-collapse-btn:active {
  background: var(--surface-alt);
}

/* --- Previous Lap Notes --- */
.rd-lap-notes {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.rd-lap-note {
  background: var(--surface-alt);
  border-radius: 8px;
  padding: 10px 12px;
}
.rd-lap-note__header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}
.rd-lap-note__lap {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text);
}
.rd-lap-note__mood {
  font-size: 1rem;
}
.rd-lap-note__edit-btn {
  margin-left: auto;
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 0.85rem;
  cursor: pointer;
  padding: 2px 6px;
}
.rd-lap-note__edit-btn:active {
  color: var(--primary);
}
.rd-lap-note__content {
  font-size: 0.8rem;
  color: var(--text-secondary);
}
.rd-lap-note__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-bottom: 6px;
}
.rd-lap-note__tag {
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 0.7rem;
  color: var(--text);
}
.rd-lap-note__text {
  line-height: 1.4;
}
.rd-lap-note__empty {
  font-style: italic;
  color: var(--text-secondary);
  opacity: 0.6;
}
.rd-lap-note__edit {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.rd-lap-note__textarea {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  font-size: 0.8rem;
  padding: 8px;
  resize: vertical;
  font-family: inherit;
}
.rd-lap-note__textarea:focus {
  outline: none;
  border-color: var(--primary);
}
.rd-lap-note__edit-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}
.rd-lap-note__save-btn,
.rd-lap-note__cancel-btn {
  padding: 5px 14px;
  border-radius: 6px;
  font-size: 0.75rem;
  cursor: pointer;
  border: none;
}
.rd-lap-note__save-btn {
  background: var(--primary);
  color: #fff;
}
.rd-lap-note__save-btn:active {
  opacity: 0.8;
}
.rd-lap-note__cancel-btn {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-secondary);
}
.rd-lap-notes__more {
  align-self: center;
  background: none;
  border: 1px solid var(--border);
  color: var(--text-secondary);
  font-size: 0.75rem;
  padding: 6px 16px;
  border-radius: 14px;
  cursor: pointer;
  margin-top: 4px;
}
.rd-lap-notes__more:active {
  background: var(--surface-alt);
}

/* ========================================
   PHASE 4D: PHOTO POSTING
   ======================================== */

/* --- Action Row (Cheer + Photo buttons side by side) --- */
.rd-feed__action-row {
  display: flex;
  gap: 8px;
  padding: 0 0 12px;
}
.rd-photo-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--surface-alt);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 8px 14px;
  border-radius: 20px;
  font-size: 0.85rem;
  cursor: pointer;
  transition: background 0.15s ease;
}
.rd-photo-btn:active {
  background: var(--surface);
}
.rd-photo-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
.rd-photo-btn__icon {
  font-size: 1rem;
}
.rd-photo-btn__text {
  font-size: 0.85rem;
}

/* --- Photo Compose Panel --- */
.rd-photo-compose {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px;
  margin-bottom: 12px;
}
.rd-photo-compose__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.rd-photo-compose__title {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text);
}
.rd-photo-compose__close {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 1.2rem;
  cursor: pointer;
  padding: 0 4px;
}

/* File picker */
.rd-photo-compose__picker {
  /* Container for the file pick button */
}
.rd-photo-compose__file-input {
  display: none;
}
.rd-photo-compose__pick-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  border: 2px dashed var(--border);
  border-radius: 10px;
  color: var(--text-secondary);
  font-size: 0.85rem;
  cursor: pointer;
  transition: border-color 0.15s ease;
}
.rd-photo-compose__pick-btn:active {
  border-color: var(--primary);
  color: var(--primary);
}

/* Preview area */
.rd-photo-compose__preview-area {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.rd-photo-compose__preview {
  position: relative;
  border-radius: 10px;
  overflow: hidden;
}
.rd-photo-compose__img {
  width: 100%;
  max-height: 300px;
  object-fit: contain;
  background: #000;
  border-radius: 10px;
}
.rd-photo-compose__remove {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(0,0,0,0.6);
  color: #fff;
  border: none;
  font-size: 1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.rd-photo-compose__caption {
  width: 100%;
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-size: 0.85rem;
  padding: 10px 12px;
  font-family: inherit;
}
.rd-photo-compose__caption:focus {
  outline: none;
  border-color: var(--primary);
}
.rd-photo-compose__meta {
  font-size: 0.7rem;
  color: var(--text-secondary);
}
.rd-photo-compose__error {
  color: var(--danger);
  font-size: 0.8rem;
  margin-top: 8px;
}
.rd-photo-compose__submit {
  width: 100%;
  margin-top: 10px;
  padding: 10px;
  border-radius: 10px;
  background: var(--primary);
  color: #fff;
  border: none;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.15s ease;
}
.rd-photo-compose__submit:active {
  opacity: 0.8;
}
.rd-photo-compose__submit:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* --- Inline Photo in Feed Cards --- */
.rd-feed-card__photo {
  margin-top: 8px;
  border-radius: 10px;
  overflow: hidden;
}
.rd-feed-card__photo-img {
  width: 100%;
  max-height: 400px;
  object-fit: contain;
  background: #000;
  border-radius: 10px;
  display: block;
}

/* ========================================
   PHASE 4E: MILESTONE AUTO-POSTS
   ======================================== */

/* --- Milestone Toast --- */
.rd-milestone-toast {
  position: fixed;
  top: 16px;
  left: 16px;
  right: 16px;
  z-index: 9000;
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
  border: 1px solid var(--warning);
  border-radius: 14px;
  padding: 14px 16px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.5), 0 0 20px rgba(251, 191, 36, 0.15);
  cursor: pointer;
}
.rd-milestone-toast__header {
  display: flex;
  align-items: center;
  gap: 8px;
}
.rd-milestone-toast__icon {
  font-size: 1.4rem;
}
.rd-milestone-toast__label {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--warning);
  flex: 1;
}
.rd-milestone-toast__close {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 1.2rem;
  cursor: pointer;
  padding: 0 4px;
}
.rd-milestone-toast__message {
  font-size: 0.8rem;
  color: var(--text);
  margin-top: 4px;
  padding-left: 30px;
}
.rd-milestone-toast__summary {
  font-size: 0.7rem;
  color: var(--text-secondary);
  margin-top: 6px;
  padding-left: 30px;
}

/* --- Highlighted Milestone Feed Card --- */
.rd-feed-card--milestone {
  background: linear-gradient(135deg, rgba(251, 191, 36, 0.08) 0%, rgba(251, 191, 36, 0.02) 100%);
  border: 1px solid rgba(251, 191, 36, 0.3);
  border-left: 4px solid var(--warning);
}

/* --- Milestone Data Summary in Feed Card --- */
.rd-feed-card__milestone-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 6px;
  font-size: 0.7rem;
  color: var(--text-secondary);
}

/* ============================================================
   REACTIONS — Phase 5C: Tap to React, Attributed Display
   ============================================================ */

.rd-feed-card__reactions {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 6px;
}

.rd-reaction-btn {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 2px 8px;
  font-size: 0.9rem;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
  line-height: 1.4;
}

.rd-reaction-btn:hover {
  background: rgba(6, 182, 212, 0.08);
  border-color: var(--primary);
}

.rd-reaction-btn--active {
  background: rgba(6, 182, 212, 0.15);
  border-color: var(--primary);
}

.rd-reaction-btn:disabled {
  opacity: 0.5;
  cursor: default;
}

.rd-reaction-text {
  font-size: var(--text-xs);
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 200px;
}

/* ============================================================
   ENHANCED FEED — Phase 5B: Lazy Load, Activity Indicator
   ============================================================ */

/* --- Feed list scroll container (for lazy load + scroll tracking) --- */
.rd-feed__list {
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

/* --- New Activity Indicator (Q3: shown when scrolled up and new items arrive) --- */
.rd-feed__new-activity {
  position: sticky;
  top: 0;
  z-index: 10;
  display: block;
  width: fit-content;
  margin: 0 auto var(--space-2);
  padding: 6px 16px;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: 20px;
  font-size: var(--text-sm);
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(6, 182, 212, 0.3);
  transition: transform 0.15s ease, opacity 0.15s ease;
}

.rd-feed__new-activity:hover {
  transform: translateY(-1px);
}

.rd-feed__new-activity:active {
  transform: translateY(0);
}

/* ============================================================
   SPECTATOR VIEW — Phase 5A: Condensed Header
   ============================================================ */

/* --- Spectator Header --- */
.rd-spectator-header {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.rd-spectator-header__disabled {
  width: 100%;
  text-align: center;
  padding: var(--space-4) 0;
}

.rd-spectator-header__disabled-text {
  color: var(--text-secondary);
  font-size: var(--text-sm);
}

/* --- Progress Ring --- */
.rd-spectator-ring {
  position: relative;
  width: 64px;
  height: 64px;
  flex-shrink: 0;
}

.rd-spectator-ring__svg {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.rd-spectator-ring__track {
  fill: none;
  stroke: var(--border);
  stroke-width: 6;
}

.rd-spectator-ring__fill {
  fill: none;
  stroke: var(--primary);
  stroke-width: 6;
  stroke-linecap: round;
  transition: d 0.5s ease;
}

.rd-spectator-ring__center {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--surface-alt, var(--border));
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.rd-spectator-ring__avatar {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

.rd-spectator-ring__initial {
  font-size: var(--text-lg);
  font-weight: 700;
  color: var(--text);
}

/* --- Runner Info --- */
.rd-spectator-info {
  flex: 1;
  min-width: 0;
}

.rd-spectator-info__name {
  font-size: var(--text-lg);
  font-weight: 700;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.rd-spectator-info__stats {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-top: 2px;
}

.rd-spectator-info__stat {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  font-family: 'Barlow Condensed', 'Barlow', system-ui, sans-serif;
  letter-spacing: 0.01em;
}

.rd-spectator-info__stat::after {
  content: '\00B7';
  margin-left: var(--space-2);
  color: var(--text-muted);
}

.rd-spectator-info__stat:last-child::after {
  content: none;
}

.rd-spectator-info__stat--mood {
  font-weight: 600;
}

/* --- Simplified Nutrition Status (Q5: macros hidden) --- */
.rd-spectator-info__status {
  display: inline-block;
  margin-top: 4px;
  font-size: var(--text-xs);
  font-weight: 600;
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.rd-spectator-info__status--on-track {
  color: var(--success);
  background: rgba(34, 197, 94, 0.12);
}

.rd-spectator-info__status--slightly-behind {
  color: var(--warning);
  background: rgba(245, 158, 11, 0.12);
}

.rd-spectator-info__status--behind-pace {
  color: var(--danger);
  background: rgba(239, 68, 68, 0.12);
}

.rd-spectator-info__status--starting {
  color: var(--text-secondary);
  background: rgba(100, 116, 139, 0.12);
}

/* ============================================================
   CHEER INPUT BAR — Phase 5D: Sticky Cheer Input for Spectators
   ============================================================ */

.rd-cheer-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 50;
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding: var(--space-2) var(--space-3);
  box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.3);
}

.rd-cheer-bar__name-row {
  margin-bottom: var(--space-2);
}

.rd-cheer-bar__name-input {
  width: 100%;
  background: var(--surface-alt, rgba(255,255,255,0.05));
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 6px 10px;
  font-size: var(--text-xs);
  color: var(--text);
  outline: none;
}

.rd-cheer-bar__name-input:focus {
  border-color: var(--primary);
}

.rd-cheer-bar__name-input::placeholder {
  color: var(--text-muted);
}

.rd-cheer-bar__input-row {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.rd-cheer-bar__emoji {
  background: none;
  border: 1px solid var(--border);
  border-radius: 50%;
  width: 36px;
  height: 36px;
  font-size: 1.1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease, transform 0.1s ease;
  flex-shrink: 0;
}

.rd-cheer-bar__emoji:hover {
  background: rgba(6, 182, 212, 0.1);
}

.rd-cheer-bar__emoji:active {
  transform: scale(0.9);
}

.rd-cheer-bar__text-input {
  flex: 1;
  min-width: 0;
  background: var(--surface-alt, rgba(255,255,255,0.05));
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 8px 14px;
  font-size: var(--text-base);
  color: var(--text);
  outline: none;
}

.rd-cheer-bar__text-input:focus {
  border-color: var(--primary);
}

.rd-cheer-bar__text-input::placeholder {
  color: var(--text-muted);
}

.rd-cheer-bar__send {
  flex-shrink: 0;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: 20px;
  padding: 8px 16px;
  font-size: var(--text-sm);
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.15s ease;
}

.rd-cheer-bar__send:disabled {
  opacity: 0.5;
  cursor: default;
}

.rd-cheer-bar__cooldown {
  letter-spacing: 2px;
}

.rd-cheer-bar__rate-msg {
  text-align: center;
  margin-top: var(--space-1);
  font-size: var(--text-xs);
  color: var(--text-muted);
}

/* ============================================================
   FLOATING REACTIONS — Phase 5D: Emoji Float Up Animation
   ============================================================ */

.rd-floating-reactions {
  position: fixed;
  bottom: 120px;
  left: 0;
  right: 0;
  height: 300px;
  pointer-events: none;
  overflow: hidden;
  z-index: 40;
}

.rd-floating-emoji {
  position: absolute;
  bottom: 0;
  font-size: 2rem;
  animation: rd-float-up 2s ease-out forwards;
  opacity: 1;
}

@keyframes rd-float-up {
  0% {
    transform: translateY(0) scale(1);
    opacity: 1;
  }
  60% {
    opacity: 0.8;
  }
  100% {
    transform: translateY(-280px) scale(0.6);
    opacity: 0;
  }
}

/* Vue transition classes for floating reactions */
.rd-float-enter-active {
  transition: opacity 0.2s ease;
}
.rd-float-leave-active {
  transition: opacity 0.3s ease;
}
.rd-float-enter-from {
  opacity: 0;
}
.rd-float-leave-to {
  opacity: 0;
}

/* --- Spectator feed needs bottom padding for the fixed cheer bar --- */
.rd-feed--spectator {
  padding-bottom: 120px;
}

/* ============================================================
   LAP CLOCK TAB (Phase 7C)
   ============================================================ */

/* Subtle tab styling — smaller, icon-only */
.rd-tab--subtle {
  min-width: auto;
  padding: var(--space-1, 4px) var(--space-2, 8px);
  font-size: 1.1rem;
  opacity: 0.6;
  transition: opacity 0.2s ease;
}
.rd-tab--subtle.active,
.rd-tab--subtle:hover {
  opacity: 1;
}

/* Clock panel */
.rd-clock {
  padding: var(--space-4, 16px);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-4, 16px);
}

.rd-clock__display {
  text-align: center;
}

.rd-clock__time {
  font-size: 3rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--text-primary, #e0e0e0);
  letter-spacing: 0.02em;
  line-height: 1.2;
  margin-bottom: var(--space-3, 12px);
}

.rd-clock__controls {
  display: flex;
  gap: var(--space-2, 8px);
  justify-content: center;
}

.rd-clock__btn {
  padding: var(--space-2, 8px) var(--space-4, 16px);
  border-radius: var(--radius, 8px);
  border: 1px solid var(--border, #333);
  background: var(--card-bg, #1a1a1a);
  color: var(--text-primary, #e0e0e0);
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  min-width: 70px;
  min-height: 44px;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.rd-clock__btn:hover:not(:disabled) {
  border-color: var(--primary, #4a90e2);
}

.rd-clock__btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.rd-clock__btn--start {
  background: var(--success, #66c343);
  color: #000;
  border-color: var(--success, #66c343);
}

.rd-clock__btn--pause {
  background: var(--warning, #f4c373);
  color: #000;
  border-color: var(--warning, #f4c373);
}

.rd-clock__btn--lap {
  background: var(--primary, #4a90e2);
  color: #fff;
  border-color: var(--primary, #4a90e2);
}

.rd-clock__btn--reset {
  background: transparent;
  border-color: var(--danger, #ef4444);
  color: var(--danger, #ef4444);
}

/* Splits table */
.rd-clock__splits {
  width: 100%;
  max-width: 400px;
}

.rd-clock__splits-header,
.rd-clock__splits-row {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  padding: var(--space-2, 8px) var(--space-3, 12px);
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.rd-clock__splits-header {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted, #999);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 1px solid var(--border, #333);
}

.rd-clock__splits-row {
  font-size: 0.875rem;
  color: var(--text-primary, #e0e0e0);
  border-bottom: 1px solid var(--border-subtle, rgba(255,255,255,0.06));
}

.rd-clock__splits-row:last-child {
  border-bottom: none;
}

.rd-clock__empty {
  color: var(--text-muted, #999);
  font-size: 0.875rem;
  text-align: center;
  padding: var(--space-6, 24px);
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
