/*
 * Rouge Cardinal Racing — Brand Stylesheet
 * Colors: #0d0d0d (bg), #CC1F1F (cardinal red), #FFFFFF (white), #1a1a1a (card bg)
 */

/* ===== RESET & BASE ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --red:        #CC1F1F;
  --red-bright: #e03030;
  --red-dark:   #9e1717;
  --red-glow:   rgba(204, 31, 31, 0.25);
  --bg:         #111114;
  --surface:    #1a1a1f;
  --surface2:   #222228;
  --surface3:   #2a2a32;
  --border:     rgba(255,255,255,0.07);
  --text:       #eeeef2;
  --text-2:     #b0b0bc;
  --muted:      #6b6b7a;
  --white:      #ffffff;
  --font:         'Segoe UI', system-ui, -apple-system, sans-serif;
  --font-display: 'Barlow Condensed', 'Segoe UI', system-ui, sans-serif;
  --mono:         'Courier New', monospace;

  /* M3 elevation tints — cardinal red bleeds into higher surfaces */
  --surface-tint-1: color-mix(in srgb, #CC1F1F 5%,  #1a1a1f);
  --surface-tint-2: color-mix(in srgb, #CC1F1F 9%,  #222228);
  --tint-1: color-mix(in srgb, #CC1F1F 5%,  #1a1a1f);
  --tint-2: color-mix(in srgb, #CC1F1F 9%,  #222228);
  --tint-3: color-mix(in srgb, #CC1F1F 13%, #2a2a32);

  /* Dark neumorphic shadows — pushed highlight up from 0.035 to 0.045 */
  --neu-raise:    -4px -4px  9px rgba(255,255,255,0.04),  4px  4px 11px rgba(0,0,0,0.70);
  --neu-raise-sm: -2px -2px  6px rgba(255,255,255,0.035), 2px  2px  7px rgba(0,0,0,0.65);
  --neu-lg:       -6px -6px 14px rgba(255,255,255,0.045), 6px  6px 16px rgba(0,0,0,0.75);
  --neu-md:       -4px -4px  9px rgba(255,255,255,0.04),  4px  4px 11px rgba(0,0,0,0.70);
  --neu-sm:       -2px -2px  6px rgba(255,255,255,0.035), 2px  2px  7px rgba(0,0,0,0.65);
  --neu-inset:    inset -3px -3px 7px rgba(255,255,255,0.03), inset 3px 3px 8px rgba(0,0,0,0.65);

  /* M3 corner radius scale — pushed larger */
  --radius-xs: 6px;
  --radius-sm: 12px;
  --radius-md: 18px;
  --radius-lg: 24px;
  --radius-xl: 32px;
}

html { font-size: 16px; scroll-behavior: smooth; }
body {
  background: radial-gradient(circle at top center, rgba(204,31,31,0.08) 0%, transparent 38%), var(--bg);
  color: var(--text);
  font-family: var(--font);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
main { flex: 1; }
img { max-width: 100%; display: block; }
a { color: var(--red); text-decoration: none; }
a:hover { color: #e02b2b; }
:focus-visible {
  outline: 2px solid var(--red);
  outline-offset: 3px;
}

/* ===== LAYOUT ===== */
.container { max-width: 1140px; margin: 0 auto; padding: 0 1.5rem; }

/* ===== NAVBAR ===== */
.navbar {
  background: rgba(17, 17, 20, 0.75);
  backdrop-filter: blur(20px) saturate(1.4);
  -webkit-backdrop-filter: blur(20px) saturate(1.4);
  border-bottom: 1px solid rgba(204,31,31,0.4);
  box-shadow: 0 1px 0 rgba(255,255,255,0.04), 0 4px 32px rgba(0,0,0,0.6), 0 0 60px rgba(204,31,31,0.04);
  padding: 0 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 70px;
  position: sticky;
  top: 0;
  z-index: 100;
}
.navbar-brand { display: flex; align-items: center; }

.nav-logo {
  height: 52px;
  width: auto;
  border-radius: var(--radius-sm);
  box-shadow: var(--neu-sm), 0 0 16px rgba(204,31,31,0.15);
  border: 1px solid rgba(255,255,255,0.07);
  padding: 5px 10px;
  background: var(--tint-1);
  display: block;
}

.navbar-menu {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  flex: 1;
  justify-content: flex-end;
  margin-left: 1rem;
  min-width: 0;
}

.nav-cluster {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-wrap: wrap;
}
.nav-cluster-public { margin-right: auto; }
.nav-cluster-team { margin-left: auto; }
.nav-cluster-label {
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 0 0.1rem;
  margin-right: 0.25rem;
  white-space: nowrap;
}

.nav-link {
  color: var(--text);
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.9rem;
  font-weight: 500;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  padding: 0.5rem 0.85rem;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  transition: color 0.2s, background 0.2s, border-color 0.2s;
  min-height: 44px;
}
.nav-link:hover { color: var(--red); background: rgba(204,31,31,0.08); }
.nav-link-active { color: var(--red) !important; background: rgba(204,31,31,0.1); }
.nav-link-strong {
  background: rgba(255,255,255,0.02);
  border-color: rgba(255,255,255,0.03);
}
.nav-link-pill {
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--text);
  padding: 0.5rem 0.7rem;
}
.nav-link-pill:hover { border-color: var(--red); }

.nav-user { display: flex; align-items: center; gap: 0.75rem; margin-left: 0.5rem; }
.nav-username {
  color: var(--text);
  font-size: 0.82rem;
  padding: 0.28rem 0.7rem;
  border: 1px solid var(--border);
  border-radius: 20px;
  transition: border-color 0.2s, color 0.2s;
}
.nav-username:hover { border-color: var(--red); color: var(--red); }

.btn-login {
  background: var(--red);
  color: var(--white) !important;
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 0.5rem 1.25rem;
  border-radius: var(--radius-md);
  margin-left: 0.5rem;
  position: relative;
  overflow: hidden;
  transition: background 0.2s, box-shadow 0.2s;
}
.btn-login::after { content: ''; position: absolute; inset: 0; background: white; opacity: 0; transition: opacity 0.15s; }
.btn-login:hover { background: var(--red-dark); box-shadow: 0 4px 16px var(--red-glow); }
.btn-login:hover::after { opacity: 0.06; }
.btn-login:active::after { opacity: 0.14; }

.btn-signout {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.8rem;
  padding: 0.35rem 0.85rem;
  border-radius: 4px;
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s;
}
.btn-signout:hover { border-color: var(--red); color: var(--red); }

.nav-hamburger {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
  flex-direction: column;
  gap: 5px;
  border-radius: 4px;
}
.nav-hamburger span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: transform 0.25s, opacity 0.25s;
}
.nav-hamburger.nav-open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-hamburger.nav-open span:nth-child(2) { opacity: 0; transform: scaleX(0); }
.nav-hamburger.nav-open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ===== BUTTONS ===== */
.btn-primary {
  display: inline-block;
  background: linear-gradient(135deg, #e03030 0%, var(--red-dark) 100%);
  color: var(--white);
  font-weight: 700;
  font-size: 0.9rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0.7rem 1.75rem;
  border-radius: var(--radius-md);
  border: none;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: box-shadow 0.2s, transform 0.15s;
  text-decoration: none;
  box-shadow: 0 4px 16px rgba(204,31,31,0.4), 0 1px 0 rgba(255,255,255,0.12) inset;
}
.btn-primary::after { content: ''; position: absolute; inset: 0; background: white; opacity: 0; transition: opacity 0.15s; }
.btn-primary:hover { box-shadow: 0 6px 28px rgba(204,31,31,0.55), 0 1px 0 rgba(255,255,255,0.12) inset; color: var(--white); transform: translateY(-1px); }
.btn-primary:hover::after { opacity: 0.08; }
.btn-primary:active { transform: translateY(1px); box-shadow: none; }
.btn-primary:active::after { opacity: 0.16; }

.btn-outline {
  display: inline-block;
  background: transparent;
  color: var(--text);
  font-weight: 600;
  font-size: 0.9rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 0.65rem 1.5rem;
  border-radius: var(--radius-md);
  border: 1.5px solid var(--border);
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: border-color 0.2s, color 0.2s;
  text-decoration: none;
}
.btn-outline::after { content: ''; position: absolute; inset: 0; background: var(--red); opacity: 0; transition: opacity 0.15s; }
.btn-outline:hover { border-color: var(--red); color: var(--red); }
.btn-outline:hover::after { opacity: 0.05; }
.btn-outline:active::after { opacity: 0.1; }

.btn-sm {
  display: inline-block;
  background: var(--surface2);
  color: var(--text);
  font-size: 0.78rem;
  font-weight: 600;
  padding: 0.3rem 0.8rem;
  border-radius: var(--radius-xs);
  border: 1px solid var(--border);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s, color 0.2s;
  text-decoration: none;
}
.btn-sm:hover { background: var(--red); border-color: var(--red); color: var(--white); }

.btn-danger {
  display: inline-block;
  background: transparent;
  color: #e05555;
  font-weight: 600;
  font-size: 0.85rem;
  padding: 0.5rem 1.25rem;
  border-radius: var(--radius-md);
  border: 1.5px solid #e05555;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: background 0.2s, color 0.2s;
}
.btn-danger::after { content: ''; position: absolute; inset: 0; background: white; opacity: 0; transition: opacity 0.15s; }
.btn-danger:hover { background: #e05555; color: var(--white); }
.btn-danger:hover::after { opacity: 0.06; }
.btn-danger:active::after { opacity: 0.12; }

.btn-full { width: 100%; text-align: center; }

/* ===== FLASH MESSAGES ===== */
.flash {
  text-align: center;
  padding: 0.75rem 3rem;
  font-size: 0.9rem;
  font-weight: 500;
  position: relative;
}
.flash-notice { background: rgba(34, 197, 94, 0.15); color: #4ade80; border-bottom: 1px solid rgba(34,197,94,0.3); }
.flash-alert  { background: rgba(204, 31, 31, 0.15); color: #f87171; border-bottom: 1px solid rgba(204,31,31,0.3); }
.flash-close {
  position: absolute;
  right: 1rem;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1.25rem;
  color: currentColor;
  opacity: 0.5;
  line-height: 1;
  padding: 0.2rem 0.4rem;
}
.flash-close:hover { opacity: 1; }

/* ===== HERO ===== */
.hero {
  position: relative;
  height: 620px;
  min-height: 480px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.hero-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 30%;
  filter: brightness(0.4) saturate(0.8);
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, rgba(10,10,10,0.3) 0%, rgba(10,10,10,0.85) 100%);
  z-index: 1;
}

.hero-content {
  position: relative;
  z-index: 2;
  text-align: center;
  padding: 2rem;
}

.hero-logo {
  height: 90px;
  width: auto;
  margin: 0 auto 1.5rem;
  filter: drop-shadow(0 0 24px rgba(204,31,31,0.6));
}

.hero-tagline {
  font-size: 1.15rem;
  font-family: var(--font-display);
  letter-spacing: 0.35em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 2.5rem;
}
.hero-tagline::before {
  content: '';
  display: block;
  width: 48px;
  height: 2px;
  background: var(--red);
  margin: 0 auto 1.25rem;
  border-radius: 2px;
}

/* ===== ACCENT ===== */
.accent { color: var(--red); }

/* ===== SECTION HEADERS ===== */
.section-title {
  font-size: 2.75rem;
  font-weight: 700;
  font-family: var(--font-display);
  letter-spacing: 0.01em;
  margin-bottom: 1.5rem;
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 2rem;
}

/* ===== ABOUT SECTION ===== */
.about-section { padding: 5rem 0; }

.about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  align-items: center;
}

.about-text p {
  color: #b0b0b0;
  margin-bottom: 1rem;
  font-size: 1.05rem;
  line-height: 1.8;
}

.about-stats {
  display: flex;
  gap: 2.5rem;
  margin-top: 2rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
}

.stat { display: flex; flex-direction: column; }
.stat-number { font-size: 2.5rem; font-weight: 700; font-family: var(--font-display); letter-spacing: -0.01em; }
.stat-label { font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); margin-top: 0.2rem; }

.about-car-img {
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  box-shadow: var(--neu-raise), 0 8px 32px rgba(0,0,0,0.6);
}

/* ===== CALENDAR SECTION ===== */
.calendar-section {
  padding: 5rem 0;
  background: var(--surface);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.events-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.25rem;
}

.event-card {
  background: var(--surface-tint-1);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  box-shadow: var(--neu-raise-sm);
  transition: box-shadow 0.25s, border-color 0.25s, transform 0.2s;
}
.event-card:hover { border-color: rgba(204,31,31,0.6); box-shadow: var(--neu-lg), 0 0 40px rgba(204,31,31,0.12); transform: translateY(-2px); }

.event-date-badge {
  background: linear-gradient(135deg, var(--red) 0%, var(--red-dark) 100%);
  border-radius: 6px;
  padding: 0.5rem 0.75rem;
  text-align: center;
  min-width: 52px;
  flex-shrink: 0;
  box-shadow: 0 4px 14px rgba(204,31,31,0.4);
}
.event-month { display: block; font-size: 0.65rem; font-weight: 700; letter-spacing: 0.1em; color: rgba(255,255,255,0.8); }
.event-day { display: block; font-size: 1.5rem; font-weight: 900; color: var(--white); line-height: 1; }
.event-year { display: block; font-size: 0.65rem; color: rgba(255,255,255,0.7); }

.event-info h3 { font-size: 1rem; font-weight: 700; margin-bottom: 0.5rem; }
.event-meta { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-bottom: 0.5rem; }
.event-location { font-size: 0.85rem; color: var(--muted); margin-bottom: 0.25rem; }
.event-time { font-size: 0.8rem; color: var(--muted); }

.event-badge {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.2rem 0.55rem;
  border-radius: 3px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--muted);
}
.badge-sim { background: rgba(204,31,31,0.15); border-color: rgba(204,31,31,0.4); color: #f87171; }
.badge-series { background: rgba(255,255,255,0.05); }
.badge-iracing { background: rgba(59,130,246,0.15); border-color: rgba(59,130,246,0.4); color: #93c5fd; }
.badge-lmu { background: rgba(234,179,8,0.15); border-color: rgba(234,179,8,0.4); color: #fcd34d; }
.badge-team-car { background: rgba(34,197,94,0.12); border-color: rgba(34,197,94,0.35); color: #86efac; }
.badge-hidden { display: inline-block; font-size: 0.65rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; padding: 0.1rem 0.4rem; border-radius: 3px; background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.15); color: var(--muted); vertical-align: middle; margin-left: 0.4rem; }

/* ===== ADMIN EVENTS ===== */
.event-row-hidden { opacity: 0.5; }
.event-row-hidden:hover { opacity: 0.75; }

.admin-events-table { margin-bottom: 1.5rem; overflow-x: auto; }
.admin-events-header,
.admin-event-row {
  display: grid;
  grid-template-columns: 2.5rem 1fr 12rem 14rem;
  gap: 0.75rem;
  align-items: center;
  padding: 0.6rem 0.75rem;
  min-width: 600px;
}
.admin-events-header {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  border-bottom: 1px solid var(--border);
}
.admin-event-row {
  border-bottom: 1px solid rgba(255,255,255,0.04);
  transition: background 0.15s;
}
.admin-event-row:hover { background: rgba(255,255,255,0.03); }
.admin-event-visible { background: rgba(34,197,94,0.04); }
.admin-event-visible:hover { background: rgba(34,197,94,0.07); }

.col-show { display: flex; justify-content: center; }
.schedule-checkbox { width: 1.1rem; height: 1.1rem; accent-color: var(--red); cursor: pointer; }

.admin-event-label { display: flex; align-items: center; gap: 0.6rem; cursor: pointer; }
.admin-event-logo { height: 2rem; width: auto; object-fit: contain; flex-shrink: 0; }
.admin-event-date { font-size: 0.75rem; color: var(--muted); white-space: nowrap; min-width: 3.5rem; }
.admin-event-title { font-weight: 600; font-size: 0.9rem; }

.team-car-input {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 0.35rem 0.6rem;
  color: var(--text);
  font-size: 0.85rem;
}
.team-car-input:focus { outline: none; border-color: var(--red); }

.sticky-actions {
  position: sticky;
  bottom: 0;
  background: var(--bg);
  border-top: 1px solid var(--border);
  padding: 1rem 0;
  margin-top: 1rem;
}

/* ===== ABOUT MODULES ===== */
.about-modules { display: flex; flex-direction: column; gap: 1.25rem; margin-top: 1.75rem; }
.about-module { display: flex; flex-direction: column; gap: 0.6rem; }
.about-module-label { font-size: 2rem; font-weight: 800; letter-spacing: -0.02em; color: var(--red); }

.platform-logos-row { display: flex; align-items: center; gap: 1.5rem; }
.platform-logo-iracing { height: 1.75rem; width: auto; }
.platform-lmu-group { display: flex; align-items: center; gap: 0.5rem; }
.platform-logo-lmu { height: 1.75rem; width: auto; opacity: 0.8; }
.platform-coming-soon { font-size: 0.6rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); border: 1px solid var(--border); border-radius: 3px; padding: 0.15rem 0.4rem; white-space: nowrap; }

.classes-row { display: flex; align-items: center; gap: 0.5rem; }
.class-pill { font-size: 0.85rem; font-weight: 700; letter-spacing: 0.05em; color: var(--red); border: 1px solid rgba(204,31,31,0.35); border-radius: 4px; padding: 0.25rem 0.7rem; background: rgba(204,31,31,0.08); }

/* ===== PLATFORM LOGOS (form labels) ===== */

.platform-field-label { display: flex; align-items: center; gap: 0.5rem; font-size: 0.875rem; font-weight: 600; margin-bottom: 0.35rem; }
.field-platform-logo { height: 1.1rem; width: auto; }
.field-platform-logo-lmu { opacity: 0.85; }

/* ===== SPECIAL EVENT LOGOS (schedule + event cards) ===== */
.event-row-logo { flex-shrink: 0; width: 5.5rem; display: flex; align-items: center; justify-content: center; }
.event-row-special-logo { width: 5.5rem; height: 3.5rem; object-fit: contain; }

.event-card { display: block; text-decoration: none; color: inherit; }
.event-card-special { position: relative; }
.event-card-logo { display: flex; align-items: center; justify-content: center; padding: 0.75rem 0.75rem 0; }
.event-special-logo { width: 100%; max-height: 5rem; object-fit: contain; }

.detail-event-logo { display: flex; justify-content: flex-start; margin-bottom: 1.25rem; }
.detail-special-logo { max-height: 6rem; width: auto; object-fit: contain; }

/* ===== CTA SECTION ===== */
.cta-section { padding: 5rem 0; }

.cta-inner {
  text-align: center;
  max-width: 600px;
  margin: 0 auto;
}
.cta-inner h2 { font-size: 2.25rem; font-weight: 800; margin-bottom: 1rem; }
.cta-inner p { color: var(--muted); margin-bottom: 2rem; font-size: 1.05rem; }

/* ===== PAGE HEADER ===== */
.page-header {
  background: linear-gradient(135deg, rgba(204,31,31,0.12) 0%, transparent 50%),
              linear-gradient(to bottom, var(--surface) 0%, transparent 100%);
  border-bottom: 1px solid var(--border);
  padding: 2.5rem 0;
  margin-bottom: 2.5rem;
  position: relative;
  overflow: hidden;
}
.page-header::after {
  content: '';
  position: absolute;
  bottom: 0; left: 2rem; right: 2rem;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(204,31,31,0.5), transparent);
}
.page-header-inner { display: flex; align-items: center; justify-content: space-between; }
.page-title { font-size: 2.5rem; font-weight: 700; font-family: var(--font-display); letter-spacing: 0.02em; }
.page-subtitle { color: var(--muted); font-size: 0.95rem; margin-top: 0.25rem; }
.back-link { color: var(--muted); font-size: 0.9rem; display: inline-block; margin-bottom: 0.75rem; }
.back-link:hover { color: var(--red); }

/* ===== EVENTS LIST ===== */
.list-section-title {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
  margin-bottom: 1rem;
  margin-top: 2.5rem;
  padding-bottom: 0.5rem;
  padding-left: 0.75rem;
  border-bottom: 1px solid var(--border);
  border-left: 3px solid var(--red);
}

.events-list { display: flex; flex-direction: column; gap: 0.75rem; margin-bottom: 2rem; }

.event-row {
  background: var(--surface-tint-1);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.25rem 1.5rem;
  display: flex;
  align-items: center;
  gap: 1.5rem;
  box-shadow: var(--neu-raise-sm);
  transition: border-color 0.2s, box-shadow 0.2s;
}
.event-row:hover { border-color: rgba(204,31,31,0.5); box-shadow: -3px 0 0 var(--red), 0 2px 16px rgba(204,31,31,0.1); }
.event-row-past { opacity: 0.55; }
.event-row-past:hover { opacity: 0.8; }

.event-row-date {
  background: linear-gradient(135deg, var(--red) 0%, var(--red-dark) 100%);
  border-radius: 6px;
  padding: 0.5rem 0.6rem;
  text-align: center;
  min-width: 48px;
  flex-shrink: 0;
  box-shadow: 0 4px 14px rgba(204,31,31,0.4);
}
.event-row-info { flex: 1; }
.event-row-info h3 { font-size: 1rem; font-weight: 700; }
.event-row-link { color: var(--text); }
.event-row-link:hover { color: var(--red); }
.event-location-inline { font-size: 0.8rem; color: var(--muted); }
.event-row-actions { display: flex; gap: 0.5rem; flex-shrink: 0; }

/* ===== DASHBOARD ===== */
.dashboard-grid {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 2rem;
  padding-bottom: 3rem;
}
.dashboard-main { display: flex; flex-direction: column; gap: 1.5rem; }
.dashboard-sidebar { display: flex; flex-direction: column; gap: 1.5rem; }

.card {
  background: var(--surface-tint-1);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--neu-raise);
  overflow: hidden;
  position: relative;
}
.card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(204,31,31,0.4), transparent);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  z-index: 1;
}
.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--border);
  background: var(--surface-tint-2);
}
.card-title { font-size: 0.95rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; }
.card-link { font-size: 0.8rem; color: var(--red); text-transform: uppercase; letter-spacing: 0.05em; font-weight: 600; }

