/* ──────────────────────────────────────────────────────────────────────────
   RacetrackStar — asset5 brand system (forest green + gold)
   Zero border-radius, no box-shadows. Forest green cinematic chrome;
   gold interactive accents. White canvas + white on-dark type preserved.
   Hero photo scrims stay neutral black (not green-tinted).

   Legacy --bmw-blue* token names retained as aliases for selector stability.
   Filename retained from prior identity to keep cache URLs stable.
   ────────────────────────────────────────────────────────────────────────── */

:root {
  /* Core palette — asset5.jpg */
  --brand-green: #0f3d2c;
  --brand-green-mid: #1e543b;
  --brand-green-bright: #286848;
  --pro-gold: #c8a74a;
  --pro-gold-hover: #b3943a;
  --cream: #f0e0c0;
  --accent-on: #0f3d2c;

  /* Legacy accent aliases → gold interactive (was BMW Blue) */
  --bmw-blue: var(--pro-gold);
  --bmw-blue-focus: var(--pro-gold-hover);
  --bmw-blue-dark: var(--brand-green);
  --surface-dark: var(--brand-green);
  --surface-light: #ffffff;
  --text-primary: #262626;
  --text-secondary: #757575;
  --text-tertiary: #bbbbbb;
  --text-on-dark: #ffffff;
  --neutral: #f5f5f5;
  --hairline: #e5e5e5;
  --hairline-dark: rgba(240, 224, 192, 0.18);

  /* Site context tokens */
  --site-context-highlight-color: var(--pro-gold);
  --site-context-focus-color: var(--pro-gold-hover);
  --site-context-metainfo-color: var(--text-secondary);

  /* Spacing scale (8px-rooted) */
  --space-xs: 1px;
  --space-sm: 8px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 32px;
  --space-xxl: 40px;
  --space-hero: 60px;
  --space-section: 56px;
  --space-gutter: 20px;
  --space-margin: 30px;

  /* Typography */
  --font-stack: "BMW Type Next", "BMWTypeNextLatin", Helvetica, Arial,
                "Hiragino Kaku Gothic ProN", "Hiragino Sans", Meiryo, sans-serif;
  --fs-display: 60px;
  --fs-section: 32px;
  --fs-nav: 18px;
  --fs-body: 16px;
  --fs-caption: 12px;
  --lh-tight: 1.15;
  --lh-default: 1.30;
  --lh-button: 1.20;

  --page-max: 1440px;

  /* Backwards-compatible aliases (legacy class hooks + inline styles) */
  --brand-primary: var(--pro-gold);
  --brand-primary-hover: var(--pro-gold-hover);
  --brand-accent: var(--pro-gold);
  --neutral-dark: var(--surface-dark);
  --neutral-gray: var(--text-secondary);
  --bg-light: var(--neutral);
  --canvas-white: var(--surface-light);
  --border-subtle: var(--hairline);
  --shadow-low: none;
  --shadow-high: none;
  --radius-btn: 0;
  --radius-card: 0;
  --muted: var(--text-secondary);
  --subtle: var(--text-secondary);
  --sky: var(--pro-gold);
  --text: var(--text-primary);
  --border: var(--hairline);
  --bg2: var(--surface-light);
  --bg3: var(--neutral);
  --emerald: var(--brand-green-mid);
  --gold: var(--pro-gold);
  --violet: var(--pro-gold);
}

/* ── BMW principle: absolute angularity. Zero border-radius EVERYWHERE.
   !important neutralizes inline style="border-radius:..." across templates. ── */
*,
*::before,
*::after {
  border-radius: 0 !important;
  box-sizing: border-box;
}

/* ── BMW principle: depth via dark/light contrast, never via shadow. ── */
*,
*::before,
*::after {
  box-shadow: none !important;
  text-shadow: none !important;
}

* { margin: 0; padding: 0; }

html {
  font-family: var(--font-stack);
  background: var(--surface-light);
  color: var(--text-primary);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

body {
  font-family: var(--font-stack);
  font-size: var(--fs-body);
  font-weight: 400;
  line-height: var(--lh-tight);
  background: var(--surface-light);
  color: var(--text-primary);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }
a:hover { color: var(--bmw-blue); }
img { max-width: 100%; display: block; }

/* Accessibility: WCAG-compliant focus visibility. */
:focus-visible {
  outline: 2px solid var(--bmw-blue-focus) !important;
  outline-offset: 2px;
}

/* Light surfaces use subtle bottom hairlines instead of shadow. */
hr { border: 0; border-top: 1px solid var(--hairline); margin: var(--space-lg) 0; }

/* Typography hierarchy */
h1, .display-hero {
  font-size: clamp(36px, 5.5vw, var(--fs-display));
  font-weight: 300;
  line-height: var(--lh-default);
  letter-spacing: 0;
  text-transform: uppercase;
  color: inherit;
}

h2, .section-heading {
  font-size: var(--fs-section);
  font-weight: 400;
  line-height: var(--lh-default);
}

h3 { font-size: 24px; font-weight: 400; line-height: var(--lh-default); }
h4 { font-size: 20px; font-weight: 700; line-height: var(--lh-default); }
h1, h2, h3 { text-wrap: balance; }

/* ──────────────────────────────────────────────────────────────────────────
   UTILITIES
   Bootstrap-compatible utility class shims (admin page references many of
   them but Bootstrap is not loaded; we provide the visual equivalents).
   ────────────────────────────────────────────────────────────────────────── */
.container { max-width: var(--page-max); margin-inline: auto; padding-inline: var(--space-xl); }
@media (max-width: 640px) { .container { padding-inline: var(--space-md); } }

.text-center { text-align: center; }
.text-left { text-align: left; }
.text-end, .text-right { text-align: right; }
.text-uppercase { text-transform: uppercase; letter-spacing: 0.04em; }
.text-muted, .text-secondary { color: var(--text-secondary) !important; }
.text-tertiary { color: var(--text-tertiary); }
.text-dark { color: var(--text-primary); }
.text-danger { color: var(--bmw-blue) !important; }
.text-on-dark { color: var(--text-on-dark); }
.fw-light { font-weight: 300; }
.fw-normal { font-weight: 400; }
.fw-semibold { font-weight: 700; }
.fw-bold { font-weight: 700; }
.fw-black { font-weight: 900; }
.fs-6 { font-size: 14px; }
.small { font-size: 13px; }

.d-flex { display: flex; }
.d-inline-flex { display: inline-flex; }
.d-block { display: block; }
.d-inline-block { display: inline-block; }
.d-none { display: none !important; }
.d-grid { display: grid; }
.flex-wrap { flex-wrap: wrap; }
.flex-column { flex-direction: column; }
@media (min-width: 992px) { .flex-lg-row { flex-direction: row; } }
.justify-between, .justify-content-between { justify-content: space-between; }
.justify-center, .justify-content-center { justify-content: center; }
.justify-content-start { justify-content: flex-start; }
.justify-content-end { justify-content: flex-end; }
.align-center, .align-items-center { align-items: center; }
.align-items-end { align-items: flex-end; }
.align-items-start { align-items: flex-start; }
@media (min-width: 992px) { .align-items-lg-center { align-items: center; } }
.w-100 { width: 100%; }
.h-100 { height: 100%; }

/* Spacing scale — match Bootstrap's 0–5 in 8px increments */
.gap-0 { gap: 0; } .gap-1 { gap: 4px; } .gap-2 { gap: 8px; }
.gap-3 { gap: 16px; } .gap-4 { gap: 24px; } .gap-5 { gap: 32px; }
.gap-6 { gap: 40px; }
.g-2 { gap: 8px; }
.mt-0 { margin-top: 0; } .mt-1 { margin-top: 4px; } .mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 16px; } .mt-4 { margin-top: 24px; } .mt-5 { margin-top: 40px; }
.mb-0 { margin-bottom: 0; } .mb-1 { margin-bottom: 4px; } .mb-2 { margin-bottom: 8px; }
.mb-3 { margin-bottom: 16px; } .mb-4 { margin-bottom: 24px; } .mb-5 { margin-bottom: 40px; }
.ms-1 { margin-left: 4px; } .ms-2 { margin-left: 8px; } .ms-3 { margin-left: 16px; }
.me-1 { margin-right: 4px; } .me-2 { margin-right: 8px; } .me-3 { margin-right: 16px; }
.mx-auto { margin-inline: auto; }
.p-0 { padding: 0; } .p-1 { padding: 4px; } .p-2 { padding: 8px; }
.p-3 { padding: 16px; } .p-4 { padding: 24px; } .p-5 { padding: 40px; }
.pb-2 { padding-bottom: 8px; } .pb-3 { padding-bottom: 16px; }
.ps-3 { padding-left: 16px; } .pt-2 { padding-top: 8px; } .pt-3 { padding-top: 16px; }
.px-2 { padding-inline: 8px; } .px-3 { padding-inline: 16px; }
.py-2 { padding-block: 8px; } .py-3 { padding-block: 16px; }