.list-items { padding: 0.5rem 0; }
.list-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.85rem 1.5rem;
  border-bottom: 1px solid var(--border);
  transition: background 0.15s;
}
.list-item:last-child { border-bottom: none; }
.list-item:hover { background: var(--surface2); }
.list-item-compact { padding: 0.65rem 1.5rem; }

.list-item-date {
  background: linear-gradient(135deg, var(--red) 0%, var(--red-dark) 100%);
  border-radius: 4px;
  padding: 0.35rem 0.5rem;
  text-align: center;
  min-width: 40px;
  flex-shrink: 0;
  box-shadow: 0 4px 14px rgba(204,31,31,0.4);
}
.event-month-sm { display: block; font-size: 0.6rem; font-weight: 700; letter-spacing: 0.08em; color: rgba(255,255,255,0.8); }
.event-day-sm { display: block; font-size: 1.2rem; font-weight: 900; color: var(--white); line-height: 1; }

.list-item-icon {
  color: var(--red);
  font-size: 1rem;
  width: 32px;
  text-align: center;
  flex-shrink: 0;
}
.list-item-info { flex: 1; }
.list-item-info strong { display: block; font-size: 0.92rem; }
.item-meta { font-size: 0.78rem; color: var(--muted); }

.empty-text { padding: 1.25rem 1.5rem; color: var(--muted); font-size: 0.9rem; }

.quick-actions { display: grid; grid-template-columns: 1fr 1fr; }
.quick-action {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
  padding: 1.25rem;
  border: none;
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.82rem;
  text-align: center;
  position: relative;
  overflow: hidden;
  transition: color 0.15s;
  text-decoration: none;
}
.quick-action::after { content: ''; position: absolute; inset: 0; background: var(--red); opacity: 0; transition: opacity 0.15s; }
.quick-action:hover { color: var(--red); }
.quick-action:hover::after { opacity: 0.05; }
.quick-action:active::after { opacity: 0.1; }
.quick-action:nth-child(2n) { border-right: none; }
.quick-action:nth-child(3), .quick-action:nth-child(4) { border-bottom: none; }
.qa-icon { font-size: 1.5rem; }

/* ===== FILES GRID ===== */
.files-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.25rem;
  padding-bottom: 3rem;
}

.file-card {
  background: var(--surface-tint-1);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  box-shadow: var(--neu-raise-sm);
  transition: border-color 0.2s, box-shadow 0.2s;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}
.file-card:hover { border-color: rgba(204,31,31,0.6); box-shadow: 0 4px 24px rgba(204,31,31,0.15); }
.file-card-header { display: flex; justify-content: space-between; align-items: center; }
.file-title { font-size: 1rem; font-weight: 700; }
.file-title a { color: var(--text); }
.file-title a:hover { color: var(--red); }
.file-meta { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.meta-item { font-size: 0.8rem; color: var(--muted); }
.file-desc { font-size: 0.85rem; color: var(--muted); flex: 1; }
.file-footer { display: flex; justify-content: space-between; align-items: center; margin-top: 0.25rem; }
.file-author { font-size: 0.78rem; color: var(--muted); }
.file-date { font-size: 0.78rem; color: var(--muted); }

/* ===== DETAIL CARD ===== */
.detail-card {
  background: var(--surface-tint-1);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--neu-raise-sm);
  padding: 1.25rem 1.5rem;
  margin-bottom: 1.25rem;
}

.detail-meta-row { display: flex; gap: 1.5rem; align-items: flex-start; margin-bottom: 1.5rem; }
.detail-date-badge {
  background: linear-gradient(135deg, var(--red) 0%, var(--red-dark) 100%);
  border-radius: 6px;
  padding: 0.75rem 1rem;
  text-align: center;
  min-width: 64px;
  box-shadow: 0 4px 14px rgba(204,31,31,0.4);
}
.detail-meta { flex: 1; }
.detail-time { font-size: 1rem; font-weight: 600; margin-bottom: 0.5rem; }
.detail-location { color: var(--muted); margin-bottom: 0.75rem; }

.detail-tags { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-bottom: 1.25rem; }

.detail-description {
  border-top: 1px solid var(--border);
  padding-top: 1.25rem;
  margin-top: 1.25rem;
}
.detail-description h3 { font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); margin-bottom: 0.75rem; }
.detail-description p { color: #c0c0c0; line-height: 1.8; }

.detail-actions {
  display: flex;
  gap: 1rem;
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
}

.detail-download { margin-top: 1.5rem; }

.muted { color: var(--muted); }

/* ===== FORMS ===== */
.form-container { max-width: 680px; margin-bottom: 3rem; }

.rcr-form { display: flex; flex-direction: column; gap: 1.25rem; }

.form-group { display: flex; flex-direction: column; gap: 0.4rem; }
.form-group label:not(.checkbox-label) {
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--muted);
}
.form-group input:not([type="checkbox"]):not([type="radio"]),
.form-group select,
.form-group textarea {
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 1rem; /* 16px minimum prevents iOS auto-zoom */
  padding: 0.65rem 0.9rem;
  font-family: var(--font);
  box-shadow: var(--neu-inset);
  transition: border-color 0.2s, box-shadow 0.2s;
  width: 100%;
}
.form-group input:not([type="checkbox"]):not([type="radio"]):focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--red);
  box-shadow: var(--neu-inset), 0 0 0 3px var(--red-glow);
}
.form-group select option { background: var(--surface2); }
.form-group textarea { resize: vertical; }

.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1.25rem; }

.form-check { display: flex; align-items: center; gap: 0.5rem; font-size: 0.9rem; color: var(--muted); }
.form-check input { width: auto; }