/* Bootstrap grid shim (column counts used in admin) */
.row { display: flex; flex-wrap: wrap; margin-inline: -8px; }
.row > [class*="col-"] { padding-inline: 8px; width: 100%; min-width: 0; max-width: 100%; }
.col, .col-12 { flex: 0 0 100%; max-width: 100%; }
@media (min-width: 768px) {
  .col-md-2 { flex: 0 0 16.6667%; max-width: 16.6667%; }
  .col-md-3 { flex: 0 0 25%; max-width: 25%; }
  .col-md-4 { flex: 0 0 33.3333%; max-width: 33.3333%; }
  .col-md-6 { flex: 0 0 50%; max-width: 50%; }
  .col-md-8 { flex: 0 0 66.6667%; max-width: 66.6667%; }
}
@media (min-width: 992px) {
  .col-lg-8 { flex: 0 0 66.6667%; max-width: 66.6667%; margin-inline: auto; }
  .col-lg-10 { flex: 0 0 83.3333%; max-width: 83.3333%; margin-inline: auto; }
}
@media (min-width: 1200px) {
  .col-xl-10 { flex: 0 0 83.3333%; max-width: 83.3333%; margin-inline: auto; }
}
.row.justify-content-center { justify-content: center; }

/* Bootstrap "show / fade / active" shims for tab visibility */
.fade { transition: opacity .15s linear; }
.tab-pane:not(.active):not(.show) { display: none; }
.tab-pane.show.active, .tab-pane.active { display: block; }


h5 { font-size: 18px; font-weight: 700; line-height: var(--lh-default); }
h6 { font-size: 16px; font-weight: 700; line-height: var(--lh-default); }

p { font-size: var(--fs-body); line-height: var(--lh-tight); }
small, .caption { font-size: var(--fs-caption); line-height: var(--lh-default); color: var(--text-secondary); }


/* ──────────────────────────────────────────────────────────────────────────
   NAVBAR — Dark surface, BMW logo treatment, weight-900 nav links.
   ────────────────────────────────────────────────────────────────────────── */
.navbar {
  background: var(--surface-dark);
  border-bottom: 2px solid var(--pro-gold);
  padding: 0 var(--space-margin);
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 50;
  color: var(--text-on-dark);
}
.navbar-brand {
  display: flex; align-items: center; gap: var(--space-md);
  font-weight: 900; color: var(--text-on-dark); height: 100%;
  letter-spacing: 0; min-width: 0; max-width: 100%;
}
.navbar-brand > div { min-width: 0; overflow: hidden; }
.navbar-brand > div > div:first-child,
.navbar-brand .brand-lockup-name {
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  font-size: var(--fs-nav); font-weight: 900; line-height: var(--lh-default);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.navbar-brand img {
  width: 40px; height: 40px; object-fit: cover; flex-shrink: 0;
  filter: grayscale(0.1) contrast(1.05);
}
.brand-submark {
  font-size: 11px; font-weight: 400; color: var(--pro-gold);
  letter-spacing: 0.06em; text-transform: uppercase;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.nav-links {
  display: flex; gap: var(--space-xl); align-items: center;
  font-size: var(--fs-nav); font-weight: 900; color: var(--text-on-dark);
  text-transform: uppercase; letter-spacing: 0.02em;
}
.nav-links a {
  color: var(--text-on-dark); padding: 8px 0;
  border-bottom: 2px solid transparent; transition: border-color .15s;
}
.nav-links a:hover { color: var(--text-on-dark); border-bottom-color: var(--bmw-blue); }
.mobile-nav-toggle { display: none; }
.nav-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 10px 20px; font-size: var(--fs-body); font-weight: 700;
  border: 1px solid var(--text-on-dark); background: transparent;
  color: var(--text-on-dark); transition: background .15s, color .15s;
  cursor: pointer; text-transform: uppercase; letter-spacing: 0.02em;
}
.nav-btn:hover { background: var(--text-on-dark); color: var(--surface-dark); }

/* ──────────────────────────────────────────────────────────────────────────
   BUTTONS — Sharp rectangles. Primary CTA solid gold + dark type. Outline on dark.
   ────────────────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 14px 32px;
  font-family: var(--font-stack);
  font-size: var(--fs-body);
  font-weight: 700;
  line-height: var(--lh-button);
  letter-spacing: 0.02em;
  text-transform: uppercase;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-primary);
  cursor: pointer;
  transition: background-color .15s, color .15s, border-color .15s;
  text-decoration: none;
  white-space: nowrap;
}
.btn:focus-visible { outline: 2px solid var(--bmw-blue-focus); outline-offset: 2px; }
/* Full-width buttons (sidebar CTAs) — relax padding/wrapping so labels fit */
.btn.w-100 {
  display: flex; width: 100%;
  padding-left: var(--space-md); padding-right: var(--space-md);
  white-space: normal; text-align: center; word-break: break-word;
}

.btn-primary,
.btn-cta {
  background: var(--pro-gold);
  color: var(--accent-on);
  border-color: var(--pro-gold);
}
.btn-primary:hover,
.btn-cta:hover {
  background: var(--pro-gold-hover);
  border-color: var(--pro-gold-hover);
  color: var(--accent-on);
}

/* Secondary on dark surfaces — outlined white */
.btn-secondary {
  background: transparent;
  color: var(--text-on-dark);
  border-color: var(--text-on-dark);
  padding: 12px 24px;
}
.btn-secondary:hover { background: var(--text-on-dark); color: var(--surface-dark); }

/* Outline (dark text on light) */
.btn-outline,
.btn-outline-secondary,
.btn-outline-primary,
.btn-outline-light,
.btn-outline-success,
.btn-outline-danger {
  background: transparent;
  color: var(--text-primary);
  border-color: var(--text-primary);
  padding: 12px 24px;
}
.btn-outline:hover,
.btn-outline-secondary:hover,
.btn-outline-primary:hover,
.btn-outline-light:hover,
.btn-outline-success:hover,
.btn-outline-danger:hover {
  background: var(--text-primary);
  color: var(--text-on-dark);
}
.btn-outline-primary { color: var(--pro-gold); border-color: var(--pro-gold); }
.btn-outline-primary:hover { background: var(--pro-gold); color: var(--accent-on); }
/* Outline buttons placed on the dark hero — invert to white for contrast */
.hero .btn-outline { color: var(--text-on-dark); border-color: var(--text-on-dark); }
.hero .btn-outline:hover { background: var(--text-on-dark); color: var(--surface-dark); }

.btn-ghost {
  background: transparent; color: var(--text-secondary);
  border: none; padding: 8px 16px; font-size: 13px;
}
.btn-ghost:hover { color: var(--bmw-blue); }

.btn-sm { padding: 8px 16px; font-size: 13px; }
.btn-lg { padding: 16px 36px; font-size: 16px; }
.btn[disabled] { opacity: 0.4; cursor: not-allowed; }


/* ──────────────────────────────────────────────────────────────────────────
   HERO — Full-bleed dark photography. Cinematic showroom rhythm.
   ────────────────────────────────────────────────────────────────────────── */
.hero {
  position: relative; overflow: hidden;
  padding: var(--space-hero) var(--space-margin);
  background: var(--surface-dark);
  color: var(--text-on-dark);
  min-height: 480px;
  display: flex; align-items: center;
}
.hero-slideshow { position: absolute; inset: 0; z-index: 0; }
.hero-slide {
  position: absolute; inset: 0;
  background-size: cover; background-position: center;
  opacity: 0; animation: heroFade 24s infinite;
  filter: brightness(0.5) contrast(1.1) saturate(0.85);
}
.hero-slide:nth-child(1) { animation-delay: 0s; }
.hero-slide:nth-child(2) { animation-delay: 6s; }
.hero-slide:nth-child(3) { animation-delay: 12s; }
.hero-slide:nth-child(4) { animation-delay: 18s; }

/* Per-image hero focal-point overrides. Each image's true subject sits at a
   different point in the frame; centering crops it on a wide hero. Match by
   the background-image URL each template injects inline. Tune the y-offset
   (percent of the image height) per image to keep the subject visible. */
.hero-slide[style*="DMTC-Aerial.jpeg"]      { background-position: center 70%; }   /* aerial — track in lower half */
.hero-slide[style*="DMTC-Aerial.jpg"]       { background-position: center 70%; }
.hero-slide[style*="DMTC-FinishLine.jpg"]   { background-position: center 45%; }   /* finish line in middle */
.hero-slide[style*="DMTC-Jockeys.jpg"]      { background-position: center 40%; }   /* jockey action in upper half */
.hero-slide[style*="DMTC-Paddock.jpg"]      { background-position: center 55%; }
.hero-slide[style*="CDTC-Spires.jpg"]       { background-position: center 25%; }   /* spires at top of frame */
.hero-slide[style*="CDTC-Crowd.jpg"]        { background-position: center 35%; }
.hero-slide[style*="CDTC-Finish.jpg"]       { background-position: center 40%; }   /* horse + jockey in middle */
.hero-slide[style*="CDTC-Logo.jpg"]         { background-position: center 30%; }
.hero-slide[style*="SATC-Fountain.jpg"]     { background-position: center 50%; }
.hero-slide[style*="SATC-Gate.jpg"]         { background-position: center 45%; }
.hero-slide[style*="SATC-Finish.jpg"]       { background-position: center 40%; }
.hero-slide[style*="SA-Seabiscuit.jpg"]     { background-position: center 40%; }
.hero-slide[style*="PRXTC-Scenic.jpg"]      { background-position: center 50%; }
.hero-slide[style*="PRXTC-Gate.jpg"]        { background-position: center 50%; }
.hero-slide[style*="PRXTC-Meet.jpg"]        { background-position: center 45%; }
.hero-slide[style*="PRXTC-Casino.jpg"]      { background-position: center 45%; }
.hero-slide[style*="KEETC-Gate.jpg"]        { background-position: center 50%; }
.hero-slide[style*="KEETC-Paddock.jpg"]     { background-position: center 50%; }
.hero-slide[style*="KEETC-Paddock2.jpg"]    { background-position: center 50%; }
.hero-slide[style*="KEETC-RaceCrowd.jpg"]   { background-position: center 35%; }
.hero-slide[style*="asset2.jpg"]            { background-position: center 55%; }   /* landing hero (record page) */
@keyframes heroFade {
  0% { opacity: 0; } 4% { opacity: 1; } 25% { opacity: 1; } 29% { opacity: 0; } 100% { opacity: 0; }
}
.hero-overlay {
  /* Neutral black scrim only — do not green-tint photography */
  position: absolute; inset: 0; z-index: 1;
  background: linear-gradient(180deg, rgba(0,0,0,0.55) 0%, rgba(0,0,0,0.75) 100%);
}
.hero-inner {
  position: relative; z-index: 2;
  max-width: var(--page-max); margin: 0 auto;
  width: 100%;
  padding: var(--space-section) 0;
}
.hero-eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: var(--fs-caption); font-weight: 700;
  letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--bmw-blue); margin-bottom: var(--space-md);
  padding: 6px 0;
  border-top: 1px solid var(--bmw-blue);
  border-bottom: 1px solid var(--bmw-blue);
  background: transparent;
}
.hero h1 {
  font-size: clamp(36px, 5.5vw, var(--fs-display));
  font-weight: 300;
  line-height: var(--lh-default);
  color: var(--text-on-dark);
  text-transform: uppercase;
  margin-bottom: var(--space-md);
  max-width: 24ch;
  overflow-wrap: break-word;
}
.hero-sub {
  font-size: 18px; color: rgba(255,255,255,0.82);
  max-width: 560px; margin: 0 0 var(--space-lg);
  line-height: var(--lh-tight); font-weight: 400;
}
.hero-chips {
  display: flex; flex-wrap: wrap; gap: var(--space-sm);
  margin-top: var(--space-md); margin-bottom: var(--space-md);
  justify-content: inherit;
}
.hero-inner[style*="text-align:center"] .hero-chips,
.hero-inner[style*="text-align: center"] .hero-chips { justify-content: center; }
/* When a hero opts into centered text, ensure the constrained heading + sub
   block elements actually sit on the visual center axis (max-width alone
   keeps them flush left because their margins default to 0). */
.hero-inner[style*="text-align:center"] h1,
.hero-inner[style*="text-align: center"] h1,
.hero-inner[style*="text-align:center"] .hero-sub,
.hero-inner[style*="text-align: center"] .hero-sub { margin-left: auto; margin-right: auto; }
/* Spacing between the chips row and the secondary CTA that follows it */
.hero-chips + .btn,
.hero-chips + .btn-secondary { margin-top: var(--space-sm); }
.chip {
  font-size: var(--fs-caption); font-weight: 700;
  padding: 6px 12px;
  border: 1px solid rgba(255,255,255,0.3);
  background: transparent;
  color: var(--text-on-dark);
  text-transform: uppercase; letter-spacing: 0.08em;
}
.chip-live { border-color: var(--bmw-blue); color: var(--bmw-blue); }
.landing-hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(260px, 1fr);
  gap: 48px;
  align-items: center;
}
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; }

/* Skew divider was a Stripe affordance; BMW uses sharp rhythm — neutralize. */
.skew-divider { height: 0; background: transparent; transform: none; margin: 0; }

/* ──────────────────────────────────────────────────────────────────────────
   CONTENT SHELL — Pure white, generous gutters, max-width.
   ────────────────────────────────────────────────────────────────────────── */
.site-main { flex: 1 1 auto; background: var(--surface-light); }
.content {
  max-width: var(--page-max); margin: 0 auto;
  padding: var(--space-section) var(--space-margin);
  background: var(--surface-light);
  position: relative; z-index: 3;
}
@media (max-width: 640px) { .content { padding: var(--space-xl) var(--space-md); } }

/* ──────────────────────────────────────────────────────────────────────────
   PANELS — Flat white blocks with hairline borders. No shadow.
   ────────────────────────────────────────────────────────────────────────── */
.panel {
  background: var(--surface-light);
  border: 1px solid var(--hairline);
  overflow: hidden;
}
.panel-header {
  padding: var(--space-lg) var(--space-xl);
  border-bottom: 1px solid var(--hairline);
}
.panel-body { padding: var(--space-lg) var(--space-xl); }
.panel-nav a {
  display: block;
  padding: var(--space-md) var(--space-lg);
  font-size: var(--fs-body); font-weight: 700;
  color: var(--text-primary);
  border-left: 3px solid transparent;
  transition: border-color .15s, color .15s;
  text-transform: uppercase; letter-spacing: 0.04em;
}
.panel-nav a:hover, .panel-nav a.active {
  color: var(--bmw-blue);
  border-left-color: var(--bmw-blue);
  background: var(--neutral);
}
.eyebrow {
  font-size: var(--fs-caption); font-weight: 700;
  letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--bmw-blue); margin-bottom: var(--space-sm);
}
.section-eyebrow {
  font-size: var(--fs-caption); font-weight: 700;
  letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--bmw-blue); margin-bottom: var(--space-sm);
  display: block;
}
.panel-title {
  font-size: 20px; font-weight: 400; color: var(--text-primary);
  line-height: var(--lh-default);
}
.panel-subtitle { font-size: 14px; font-weight: 400; color: var(--text-secondary); }

/* Dashboard grid layout */
.dashboard-grid {
  display: grid; grid-template-columns: 240px 1fr 280px;
  gap: var(--space-xl);
}
@media (max-width: 1024px) { .dashboard-grid { grid-template-columns: 1fr; } }
/* About page — 2-col desktop with a fixed 320px rail; collapses below 1024px. */
.about-grid { grid-template-columns: 1fr 320px; }
@media (max-width: 1024px) { .about-grid { grid-template-columns: 1fr; } }

/* Market rows (card list rows) */
.market-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: var(--space-md) var(--space-lg);
  border-bottom: 1px solid var(--hairline);
  transition: background .15s, color .15s;
}
.market-row:hover { background: var(--neutral); color: var(--bmw-blue); }
.market-row:last-child { border-bottom: none; }
.market-cell strong {
  display: block; font-size: var(--fs-body); font-weight: 700;
  color: var(--text-primary); text-transform: uppercase; letter-spacing: 0.02em;
}
.market-cell span { font-size: 13px; color: var(--text-secondary); }
.market-action { font-size: 13px; font-weight: 700; color: var(--bmw-blue); text-transform: uppercase; letter-spacing: 0.08em; }


/* ──────────────────────────────────────────────────────────────────────────
   METRIC TILES — Light treatment on light surfaces; flat on dark heroes.
   ────────────────────────────────────────────────────────────────────────── */
.metric-strip { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--space-md); }
.metric-card {
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.18);
  padding: var(--space-lg);
  color: var(--text-on-dark);
  display: flex;
  flex-direction: column;
  min-height: 100%;
}
.metric-card .label {
  font-size: 11px; font-weight: 700;
  letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--text-tertiary); margin-bottom: 4px;
  line-height: 1.35;
}
.metric-card .period {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.55);
  margin-bottom: 8px;
  line-height: 1.3;
}
.metric-card .period.period--after {
  margin-top: 8px;
  margin-bottom: 0;
}
.metric-card .value {
  font-size: 32px; font-weight: 300; color: var(--text-on-dark);
  line-height: 1.15;
}
.metric-card .value.is-signal { color: var(--pro-gold); }
.metric-card .value.is-pos { color: #6ee7a8; }
.metric-card .value.is-neg { color: #f07178; }
.metric-card .detail-link {
  display: inline-block;
  margin-top: 10px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--pro-gold);
  text-decoration: none;
  border-bottom: 1px solid rgba(200,167,74,0.35);
  line-height: 1.4;
  width: fit-content;
  max-width: 100%;
}
.metric-card .detail-link:hover {
  color: var(--pro-gold-hover, #b3943a);
  border-bottom-color: rgba(200,167,74,0.7);
}
.metric-card .detail-link span {
  display: block;
  font-size: 11px;
  font-weight: 500;
  color: rgba(255,255,255,0.55);
  border: 0;
  margin-top: 2px;
  letter-spacing: 0.02em;
}
.metric-card .prior-log {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid rgba(255,255,255,0.12);
  display: flex;
  flex-wrap: wrap;
  gap: 6px 10px;
}
.metric-card .prior-log .prior-item {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: rgba(255,255,255,0.5);
  white-space: nowrap;
}
.metric-card .prior-log .prior-item em {
  font-style: normal;
  margin-left: 4px;
}
.metric-card .prior-log .prior-item.is-pos em { color: #6ee7a8; }
.metric-card .prior-log .prior-item.is-neg em { color: #f07178; }
.metric-card .prior-log-label {
  flex: 0 0 100%;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.38);
  margin-bottom: 2px;
}
.metric-tile {
  background: var(--neutral); border: 1px solid var(--hairline);
  padding: var(--space-md); display: block;
}
.metric-tile .metric-label,
.metric-label {
  display: block; font-size: var(--fs-caption); font-weight: 700;
  letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--text-secondary); margin-bottom: 6px;
}
.metric-tile strong { font-size: 28px; font-weight: 300; color: var(--text-primary); }

.rail-metrics { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-md); }
.rail-metric { text-align: left; }
.rail-metric span {
  display: block; font-size: 11px; font-weight: 700;
  letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--text-secondary); margin-bottom: 4px;
}
.rail-metric strong { font-size: 24px; font-weight: 300; color: var(--text-primary); }

/* ──────────────────────────────────────────────────────────────────────────
   TABLES
   ────────────────────────────────────────────────────────────────────────── */