.form-hint { font-size: 0.8rem; color: var(--muted); margin-top: 0.25rem; }
.form-actions { display: flex; gap: 1rem; align-items: center; margin-top: 0.5rem; flex-wrap: wrap; }

.file-input { cursor: pointer; }
.file-input::file-selector-button {
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 0.4rem 0.9rem;
  border-radius: 4px;
  cursor: pointer;
  margin-right: 0.75rem;
  font-size: 0.85rem;
}

.form-errors {
  background: rgba(204,31,31,0.1);
  border: 1px solid rgba(204,31,31,0.4);
  border-radius: 6px;
  padding: 0.85rem 1rem;
  color: #f87171;
  font-size: 0.9rem;
}

/* ===== AUTH ===== */
.auth-page {
  min-height: calc(100vh - 70px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  background: radial-gradient(ellipse at center, rgba(204,31,31,0.06) 0%, transparent 70%);
}

.auth-card {
  background: var(--surface-tint-1);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  box-shadow: var(--neu-lg), 0 0 80px rgba(204,31,31,0.08);
  padding: 2.5rem;
  width: 100%;
  max-width: 420px;
  position: relative;
  overflow: hidden;
}
.auth-card::before {
  content: '';
  position: absolute;
  top: 0; left: 50%; transform: translateX(-50%);
  width: 200px; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(204,31,31,0.6), transparent);
}

.auth-logo { margin-bottom: 1.75rem; }
.auth-logo img { height: 44px; width: auto; }
.auth-title { font-size: 1.6rem; font-weight: 800; margin-bottom: 1.75rem; }

.auth-links { margin-top: 1.5rem; padding-top: 1.25rem; border-top: 1px solid var(--border); }
.auth-links a { font-size: 0.85rem; color: var(--muted); display: block; margin-bottom: 0.5rem; }
.auth-links a:hover { color: var(--red); }

.submitted-icon { font-size: 3rem; color: var(--red); margin-bottom: 1rem; }

/* ===== FORM SECTION LABEL ===== */
.form-section-label { font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.12em; color: var(--muted); padding-bottom: 0.4rem; border-bottom: 1px solid var(--border); margin-bottom: 0.25rem; }
.form-hint-inline { font-size: 0.8rem; color: var(--muted); text-transform: none; font-weight: 400; letter-spacing: 0; }
.nav-admin { color: var(--red) !important; }

/* ===== ADMIN VIEWS ===== */
.admin-section { margin-bottom: 2.5rem; }
.admin-section-title { font-size: 1rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; margin-bottom: 1rem; display: flex; align-items: center; gap: 0.6rem; }
.admin-badge { display: inline-flex; align-items: center; justify-content: center; min-width: 1.5rem; height: 1.5rem; border-radius: 999px; font-size: 0.75rem; font-weight: 700; padding: 0 0.4rem; }
.badge-pending { background: var(--red); color: var(--white); }

.admin-table-wrap { overflow-x: auto; }
.admin-table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.admin-table th { text-align: left; font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); padding: 0.6rem 1rem; border-bottom: 1px solid var(--border); }
.admin-table td { padding: 0.85rem 1rem; border-bottom: 1px solid var(--border); vertical-align: middle; }
.admin-table tr:last-child td { border-bottom: none; }
.admin-table tr:hover td { background: var(--surface2); }
.muted-cell { color: var(--muted); font-size: 0.85rem; }

.platform-tag { display: inline-block; font-size: 0.75rem; font-weight: 600; padding: 0.15rem 0.5rem; border-radius: 4px; margin-right: 0.3rem; margin-bottom: 0.2rem; }
.platform-tag.iracing { background: rgba(204,31,31,0.15); color: var(--red); }
.platform-tag.lmu { background: rgba(255,255,255,0.08); color: var(--text); }

.style-badge { display: inline-block; font-size: 0.75rem; font-weight: 600; padding: 0.15rem 0.5rem; border-radius: 4px; text-transform: capitalize; }
.style-badge.style-casual { background: rgba(100,200,100,0.12); color: #6ec96e; }
.style-badge.style-competitive { background: rgba(204,31,31,0.15); color: var(--red); }
.style-badge.style-hybrid { background: rgba(100,150,255,0.12); color: #7aabff; }

.status-badge { display: inline-block; font-size: 0.75rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; padding: 0.15rem 0.5rem; border-radius: 4px; }
.status-badge.status-pending { background: rgba(255,200,50,0.12); color: #f5c842; }
.status-badge.status-approved { background: rgba(100,200,100,0.12); color: #6ec96e; }
.status-badge.status-rejected { background: rgba(204,31,31,0.12); color: #cc6666; }

/* Admin detail layout */
.admin-detail-grid { display: grid; grid-template-columns: 1fr 320px; gap: 1.5rem; align-items: start; padding-bottom: 3rem; }
.detail-card-title { font-size: 0.8rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); margin-bottom: 1rem; }
.detail-list { display: grid; grid-template-columns: max-content 1fr; gap: 0.5rem 1.5rem; font-size: 0.9rem; }
.detail-list dt { color: var(--muted); font-weight: 600; font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.05em; padding-top: 0.1rem; }
.detail-list dd { color: var(--text); }

.action-card { border-color: var(--border); }
.action-approve { border-top: 2px solid #6ec96e; }
.action-reject { border-top: 2px solid #cc4444; }

.iracing-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1rem; }
.iracing-header .detail-card-title { margin-bottom: 0; }
.iracing-stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; margin-bottom: 1rem; }
.iracing-stat { text-align: center; }
.iracing-stat-value { display: block; font-size: 1.3rem; font-weight: 800; margin-bottom: 0.2rem; }
.iracing-stat-label { display: block; font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); }

.license-badge { display: inline-block; font-size: 0.85rem; font-weight: 800; padding: 0.1rem 0.4rem; border-radius: 3px; }
.license-badge.license-p { background: #b87333; color: #fff; } /* Rookie */
.license-badge.license-d { background: #cc7722; color: #fff; }
.license-badge.license-c { background: #cccc00; color: #000; }
.license-badge.license-b { background: #44aa44; color: #fff; }
.license-badge.license-a { background: #4444cc; color: #fff; }
.license-badge.license-w { background: #444; color: #fff; } /* Pro/WC */

.other-licenses { display: flex; flex-wrap: wrap; gap: 0.4rem; align-items: center; }

@media (max-width: 900px) {
  .admin-detail-grid { grid-template-columns: 1fr; }
  .iracing-stats-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ===== LOCAL TIME ===== */
.local-time { color: var(--muted); font-size: 0.85em; }

/* ===== EVENT TYPE BADGE ===== */
.badge-type { background: var(--surface2); color: var(--muted); border: 1px solid var(--border); }
.event-type-label { color: var(--muted); font-size: 0.85em; }

/* ===== NEXT RACE CARD ===== */
.next-race-card { border-left: 3px solid var(--red); }
.next-race-info { display: flex; gap: 1.5rem; align-items: flex-start; padding: 0.5rem 0; }
.next-race-date-block { display: flex; flex-direction: column; align-items: center; background: var(--red); color: #fff; border-radius: 6px; padding: 0.5rem 0.75rem; min-width: 52px; }
.next-race-date-block .event-month { font-size: 0.7rem; font-weight: 700; letter-spacing: 0.05em; }
.next-race-date-block .event-day { font-size: 1.8rem; font-weight: 700; line-height: 1; }
.next-race-details { flex: 1; }
.next-race-title { font-size: 1.1rem; font-weight: 600; margin-bottom: 0.4rem; }
.next-race-meta { margin-bottom: 0.4rem; display: flex; gap: 0.5rem; flex-wrap: wrap; align-items: center; }
.next-race-time { color: var(--muted); font-size: 0.9rem; }

/* ===== EMPTY STATE ===== */
.empty-state {
  text-align: center;
  padding: 4rem 2rem;
  color: var(--muted);
}
.empty-state p { margin-bottom: 1.5rem; font-size: 1rem; }

/* ===== FOOTER ===== */
.site-footer {
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding: 2rem;
  margin-top: auto;
}
.footer-inner { display: flex; align-items: center; justify-content: center; flex-direction: column; gap: 1rem; text-align: center; }
.footer-nav { display: flex; gap: 1.75rem; flex-wrap: wrap; justify-content: center; }
.footer-nav a { font-size: 0.78rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.08em; transition: color 0.2s; }
.footer-nav a:hover { color: var(--red); }
.footer-logo { height: 32px; width: auto; opacity: 0.6; }
.footer-copy { font-size: 0.8rem; color: var(--muted); }

/* ===== RESPONSIVE ===== */
@media (max-width: 900px) {
  .about-grid { grid-template-columns: 1fr; }
  .dashboard-grid { grid-template-columns: 1fr; }
  .form-row { grid-template-columns: 1fr; }
}

@media (max-width: 700px) {
  .hero { height: auto; min-height: 480px; padding: 4rem 0; }
  .hero-logo { height: 60px; }
  .events-grid { grid-template-columns: 1fr; }
  .event-row { flex-wrap: wrap; }
  .section-title { font-size: 1.5rem; }
  .page-header-inner { flex-direction: column; align-items: flex-start; gap: 1rem; }
  .section-header { flex-direction: column; align-items: flex-start; gap: 0.75rem; }
  .form-actions { flex-direction: column; align-items: stretch; }
  .form-actions > * { width: 100%; text-align: center; }

  /* Mobile nav */
  .nav-hamburger { display: flex; }
  .navbar-menu {
    display: none;
    position: absolute;
    top: 70px;
    left: 0;
    right: 0;
    background: rgba(10, 10, 10, 0.98);
    backdrop-filter: blur(10px);
    border-bottom: 2px solid var(--border);
    flex-direction: column;
    padding: 0.75rem;
    gap: 0.25rem;
    z-index: 99;
  }
  .navbar-menu.nav-open { display: flex; }
  .nav-link { width: 100%; padding: 0.65rem 0.75rem; }
  .nav-user {
    flex-direction: column;
    align-items: stretch;
    margin-left: 0;
    margin-top: 0.5rem;
    padding-top: 0.5rem;
    border-top: 1px solid var(--border);
    gap: 0.5rem;
    width: 100%;
  }
  .btn-login { margin-left: 0; width: 100%; text-align: center; display: block; }
  .btn-signout { width: 100%; text-align: center; }
}

/* ===== GALLERY ===== */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(400px, 100%), 1fr));
  gap: 1rem;
  padding-bottom: 3rem;
}
.gallery-item {
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--border);
  box-shadow: var(--neu-raise-sm);
  transition: border-color 0.2s, box-shadow 0.2s;
}
.gallery-item:hover { border-color: var(--red); }
.gallery-img {
  width: 100%;
  height: 260px;
  object-fit: cover;
  display: block;
}
.gallery-caption {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.6rem 0.75rem;
  font-size: 0.85rem;
  color: var(--muted);
  background: var(--surface);
}

/* ===== SECTION HEADERS ===== */
h3.section-title { font-size: 1rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); margin-bottom: 1rem; }
.section-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1rem; }
.section-header h3.section-title { margin-bottom: 0; }

/* ===== SERVER INFO ===== */
.server-info { margin-top: 1rem; padding-top: 1rem; border-top: 1px solid var(--border); }
.server-info h3 { font-size: 0.85rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); margin-bottom: 0.5rem; }
.server-details { display: flex; gap: 2rem; flex-wrap: wrap; }
.server-password { background: var(--bg); padding: 0.1rem 0.4rem; border-radius: 4px; font-family: monospace; font-size: 0.95rem; color: var(--red); }

/* ===== RSVP ===== */
.rsvp-buttons { display: flex; gap: 0.5rem; flex-wrap: wrap; margin-bottom: 0.75rem; }
.btn-rsvp { background: var(--surface); border: 1px solid var(--border); color: var(--text); padding: 0.4rem 1rem; border-radius: 6px; cursor: pointer; font-size: 0.875rem; transition: border-color 0.2s; }
.btn-rsvp:hover { border-color: var(--red); }
.btn-rsvp-yes.btn-rsvp-active { background: #1a3a1a; border-color: #4caf50; color: #4caf50; }
.btn-rsvp-maybe.btn-rsvp-active { background: #3a3010; border-color: #f0b429; color: #f0b429; }
.btn-rsvp-no.btn-rsvp-active { background: #3a1010; border-color: var(--red); color: var(--red); }
.rsvp-count { font-size: 0.85rem; color: var(--muted); margin-top: 0.5rem; }

/* ===== DATA TABLE ===== */
.data-table { width: 100%; border-collapse: collapse; font-size: 0.875rem; }
.data-table th { text-align: left; padding: 0.5rem 0.75rem; font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); border-bottom: 1px solid var(--border); }
.data-table td { padding: 0.6rem 0.75rem; border-bottom: 1px solid var(--border); }
.data-table tbody tr:last-child td { border-bottom: none; }
.data-table tbody tr:hover { background: rgba(255,255,255,0.03); }
.table-actions { display: flex; gap: 0.4rem; justify-content: flex-end; }
.table-total td { border-top: 2px solid var(--border); border-bottom: none; padding-top: 0.75rem; }
.badge-type { background: rgba(204,31,31,0.15); color: var(--red); }

/* ===== NOTIFICATIONS ===== */
.nav-bell { position: relative; font-size: 1.1rem; color: var(--text); padding: 0 0.25rem; text-decoration: none; }
.nav-bell-badge { position: absolute; top: -4px; right: -6px; background: var(--red); color: white; font-size: 0.65rem; font-weight: 700; border-radius: 999px; padding: 0 4px; min-width: 16px; text-align: center; }
.notifications-list { display: flex; flex-direction: column; gap: 0.75rem; padding-bottom: 3rem; }
.notification-item { background: var(--surface-tint-1); border: 1px solid var(--border); border-radius: var(--radius-md); box-shadow: var(--neu-raise-sm); padding: 1rem 1.25rem; }
.notification-unread { border-color: var(--red); }
.notification-message { font-weight: 600; margin-bottom: 0.3rem; }
.notification-meta { display: flex; gap: 1rem; font-size: 0.8rem; color: var(--muted); }
.notification-link { color: var(--red); text-decoration: none; }

/* ===== PROFILE ===== */
.nav-avatar { width: 28px; height: 28px; border-radius: 50%; object-fit: cover; border: 1px solid var(--border); }
.profile-avatar-group { display: flex; flex-direction: column; gap: 0.5rem; }
.profile-avatar { width: 80px; height: 80px; border-radius: 50%; object-fit: cover; border: 2px solid var(--border); }
.profile-avatar-fallback {
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, rgba(204,31,31,0.16), rgba(255,255,255,0.04));
  color: var(--red);
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 800;
}
.form-static { color: var(--muted); font-size: 0.9rem; margin: 0; }
.checkbox-group { display: flex; flex-direction: column; gap: 0.5rem; margin-top: 0.5rem; }
.checkbox-label { display: flex; align-items: center; gap: 0.5rem; font-size: 0.9rem; cursor: pointer; }

/* Toggle switch */
.toggle-group { display: flex; flex-direction: column; gap: 0.75rem; margin-top: 0.5rem; }

.toggle-row {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  cursor: pointer;
  user-select: none;
}

.toggle-input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-track {
  position: relative;
  width: 40px;
  height: 22px;
  background: var(--border);
  border-radius: 999px;
  flex-shrink: 0;
  transition: background 0.2s ease;
}

.toggle-thumb {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 16px;
  height: 16px;
  background: #fff;
  border-radius: 50%;
  transition: transform 0.2s ease, background 0.2s ease;
  box-shadow: 0 1px 3px rgba(0,0,0,0.4);
}

.toggle-input:checked + .toggle-track {
  background: var(--red);
}
.toggle-input:checked + .toggle-track .toggle-thumb {
  transform: translateX(18px);
}

.toggle-row:hover .toggle-track {
  background: color-mix(in srgb, var(--border) 60%, var(--red));
}
.toggle-input:checked + .toggle-track:hover,
.toggle-row:hover .toggle-input:checked + .toggle-track {
  background: #e02525;
}

.toggle-label {
  font-size: 0.9rem;
  color: var(--text);
}

/* ===== DISPLAY FONT — ELEMENT OVERRIDES ===== */
.auth-title { font-family: var(--font-display); letter-spacing: 0.03em; font-size: 2rem; }
.card-title { font-family: var(--font-display); letter-spacing: 0.06em; }
.admin-section-title { font-family: var(--font-display); }
.cta-inner h2 { font-family: var(--font-display); font-size: 3rem; letter-spacing: 0.01em; }
.about-module-label { font-family: var(--font-display); }
.iracing-stat-value { font-family: var(--font-display); }
.event-info h3 { font-family: var(--font-display); font-size: 1.15rem; letter-spacing: 0.01em; }
.event-row-info h3 { font-family: var(--font-display); font-size: 1.1rem; letter-spacing: 0.01em; }
.event-day { font-family: var(--font-display); font-size: 1.9rem; }
.event-day-sm { font-family: var(--font-display); font-size: 1.5rem; }
.detail-time { font-family: var(--font-display); font-size: 1.2rem; letter-spacing: 0.03em; }
h3.section-title { font-family: var(--font-display); font-size: 1.1rem; }

/* ===== HERO LOGO PULSE ===== */
@keyframes logo-glow {
  0%, 100% { filter: drop-shadow(0 0 20px rgba(204,31,31,0.5)); }
  50% { filter: drop-shadow(0 0 40px rgba(204,31,31,0.9)) drop-shadow(0 0 10px rgba(204,31,31,0.4)); }
}
.hero-logo { animation: logo-glow 3s ease-in-out infinite; }

/* ===== CALENDAR SECTION REFINEMENT ===== */
.calendar-section {
  background: linear-gradient(to bottom, var(--surface) 0%, rgba(20,20,20,0.6) 100%);
}

/* ===== GALLERY HOVER ===== */
.gallery-item:hover { border-color: rgba(204,31,31,0.6); box-shadow: 0 4px 24px rgba(204,31,31,0.15); }

/* ===== NOTIFICATION ITEM ===== */
.notification-unread { border-color: rgba(204,31,31,0.5); box-shadow: -3px 0 0 var(--red); }

/* ===== SETUP LIBRARY ===== */

/* Folder tabs */
.folder-tabs {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 1.25rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--border);
}
.folder-tab {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.9rem;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  border: 1px solid var(--border);
  color: var(--muted);
  transition: border-color 0.15s, color 0.15s, background 0.15s;
  text-decoration: none;
}
.folder-tab:hover { border-color: var(--red); color: var(--text); }
.folder-tab-active { background: rgba(204,31,31,0.12); border-color: rgba(204,31,31,0.45); color: var(--red); }

/* Filter bar */
.filter-bar {
  display: flex;
  gap: 0.65rem;
  align-items: center;
  margin-bottom: 1.75rem;
  flex-wrap: wrap;
}
.filter-label {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}
.filter-select {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 5px;
  color: var(--text);
  font-size: 0.85rem;
  padding: 0.42rem 0.75rem;
  font-family: var(--font);
  cursor: pointer;
  transition: border-color 0.2s;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23888' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.6rem center;
  padding-right: 2rem;
}
.filter-select:focus { outline: none; border-color: var(--red); }
.filter-clear {
  font-size: 0.8rem;
  color: var(--muted);
  text-decoration: underline;
  margin-left: 0.25rem;
}
.filter-clear:hover { color: var(--red); }

/* Setup card grid */
.setup-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.25rem;
  padding-bottom: 3rem;
}

/* Setup card */
.setup-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.setup-card:hover { border-color: rgba(204,31,31,0.6); box-shadow: 0 4px 28px rgba(204,31,31,0.18); }

/* Car image */
.setup-card-image {
  width: 100%;
  height: 170px;
  overflow: hidden;
  flex-shrink: 0;
}
.setup-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.4s ease;
}
.setup-card:hover .setup-card-image img { transform: scale(1.04); }

/* Placeholder when no image uploaded */
.setup-card-image-placeholder {
  width: 100%;
  height: 170px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  position: relative;
  overflow: hidden;
}
.setup-card-image-placeholder::before {
  content: '';
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    -45deg,
    transparent,
    transparent 12px,
    rgba(255,255,255,0.015) 12px,
    rgba(255,255,255,0.015) 24px
  );
}
.setup-card-image-placeholder.sim-iracing {
  background: linear-gradient(135deg, rgba(59,130,246,0.18) 0%, rgba(30,30,30,0.8) 100%);
  border-bottom: 1px solid rgba(59,130,246,0.2);
}
.setup-card-image-placeholder.sim-le-mans-ultimate {
  background: linear-gradient(135deg, rgba(234,179,8,0.18) 0%, rgba(30,30,30,0.8) 100%);
  border-bottom: 1px solid rgba(234,179,8,0.2);
}
.setup-card-image-placeholder.sim- {
  background: linear-gradient(135deg, rgba(204,31,31,0.12) 0%, rgba(30,30,30,0.8) 100%);
  border-bottom: 1px solid rgba(204,31,31,0.15);
}
.setup-card-car-label {
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 700;
  color: rgba(255,255,255,0.35);
  letter-spacing: 0.04em;
  text-align: center;
  padding: 1rem;
  position: relative;
  z-index: 1;
}

/* Card body */
.setup-card-body {
  padding: 1.1rem 1.25rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  flex: 1;
}
.setup-card-meta-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.setup-card-title {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  margin: 0;
}
.setup-card-link { color: var(--text); }
.setup-card-link:hover { color: var(--red); }

.setup-card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}
.setup-tag {
  font-size: 0.75rem;
  color: var(--muted);
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 0.15rem 0.5rem;
}
.setup-tag-folder {
  background: rgba(204,31,31,0.08);
  border-color: rgba(204,31,31,0.25);
  color: rgba(204,31,31,0.8);
}

.setup-card-desc {
  font-size: 0.83rem;
  color: var(--muted);
  line-height: 1.5;
  flex: 1;
}
.setup-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: auto;
  padding-top: 0.25rem;
}

/* Show page hero image */
.setup-hero-image {
  width: 100%;
  max-width: 800px;
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: 1.5rem;
  border: 1px solid var(--border);
  box-shadow: 0 8px 32px rgba(0,0,0,0.5);
}
.setup-hero-image img {
  width: 100%;
  max-height: 420px;
  object-fit: cover;
  display: block;
}

@media (max-width: 700px) {
  .setup-grid { grid-template-columns: 1fr; }
  .filter-bar { gap: 0.5rem; }
  .filter-select { font-size: 0.8rem; }
}

/* ============================================================
   FEATURES PUBLIC PAGE
   ============================================================ */

/* Hero */
.features-hero {
  position: relative;
  min-height: 560px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: var(--bg);
}

.features-hero-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(204,31,31,0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(204,31,31,0.06) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse at center, black 30%, transparent 75%);
}

.features-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 50% 60%, rgba(204,31,31,0.14) 0%, transparent 65%);
}

.features-hero-inner {
  position: relative;
  z-index: 2;
  text-align: center;
  padding: 5rem 1.5rem;
}

.features-hero-eyebrow {
  font-family: var(--font-display);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--red);
  margin-bottom: 1.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
}
.features-hero-eyebrow::before,
.features-hero-eyebrow::after {
  content: '';
  display: block;
  width: 32px;
  height: 1px;
  background: var(--red);
  opacity: 0.5;
}

.features-hero-title {
  font-family: var(--font-display);
  font-size: clamp(3rem, 8vw, 5.5rem);
  font-weight: 800;
  line-height: 1.0;
  letter-spacing: 0.01em;
  margin-bottom: 1.5rem;
}

.features-hero-sub {
  font-size: 1.1rem;
  color: #a0a0a0;
  max-width: 560px;
  margin: 0 auto 2.5rem;
  line-height: 1.7;
}

.features-hero-ctas {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}

.features-hero-scroll-hint {
  position: absolute;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
  color: var(--muted);
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  z-index: 2;
  animation: bounce-hint 2s ease-in-out infinite;
}

@keyframes bounce-hint {
  0%, 100% { transform: translateX(-50%) translateY(0); opacity: 0.5; }
  50% { transform: translateX(-50%) translateY(6px); opacity: 1; }
}

/* Live bar */
.features-live-bar {
  background: rgba(204,31,31,0.08);
  border-top: 1px solid rgba(204,31,31,0.2);
  border-bottom: 1px solid rgba(204,31,31,0.2);
  padding: 0.6rem 0;
}

.features-live-inner {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.85rem;
  color: var(--muted);
}

.features-live-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--red);
  flex-shrink: 0;
  animation: pulse-dot 1.8s ease-in-out infinite;
}

@keyframes pulse-dot {
  0%, 100% { box-shadow: 0 0 0 0 rgba(204,31,31,0.6); }
  50% { box-shadow: 0 0 0 5px rgba(204,31,31,0); }
}

.features-live-text { color: var(--red); font-weight: 700; font-size: 0.85rem; }
.features-live-sep { color: var(--border); }

/* Section header */
.features-section { padding: 5rem 0; }

.features-section-header {
  text-align: center;
  margin-bottom: 3.5rem;
}

.features-section-eyebrow {
  font-family: var(--font-display);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--red);
  margin-bottom: 1rem;
}

.features-section-title {
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 4vw, 2.75rem);
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: 0.01em;
}

/* Main feature cards grid */
.features-main-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: auto auto;
  gap: 1.5rem;
}

.feature-card-wide {
  grid-column: 1 / -1;
}

.feature-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  transition: border-color 0.25s, box-shadow 0.25s, transform 0.25s;
}
.feature-card:hover {
  border-color: rgba(204,31,31,0.5);
  box-shadow: 0 8px 40px rgba(204,31,31,0.15);
  transform: translateY(-3px);
}

.feature-card-inner {
  padding: 2rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  height: 100%;
}

.feature-num {
  font-family: var(--font-display);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  color: rgba(204,31,31,0.5);
}

.feature-icon-wrap {
  width: 56px;
  height: 56px;
  background: rgba(204,31,31,0.1);
  border: 1px solid rgba(204,31,31,0.2);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--red);
}

.feature-title {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  margin: 0;
}

.feature-desc {
  color: #9a9a9a;
  font-size: 0.95rem;
  line-height: 1.7;
  flex: 1;
}

.feature-cta {
  display: inline-block;
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--red);
  margin-top: 0.5rem;
  transition: letter-spacing 0.2s;
}
.feature-cta:hover { color: var(--red); letter-spacing: 0.14em; }

.feature-members-badge {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  padding: 0.25rem 0.7rem;
  border-radius: 4px;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border);
  color: var(--muted);
  margin-top: 0.5rem;
  align-self: flex-start;
}

/* Feature preview widgets */
.feature-preview {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1rem;
  margin: 0.25rem 0;
}

.feature-preview-schedule { display: flex; flex-direction: column; gap: 0.6rem; }

.fp-race-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.6rem 0.75rem;
  background: var(--surface);
  border-radius: 6px;
  border-left: 3px solid var(--border);
}
.fp-race-upcoming { border-left-color: var(--red); }

.fp-race-time { display: flex; flex-direction: column; align-items: center; min-width: 44px; }
.fp-race-hour { font-family: var(--font-display); font-size: 1.1rem; font-weight: 700; line-height: 1; }
.fp-race-tz { font-size: 0.6rem; color: var(--muted); letter-spacing: 0.06em; }

.fp-race-info { flex: 1; display: flex; flex-direction: column; }
.fp-race-name { font-weight: 600; font-size: 0.88rem; }
.fp-race-meta { font-size: 0.75rem; color: var(--muted); }

.fp-status { font-size: 0.68rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; padding: 0.2rem 0.5rem; border-radius: 3px; }
.fp-status-upcoming { background: rgba(204,31,31,0.15); color: var(--red); }
.fp-status-later { background: rgba(255,255,255,0.06); color: var(--muted); }