.table-wrap, .rec-table-wrap { overflow-x: auto; background: var(--surface-light); border: 1px solid var(--hairline); }
table { width: 100%; border-collapse: collapse; text-align: left; font-size: 14px; }
th {
  padding: var(--space-md) var(--space-lg);
  font-size: 11px; font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase; letter-spacing: 0.12em;
  border-bottom: 1px solid var(--hairline);
  white-space: nowrap; background: var(--neutral);
}
td {
  padding: var(--space-md) var(--space-lg);
  border-bottom: 1px solid var(--hairline);
  vertical-align: middle;
  color: var(--text-primary);
}
tr:last-child td { border-bottom: none; }

/* ──────────────────────────────────────────────────────────────────────────
   STATS GRID — Numbers like a spec sheet.
   ────────────────────────────────────────────────────────────────────────── */
.stats-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0;
  max-width: var(--page-max); margin: 0 auto var(--space-xxl);
  padding: 0 var(--space-margin);
  border-left: 1px solid var(--hairline);
  border-top: 1px solid var(--hairline);
}
.stat-card {
  background: var(--surface-light);
  border-right: 1px solid var(--hairline);
  border-bottom: 1px solid var(--hairline);
  padding: var(--space-xl) var(--space-lg);
  text-align: left;
}
.stat-val {
  font-size: 36px; font-weight: 300; color: var(--text-primary);
  line-height: var(--lh-default); margin-bottom: 6px;
}
.stat-val.em, .stat-val.sky { color: var(--bmw-blue); }
.stat-val.tpi-elite, .stat-val.tpi-sharp, .stat-val.tpi-cold { color: var(--text-primary); }
.stat-lbl {
  font-size: 11px; font-weight: 700;
  letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--text-secondary);
}

/* ──────────────────────────────────────────────────────────────────────────
   FOOTER — Black, columned, BMW-style.
   ────────────────────────────────────────────────────────────────────────── */