/* Stint timeline preview */
.fp-stint-timeline {
  position: relative;
  height: 32px;
  background: var(--surface);
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 0.75rem;
}

.fp-stint {
  position: absolute;
  top: 4px;
  height: 24px;
  width: var(--stint-w);
  left: var(--stint-start);
  background: rgba(204,31,31,0.2);
  border: 1px solid rgba(204,31,31,0.35);
  border-radius: 3px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.68rem;
  color: var(--muted);
  font-weight: 600;
}

.fp-stint-you {
  background: rgba(204,31,31,0.5);
  border-color: var(--red);
  color: white;
  font-weight: 700;
}

.fp-roster-preview { display: flex; flex-direction: column; gap: 0.3rem; }
.fp-driver { display: flex; justify-content: space-between; font-size: 0.8rem; color: var(--muted); padding: 0.2rem 0; }
.fp-driver span { font-size: 0.75rem; }
.fp-driver-you { color: var(--text); font-weight: 600; }
.fp-driver-you::before { content: ''; display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--red); margin-right: 0.4rem; vertical-align: middle; }

/* Availability preview */
.fp-avail-row { display: flex; align-items: center; gap: 0.75rem; margin-bottom: 0.75rem; }
.fp-avail-label { font-size: 0.8rem; font-weight: 600; min-width: 130px; }
.fp-avail-bar { flex: 1; height: 6px; background: var(--surface); border-radius: 3px; overflow: hidden; }
.fp-avail-fill { height: 100%; background: linear-gradient(90deg, var(--red) 0%, #e03030 100%); border-radius: 3px; }
.fp-avail-pct { font-size: 0.78rem; font-weight: 700; color: var(--red); min-width: 32px; }

.fp-avail-btns { display: flex; gap: 0.5rem; }
.fp-avail-btn { font-size: 0.75rem; font-weight: 600; padding: 0.25rem 0.65rem; border-radius: 4px; border: 1px solid var(--border); color: var(--muted); }
.fp-avail-yes { border-color: rgba(34,197,94,0.35); color: #4ade80; background: rgba(34,197,94,0.08); }
.fp-avail-maybe { border-color: rgba(234,179,8,0.35); color: #fbbf24; background: rgba(234,179,8,0.08); }
.fp-avail-no { border-color: rgba(204,31,31,0.35); color: var(--red); background: rgba(204,31,31,0.08); }

/* Secondary features */
.features-secondary-section {
  padding: 4rem 0;
  background: var(--surface);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.features-secondary-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
}

.feature-secondary-card {
  padding: 1.75rem;
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  transition: background 0.2s;
}
.feature-secondary-card:hover { background: rgba(204,31,31,0.04); }
.feature-secondary-card:last-child { border-right: none; }

.fsc-icon { font-size: 1.75rem; }

.fsc-title {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.fsc-desc { font-size: 0.85rem; color: var(--muted); line-height: 1.6; flex: 1; }

/* How it works */
.features-how-section { padding: 5rem 0; text-align: center; }

.features-how-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 3rem;
  text-align: left;
  position: relative;
}

.features-how-step { position: relative; }

.fhs-num {
  font-family: var(--font-display);
  font-size: 4rem;
  font-weight: 900;
  color: rgba(204,31,31,0.15);
  line-height: 1;
  margin-bottom: 0.5rem;
}

.fhs-line {
  width: 32px;
  height: 2px;
  background: var(--red);
  margin-bottom: 1.25rem;
}

.features-how-step h4 {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
  letter-spacing: 0.02em;
}

.features-how-step p { color: var(--muted); font-size: 0.9rem; line-height: 1.7; }

.cta-rcr-text {
  background: linear-gradient(135deg, #e03030 0%, #ff6b6b 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Final CTA */
.features-final-cta {
  padding: 6rem 0;
  background: linear-gradient(135deg, rgba(204,31,31,0.08) 0%, transparent 60%), var(--bg);
  text-align: center;
  border-top: 1px solid var(--border);
}

.features-final-inner { max-width: 600px; margin: 0 auto; padding: 0 1.5rem; }
.features-final-inner h2 { font-family: var(--font-display); font-size: 3rem; font-weight: 800; margin-bottom: 1rem; }
.features-final-inner p { color: var(--muted); font-size: 1rem; line-height: 1.7; margin-bottom: 2.5rem; }

/* ============================================================
   IRACEPLAN PAGES — SHARED CHROME
   ============================================================ */

/* Page header variant with red accent line top */
.rp-page-header {
  background: linear-gradient(135deg, rgba(204,31,31,0.07) 0%, transparent 55%), var(--surface);
  border-bottom: 2px solid var(--red);
  padding: 2rem 0;
  margin-bottom: 2rem;
}

.rp-page-header-inner {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.rp-eyebrow {
  font-family: var(--font-display);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--red);
  margin-bottom: 0.5rem;
}

/* Quick nav links in page header */
.rp-header-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  padding-top: 0.25rem;
}

.rp-quick-nav {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  padding: 0.35rem 0.8rem;
  border: 1px solid var(--border);
  border-radius: 4px;
  transition: color 0.15s, border-color 0.15s;
  text-decoration: none;
}
.rp-quick-nav:hover { color: var(--text); border-color: rgba(204,31,31,0.5); }

/* ============================================================
   SCHEDULE PAGE
   ============================================================ */

/* Period tabs */
.rp-tabs {
  display: flex;
  gap: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  overflow: hidden;
  margin-bottom: 1.5rem;
  width: fit-content;
}

.rp-tab {
  background: transparent;
  border: none;
  border-right: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 0.6rem 1.25rem;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  font-family: var(--font);
}
.rp-tab:last-child { border-right: none; }
.rp-tab:hover { background: var(--surface2); color: var(--text); }
.rp-tab-active { background: var(--red); color: white !important; }

/* Stats bar */
.rp-stats-bar {
  display: flex;
  align-items: center;
  gap: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.rp-stat-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0.9rem 2rem;
  gap: 0.2rem;
}

.rp-stat-divider {
  width: 1px;
  height: 2.5rem;
  background: var(--border);
  flex-shrink: 0;
}

.rp-stat-value {
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--red);
  line-height: 1;
}

.rp-stat-countdown { font-size: 1.1rem; }

.rp-stat-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
  font-weight: 600;
}

/* Race cards */
.rp-race-list { display: flex; flex-direction: column; gap: 0.85rem; }

.rp-race-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  display: flex;
  align-items: stretch;
  overflow: hidden;
  transition: box-shadow 0.2s, border-color 0.2s;
  border-left: 4px solid var(--border);
}
.rp-race-card:hover {
  border-color: rgba(204,31,31,0.4);
  box-shadow: 0 4px 24px rgba(0,0,0,0.3);
}

.rp-race-upcoming { border-left-color: var(--red); }
.rp-race-in_progress { border-left-color: #f59e0b; }
.rp-race-completed { border-left-color: #3a3a3a; opacity: 0.7; }

/* Time column */
.rp-race-time-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1.25rem 1.5rem;
  background: var(--surface2);
  border-right: 1px solid var(--border);
  min-width: 90px;
  flex-shrink: 0;
  gap: 0.1rem;
}

.rp-race-clock {
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 800;
  line-height: 1;
  color: var(--text);
}

.rp-race-date {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--muted);
}

.rp-race-tz {
  font-size: 0.6rem;
  letter-spacing: 0.06em;
  color: rgba(136,136,136,0.6);
  text-transform: uppercase;
}

/* Body */
.rp-race-body {
  flex: 1;
  padding: 1rem 1.25rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.4rem;
}

.rp-race-name {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.rp-race-meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.rp-race-meta-item {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.8rem;
  color: var(--muted);
}

.rp-race-meta-team { color: rgba(204,31,31,0.8); }

.rp-stints-row {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
  margin-top: 0.2rem;
}

.rp-stints-label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  font-weight: 600;
}

.rp-stint-chip {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.15rem 0.5rem;
  border-radius: 3px;
  background: rgba(204,31,31,0.12);
  border: 1px solid rgba(204,31,31,0.25);
  color: rgba(204,31,31,0.9);
  font-family: var(--mono);
}

/* Status badge column */
.rp-race-status-col {
  display: flex;
  align-items: center;
  padding: 1rem 1.25rem;
  flex-shrink: 0;
}

.rp-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  padding: 0.25rem 0.65rem;
  border-radius: 4px;
  white-space: nowrap;
}

.rp-status-upcoming { background: rgba(204,31,31,0.12); color: var(--red); border: 1px solid rgba(204,31,31,0.3); }
.rp-status-in_progress { background: rgba(245,158,11,0.12); color: #f59e0b; border: 1px solid rgba(245,158,11,0.3); }
.rp-status-completed { background: rgba(255,255,255,0.04); color: var(--muted); border: 1px solid var(--border); }

.rp-status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}
.rp-status-dot-live { background: #f59e0b; animation: pulse-dot 1.4s infinite; }

/* Empty state */
.rp-empty-state {
  text-align: center;
  padding: 5rem 2rem;
  color: var(--muted);
}

.rp-empty-icon {
  font-size: 3.5rem;
  margin-bottom: 1rem;
  opacity: 0.5;
}

/* ============================================================
   PLANNINGS PAGE
   ============================================================ */

.rp-plannings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.25rem;
}

.rp-planning-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: inherit;
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.2s;
}
.rp-planning-card:hover {
  border-color: rgba(204,31,31,0.5);
  box-shadow: 0 8px 32px rgba(204,31,31,0.12);
  transform: translateY(-2px);
  color: inherit;
}

.rp-planning-team { border-top: 3px solid var(--red); }

.rp-planning-card-header {
  padding: 1.25rem 1.25rem 0.75rem;
  background: var(--surface2);
  border-bottom: 1px solid var(--border);
}

.rp-planning-meta-top {
  display: flex;
  gap: 0.4rem;
  margin-bottom: 0.6rem;
}

.rp-planning-type-badge {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  padding: 0.18rem 0.5rem;
  border-radius: 3px;
}

.rp-badge-team { background: rgba(204,31,31,0.15); color: var(--red); border: 1px solid rgba(204,31,31,0.3); }
.rp-badge-solo { background: rgba(59,130,246,0.12); color: #93c5fd; border: 1px solid rgba(59,130,246,0.25); }

.rp-planning-name {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.rp-planning-team-name {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.8rem;
  color: var(--muted);
  margin-top: 0.35rem;
}

.rp-planning-card-body {
  padding: 1rem 1.25rem;
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  flex: 1;
}

.rp-planning-date-badge {
  background: var(--red);
  border-radius: 6px;
  padding: 0.5rem 0.6rem;
  text-align: center;
  min-width: 52px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
}

.rp-planning-date-month { font-size: 0.58rem; font-weight: 700; letter-spacing: 0.1em; color: rgba(255,255,255,0.8); }
.rp-planning-date-day { font-family: var(--font-display); font-size: 1.6rem; font-weight: 900; color: white; line-height: 1; }
.rp-planning-date-time { font-size: 0.55rem; color: rgba(255,255,255,0.7); letter-spacing: 0.04em; }

.rp-planning-details { display: flex; flex-direction: column; gap: 0.4rem; }
.rp-planning-detail-row {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.82rem;
  color: var(--muted);
}

.rp-planning-card-footer {
  padding: 0.75rem 1.25rem;
  border-top: 1px solid var(--border);
}

.rp-planning-cta {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--red);
}

/* ============================================================
   PLANNING DETAIL PAGE
   ============================================================ */

.rp-planning-hero-date {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0.75rem 1.25rem;
  background: var(--red);
  border-radius: 8px;
  min-width: 64px;
  flex-shrink: 0;
}

.rp-phd-month { font-size: 0.65rem; font-weight: 700; letter-spacing: 0.12em; color: rgba(255,255,255,0.8); }
.rp-phd-day { font-family: var(--font-display); font-size: 2.2rem; font-weight: 900; color: white; line-height: 1; }
.rp-phd-year { font-size: 0.65rem; color: rgba(255,255,255,0.7); }

.rp-detail-grid {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 1.5rem;
  align-items: start;
}

.rp-detail-main { display: flex; flex-direction: column; }
.rp-detail-sidebar { display: flex; flex-direction: column; }

/* Info grid */
.rp-info-grid {
  display: flex;
  flex-direction: column;
  padding: 0.5rem 0;
}

.rp-info-item {
  display: grid;
  grid-template-columns: 130px 1fr;
  gap: 0.5rem;
  padding: 0.65rem 1.5rem;
  border-bottom: 1px solid var(--border);
  align-items: center;
}
.rp-info-item:last-child { border-bottom: none; }

.rp-info-label {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--muted);
}

.rp-info-val {
  font-size: 0.9rem;
  font-weight: 500;
}

/* Stint timeline */
.rp-stints-container {
  padding: 1rem 1.5rem;
  display: flex;
  flex-direction: column;
}

.rp-stint-row {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  position: relative;
  padding: 0.5rem 0;
}
.rp-stint-mine {
  background: rgba(204, 31, 31, 0.06);
  border-radius: 6px;
  padding-left: 0.6rem;
  padding-right: 0.6rem;
  margin-left: -0.6rem;
  margin-right: -0.6rem;
  border-left: 2px solid var(--red);
}

.rp-stint-number {
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--red);
  width: 36px;
  text-align: center;
  flex-shrink: 0;
  position: relative;
  z-index: 1;
}

.rp-stint-connector {
  position: absolute;
  left: 18px;
  top: 2rem;
  bottom: -0.5rem;
  width: 1px;
  background: var(--border);
}

.rp-stint-connector-visible { background: rgba(204,31,31,0.3); }

.rp-stint-detail {
  flex: 1;
  padding: 0.6rem 1rem;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 6px;
  margin-bottom: 0.5rem;
}

.rp-stint-driver {
  display: block;
  font-size: 0.9rem;
  margin-bottom: 0.25rem;
}

.rp-stint-meta {
  display: flex;
  gap: 1rem;
  font-size: 0.78rem;
  color: var(--muted);
}

/* Driver avatar in roster */
.rp-driver-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: rgba(204,31,31,0.2);
  border: 1px solid rgba(204,31,31,0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--red);
  flex-shrink: 0;
  text-transform: uppercase;
}

/* ============================================================
   SURVEYS INDEX
   ============================================================ */

.rp-surveys-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.25rem;
}

.rp-survey-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: inherit;
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.2s;
}
.rp-survey-card:hover {
  border-color: rgba(204,31,31,0.5);
  box-shadow: 0 6px 28px rgba(0,0,0,0.3);
  transform: translateY(-2px);
  color: inherit;
}

.rp-survey-status-strip {
  height: 3px;
  background: var(--border);
}
.rp-survey-open .rp-survey-status-strip { background: var(--red); }
.rp-survey-closed .rp-survey-status-strip { background: var(--muted); }

.rp-survey-body { padding: 1.25rem; display: flex; flex-direction: column; gap: 0.6rem; flex: 1; }

.rp-survey-header-row { display: flex; align-items: center; gap: 0.4rem; flex-wrap: wrap; }

.rp-survey-status-badge {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 0.2rem 0.55rem;
  border-radius: 3px;
}

.rp-sbadge-open { background: rgba(204,31,31,0.15); color: var(--red); border: 1px solid rgba(204,31,31,0.3); }
.rp-sbadge-closed { background: rgba(255,255,255,0.05); color: var(--muted); border: 1px solid var(--border); }
.rp-sbadge-created { background: rgba(59,130,246,0.12); color: #93c5fd; border: 1px solid rgba(59,130,246,0.25); }
.rp-sbadge-unknown { background: rgba(255,255,255,0.05); color: var(--muted); border: 1px solid var(--border); }
.rp-sbadge-lg { font-size: 0.82rem; padding: 0.35rem 0.85rem; }

.rp-survey-public-tag {
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--muted);
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 0.15rem 0.4rem;
}

.rp-survey-title {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.rp-survey-desc { font-size: 0.83rem; color: var(--muted); line-height: 1.55; flex: 1; }

.rp-survey-footer {
  display: flex;
  align-items: center;
  gap: 1rem;
  font-size: 0.78rem;
  color: var(--muted);
  margin-top: auto;
  padding-top: 0.5rem;
  border-top: 1px solid var(--border);
}

.rp-survey-responses, .rp-survey-when {
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

/* ============================================================
   SURVEY DETAIL PAGE
   ============================================================ */

.rp-survey-status-hero {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.4rem;
  padding-top: 0.5rem;
}

.rp-survey-hero-responses {
  font-size: 0.8rem;
  color: var(--muted);
}

/* Availability response card */
.rp-avail-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: 1.5rem;
  border-top: 3px solid var(--red);
}

.rp-avail-card-title {
  font-family: var(--font-display);
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  padding: 1rem 1.25rem 0.5rem;
}

.rp-avail-toggle-group {
  display: flex;
  gap: 0;
  padding: 0 1.25rem;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.rp-avail-toggle {
  flex: 1;
  min-width: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-size: 0.9rem;
  font-weight: 600;
  padding: 0.75rem 1rem;
  border-radius: 6px;
  border: 2px solid var(--border);
  background: var(--surface2);
  color: var(--muted);
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
  font-family: var(--font);
}

.rp-avail-yes:hover { border-color: #4ade80; color: #4ade80; background: rgba(34,197,94,0.08); }
.rp-avail-maybe:hover { border-color: #fbbf24; color: #fbbf24; background: rgba(234,179,8,0.08); }
.rp-avail-no:hover { border-color: var(--red); color: var(--red); background: rgba(204,31,31,0.08); }

.rp-avail-toggle-active.rp-avail-yes { border-color: #4ade80; color: #4ade80; background: rgba(34,197,94,0.12); }
.rp-avail-toggle-active.rp-avail-maybe { border-color: #fbbf24; color: #fbbf24; background: rgba(234,179,8,0.12); }
.rp-avail-toggle-active.rp-avail-no { border-color: var(--red); color: var(--red); background: rgba(204,31,31,0.12); }

.rp-avail-notes {
  padding: 0 1.25rem 0.75rem;
}

.rp-avail-notes textarea {
  width: 100%;
  background: var(--surface2);
  border: 1.5px solid var(--border);
  border-radius: 5px;
  color: var(--text);
  font-size: 0.9rem;
  padding: 0.6rem 0.9rem;
  font-family: var(--font);
  resize: none;
  transition: border-color 0.2s;
}
.rp-avail-notes textarea:focus { outline: none; border-color: var(--red); }

.rp-avail-card .btn-primary {
  display: block;
  margin: 0 1.25rem 1.25rem;
  width: calc(100% - 2.5rem);
  text-align: center;
  opacity: 1;
  transition: opacity 0.15s, background 0.2s;
}
.rp-avail-card .btn-primary:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  background: var(--surface2);
  box-shadow: none;
}

/* Session time availability bars */
.rp-session-time-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.9rem 1.5rem;
  border-bottom: 1px solid var(--border);
}
.rp-session-time-row:last-child { border-bottom: none; }

.rp-session-time-info { flex: 1; }

.rp-session-avail {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-shrink: 0;
}

.rp-avail-bar-wrap {
  width: 80px;
  height: 6px;
  background: var(--surface2);
  border-radius: 3px;
  overflow: hidden;
}

.rp-avail-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--red) 0%, #e03030 100%);
  border-radius: 3px;
  transition: width 0.3s;
}

.rp-avail-pct-label {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--red);
  min-width: 34px;
  text-align: right;
}

/* form-control alias — used in iRacePlan forms */
.form-control {
  background: var(--surface2);
  border: 1.5px solid var(--border);
  border-radius: 5px;
  color: var(--text);
  font-size: 1rem; /* 16px minimum prevents iOS auto-zoom */
  padding: 0.65rem 0.9rem;
  font-family: var(--font);
  transition: border-color 0.2s, box-shadow 0.2s;
  width: 100%;
}
.form-control:focus {
  outline: none;
  border-color: var(--red);
  box-shadow: 0 0 0 3px var(--red-glow);
}
.form-control option { background: var(--surface2); }

/* Features nav link subtle glow */
.nav-link-features { position: relative; }

/* ============================================================
   RESPONSIVE
   ============================================================ */

@media (max-width: 900px) {
  .rp-detail-grid { grid-template-columns: 1fr; }
  .features-main-grid { grid-template-columns: 1fr; }
  .feature-card-wide { grid-column: auto; }
  .features-secondary-grid { grid-template-columns: repeat(2, 1fr); }
  .feature-secondary-card:nth-child(2) { border-right: none; }
  .feature-secondary-card:nth-child(3) { border-top: 1px solid var(--border); }
  .feature-secondary-card:nth-child(4) { border-top: 1px solid var(--border); border-right: none; }
  .features-how-grid { grid-template-columns: 1fr; gap: 2rem; }
  .rp-survey-status-hero { align-items: flex-start; }
}

@media (max-width: 700px) {
  .rp-tabs { width: 100%; }
  .rp-tab { flex: 1; text-align: center; }
  .rp-stats-bar { justify-content: center; }
  .rp-race-card { flex-wrap: wrap; }
  .rp-race-time-col { min-width: 70px; padding: 1rem; }
  .rp-race-status-col { width: 100%; border-top: 1px solid var(--border); padding: 0.5rem 1rem; }
  .features-hero-title { font-size: 2.5rem; }
  .features-secondary-grid { grid-template-columns: 1fr; }
  .feature-secondary-card { border-right: none; border-bottom: 1px solid var(--border); }
  .rp-avail-toggle-group { flex-direction: column; }
  .rp-page-header-inner { flex-direction: column; }
  .features-final-inner h2 { font-size: 2rem; }
  .rp-plannings-grid { grid-template-columns: 1fr; }
}

/* ============================================================
   NEXT RACE HERO CARD (Dashboard)
   ============================================================ */

.next-race-card {
  display: block;
  background: var(--surface);
  border: 1px solid rgba(204,31,31,0.35);
  border-radius: 10px;
  overflow: hidden;
  transition: border-color 0.2s, box-shadow 0.2s;
  box-shadow: 0 0 0 1px rgba(204,31,31,0.08), inset 0 0 80px rgba(204,31,31,0.03);
}
.next-race-card:hover {
  border-color: rgba(204,31,31,0.6);
  box-shadow: 0 8px 40px rgba(204,31,31,0.18);
}

.next-race-eyebrow {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.6rem 1.25rem;
  background: rgba(204,31,31,0.08);
  border-bottom: 1px solid rgba(204,31,31,0.15);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--red);
}

.next-race-live-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--red);
  animation: pulse-dot 2s infinite;
  flex-shrink: 0;
}

.next-race-countdown {
  margin-left: auto;
  font-weight: 600;
  color: var(--muted);
  font-size: 0.78rem;
  letter-spacing: 0.04em;
}

.next-race-body {
  display: flex;
  align-items: stretch;
  gap: 0;
}

.next-race-date-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: var(--red);
  padding: 1.25rem 1.5rem;
  min-width: 90px;
  flex-shrink: 0;
  gap: 0;
}

.next-race-month {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: rgba(255,255,255,0.8);
}

.next-race-day {
  font-family: var(--font-display);
  font-size: 2.5rem;
  font-weight: 900;
  color: white;
  line-height: 1;
}

.next-race-time {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 700;
  color: rgba(255,255,255,0.9);
  margin-top: 0.15rem;
}

.next-race-tz {
  font-size: 0.6rem;
  letter-spacing: 0.08em;
  color: rgba(255,255,255,0.6);
}

.next-race-info {
  flex: 1;
  padding: 1.25rem 1.5rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.4rem;
  border-right: 1px solid var(--border);
}

.next-race-title {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: 0.01em;
  line-height: 1.2;
}

.next-race-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.25rem;
}

.next-race-stats {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0;
  padding: 0.75rem 1.5rem;
  flex-shrink: 0;
  min-width: 150px;
}

.next-race-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--border);
  text-align: center;
}
.next-race-stat:last-child { border-bottom: none; }

.next-race-stat-val {
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--red);
  line-height: 1.1;
}

.next-race-stat-label {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
}

.next-race-stat-warn .next-race-stat-val { color: #f59e0b; }

.next-race-stints-bar {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
  padding: 0.65rem 1.25rem;
  background: rgba(204,31,31,0.06);
  border-top: 1px solid rgba(204,31,31,0.15);
}

.next-race-stints-label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--red);
}

.next-race-server {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
  padding: 0.6rem 1.25rem;
  background: rgba(255,255,255,0.02);
  border-top: 1px solid var(--border);
  font-size: 0.85rem;
}

.next-race-server-label {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
}

.next-race-server-name {
  font-weight: 600;
  color: var(--text);
}

.next-race-server-sep { color: var(--border); }

/* ============================================================
   LINEUP / STINT — MY ROW HIGHLIGHTING
   ============================================================ */

.lineup-me {
  background: rgba(204,31,31,0.05) !important;
  border-left: 3px solid var(--red);
}
.lineup-me td { border-color: rgba(204,31,31,0.12); }

.lineup-you-tag {
  display: inline-block;
  font-size: 0.62rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 0.1rem 0.35rem;
  border-radius: 3px;
  background: rgba(204,31,31,0.15);
  color: var(--red);
  border: 1px solid rgba(204,31,31,0.3);
  margin-left: 0.4rem;
  vertical-align: middle;
}

/* My stints summary strip above the table */
.my-stints-summary {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
  padding: 0.6rem 1rem;
  background: rgba(204,31,31,0.07);
  border-left: 3px solid var(--red);
  border-radius: 0 4px 4px 0;
  margin-bottom: 1rem;
}

.my-stints-label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--red);
}

.my-stint-chip {
  font-size: 0.78rem;
  font-weight: 600;
  padding: 0.2rem 0.6rem;
  border-radius: 3px;
  background: rgba(204,31,31,0.12);
  border: 1px solid rgba(204,31,31,0.25);
  color: rgba(204,31,31,0.95);
  font-family: var(--mono);
}

@media (max-width: 700px) {
  .next-race-body { flex-wrap: wrap; }
  .next-race-stats { flex-direction: row; flex-wrap: wrap; min-width: 0; width: 100%; border-top: 1px solid var(--border); padding: 0.75rem 1rem; justify-content: space-around; }
  .next-race-stat { border-bottom: none; padding: 0.4rem 0.75rem; }
  .next-race-info { border-right: none; }
  .next-race-date-col { min-width: 80px; padding: 1rem; }
}

/* ============================================================
   TURBO PROGRESS BAR
   ============================================================ */
.turbo-progress-bar { height: 3px; background: var(--red); box-shadow: 0 0 8px var(--red-glow); }

/* ============================================================
   USER DROPDOWN NAV
   ============================================================ */
.nav-dropdown-wrap { position: relative; }

.nav-dropdown-trigger {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  background: none;
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 0.25rem 0.6rem 0.25rem 0.35rem;
  cursor: pointer;
  color: var(--text);
  font-size: 0.82rem;
  font-family: var(--font);
  transition: border-color 0.2s, background 0.2s;
}
.nav-dropdown-trigger:hover { border-color: var(--red); background: rgba(204,31,31,0.06); }
.nav-dropdown-wrap.open .nav-dropdown-trigger { border-color: var(--red); background: rgba(204,31,31,0.08); }
.nav-group-trigger {
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 0.48rem 0.75rem;
}

.nav-avatar-initial {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--red);
  color: white;
  font-size: 0.75rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.nav-dropdown-name { max-width: 100px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-dropdown-caret { opacity: 0.5; transition: transform 0.2s; flex-shrink: 0; }
.nav-dropdown-wrap.open .nav-dropdown-caret { transform: rotate(180deg); }

.nav-dropdown {
  display: none;
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  min-width: 230px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.6), 0 0 0 1px rgba(255,255,255,0.04);
  z-index: 200;
  overflow: hidden;
}
.nav-dropdown-wrap.open .nav-dropdown { display: block; }