.site-footer {
  text-align: center;
  padding: var(--space-section) var(--space-margin);
  background: var(--surface-dark);
  color: var(--text-tertiary);
  font-size: 13px;
  margin-top: auto;
}
.site-footer a { color: var(--text-tertiary); font-weight: 400; }
.site-footer a:hover { color: var(--text-on-dark); }
.footer-brand {
  font-weight: 900; font-size: var(--fs-nav); color: var(--text-on-dark);
  text-transform: uppercase; letter-spacing: 0.04em; margin-bottom: 6px;
}
.site-entity-note {
  margin-top: 8px;
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 0.02em;
  color: var(--text-tertiary, #94a3b8);
  opacity: 0.85;
}
.site-entity-note a {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.site-entity-note a:hover { color: var(--text-on-dark); }
.footer-links {
  display: flex; justify-content: center; flex-wrap: wrap;
  gap: var(--space-lg); margin-bottom: var(--space-lg);
  font-size: var(--fs-body); font-weight: 400;
  text-transform: uppercase; letter-spacing: 0.04em;
}
.footer-links a { color: var(--text-tertiary); }
.footer-links a:hover { color: var(--text-on-dark); }
.crypto-wallet { text-align: center; }
.crypto-address {
  display: inline-block;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12px;
  padding: 6px 10px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.15);
  color: var(--text-tertiary);
  cursor: pointer; transition: border-color .15s, color .15s;
}
.crypto-address:hover { border-color: var(--bmw-blue); color: var(--bmw-blue); }
.crypto-address.copied { border-color: var(--bmw-blue); color: var(--bmw-blue); }


/* ──────────────────────────────────────────────────────────────────────────
   CURATED CARD — Race rail + per-race panels.
   ────────────────────────────────────────────────────────────────────────── */
.cc-layout { display: grid; grid-template-columns: 64px 1fr; gap: var(--space-lg); align-items: start; }
.race-rail { display: flex; flex-direction: column; gap: 4px; position: sticky; top: 80px; }
@media (max-width: 767px) {
  /* Collapse the rail-on-the-side layout into a single column so the rail
     can flow horizontally above the race panels and remain reachable. */
  .cc-layout,
  .cc-layout--pro { grid-template-columns: 1fr; gap: var(--space-md); }
  .cc-layout > * { min-width: 0; }
  .race-rail {
    flex-direction: row; overflow-x: auto; gap: 6px;
    padding: 4px 2px 10px; position: static;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
  }
}

.rail-item {
  width: 64px; height: 64px;
  display: flex; align-items: center; justify-content: center;
  border: 1px solid var(--hairline);
  background: var(--surface-light);
  color: var(--text-secondary);
  font-size: 16px; font-weight: 700; cursor: pointer;
  transition: border-color .15s, color .15s, background .15s;
  text-decoration: none; position: relative;
}
@media (max-width: 767px) { .rail-item { min-width: 64px; } }
.rail-item:hover { border-color: var(--bmw-blue); color: var(--bmw-blue); }
.rail-item.active {
  border-color: var(--pro-gold);
  background: var(--pro-gold);
  color: var(--accent-on);
}
.rail-item.fc { font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; line-height: var(--lh-default); text-align: center; }

.race-panel {
  display: none;
  background: var(--surface-light);
  border: 1px solid var(--hairline);
  margin-bottom: var(--space-lg);
}
.race-panel.is-active { display: block; }
body[data-view-mode="full-card"] .race-panel { display: block; }
body[data-view-mode="full-card"] .race-panel:last-child { margin-bottom: 0; }
.race-panels-container { display: flex; flex-direction: column; }

.rp-header {
  padding: var(--space-md) var(--space-lg);
  border-bottom: 1px solid var(--hairline);
  background: var(--neutral);
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 12px;
}
.rp-title-wrap { display: flex; align-items: center; gap: 14px; }
.rp-icon { color: var(--text-secondary); }
.rp-title {
  font-size: var(--fs-body); font-weight: 700;
  color: var(--text-primary);
  text-transform: uppercase; letter-spacing: 0.04em;
}
.rp-badge {
  font-size: 11px; font-weight: 700; letter-spacing: 0.16em;
  text-transform: uppercase; color: var(--bmw-blue);
  padding: 4px 10px;
  border: 1px solid var(--bmw-blue);
  background: transparent;
}

/* Horse rows */
.horse-name, .rt-horse-name {
  font-weight: 700; font-size: var(--fs-body);
  color: var(--text-primary);
  text-transform: uppercase; letter-spacing: 0.02em;
}
.post, .rt-post { color: var(--text-secondary); margin-right: 6px; font-weight: 700; }
.secondary, .rt-secondary { font-size: 13px; color: var(--text-secondary); margin-top: 4px; }
.ml-chip {
  display: inline-block; font-size: 13px; font-weight: 700;
  padding: 3px 10px;
  border: 1px solid var(--bmw-blue);
  color: var(--bmw-blue); background: transparent;
  letter-spacing: 0.02em;
}
.stars, .rt-rating { color: var(--bmw-blue); font-size: 14px; letter-spacing: 0.1em; white-space: nowrap; }

/* Probability rings */
.prob-ring, .rt-win-prob {
  display: flex; align-items: center; justify-content: center;
  width: 44px; height: 44px; position: relative; margin: 0 auto;
}
.prob-ring svg, .rt-win-prob svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.prob-ring .bg, .rt-win-prob circle.bg { fill: none; stroke: var(--hairline); stroke-width: 3; }
.prob-ring .fg, .rt-win-prob circle.fg { fill: none; stroke: var(--bmw-blue); stroke-width: 3; stroke-linecap: butt; }
.prob-ring span, .rt-win-prob span {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700; color: var(--text-primary);
}
.prob-ring.prob-heavy .fg { stroke: var(--bmw-blue); }
.prob-ring.prob-strong .fg { stroke: var(--bmw-blue); }
.prob-ring.prob-mid .fg { stroke: var(--text-secondary); }
.prob-ring.prob-low .fg { stroke: var(--hairline); }

/* Role pills — flattened to rectangles by global rule, BMW-blue accent */
.role-pill, .rt-role {
  font-size: 11px; font-weight: 700;
  letter-spacing: 0.1em; text-transform: uppercase;
  padding: 4px 10px; display: inline-block; white-space: nowrap;
  border: 1px solid currentColor; background: transparent;
}
.role-top, .rt-role.top-pick { color: var(--bmw-blue); }
.role-value, .rt-role.value-play { color: var(--text-primary); }
.role-long, .rt-role.longshot { color: var(--text-primary); }

/* Top-pick / longshot row markers */
tr.is-top-pick td:first-child { border-left: 3px solid var(--bmw-blue); padding-left: 17px; }
tr.is-longshot td:first-child { border-left: 3px solid var(--text-primary); padding-left: 17px; }

/* Scratched entries */
.is-scratched { opacity: 0.45; filter: grayscale(80%); pointer-events: none; }

/* Drilldown */
.drilldown {
  background: var(--neutral);
  border-top: 1px solid var(--hairline);
  padding: var(--space-lg);
}
.dd-tabs {
  display: flex; gap: var(--space-lg);
  border-bottom: 1px solid var(--hairline);
  margin-bottom: var(--space-md);
}
.dd-tab {
  padding-bottom: 10px; color: var(--text-secondary);
  font-size: 13px; font-weight: 700; cursor: pointer;
  text-transform: uppercase; letter-spacing: 0.12em;
  border-bottom: 2px solid transparent; transition: color .15s, border-color .15s;
}
.dd-tab:hover { color: var(--text-primary); }
.dd-tab.active, .dd-tab.tab-active { color: var(--bmw-blue); border-bottom-color: var(--bmw-blue); }
.dd-body, .dd-content { font-size: 15px; line-height: var(--lh-default); color: var(--text-primary); }
.dd-content { display: none; }
.dd-content.tab-active { display: block; }
.dd-content ul { padding-left: 24px; margin-top: 12px; }
.dd-content li { margin-bottom: 8px; }

/* Navigator highlights — Verified Results Tape (Concept A) */
.navigator-bar { max-width: 1200px; margin: 0 auto 34px; padding: 0 24px; }
.navigator-head { display: flex; justify-content: space-between; align-items: end; gap: 18px; margin-bottom: 16px; flex-wrap: wrap; }
.navigator-title { font-size: 13px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.14em; color: var(--text-primary); }
.navigator-subtitle { margin-top: 5px; font-size: 13px; color: var(--text-secondary); }
.navigator-tabs { display: flex; border: 1px solid var(--hairline); background: #fff; }
.navigator-tab {
  appearance: none; border: 0; background: transparent; cursor: pointer;
  padding: 10px 16px; font-size: 11px; font-weight: 800;
  letter-spacing: 0.12em; text-transform: uppercase; color: var(--text-secondary);
  border-right: 1px solid var(--hairline); font-family: inherit;
}
.navigator-tab:last-child { border-right: 0; }
.navigator-tab.is-active { background: var(--brand-green, #0f3d2c); color: #fff; }
.navigator-tab:focus-visible { outline: 2px solid var(--pro-gold, #c8a74a); outline-offset: -2px; }
.navigator-panel[hidden] { display: none; }
.navigator-list { border: 1px solid var(--hairline); background: #fff; }
.navigator-row {
  display: grid;
  grid-template-columns: 96px minmax(72px, 110px) minmax(0, 1fr) auto;
  gap: 12px; align-items: center;
  padding: 14px 10px 14px 12px;
  border-bottom: 1px solid var(--hairline);
  border-left: 2px solid transparent;
  color: var(--text-primary); text-decoration: none;
  transition: border-color .12s, background .12s;
}
.navigator-row:last-child { border-bottom: 0; }
.navigator-row:hover, .navigator-row:focus-visible {
  border-left-color: var(--pro-gold, #c8a74a);
  background: #faf9f5;
}
.navigator-row:focus-visible { outline: 2px solid var(--pro-gold-hover, #b3943a); outline-offset: 2px; }
.navigator-row-type {
  font-size: 11px; font-weight: 800; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--text-secondary);
}
.navigator-row-type em {
  display: block; margin-top: 3px; font-style: normal;
  font-size: 10px; font-weight: 600; letter-spacing: 0.08em; color: var(--text-tertiary, #8b929a);
}
.navigator-row-value {
  font-size: 22px; font-weight: 300; letter-spacing: -0.03em; line-height: 1;
  font-variant-numeric: tabular-nums; color: var(--text-primary);
}
.navigator-row-context { min-width: 0; }
.navigator-row-context strong {
  display: block; font-size: 13px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.02em; margin-bottom: 3px;
}
.navigator-row-context span {
  display: block; font-size: 12px; color: var(--text-secondary); font-weight: 500;
}
.navigator-row-go {
  font-size: 11px; font-weight: 800; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--pro-gold, #c8a74a); white-space: nowrap;
}
@media (max-width: 720px) {
  .navigator-head { align-items: start; flex-direction: column; }
  .navigator-row {
    grid-template-columns: 1fr 1fr;
    gap: 8px 12px;
  }
  .navigator-row-go { grid-column: 2; justify-self: end; }
  .navigator-row-context { grid-column: 1 / -1; }
}

/* Pagination */
.pagination-bar { max-width: 1200px; margin: 0 auto 48px; padding: 0 24px; display: flex; align-items: center; justify-content: center; gap: 12px; flex-wrap: wrap; }
.pagination-pages { display: flex; gap: 6px; }
.pagination-prev, .pagination-next, .pagination-page { display: inline-flex; align-items: center; justify-content: center; min-width: 36px; height: 36px; padding: 0 10px; border-radius: 6px; border: 1px solid var(--hairline); background: var(--neutral); color: var(--text-primary); font-size: 13px; font-weight: 700; text-decoration: none; transition: background .12s, border-color .12s; }
.pagination-prev:hover, .pagination-next:hover, .pagination-page:hover { background: var(--surface-light); border-color: var(--bmw-blue); color: var(--bmw-blue); }
.pagination-page.active, .pagination-page.active:hover { background: var(--pro-gold); border-color: var(--pro-gold); color: var(--accent-on); }
.pagination-prev.disabled, .pagination-next.disabled { opacity: 0.5; cursor: not-allowed; }

/* Strategy block */
.strategy {
  padding: var(--space-md) var(--space-lg);
  background: var(--neutral);
  border-top: 1px solid var(--hairline);
  display: flex; gap: var(--space-md); align-items: center;
  justify-content: space-between; flex-wrap: wrap;
}
.strategy-label {
  font-size: 11px; font-weight: 700; letter-spacing: 0.16em;
  text-transform: uppercase; color: var(--bmw-blue);
  display: block; margin-bottom: 6px;
}
.strategy-text { flex: 1; font-size: 14px; line-height: var(--lh-default); color: var(--text-primary); font-weight: 400; }
.strategy-actions { display: flex; gap: 10px; flex-wrap: wrap; }

/* Race-panel entries table (rp-table) — spec-sheet typography */
.rp-table-wrap { background: var(--surface-light); border-top: 1px solid var(--hairline); }
.rp-table {
  width: 100%; border-collapse: collapse; font-size: 13px;
  background: var(--surface-light);
}
.rp-table thead th {
  padding: 12px 14px; font-size: 11px; font-weight: 700;
  letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--text-secondary); background: var(--neutral);
  border-bottom: 1px solid var(--hairline); text-align: left;
}
.rp-table tbody td {
  padding: 14px; border-bottom: 1px solid var(--hairline);
  color: var(--text-primary); vertical-align: middle;
}
.rp-table tbody tr:last-child td { border-bottom: none; }
.rp-table tbody tr:hover { background: var(--neutral); }
.rt-horse-name {
  font-size: 14px; font-weight: 700; color: var(--text-primary);
  display: flex; align-items: center; gap: 10px;
}
.rt-post {
  display: inline-flex; align-items: center; justify-content: center;
  width: 28px; height: 28px; font-size: 12px; font-weight: 700;
  background: var(--text-primary); color: var(--text-on-dark);
  letter-spacing: 0; flex-shrink: 0;
}

/* Traditional thoroughbred saddlecloth colours (post-position 1–20).
   Class is applied via Jinja in the curated card template. Letter-suffixed
   posts (1A/1X/etc.) inherit the base number's colour. */
.saddlecloth-1  { background: #d8232a; color: #fff; }   /* Red */
.saddlecloth-2  { background: #ffffff; color: #000; border: 1px solid var(--text-primary); }
.saddlecloth-3  { background: #1c5fb6; color: #fff; }   /* Blue */
.saddlecloth-4  { background: #f1c40f; color: #000; }   /* Yellow */
.saddlecloth-5  { background: #1f7a3f; color: #fff; }   /* Green */
.saddlecloth-6  { background: #000000; color: #fff; }   /* Black */
.saddlecloth-7  { background: #f17a17; color: #fff; }   /* Orange */
.saddlecloth-8  { background: #f4a8c4; color: #000; }   /* Pink */
.saddlecloth-9  { background: #2cb6c4; color: #000; }   /* Turquoise */
.saddlecloth-10 { background: #6a3da1; color: #fff; }   /* Purple */
.saddlecloth-11 { background: #9aa0a6; color: #000; }   /* Grey */
.saddlecloth-12 { background: #c4d82e; color: #000; }   /* Lime */
.saddlecloth-13 { background: #6b3f18; color: #fff; }   /* Brown */
.saddlecloth-14 { background: #7a1f24; color: #fff; }   /* Maroon */
.saddlecloth-15 { background: #c3b091; color: #000; }   /* Khaki */
.saddlecloth-16 { background: #7a3aa1; color: #fff; }   /* Violet */
.saddlecloth-17 { background: #00a878; color: #fff; }   /* Emerald */
.saddlecloth-18 { background: #d63868; color: #fff; }   /* Cerise */
.saddlecloth-19 { background: #b87333; color: #fff; }   /* Copper */
.saddlecloth-20 { background: #b3001b; color: #fff; }   /* Crimson */
.rt-secondary { font-size: 12px; color: var(--text-secondary); line-height: 1.45; }
.rt-rating { font-size: 13px; color: var(--bmw-blue); letter-spacing: 0.05em; }
.ml-odds-chip {
  display: inline-block; padding: 4px 10px; min-width: 44px; text-align: center;
  font-size: 12px; font-weight: 700; letter-spacing: 0.04em;
  border: 1px solid var(--text-primary); color: var(--text-primary);
  background: transparent;
}
.live-odds-chip {
  display: inline-block; padding: 4px 10px; min-width: 44px; text-align: center;
  font-size: 12px; font-weight: 700; letter-spacing: 0.04em;
  border: 1px solid var(--bmw-blue); color: var(--bmw-blue);
  background: rgba(6, 83, 182, 0.06);
}

/* rt-win-prob colour states (prob ring already shares structure with .prob-ring) */
.rt-win-prob.prob-heavy circle.fg { stroke: var(--bmw-blue); }
.rt-win-prob.prob-strong circle.fg { stroke: var(--bmw-blue); }
.rt-win-prob.prob-mid circle.fg { stroke: var(--text-secondary); }
.rt-win-prob.prob-low circle.fg { stroke: var(--hairline); }

/* Mobile horse cards — industrial spec-sheet stack */
.mobile-horse-card {
  padding: var(--space-md); background: var(--surface-light);
  border-bottom: 1px solid var(--hairline);
}
.mobile-horse-header { display: flex; gap: var(--space-md); align-items: flex-start; margin-bottom: 12px; }
.mobile-horse-main { flex: 1; min-width: 0; }
.mobile-horse-topline { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 6px; }
.mobile-horse-title-row { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.mobile-horse-title { font-size: 15px; font-weight: 700; color: var(--text-primary); line-height: 1.25; }
.mobile-horse-connections { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-sm); }
.mobile-connection-value { font-size: 13px; font-weight: 400; color: var(--text-primary); }
.mobile-horse-probability {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  flex-shrink: 0; padding-left: var(--space-sm);
  border-left: 1px solid var(--hairline);
}
.mobile-prob-label {
  font-size: 10px; font-weight: 700; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--text-secondary);
}
.mobile-horse-metrics {
  display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-md);
  padding-top: 10px; border-top: 1px solid var(--hairline);
}
.mobile-card-stat { min-width: 0; }
.mobile-card-muted { color: var(--text-secondary); }
.mobile-rating-stars { font-size: 14px; color: var(--bmw-blue); letter-spacing: 0.05em; }
.mobile-rating-score { font-size: 12px; font-weight: 700; color: var(--text-secondary); margin-left: 6px; }
.mobile-horse-note {
  margin-top: 10px; padding-top: 10px; font-size: 13px;
  color: var(--text-secondary); line-height: var(--lh-default);
  border-top: 1px solid var(--hairline);
}
.mobile-card-note { font-size: 13px; color: var(--text-secondary); padding: 12px 0; }

/* Legacy single-race picks grid (cc-picks → pick-card) */
.cc-picks {
  max-width: var(--page-max); margin: 0 auto;
  padding: var(--space-section) var(--space-margin);
  display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--space-lg);
}
@media (max-width: 900px) { .cc-picks { grid-template-columns: 1fr; } }
.pick-card {
  padding: var(--space-lg); background: var(--surface-light);
  border: 1px solid var(--hairline); border-top: 3px solid var(--text-primary);
  display: flex; flex-direction: column; gap: 10px;
}
.pick-card.gold { border-top-color: var(--bmw-blue); }
.pick-card.emerald { border-top-color: var(--text-primary); }
.pick-card.violet { border-top-color: var(--text-secondary); }
.pick-badge {
  align-self: flex-start; padding: 4px 10px;
  font-size: 11px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase;
  border: 1px solid currentColor; color: var(--text-primary); background: transparent;
}
.pick-card.gold .pick-badge { color: var(--bmw-blue); }
.pick-number { font-size: 11px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--text-secondary); }
.pick-name { font-size: 22px; font-weight: 400; color: var(--text-primary); text-transform: uppercase; letter-spacing: 0; line-height: 1.15; }
.pick-silks { font-size: 13px; color: var(--text-secondary); line-height: 1.5; }
.pick-form { font-size: 13px; color: var(--text-primary); padding: 10px; background: var(--neutral); border: 1px solid var(--hairline); }
.pick-empty { font-size: 13px; color: var(--text-secondary); font-style: italic; }
.pick-stats { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.stat-pill {
  display: inline-block; padding: 3px 8px; font-size: 10px; font-weight: 700;
  letter-spacing: 0.1em; text-transform: uppercase;
  border: 1px solid var(--hairline); color: var(--text-secondary); background: transparent;
}
.stat-pill.text-warning { border-color: var(--bmw-blue); color: var(--bmw-blue); }

/* Single-race "Paddock notes" + betting strategy panels */
.cc-take, .cc-strategy {
  max-width: var(--page-max); margin: var(--space-lg) auto 0;
  padding: 0 var(--space-margin);
}
.take-inner, .strategy-inner {
  padding: var(--space-lg) var(--space-xl);
  background: var(--surface-light); border: 1px solid var(--hairline);
  border-left: 3px solid var(--bmw-blue);
}
.take-eyebrow {
  font-size: 11px; font-weight: 700; letter-spacing: 0.16em;
  text-transform: uppercase; color: var(--bmw-blue); margin-bottom: 8px;
}
.take-body, .strategy-body { font-size: 14px; color: var(--text-primary); line-height: var(--lh-default); }
.cc-strategy .strategy-label { margin-bottom: 8px; }

/* Curated-card footer (donate strip + brand notes) */
.cc-footer {
  margin-top: var(--space-section);
  padding: var(--space-xl) var(--space-margin);
  background: var(--surface-dark); color: var(--text-on-dark);
  text-align: center; font-size: 13px;
}
.cc-footer a { color: var(--text-on-dark); border-bottom: 1px solid currentColor; }
.cc-footer a:hover { color: var(--bmw-blue); }
.cc-footer-code {
  display: inline-block; padding: 6px 10px; margin-top: 4px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, "Cascadia Mono", monospace;
  font-size: 11px; color: var(--text-on-dark);
  border: 1px solid rgba(255,255,255,0.25); background: transparent;
  cursor: pointer; word-break: break-all;
}
.cc-footer-code:hover { border-color: var(--bmw-blue); color: var(--bmw-blue); }
.crypto-btc { color: #f7931a; }
.crypto-eth { color: #c0c0c0; }





/* ──────────────────────────────────────────────────────────────────────────
   ADMIN — Bootstrap-shaped components reskinned to BMW grammar.
   Cards, tab nav, forms, alerts, badges, progress bars.
   ────────────────────────────────────────────────────────────────────────── */
.admin-page-shell {
  max-width: var(--page-max);
  margin: 0 auto;
  padding: var(--space-section) var(--space-margin);
}
.admin-toolbar { padding-bottom: var(--space-md); border-bottom: 1px solid var(--hairline); }
.admin-toolbar h1 { overflow-wrap: anywhere; }

/* Cards (admin "card.shadow-lg.border-0" → flat bordered panel) */
.card {
  background: var(--surface-light);
  border: 1px solid var(--hairline);
  display: block;
  margin-bottom: var(--space-md);
}
.card-body { padding: var(--space-lg); }
.card-body.p-4 { padding: var(--space-xl); }
.card-title { font-size: 18px; font-weight: 700; margin-bottom: var(--space-sm); text-transform: uppercase; letter-spacing: 0.04em; }
.card-text { color: var(--text-secondary); font-size: 14px; }
.card.border-0 { border: 1px solid var(--hairline) !important; }
.card-header {
  display: flex; justify-content: space-between; align-items: center;
  gap: var(--space-md);
  padding: var(--space-md) var(--space-lg);
  background: var(--neutral);
  border-bottom: 1px solid var(--hairline);
}
.card-header[data-bs-toggle="collapse"] { cursor: pointer; }
.card-header[data-bs-toggle="collapse"]:hover { background: var(--surface-light); }

/* Collapse (vanilla shim in app.js toggles .show) */
.collapse { display: none; }
.collapse.show { display: block; }

/* Tab nav */
.nav-tabs {
  display: flex; flex-wrap: wrap;
  list-style: none; gap: 0;
  border-bottom: 1px solid var(--hairline);
  padding: 0; margin: 0 0 var(--space-lg);
}
.nav-tabs .nav-item { margin-bottom: -1px; }
.nav-tabs .nav-link {
  display: inline-flex; align-items: center; gap: 6px;
  background: transparent; border: none;
  padding: 14px 20px;
  font-family: var(--font-stack);
  font-size: var(--fs-body); font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase; letter-spacing: 0.04em;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  transition: color .15s, border-color .15s;
}
.nav-tabs .nav-link:hover { color: var(--text-primary); }
.nav-tabs .nav-link.active {
  color: var(--bmw-blue);
  border-bottom-color: var(--bmw-blue);
  background: transparent;
}

/* Forms */
.form-label {
  display: block;
  font-size: var(--fs-caption); font-weight: 700;
  letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--text-secondary);
  margin-bottom: 6px;
}
.form-control,
.form-select,
input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="date"],
input[type="search"],
textarea,
select {
  width: 100%;
  padding: 12px 14px;
  font-family: var(--font-stack);
  font-size: var(--fs-body);
  font-weight: 400;
  line-height: var(--lh-default);
  color: var(--text-primary);
  background: var(--surface-light);
  border: 1px solid var(--hairline);
  outline: none;
  transition: border-color .15s;
}
.form-control:focus,
.form-select:focus,
input:focus,
textarea:focus,
select:focus {
  border-color: var(--bmw-blue);
  outline: 2px solid var(--bmw-blue-focus);
  outline-offset: -2px;
}
.form-control::placeholder, textarea::placeholder { color: var(--text-tertiary); }
.form-select { padding-right: 36px; appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--text-primary) 50%),
                    linear-gradient(135deg, var(--text-primary) 50%, transparent 50%);
  background-position: calc(100% - 18px) 50%, calc(100% - 12px) 50%;
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
}
.form-check { display: flex; align-items: center; gap: 8px; padding: 4px 0; }
.form-check-input { width: 16px; height: 16px; accent-color: var(--bmw-blue); }
.form-check-label { font-size: 14px; color: var(--text-primary); }
.form-text { font-size: 12px; color: var(--text-secondary); margin-top: 4px; }
input[type="radio"], input[type="checkbox"] { width: auto; accent-color: var(--bmw-blue); }
.input-group { display: flex; }
.input-group > .form-control { flex: 1; }

/* Alerts — borderless on the sides, accent stripe on the left */
.alert {
  position: relative;
  padding: var(--space-md) var(--space-lg);
  margin-bottom: var(--space-md);
  background: var(--neutral);
  border: 1px solid var(--hairline);
  border-left: 3px solid var(--text-secondary);
  color: var(--text-primary);
  font-size: 14px; line-height: var(--lh-default);
}
.alert strong { font-weight: 700; }
.alert code { background: var(--surface-light); padding: 1px 6px; border: 1px solid var(--hairline); font-size: 12px; }
.alert-info, .alert-primary { border-left-color: var(--bmw-blue); }
.alert-success { border-left-color: var(--bmw-blue); }
.alert-warning { border-left-color: var(--text-primary); background: var(--neutral); }
.alert-danger { border-left-color: var(--text-primary); }

/* Badges */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 11px; font-weight: 700;
  letter-spacing: 0.12em; text-transform: uppercase;
  padding: 4px 10px;
  border: 1px solid var(--text-primary);
  background: transparent;
  color: var(--text-primary);
  white-space: nowrap;
}
.badge.bg-success, .badge.bg-primary { background: var(--bmw-blue); border-color: var(--bmw-blue); color: var(--text-on-dark); }
.badge.bg-secondary { background: var(--text-secondary); border-color: var(--text-secondary); color: var(--text-on-dark); }
.badge.bg-warning, .badge.bg-danger, .badge.bg-info { background: var(--text-primary); border-color: var(--text-primary); color: var(--text-on-dark); }
.badge.bg-light { background: var(--neutral); color: var(--text-primary); border-color: var(--hairline); }

/* Progress bar */
.progress {
  background: var(--neutral);
  border: 1px solid var(--hairline);
  height: 8px; overflow: hidden; margin: 8px 0;
}
.progress-bar { background: var(--bmw-blue); height: 100%; transition: width .3s ease; }

/* Spinner — single-color */
.spinner-border {
  display: inline-block; width: 16px; height: 16px;
  border: 2px solid var(--hairline);
  border-right-color: var(--bmw-blue);
  animation: spinnerRotate .8s linear infinite;
}
@keyframes spinnerRotate { to { transform: rotate(360deg); } }

/* Tables variants used in admin */
.table { width: 100%; }
.table-sm th, .table-sm td { padding: 8px 12px; font-size: 13px; }
.table-hover tbody tr:hover { background: var(--neutral); }
.table-dark { background: var(--surface-dark); color: var(--text-on-dark); }
.table-dark th, .table-dark td { color: var(--text-on-dark); border-color: var(--hairline-dark); background: var(--surface-dark); }
.table-responsive { overflow-x: auto; max-width: 100%; -webkit-overflow-scrolling: touch; }
.align-middle td, .align-middle th { vertical-align: middle; }

/* Code element */
code, pre { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; }

/* Borders helpers */
.border-0 { border: 0; }
.border-top { border-top: 1px solid var(--hairline); }
.border-bottom { border-bottom: 1px solid var(--hairline); }

/* ──────────────────────────────────────────────────────────────────────────
   AD SLOTS — Reserved real estate as flat dashed placeholders.
   ────────────────────────────────────────────────────────────────────────── */
.ad-slot {
  background: var(--neutral);
  border: 1px dashed var(--hairline);
  padding: var(--space-lg);
  margin-bottom: var(--space-md);
  text-align: center;
  color: var(--text-secondary);
}
.ad-slot strong {
  display: block; font-size: var(--fs-body); font-weight: 700;
  color: var(--text-primary);
  text-transform: uppercase; letter-spacing: 0.04em;
  margin: 6px 0;
}
.ad-slot p { font-size: 13px; color: var(--text-secondary); margin: 0; }
.ad-slot-label {
  display: inline-block; font-size: 10px; font-weight: 700;
  letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--text-tertiary);
}
.ad-slot-banner { padding: var(--space-xl) var(--space-lg); margin-bottom: var(--space-lg); }
.ad-slot-inline { padding: var(--space-md) var(--space-lg); margin: var(--space-md) 0; }

/* Empty-state panel */
.empty-state-panel { padding: var(--space-xl); }
.empty-state-panel h3 { margin: var(--space-sm) 0; }
.empty-state-panel p { color: var(--text-secondary); }

/* Decoration: a panel anchored as an "active" tab marker */
.panel-nav .text-decoration-none { text-decoration: none; }
.text-decoration-none { text-decoration: none; }

/* ──────────────────────────────────────────────────────────────────────────
   RECORD PAGE — Workspace: highlights+detail left, recap list right.
   ────────────────────────────────────────────────────────────────────────── */
body.record-page .stats-grid {
  max-width: min(1600px, 100%);
  margin-left: auto;
  margin-right: auto;
  padding-left: clamp(16px, 2vw, 28px);
  padding-right: clamp(16px, 2vw, 28px);
}
.record-workspace {
  max-width: min(1600px, 100%);
  width: 100%;
  margin: 0 auto;
  padding: 8px clamp(16px, 2vw, 28px) var(--space-section);
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: clamp(16px, 2vw, 28px);
  align-items: start;
  box-sizing: border-box;
}
.record-workspace__primary {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.record-workspace__list {
  min-width: 0;
  position: static;
  max-height: none;
  overflow: visible;
  align-self: start;
}
.record-workspace .navigator-bar {
  max-width: none;
  margin: 0;
  padding: 0;
}
.record-workspace .navigator-head {
  margin-bottom: 12px;
  gap: 12px;
}
.record-workspace .navigator-row {
  grid-template-columns: 88px minmax(70px, 96px) minmax(0, 1fr);
  gap: 10px 12px;
}
.record-workspace .navigator-row-go {
  grid-column: 1 / -1;
  justify-self: start;
  padding-left: 0;
}
.record-workspace .navigator-row-value { font-size: 22px; }

.record-container,
.record-listing {
  max-width: var(--page-max); margin: 0 auto;
  padding: var(--space-section) var(--space-margin);
  display: grid; grid-template-columns: 1fr; gap: var(--space-xl);
  align-items: start;
}
.record-listing--full,
.record-listing--workspace {
  grid-template-columns: 1fr;
  max-width: none;
  margin: 0;
  padding: 0;
}
.record-workspace .recap-panel-shell {
  max-width: none;
  margin: 0;
  padding: 0;
}
.record-workspace .pagination-bar,
.pagination-bar--workspace {
  max-width: none;
  margin: 12px 0 0;
  padding: 0;
  justify-content: flex-start;
}
.record-workspace .rec-list-row {
  flex-wrap: wrap;
  gap: 10px 14px;
}
.record-workspace .rec-list-meta {
  min-width: 0;
  flex: 1 1 140px;
}
.record-workspace .rec-list-stats {
  flex: 1 1 180px;
  min-width: 0;
}
.record-workspace .rec-list-cta {
  flex: 0 0 auto;
  margin-left: auto;
}
.detail-race:target,
.detail-race.is-target {
  outline: 2px solid var(--pro-gold, #c8a74a);
  outline-offset: 2px;
}
@media (max-width: 1024px) {
  .record-workspace {
    grid-template-columns: 1fr;
    gap: 20px;
  }
  .record-workspace__list {
    position: static;
    max-height: none;
    overflow: visible;
    order: 2;
  }
  .record-workspace__primary { order: 1; }
  .record-container, .record-listing { grid-template-columns: 1fr; }
  .record-workspace .navigator-row {
    grid-template-columns: 96px minmax(80px, 120px) minmax(0, 1fr) auto;
  }
  .record-workspace .navigator-row-go {
    grid-column: auto;
    justify-self: end;
  }
}

/* Full-width recap listing — track + date + Open Card CTA per row. */
.rec-list { background: var(--surface-light); border: 1px solid var(--hairline); }
.rec-list-row {
  display: flex; align-items: center; justify-content: space-between;
  gap: var(--space-md);
  padding: var(--space-lg) var(--space-lg);
  border-bottom: 1px solid var(--hairline);
  text-decoration: none; color: inherit;
  transition: background .15s, border-color .15s;
}
.rec-list-row:last-child { border-bottom: none; }
.rec-list-row:hover { background: var(--neutral); }
.rec-list-row:hover .rec-list-cta { color: var(--bmw-blue-focus); }
.rec-list-row.is-active {
  background: var(--neutral);
  border-left: 3px solid var(--pro-gold, #c8a74a);
  padding-left: calc(var(--space-lg) - 3px);
}
.rec-list-meta { min-width: 180px; flex: 0 0 auto; }
.rec-list-track {
  font-size: 16px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.04em;
  color: var(--text-primary);
}
.rec-list-date {
  font-size: 12px; color: var(--text-secondary);
  margin-top: 4px;
}
.rec-list-stats {
  display: flex; align-items: center; gap: var(--space-lg);
  flex: 1 1 auto; justify-content: flex-end;
}
.rec-list-stat { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; }
.rec-list-stat-label {
  font-size: 10px; font-weight: 700;
  letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--text-secondary);
}
.rec-list-stat-value { font-size: 13px; font-weight: 700; color: var(--text-primary); }
.rec-list-cta {
  font-size: 12px; font-weight: 700;
  letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--bmw-blue);
  display: inline-flex; align-items: center; gap: 8px;
  white-space: nowrap; flex: 0 0 auto;
}
.rec-list-empty {
  padding: var(--space-xl); text-align: center;
  color: var(--text-secondary); font-size: 14px;
}
@media (max-width: 767px) {
  .rec-list-row { flex-wrap: wrap; }
  .rec-list-stats { width: 100%; justify-content: flex-start; gap: var(--space-md); flex-wrap: wrap; }
  .rec-list-cta { width: 100%; justify-content: flex-end; }
}

.rec-table {
  width: 100%; border-collapse: collapse; font-size: 13px;
  background: var(--surface-light);
}
.rec-table th {
  padding: 12px 14px; font-size: 11px; font-weight: 700;
  letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--text-secondary); background: var(--neutral);
  border-bottom: 1px solid var(--hairline); text-align: left;
}
.rec-table td {
  padding: 14px; border-bottom: 1px solid var(--hairline);
  color: var(--text-primary);
}
.rec-summary-row { cursor: pointer; transition: background .15s; }
.rec-summary-row:hover { background: var(--neutral); }
.rec-summary-row.is-active { background: var(--neutral); }
.rec-summary-row.is-active td:first-child { border-left: 3px solid var(--bmw-blue); padding-left: 11px; }
.rec-row-link { font-weight: 700; color: var(--text-primary); }
.rec-track-cell { font-weight: 700; text-transform: uppercase; letter-spacing: 0.02em; }
.rec-score {
  display: inline-block; min-width: 42px; padding: 4px 10px; text-align: center;
  font-weight: 700; font-size: 13px;
  border: 1px solid var(--text-primary); color: var(--text-primary);
  background: transparent;
}
.rec-score.score-high { color: var(--bmw-blue); border-color: var(--bmw-blue); }
.rec-score.score-mid { color: var(--text-primary); border-color: var(--text-primary); }
.rec-score.score-low { color: var(--text-secondary); border-color: var(--text-secondary); }

.mobile-cards { display: none; }
@media (max-width: 767px) {
  .table-desktop { display: none; }
  .mobile-cards { display: block; }
  .race-panel .mobile-cards { display: block; padding: 0 var(--space-md); }
  .race-panel { width: 100%; box-sizing: border-box; }
  .dd-tabs { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .dd-content { overflow-wrap: break-word; }
}
.mobile-record-link {
  display: block; padding: var(--space-md);
  border-bottom: 1px solid var(--hairline);
  background: var(--surface-light); color: inherit;
}
.mobile-record-link.is-active { border-left: 3px solid var(--bmw-blue); padding-left: calc(var(--space-md) - 3px); }
.rec-mobile-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 10px; }
.rec-mobile-track { font-size: 13px; color: var(--text-secondary); margin-top: 2px; }
.rec-mobile-score { font-size: 15px; padding: 6px 12px; }
.mobile-card-label {
  display: block; font-size: 10px; font-weight: 700;
  letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--text-secondary); margin-bottom: 4px;
}
.mobile-card-value { font-size: 14px; font-weight: 700; color: var(--text-primary); }
.mobile-card-grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-md); margin-bottom: 8px; }
.rec-mobile-hint { font-size: 11px; color: var(--text-secondary); letter-spacing: 0.08em; text-transform: uppercase; }

/* Recap panel — sits below the listing, hidden until a row is selected. */
.recap-panel-shell { margin-top: var(--space-lg); }
.recap-panel {
  display: none; background: var(--surface-light);
  border: 1px solid var(--hairline); margin-bottom: var(--space-lg);
  border-top: 3px solid var(--bmw-blue);
}
.recap-panel.is-active { display: block; }
.recap-panel-head {
  padding: var(--space-lg) var(--space-xl);
  border-bottom: 1px solid var(--hairline);
  display: flex; justify-content: space-between; align-items: flex-start;
  gap: var(--space-md); flex-wrap: wrap; background: var(--neutral);
}
.recap-panel-kicker {
  font-size: var(--fs-caption); font-weight: 700;
  letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--bmw-blue); margin-bottom: 6px;
}
.recap-panel-title {
  font-size: 22px; font-weight: 400; color: var(--text-primary);
  text-transform: uppercase; letter-spacing: 0; margin-bottom: 6px;
}
.recap-panel-sub { font-size: 15px; color: var(--text-primary); line-height: var(--lh-default); font-weight: 400; }
.recap-panel-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.recap-panel-action {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 14px; font-size: 12px; font-weight: 700;
  letter-spacing: 0.08em; text-transform: uppercase;
  border: 1px solid var(--text-primary); color: var(--text-primary);
  transition: background .15s, color .15s;
}
.recap-panel-action:hover { background: var(--text-primary); color: var(--text-on-dark); }

.recap-stat-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  border-top: 1px solid var(--hairline);
}
.recap-stat-card {
  padding: var(--space-lg);
  border-right: 1px solid var(--hairline);
  border-bottom: 1px solid var(--hairline);
}
.recap-stat-value { font-size: 30px; font-weight: 300; color: var(--text-primary); margin-bottom: 4px; }
.recap-stat-card:first-child .recap-stat-value { color: var(--bmw-blue); }
.recap-stat-label { font-size: 10px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--text-secondary); }

.recap-races { padding: var(--space-xl); }
.detail-race { padding: var(--space-lg) 0; border-bottom: 1px solid var(--hairline); }
.detail-race:last-child { border-bottom: none; }
.dr-head { font-weight: 700; font-size: 14px; text-transform: uppercase; letter-spacing: 0.04em; margin-bottom: 8px; color: var(--text-primary); }
.dr-note { font-size: 15px; color: var(--text-primary); line-height: var(--lh-default); margin-bottom: 12px; padding: 12px 14px; background: var(--neutral); border-left: 3px solid var(--bmw-blue); }
.dr-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: var(--space-sm); margin: 8px 0; }
.dr-stat { font-size: 12px; color: var(--text-primary); padding: 8px; background: var(--neutral); border: 1px solid var(--hairline); }
.dr-stat strong { display: block; font-size: 10px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--text-secondary); margin-bottom: 4px; }
.recap-finishers { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: var(--space-sm); margin: 10px 0; }
.recap-finisher-card { min-height: 0; padding: var(--space-md); }
.recap-finisher-card .pick-name { font-size: 16px; line-height: 1.2; }
.recap-finisher-card .pick-number { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.recap-finisher-card .pick-number .rt-post { width: 24px; height: 24px; margin-right: 0; font-size: 11px; }
.dr-hits { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.hit-badge {
  display: inline-block; padding: 4px 10px;
  font-size: 10px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase;
  background: var(--bmw-blue); color: var(--text-on-dark); border: 1px solid var(--bmw-blue);
}

@media (max-width: 1024px) { .recap-panel-shell { margin-top: var(--space-lg); } }


/* DeepSeek warning helper + utility shim used by JS toggling */
.d-none { display: none !important; }


/* Maintenance-mode banner — flat CI2020 rectangle, no radius, no shadow */
.maintenance-banner {
  padding: 12px var(--space-margin);
  background: var(--surface-dark); color: var(--text-on-dark);
  border-bottom: 2px solid var(--bmw-blue);
  font-size: 13px; letter-spacing: 0.02em; text-align: center;
}
.maintenance-banner strong {
  color: var(--bmw-blue); text-transform: uppercase; letter-spacing: 0.08em;
  margin-right: 8px;
}


/* ──────────────────────────────────────────────────────────────────────────
   RESPONSIVE — Margins collapse, hero scales, dashboard stacks.
   ────────────────────────────────────────────────────────────────────────── */
@media (max-width: 1024px) {
  :root { --space-margin: 20px; --space-section: 40px; --space-hero: 40px; }
  .nav-links { gap: var(--space-md); }
}
@media (max-width: 767px) {
  :root { --space-margin: 16px; --space-section: 32px; --fs-display: 40px; --fs-section: 24px; }
  .navbar { height: 56px; padding: 0 var(--space-md); position: relative; }
  .navbar-brand img { width: 32px; height: 32px; }
  .nav-links { display: none; flex-direction: column; position: absolute; top: 100%; left: 0; right: 0; background: var(--surface-dark); padding: var(--space-md); border-bottom: 1px solid var(--hairline-dark); z-index: 1000; box-shadow: 0 4px 6px rgba(0,0,0,0.3); }
  .nav-links.is-open { display: flex; }
  .mobile-nav-toggle { display: block; color: var(--text-on-dark); font-size: 24px; cursor: pointer; }
  .hero { min-height: 360px; padding: var(--space-section) var(--space-md); }
  .hero h1 { font-size: clamp(28px, 10vw, 34px); line-height: 1.14; max-width: 100%; hyphens: auto; }
  .landing-hero-grid { grid-template-columns: 1fr; gap: var(--space-lg); }
  .hero-actions { flex-direction: column; align-items: stretch; max-width: 260px; }
  .hero-actions .btn { width: 100%; }
  .btn, .badge { white-space: normal; text-align: center; }
  .admin-page-shell { padding: var(--space-xl) var(--space-md); margin-inline: 0; }
  .admin-toolbar { text-align: center; align-items: center; }
  .admin-toolbar > div { width: 100%; }
  .admin-toolbar > div:last-child { justify-content: center; }
  .nav-tabs { flex-wrap: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .nav-tabs .nav-item { flex: 0 0 auto; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .nav-tabs .nav-link { padding: 10px 12px; font-size: 13px; }
  .card-body.p-4 { padding: var(--space-md); }
  .footer-links { gap: var(--space-md); }
}
@media (max-width: 480px) {
  .stats-grid { grid-template-columns: 1fr; }
  .metric-strip { grid-template-columns: 1fr; }
  .rail-metrics { grid-template-columns: 1fr; }
}