.nav-dropdown-header {
  padding: 0.75rem 1rem;
  background: var(--surface2);
}
.nav-dropdown-user-name { display: block; font-weight: 700; font-size: 0.9rem; }
.nav-dropdown-user-role {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--red);
  font-weight: 700;
  margin-top: 0.1rem;
  display: block;
}

.nav-dropdown-item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.6rem 1rem;
  font-size: 0.88rem;
  color: var(--text);
  text-decoration: none;
  transition: background 0.15s, color 0.15s;
}
.nav-dropdown-item:hover { background: rgba(255,255,255,0.05); color: var(--white); }
.nav-dropdown-item.nav-link-active { color: var(--red); background: rgba(204,31,31,0.08); }
.nav-dropdown-item svg { opacity: 0.5; flex-shrink: 0; transition: opacity 0.15s; }
.nav-dropdown-item:hover svg { opacity: 0.85; }
.nav-dropdown-admin { color: var(--red) !important; }
.nav-dropdown-admin svg { opacity: 0.7 !important; }

.nav-dropdown-divider { height: 1px; background: var(--border); margin: 0.25rem 0; }

.nav-dropdown-signout {
  display: flex;
  align-items: center;
  width: 100%;
  padding: 0.6rem 1rem;
  font-size: 0.88rem;
  color: var(--muted);
  background: none;
  border: none;
  cursor: pointer;
  text-align: left;
  transition: background 0.15s, color 0.15s;
  font-family: var(--font);
}
.nav-dropdown-signout:hover { background: rgba(204,31,31,0.1); color: var(--red); }
.nav-dropdown-wrap .button_to { width: 100%; margin: 0; }
.nav-dropdown-wrap .button_to button { width: 100%; }

@media (max-width: 700px) {
  .navbar-menu { align-items: stretch; }
  .nav-cluster { width: 100%; flex-direction: column; align-items: stretch; gap: 0.25rem; }
  .nav-cluster-public, .nav-cluster-team, .nav-cluster-auth { margin: 0; }
  .nav-cluster-label { margin: 0.15rem 0 0.25rem; }
  .nav-link, .nav-link-pill { width: 100%; justify-content: flex-start; }
  .nav-dropdown-wrap { width: 100%; border-top: 1px solid var(--border); margin-top: 0.25rem; padding-top: 0.25rem; }
  .nav-dropdown-trigger { width: 100%; border-radius: 4px; justify-content: space-between; padding: 0.65rem 0.75rem; border: none; }
  .nav-group-trigger { padding: 0.7rem 0.75rem; }
  .nav-dropdown { position: static; box-shadow: none; border: none; border-radius: 0; background: transparent; }
  .nav-dropdown-wrap.open .nav-dropdown { display: block; }
  .nav-dropdown-header { display: none; }
  .nav-dropdown-divider { display: none; }
  .nav-dropdown-item { padding: 0.65rem 0.75rem; }
  .nav-dropdown-signout { padding: 0.65rem 0.75rem; }
}

/* ============================================================
   HOME PAGE — STATS BAR & RECRUITMENT SECTION
   ============================================================ */
.home-stats-bar {
  background: var(--surface);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: 2rem 0;
}
.home-stats-inner {
  display: flex;
  justify-content: center;
  align-items: stretch;
  flex-wrap: wrap;
}
.home-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0.5rem 3rem;
  border-right: 1px solid var(--border);
}
.home-stat:last-child { border-right: none; }
.home-stat-number {
  font-family: var(--font-display);
  font-size: 3rem;
  font-weight: 800;
  color: var(--red);
  line-height: 1;
  letter-spacing: -0.01em;
}
.home-stat-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
  margin-top: 0.4rem;
  font-weight: 600;
}

.recruitment-section { padding: 5rem 0; }
.recruitment-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
  margin-top: 3rem;
}
.recruitment-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1.75rem;
  transition: border-color 0.2s, transform 0.2s, box-shadow 0.2s;
  position: relative;
  overflow: hidden;
}
.recruitment-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: var(--red);
  transform: scaleX(0);
  transition: transform 0.3s;
  transform-origin: left;
}
.recruitment-card:hover {
  border-color: rgba(204,31,31,0.45);
  transform: translateY(-3px);
  box-shadow: 0 8px 32px rgba(204,31,31,0.12);
}
.recruitment-card:hover::before { transform: scaleX(1); }
.recruitment-card-icon {
  width: 44px;
  height: 44px;
  background: rgba(204,31,31,0.1);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.1rem;
  color: var(--red);
}
.recruitment-card-title { font-size: 1rem; font-weight: 700; margin-bottom: 0.5rem; }
.recruitment-card-desc { font-size: 0.88rem; color: var(--muted); line-height: 1.7; }

/* Hero racing line animation */
.hero-racing-line {
  position: absolute;
  inset: 0;
  z-index: 1;
  overflow: hidden;
  pointer-events: none;
}
.hero-racing-line::after {
  content: '';
  position: absolute;
  top: 55%;
  left: -20%;
  width: 140%;
  height: 1px;
  background: linear-gradient(90deg, transparent 0%, rgba(204,31,31,0.15) 30%, rgba(204,31,31,0.6) 50%, rgba(204,31,31,0.15) 70%, transparent 100%);
  transform: rotate(-6deg);
  animation: racing-sweep 5s ease-in-out infinite;
}
.hero-actions {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}
@keyframes racing-sweep {
  0%, 100% { opacity: 0; transform: rotate(-6deg) translateX(-8%); }
  50% { opacity: 1; transform: rotate(-6deg) translateX(8%); }
}

@media (max-width: 900px) {
  .recruitment-grid { grid-template-columns: 1fr 1fr; }
  .home-stat { padding: 0.5rem 1.5rem; }
  .home-stat-number { font-size: 2.25rem; }
}
@media (max-width: 700px) {
  .recruitment-grid { grid-template-columns: 1fr; }
  .home-stats-inner { flex-direction: column; align-items: stretch; }
  .home-stat { border-right: none; border-bottom: 1px solid var(--border); padding: 0.75rem 2rem; flex-direction: row; justify-content: space-between; align-items: center; }
  .home-stat:last-child { border-bottom: none; }
  .home-stat-label { margin-top: 0; }
}

/* ===== SETTINGS CENTER ===== */
.settings-hero {
  padding: 2.5rem 0 1.25rem;
  background: linear-gradient(135deg, rgba(204,31,31,0.08) 0%, transparent 55%);
  border-bottom: 1px solid var(--border);
}
.settings-hero-inner {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 1.5rem;
  align-items: start;
}
.settings-hero-copy { max-width: 620px; }
.settings-eyebrow {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--red);
  margin-bottom: 0.75rem;
}
.settings-lead {
  margin-top: 0.85rem;
  color: #b5b5b5;
  font-size: 1rem;
  line-height: 1.7;
  max-width: 56ch;
}
.settings-summary-card,
.settings-panel,
.settings-info-card {
  background: rgba(20,20,20,0.96);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: 0 8px 30px rgba(0,0,0,0.22);
}
.settings-summary-card { padding: 1.25rem; }
.settings-summary-header {
  display: flex;
  gap: 1rem;
  align-items: center;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}
.settings-summary-avatar {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--border);
  flex-shrink: 0;
}
.settings-summary-avatar-fallback {
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, rgba(204,31,31,0.18), rgba(255,255,255,0.04));
  color: var(--red);
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 800;
}
.settings-summary-name { font-size: 1rem; font-weight: 700; }
.settings-summary-email { font-size: 0.82rem; color: var(--muted); }
.settings-status-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.85rem;
  margin-top: 1rem;
}
.settings-status-item {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.85rem;
  background: rgba(255,255,255,0.02);
}
.settings-status-label {
  display: block;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.35rem;
}
.settings-status-value {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 0.25rem 0.6rem;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.settings-status-value.is-live { background: rgba(34,197,94,0.1); color: #86efac; border: 1px solid rgba(34,197,94,0.25); }
.settings-status-value.is-muted { background: rgba(255,255,255,0.04); color: var(--muted); border: 1px solid var(--border); }
.settings-status-value.is-planned { background: rgba(204,31,31,0.12); color: #fca5a5; border: 1px solid rgba(204,31,31,0.25); }
.settings-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 1.5rem;
  padding: 2rem 0 3rem;
}
.settings-main,
.settings-sidebar { display: flex; flex-direction: column; gap: 1rem; }
.settings-form { display: block; margin: 0; }
.settings-panel {
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.settings-panel-quiet { background: var(--surface); }
.settings-panel-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}
.settings-panel-eyebrow {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
  margin-bottom: 0.3rem;
}
.settings-panel-title {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: 0.01em;
}
.settings-panel-note {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
  border-radius: 999px;
  padding: 0.28rem 0.65rem;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border);
}
.settings-panel-note.is-planned { color: #fca5a5; border-color: rgba(204,31,31,0.25); background: rgba(204,31,31,0.1); }
.settings-panel-body { display: flex; flex-direction: column; gap: 1rem; }
.settings-panel-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.settings-panel-actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-start;
}
.settings-panel-actions-split { justify-content: space-between; }
.settings-info-card {
  padding: 1rem;
  background: rgba(255,255,255,0.02);
}
.settings-info-card-muted { background: rgba(255,255,255,0.03); }
.settings-info-card-strong { background: linear-gradient(135deg, rgba(204,31,31,0.08), rgba(255,255,255,0.03)); }
.settings-info-label {
  display: block;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.35rem;
}
.settings-info-copy {
  color: #b5b5b5;
  font-size: 0.92rem;
  line-height: 1.65;
}
.settings-copy-wide { max-width: 68ch; }
.settings-license-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.85rem;
}
.settings-license-chip {
  border-radius: 12px;
  border: 1px solid color-mix(in srgb, var(--chip-accent) 28%, var(--border));
  background: color-mix(in srgb, var(--chip-accent) 10%, rgba(255,255,255,0.02));
  padding: 0.9rem;
}
.settings-license-label {
  display: block;
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.35rem;
}
.settings-license-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
}
.settings-license-class {
  font-family: var(--font-display);
  font-size: 1.25rem;
  color: var(--chip-accent);
}
.settings-license-meta,
.settings-license-irating {
  font-size: 0.78rem;
  color: var(--muted);
}
.settings-license-irating {
  font-family: var(--mono);
  font-weight: 700;
  color: var(--text);
  margin-top: 0.35rem;
}
.settings-career-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
  gap: 0.75rem;
}
.settings-career-stat {
  padding: 0.85rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: rgba(255,255,255,0.02);
}
.settings-career-value {
  display: block;
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 800;
}
.settings-career-label {
  display: block;
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  margin-top: 0.15rem;
}
.settings-table-wrap { overflow-x: auto; }
.settings-table { font-size: 0.85rem; }
.settings-table-ellipsis {
  max-width: 170px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.settings-table-delta { font-family: var(--mono); white-space: nowrap; }
.settings-table-muted { color: var(--muted); font-size: 0.72rem; }
.settings-delta-positive { color: #10b981; font-size: 0.75rem; }
.settings-delta-negative { color: #ef4444; font-size: 0.75rem; }
.settings-state-list { gap: 0.75rem; }
.settings-state-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem 0;
  border-bottom: 1px solid var(--border);
}
.settings-state-row:last-child { border-bottom: none; }
.settings-state-row span { color: var(--muted); font-size: 0.85rem; }
.settings-state-row strong { color: var(--text); font-size: 0.9rem; }
.settings-errors { margin-bottom: 0.5rem; }

@media (max-width: 900px) {
  .settings-hero-inner,
  .settings-layout { grid-template-columns: 1fr; }
  .settings-sidebar { order: 2; }
}

@media (max-width: 700px) {
  .settings-status-grid,
  .settings-panel-grid,
  .settings-career-grid { grid-template-columns: 1fr; }
  .settings-panel-actions-split { justify-content: flex-start; }
  .settings-license-row,
  .settings-state-row { align-items: flex-start; flex-direction: column; }
}

/* ── Profile: iRacing & iRacePlan sections ── */
.profile-section-title {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
  border-bottom: 1px solid var(--border);
  padding-bottom: 0.5rem;
  margin-bottom: 1.25rem;
}

.profile-iracing-card {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.25rem;
  margin-top: 1.25rem;
}
.profile-iracing-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.profile-license-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 1rem;
}
.profile-license-chip {
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.6rem 0.9rem;
  min-width: 110px;
}

.profile-career-stats {
  display: flex;
  gap: 0;
  border: 1px solid var(--border);
  border-radius: 6px;
  overflow: hidden;
  margin-bottom: 0.5rem;
}
.profile-career-stat {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0.6rem 0.5rem;
  border-right: 1px solid var(--border);
}
.profile-career-stat:last-child { border-right: none; }
.profile-career-val {
  font-family: var(--mono);
  font-weight: 700;
  font-size: 1rem;
  color: var(--text);
}
.profile-career-label {
  font-size: 0.62rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--muted);
  margin-top: 0.15rem;
}

.profile-iraceplan-prompt {
  background: rgba(204, 31, 31, 0.06);
  border: 1px solid rgba(204, 31, 31, 0.25);
  border-radius: 8px;
  padding: 1rem 1.25rem;
}

/* iRacePlan setup banner on schedule/plannings pages */
.irp-setup-banner {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-left: 3px solid var(--red);
  border-radius: 6px;
  padding: 0.85rem 1rem;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
}
.irp-setup-dismiss {
  background: none;
  border: none;
  color: var(--muted);
  font-size: 1.1rem;
  cursor: pointer;
  padding: 0 0.25rem;
  flex-shrink: 0;
  line-height: 1;
}
.irp-setup-dismiss:hover { color: var(--text); }

/* ── Multi-Car Race Components ── */
.badge-gtp {
  background: rgba(204, 31, 31, 0.18);
  color: #ff6b6b;
  border: 1px solid rgba(204, 31, 31, 0.4);
}
.badge-gt3 {
  background: rgba(59, 130, 246, 0.15);
  color: #60a5fa;
  border: 1px solid rgba(59, 130, 246, 0.35);
}
.badge-lmp {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.35);
}

/* Car entry row in event show admin panel */
.race-car-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.6rem 0.75rem;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 6px;
  flex-wrap: wrap;
}
.race-car-info {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
  flex: 1;
}
.race-car-actions {
  display: flex;
  gap: 0.4rem;
  flex-shrink: 0;
}

/* Driver lineup car groups */
.lineup-car-group {
  border-top: 1px solid var(--border);
  padding-top: 1rem;
  margin-top: 0.75rem;
}
.lineup-car-group:first-child {
  border-top: none;
  padding-top: 0;
  margin-top: 0;
}
.lineup-car-header {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 0.75rem;
  flex-wrap: wrap;
}
.lineup-car-number {
  font-family: var(--mono);
  font-weight: 700;
  font-size: 1rem;
  color: var(--text);
}
.lineup-car-model {
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text);
}

/* Multi-car bar in next-race hero */
.next-race-cars-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  padding: 0.75rem 1.25rem;
  border-top: 1px solid rgba(255,255,255,0.07);
  background: rgba(255,255,255,0.02);
}
.next-race-car-chip {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 0.25rem 0.75rem;
  font-size: 0.8rem;
}
.next-race-car-chip:hover {
  border-color: rgba(204, 31, 31, 0.4);
}

/* ===== FOOTER GRID ===== */
.site-main {
  padding-bottom: 4.5rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr 0.8fr;
  gap: 1.5rem;
}

.footer-column h2 {
  margin-bottom: 0.75rem;
  color: var(--text);
  font-family: var(--font-display);
  font-size: 1.1rem;
}

.footer-brand p,
.footer-links a,
.footer-meta {
  color: var(--muted);
}

.footer-links {
  display: grid;
  gap: 0.5rem;
}

.footer-links a:hover {
  color: var(--text);
}

.footer-meta {
  padding-top: 1.5rem;
  margin-top: 1.5rem;
  border-top: 1px solid var(--border);
  font-size: 0.85rem;
}

@media (max-width: 1100px) {
  .footer-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 700px) {
  .footer-grid {
    grid-template-columns: 1fr;
  }
}

/* ===== SECTION KICKER ===== */
.section-kicker {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--red);
  margin-bottom: 0.35rem;
}

/* ===== CAR CHIP INLINE ELEMENTS ===== */
.car-chip-number {
  font-family: var(--mono);
  font-weight: 700;
  font-size: 0.8rem;
}

.car-chip-model {
  font-size: 0.78rem;
}

/* ===== FUEL STRATEGY INLINE HELPERS ===== */
.fuel-strategy-note {
  color: var(--muted);
  margin-bottom: 1rem;
}

.fuel-entry-meta {
  margin-bottom: 0.25rem;
}

/* ===== UNASSIGNED DRIVER LABEL ===== */
.lineup-unassigned-label {
  font-style: italic;
  color: var(--muted);
}

/* ===== OPS NOTE CARD ===== */
.ops-note-text {
  padding-top: 0;
}

/* ===== EVENT BADGE EXTRA-SMALL MODIFIER ===== */
.event-badge-xs {
  font-size: 0.62rem;
  padding: 0.15rem 0.5rem;
}

/* ===== FILES GRID SPACED (dashboard top margin) ===== */
.files-grid-spaced {
  margin-top: 1.5rem;
}

/* ===== AUTH LAYOUT (two-column sign-in / register) ===== */
.auth-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  align-items: center;
  width: 100%;
  max-width: 900px;
}

.auth-panel {
  color: var(--muted);
}

.auth-panel .section-kicker {
  margin-bottom: 0.75rem;
}

.auth-panel h2 {
  font-size: 1.75rem;
  font-weight: 800;
  font-family: var(--font-display);
  color: var(--text);
  margin-bottom: 1rem;
  line-height: 1.25;
}

.auth-panel p {
  font-size: 0.95rem;
  line-height: 1.7;
}

@media (max-width: 700px) {
  .auth-layout {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
  .auth-panel { display: none; }
}

/* ============================================================
   HOME PAGE — NEW COMPONENT DEFINITIONS
   (hero-shell, hero-panel, hero-copy, hero-proof, trust-strip,
    story-card, briefing-grid, briefing-card, member-banner)
   ============================================================ */

/* ── Shared button aliases used in views ── */
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.9rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 0.7rem 1.75rem;
  border-radius: 4px;
  border: none;
  cursor: pointer;
  transition: background 0.2s, box-shadow 0.2s, transform 0.1s, border-color 0.2s, color 0.2s;
  text-decoration: none;
  min-height: 44px;
  white-space: nowrap;
}
.button-primary {
  background: linear-gradient(135deg, #d62323 0%, var(--red-dark) 100%);
  color: var(--white);
}
.button-primary:hover {
  background: linear-gradient(135deg, #e02b2b 0%, var(--red) 100%);
  box-shadow: 0 4px 20px var(--red-glow);
  color: var(--white);
  transform: translateY(-1px);
}
.button-secondary {
  background: transparent;
  color: var(--text);
  border: 1.5px solid var(--border);
}
.button-secondary:hover { border-color: var(--red); color: var(--red); }
.button-small { font-size: 0.78rem; padding: 0.4rem 1rem; min-height: 36px; }

/* ── Hero shell: two-column split layout ── */
.hero-command {
  height: auto;
  min-height: 580px;
  align-items: stretch;
}

.hero-shell {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 3rem;
  align-items: center;
  padding-top: 4rem;
  padding-bottom: 4rem;
}

.hero-copy {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.hero-title {
  font-family: var(--font-display);
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: 0.01em;
}

.hero-description {
  color: #b0b0b0;
  font-size: 1.05rem;
  line-height: 1.75;
  max-width: 52ch;
}

.hero-text-link {
  font-size: 0.85rem;
  color: var(--muted);
  text-decoration: underline;
  text-underline-offset: 3px;
  align-self: flex-start;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}
.hero-text-link:hover { color: var(--text); }

.hero-proof {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.25rem;
  font-size: 0.78rem;
  color: var(--muted);
  border-top: 1px solid rgba(255,255,255,0.07);
  padding-top: 1rem;
  margin-top: 0.25rem;
}
.hero-proof span::before {
  content: '✓ ';
  color: var(--red);
  font-weight: 700;
}

/* ── Hero panel (sidebar card) ── */
.hero-panel {
  background: rgba(20,20,20,0.85);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.75rem;
  backdrop-filter: blur(8px);
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.panel-kicker {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--red);
}

.hero-panel h2 {
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 800;
  line-height: 1.25;
  color: var(--text);
}

.signal-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  margin: 0;
  padding: 0;
}
.signal-list li {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  font-size: 0.88rem;
  padding-left: 0.85rem;
  border-left: 2px solid rgba(204,31,31,0.4);
}
.signal-list li strong { color: var(--text); font-weight: 700; }
.signal-list li span { color: var(--muted); }

/* ── Trust strip ── */
.trust-strip {
  background: var(--surface);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: 1.5rem 0;
}

.trust-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
  divide: var(--border);
}

.trust-item {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  padding: 0.75rem 1.5rem;
  border-right: 1px solid var(--border);
}
.trust-item:last-child { border-right: none; }

.trust-label {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
}
.trust-item strong {
  font-size: 0.9rem;
  color: var(--text);
  font-weight: 600;
}

/* ── Story section ── */
.story-section { padding: 5rem 0; }

.story-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
  margin-top: 2.5rem;
}

.story-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  transition: border-color 0.2s, transform 0.2s;
}
.story-card:hover {
  border-color: rgba(204,31,31,0.45);
  transform: translateY(-2px);
}
.story-card h3 {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: 0.01em;
}
.story-card p {
  font-size: 0.88rem;
  color: var(--muted);
  line-height: 1.7;
}

/* ── Section copy (used in story-section header) ── */
.section-copy {
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.7;
  max-width: 44ch;
}

.section-header-logo {
  height: 300px;
  width: auto;
  border-radius: var(--radius-lg);
  flex-shrink: 0;
  object-fit: contain;
  filter: drop-shadow(-4px -4px 8px rgba(255,255,255,0.04)) drop-shadow(4px 4px 12px rgba(0,0,0,0.75)) drop-shadow(0 0 32px rgba(204,31,31,0.2));
}

/* ── Briefing grid (upcoming events on home) ── */
.briefing-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(320px, 100%), 1fr));
  gap: 1.25rem;
}

.briefing-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.briefing-card:hover {
  border-color: rgba(204,31,31,0.5);
  box-shadow: 0 4px 24px rgba(204,31,31,0.12);
}

.briefing-date {
  background: var(--red);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0.75rem;
  min-width: 60px;
  flex-shrink: 0;
}
.briefing-month {
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: rgba(255,255,255,0.8);
}
.briefing-day {
  font-family: var(--font-display);
  font-size: 1.75rem;
  font-weight: 900;
  color: white;
  line-height: 1;
}

.briefing-body {
  padding: 1.1rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  flex: 1;
}
.briefing-body h3 {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: 0.01em;
}
.briefing-tags { display: flex; flex-wrap: wrap; gap: 0.35rem; }
.briefing-meta { font-size: 0.8rem; color: var(--muted); }
.briefing-copy { font-size: 0.83rem; color: var(--muted); line-height: 1.6; flex: 1; }

.briefing-footer {
  padding: 0.85rem 1.25rem;
  border-top: 1px solid var(--border);
}

/* ── Member banner ── */
.member-banner {
  padding: 4rem 0;
  background: linear-gradient(135deg, rgba(204,31,31,0.08) 0%, transparent 60%), var(--surface);
  border-top: 1px solid var(--border);
}

.member-banner-inner {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 2.5rem;
  align-items: center;
}

.member-banner .section-title { margin-bottom: 1rem; }

.benefit-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
  font-size: 0.85rem;
  color: var(--muted);
}
.benefit-list span::before {
  content: '✓ ';
  color: var(--red);
  font-weight: 700;
}

.member-banner-actions {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  flex-shrink: 0;
  min-width: 180px;
}
.member-banner-actions .button { width: 100%; justify-content: center; }

/* ── Recruit layout (join page) ── */
.recruit-layout {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 2.5rem;
  align-items: start;
  padding-bottom: 3rem;
}

.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1.5rem;
}

.recruit-panel {
  position: sticky;
  top: 90px;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.recruit-panel h2 {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 800;
  line-height: 1.3;
  color: var(--text);
}

.form-panel { background: transparent; border: none; padding: 0; }

/* ============================================================
   MOBILE RESPONSIVE — NEW & MISSING CLASSES
   ============================================================ */

@media (max-width: 900px) {
  .hero-shell { grid-template-columns: 1fr; gap: 2rem; }
  .hero-panel { display: none; } /* panel collapses on tablet, shown on desktop only */
  .story-grid { grid-template-columns: 1fr 1fr; }
  .trust-grid { grid-template-columns: repeat(2, 1fr); }
  .trust-item:nth-child(2) { border-right: none; }
  .trust-item:nth-child(3) { border-top: 1px solid var(--border); }
  .trust-item:nth-child(4) { border-right: none; border-top: 1px solid var(--border); }
  .member-banner-inner { grid-template-columns: 1fr; gap: 1.5rem; }
  .recruit-layout { grid-template-columns: 1fr; gap: 1.5rem; }
  .recruit-panel { position: static; }
  .admin-events-header,
  .admin-event-row { grid-template-columns: 2.5rem 1fr 10rem; }
  .admin-events-header .col-team-car,
  .admin-event-row .col-team-car { display: none; }
}

@media (max-width: 700px) {
  /* Hero */
  .hero-command { min-height: 0; }
  .hero-shell { padding-top: 2.5rem; padding-bottom: 2.5rem; gap: 1.25rem; }
  .hero-title { font-size: 1.85rem; }
  .hero-description { font-size: 0.95rem; }
  .hero-actions { flex-direction: column; align-items: stretch; }
  .hero-actions .button { width: 100%; justify-content: center; }
  .hero-text-link { align-self: center; }

  /* Trust */
  .trust-grid { grid-template-columns: 1fr; }
  .trust-item { border-right: none; border-bottom: 1px solid var(--border); }
  .trust-item:last-child { border-bottom: none; }

  /* Story */
  .story-grid { grid-template-columns: 1fr; }

  /* Member banner */
  .member-banner { padding: 2.5rem 0; }
  .member-banner-actions { min-width: 0; }

  /* Recruit layout */
  .recruit-layout { grid-template-columns: 1fr; }
  .recruit-panel { display: none; } /* de-clutter on small screens */

  /* Briefing grid — single column handled by minmax already */
  .briefing-card .briefing-date { flex-direction: row; padding: 0.5rem 0.85rem; gap: 0.4rem; align-items: baseline; }
  .briefing-month { margin-right: 0.2rem; }

  /* Auth layout */
  .auth-layout { grid-template-columns: 1fr; }

  /* Admin events */
  .admin-events-table { overflow-x: auto; -webkit-overflow-scrolling: touch; }

  /* Inputs — already 1rem/16px, reinforce for safety */
  input, select, textarea { font-size: 1rem !important; }
}

/* ============================================================
   iOS SAFE-AREA INSETS
   ============================================================ */

.navbar {
  padding-left: max(1.5rem, env(safe-area-inset-left));
  padding-right: max(1.5rem, env(safe-area-inset-right));
}

.container {
  padding-left: max(1.5rem, env(safe-area-inset-left));
  padding-right: max(1.5rem, env(safe-area-inset-right));
}

.site-footer {
  padding-bottom: max(2rem, calc(2rem + env(safe-area-inset-bottom)));
  padding-left: max(2rem, env(safe-area-inset-left));
  padding-right: max(2rem, env(safe-area-inset-right));
}

/* Mobile menu dropdown also needs safe-area */
@media (max-width: 700px) {
  .navbar-menu {
    padding-bottom: max(0.75rem, env(safe-area-inset-bottom));
    padding-left: max(0.75rem, env(safe-area-inset-left));
    padding-right: max(0.75rem, env(safe-area-inset-right));
  }
}
