/* Standalone document-only styling; omit in CMS if not needed. */
body.racecard-local-page { margin: 12px auto; padding: 0 12px; max-width: 1240px; background: #fff; }
/* Everything below applies only to this racecard. */
#racecard-local { --race-cols: 32px 20px 151px 48px 48px 72px repeat(4,minmax(0,1fr)); width:100%; max-width:1200px; min-width:0; margin:0 auto; box-sizing:border-box; container:racecard / inline-size; color:#252525; background:#fdfdfd; font-family:Arial,"Hiragino Kaku Gothic ProN","Yu Gothic",Meiryo,sans-serif; font-size:12px; line-height:1.45; }
#racecard-local *, #racecard-local *::before, #racecard-local *::after { box-sizing:border-box; }
#racecard-local .raceCont, #racecard-local .raceCont__inner { width:100%; max-width:100%; min-width:0; }
#racecard-local .raceCont__inner { overflow-x:visible; overflow-y:visible; -webkit-overflow-scrolling:touch; }
#racecard-local p, #racecard-local dl, #racecard-local dt, #racecard-local dd, #racecard-local ul { margin:0; padding:0; }
#racecard-local ul { list-style:none; }
#racecard-local .raceTable { display:block; width:100%; min-width:0; margin:0; border:1px solid #d2d2d2; border-right:0; background:#fdfdfd; }
#racecard-local .raceTable__header, #racecard-local .raceTable__details__line { display:grid; grid-template-columns:var(--race-cols); min-width:0; width:100%; }
#racecard-local .raceTable__header { background:#efefef; font-weight:bold; }
#racecard-local .raceTable__details { display:block; margin:0; }
#racecard-local .raceTable__details__line { border-top:1px solid #d2d2d2; }
#racecard-local .raceTable__details__line:nth-of-type(even) { background:#f9f9f9; }
#racecard-local .raceTable__header__item, #racecard-local .raceTable__details__line__item { padding:5px 4px; min-width:0; max-width:100%; border-right:1px solid #d2d2d2; overflow-wrap:anywhere; white-space:normal; }
#racecard-local .raceTable__header__item--horseNun, #racecard-local .raceTable__header__item--gateNun, #racecard-local .raceTable__details__line__item--horseNun, #racecard-local .raceTable__details__line__item--gateNun, #racecard-local .raceTable__header__item--odds, #racecard-local .raceTable__details__line__item--odds { padding-left:2px; padding-right:2px; text-align:center; }
#racecard-local .raceTable__header__item--odds, #racecard-local .raceTable__header__item--before { grid-column:span 2; padding:0; }
#racecard-local .raceTable__header__item--before { grid-column:span 4; }
#racecard-local .raceTable__header__item__inner, #racecard-local .raceTable__details__line__item__inner { min-width:0; max-width:100%; }
#racecard-local .raceTable__header__item--odds__title { padding:4px; border-bottom:1px solid #d2d2d2; text-align:center; }
/* JRA / ML: extend the divider to the bottom of the full header. */
#racecard-local .raceTable__header__item--odds {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  align-self: stretch;
  align-items: stretch;
  height: auto;
  min-height: 0;
}
#racecard-local .raceTable__header__item--odds__item {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  align-items: stretch;
  align-self: stretch;
  width: 100%;
  min-height: 0;
  height: auto;
  margin: 0;
  padding: 0;
  text-align: center;
}
#racecard-local .raceTable__header__item--odds__item p {
  display: flex;
  align-items: center;
  justify-content: center;
  align-self: stretch;
  float: none;
  position: static;
  width: auto;
  height: auto;
  min-width: 0;
  margin: 0;
  padding: 4px 2px;
}
#racecard-local .raceTable__header__item--odds__item p:first-child { border-right:1px solid #d2d2d2; }
#racecard-local .raceTable__header__item--before__details { text-align:left; padding:4px 6px; border-bottom:1px solid #d2d2d2; }
#racecard-local .raceTable__header__item--before__list { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); text-align:center; }
#racecard-local .raceTable__header__item--before__list__item { border-right:1px solid #d2d2d2; padding:4px; }
#racecard-local .raceTable__header__item--before__list__item:last-child { border-right:0; }
#racecard-local .raceTable__details__line__item--horse__heading { display:flex; align-items:flex-start; gap:3px; min-width:0; }
#racecard-local .raceTable__details__line__item--horse__name,
#racecard-local .raceTable__details__line__item--horse__info__rating { font-size:13px; }
#racecard-local .raceTable__details__line__item--horse__name { font-weight:bold; color:#0078d6; min-width:0; overflow-wrap:anywhere; }
#racecard-local .raceTable__details__line__item--horse__info { font-size:12px; overflow-wrap:anywhere; }
#racecard-local .raceTable__details__line__item--horse__info > span { display:block; }
#racecard-local .raceTable__details__line__item--horse__info__rating:empty { display:none; }
#racecard-local .raceTable__details__line__item--horse__info__father>span, #racecard-local .raceTable__details__line__item--horse__info__mother>span, #racecard-local .raceTable__details__line__item--horse__info__motherfather>span { margin-right:2px; }
/* Past race: rank | country, venue and date / race name (class). */
#racecard-local .raceTable__details__line__item--before__info {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  column-gap: 4px;
  align-items: center;
  width: 100%;
  min-width: 0;
  min-height: 0;
  height: auto;
}
#racecard-local .raceTable__details__line__item--before__info__rank {
  display: block;
  float: none;
  position: static;
  align-self: center;
  width: auto;
  min-width: 0;
  min-height: 0;
  height: auto;
  margin: 0;
  padding: 0;
  font-size: 22px;
  font-weight: 700;
  line-height: 1.25;
  text-align: center;
  white-space: nowrap;
}
#racecard-local .raceTable__details__line__item--before__info__name {
  display: block;
  float: none;
  position: static;
  width: auto;
  min-width: 0;
  max-width: 100%;
  height: auto;
  margin: 0;
  padding: 0;
  font-size: 12px;
  line-height: 1.45;
  text-align: left;
  white-space: normal;
  overflow-wrap: anywhere;
}
#racecard-local .race-meeting {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  column-gap: 6px;
  min-width: 0;
  font-weight: 400;
  color: #252525;
}
#racecard-local .race-country,
#racecard-local .race-date { white-space: nowrap; }
#racecard-local .race-date { font-variant-numeric: tabular-nums; }
#racecard-local .race-venue { min-width: 0; overflow-wrap: anywhere; }
#racecard-local .race-venue:empty { display: none; }
#racecard-local .raceTable__details__line__item--before__info__name .race-name {
  display: block;
  width: auto;
  min-width: 0;
  max-width: 100%;
  margin: 0;
  padding: 0;
  color: #000000 !important;
  font-weight: 700 !important;
  line-height: 1.45;
  white-space: normal;
  overflow-wrap: anywhere;
}
#racecard-local .race-name a,
#racecard-local .race-name a:link,
#racecard-local .race-name a:visited,
#racecard-local .race-name a:hover,
#racecard-local .race-name a:focus,
#racecard-local .race-name a:active {
  color: #000000 !important;
  font-weight: 700 !important;
}
#racecard-local .raceTable__details__line__item--before__details { margin-top:4px; overflow-wrap:anywhere; color:#252525; }
#racecard-local .raceTable__details__line__item--before.number-one { background:#ffe4e4; }
#racecard-local .raceTable__details__line__item--before.number-two { background:#fff7e3; }
#racecard-local .raceTable__details__line__item--before.number-three { background:#e1f8ff; }
#racecard-local .race-time { font-size:14px; }
#racecard-local .race-jockey, #racecard-local .race-name, #racecard-local .raceTable__details__line__item--jockey__name { color:#000!important; }
#racecard-local .race-jockey a, #racecard-local .race-name a, #racecard-local .raceTable__details__line__item--jockey__name a { color:#000!important; }
#racecard-local .race-jockey a:visited, #racecard-local .race-jockey a:hover, #racecard-local .race-jockey a:focus, #racecard-local .race-jockey a:active, #racecard-local .race-name a:visited, #racecard-local .race-name a:hover, #racecard-local .race-name a:focus, #racecard-local .race-name a:active { color:#000!important; }
#racecard-local .race-number, #racecard-local .odds-value, #racecard-local .raceTable__details__line__item--odds, #racecard-local .race-weight, #racecard-local .raceTable__details__line__item--jockey__weight { white-space:nowrap; overflow-wrap:normal; word-break:normal; font-variant-numeric:tabular-nums; }
#racecard-local .race-silks { min-height:18px; }
#racecard-local .raceTable__details__line__item--jockey__cloth { display:block; max-width:100%; height:auto; border:0; outline:0; box-shadow:none; }
#racecard-local .flags { flex:none; display:inline-block; width:20px; height:14px; margin:2px 0 0; background-repeat:no-repeat; background-image:none; }
/* Flag sprite, available from JRA-VAN World only when online. Do not render a flag for unknown codes. */
#racecard-local .flag_usa, #racecard-local .flag_aus, #racecard-local .flag_irl, #racecard-local .flag_jpn, #racecard-local .flag_fra, #racecard-local .flag_bri, #racecard-local .flag_deu, #racecard-local .flag_ksa, #racecard-local .flag_hkg, #racecard-local .flag_uae { background-image:url("https://world.jra-van.jp/img/flags.png"); }
/* Flag sprite: source image is a 10-column grid of 100 x 67px flags.
   Scale each flag to 20 x 13.4px while preserving the original aspect ratio. */
#racecard-local .flags { background-size:200px auto; background-position:0 0; }
#racecard-local .flags:not(.flag_usa):not(.flag_aus):not(.flag_irl):not(.flag_jpn):not(.flag_fra):not(.flag_bri):not(.flag_deu):not(.flag_ksa):not(.flag_hkg):not(.flag_uae) { background-image:none; }
#racecard-local .flag_irl { background-position:0 0; }
#racecard-local .flag_bri { background-position:-20px 0; }
#racecard-local .flag_fra { background-position:-40px 0; }
#racecard-local .flag_usa { background-position:-60px 0; }
#racecard-local .flag_aus { background-position:-80px 0; }
#racecard-local .flag_uae { background-position:-100px 0; }
#racecard-local .flag_hkg { background-position:-120px 0; }
#racecard-local .flag_jpn { background-position:-140px 0; }
#racecard-local .flag_deu { background-position:-180px 0; }
#racecard-local .flag_ksa { background-position:-60px -13.4px; }
@container racecard (width < 960px) {
  #racecard-local .raceCont__inner { overflow-x:auto; overflow-y:visible; }
  #racecard-local .raceTable { width:1200px; min-width:1200px; max-width:none; }
}

/* Standalone Equibase final field: name and weight stacked beneath the silks */
#racecard-local .raceTable__details__line__item--jockey__name,
#racecard-local .raceTable__details__line__item--jockey__weight { display:block; text-align:center; }
#racecard-local .raceTable__details__line__item--odds__local { font-variant-numeric: tabular-nums; white-space:nowrap; }

/* BC Classic: larger bold win odds; ML top three in red, other ML odds in blue. */
#racecard-local .raceTable__details__line__item--odds__jra,
#racecard-local .raceTable__details__line__item--odds__local { font-size: 15px; font-weight: 700; line-height: 1.45; }
#racecard-local .raceTable__details__line__item--odds__local.odds-top3 { color: #d20b20; }
#racecard-local .raceTable__details__line__item--odds__local.odds-other { color: #0078d6; }
/* The update timestamp is outside #racecard-local in the original page. */
.bc-racecard-page .racecard-odds-update { margin-bottom: 12px; text-align: right; }

/* Horse number and gate number: vertically center within each horse row. */
#racecard-local .raceTable__details__line__item--horseNun,
#racecard-local .raceTable__details__line__item--gateNun {
  display: flex;
  align-items: center;
  justify-content: center;
}
#racecard-local .raceTable__details__line__item--horseNun > .raceTable__details__line__item__inner,
#racecard-local .raceTable__details__line__item--gateNun > .raceTable__details__line__item__inner {
  width: 100%;
  text-align: center;
}
/* Rating: JRA Rt. value, black and bold at the lower right.
   Font size is shared with the horse name above. */
#racecard-local .raceTable__details__line__item--horse > .raceTable__details__line__item__inner {
  display: flex;
  flex-direction: column;
  height: 100%;
}
#racecard-local .raceTable__details__line__item--horse__info {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
}
#racecard-local .raceTable__details__line__item--horse__info__rating {
  margin-top: auto;
  align-self: flex-end;
  text-align: right;
  color: #000;
  font-weight: 700;
  white-space: nowrap;
}

/* Center JRA / ML odds vertically and horizontally in every horse row. */
#racecard-local .raceTable__details__line__item--odds {
  display:flex;
  align-items:center;
  justify-content:center;
}
#racecard-local .raceTable__details__line__item--odds > .raceTable__details__line__item__inner {
  width:100%; display:flex; align-items:center; justify-content:center;
}
#racecard-local .raceTable__header__item--odds__item > p {
  display:flex; align-items:center; justify-content:center; min-height:28px;
  line-height:1.25; white-space:nowrap;
}


/* ====================================================================
   BC Classic: align the racecard column HEADER with the BC Dirt Mile.
   This block is deliberately scoped to .raceTable__header only.
   Race entries, odds colours, ratings, and site navigation are unchanged.
   ==================================================================== */
#racecard-local .raceTable__header {
  display: grid;
  grid-template-columns: var(--race-cols);
  align-items: stretch;
  gap: 0;
  position: static;
  width: 100%;
  min-width: 0;
  height: auto;
  margin: 0;
  padding: 0;
  border: 0;
  background: #efefef;
  font-weight: 700;
}

#racecard-local .raceTable__header::before,
#racecard-local .raceTable__header::after {
  content: none;
}

#racecard-local .raceTable__header__item {
  display: block;
  position: static;
  width: auto;
  max-width: none;
  min-width: 0;
  height: auto;
  margin: 0;
  padding: 6px 4px;
  border: 0;
  border-right: 1px solid #d2d2d2;
  border-bottom: 1px solid #d2d2d2;
  background: transparent;
  color: inherit;
  vertical-align: top;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: normal;
}

#racecard-local .raceTable__header__item__inner {
  display: block;
  position: static;
  width: 100%;
  height: auto;
  margin: 0;
  padding: 0;
  border: 0;
}

/* Reset inherited page styles inside the header only. */
#racecard-local .raceTable__header p,
#racecard-local .raceTable__header ul,
#racecard-local .raceTable__header li,
#racecard-local .raceTable__header span {
  float: none;
  position: static;
  margin: 0;
  font-family: inherit;
  font-size: inherit;
  line-height: inherit;
  letter-spacing: normal;
  text-indent: 0;
  text-shadow: none;
}

#racecard-local .raceTable__header__item--horseNun { grid-column: 1; }
#racecard-local .raceTable__header__item--gateNun { grid-column: 2; }
#racecard-local .raceTable__header__item--horse {
  grid-column: 3;
  text-align: left;
}
#racecard-local .raceTable__header__item--jockey { grid-column: 6; }

/* Vertical and horizontal centering of heading cells. */
#racecard-local .raceTable__header__item--horseNun,
#racecard-local .raceTable__header__item--gateNun,
#racecard-local .raceTable__header__item--jockey {
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}
#racecard-local .raceTable__header__item--horseNun,
#racecard-local .raceTable__header__item--gateNun {
  padding-right: 2px;
  padding-left: 2px;
}

/* Match the two-level WIN ODDS heading: centred JRA and ML labels,
   a divider reaching the bottom of the entire column header. */
#racecard-local .raceTable__header__item--odds {
  grid-column: 4 / 6;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  align-items: stretch;
  padding: 0;
  border-right: 0;
  text-align: center;
}
#racecard-local .raceTable__header__item--odds__title {
  display: flex;
  align-items: center;
  justify-content: center;
  position: static;
  width: 100%;
  height: auto;
  margin: 0;
  padding: 5px 2px;
  border-right: 1px solid #d2d2d2;
  border-bottom: 1px solid #d2d2d2;
  white-space: nowrap;
}
#racecard-local .raceTable__header__item--odds__item {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: stretch;
  position: static;
  width: 100%;
  height: auto;
  min-height: 0;
  margin: 0;
  padding: 0;
}
#racecard-local .raceTable__header__item--odds__item__jra,
#racecard-local .raceTable__header__item--odds__item__local {
  display: flex;
  align-items: center;
  justify-content: center;
  align-self: stretch;
  position: static;
  width: auto;
  height: auto;
  min-height: 0;
  margin: 0;
  padding: 2px;
  border: 0;
  border-right: 1px solid #d2d2d2;
  white-space: nowrap;
}
#racecard-local .raceTable__header__item--odds__item span {
  display: inline;
  position: static;
  width: auto;
  height: auto;
  margin: 0;
  padding: 0;
  transform: none;
}

/* Past-performance legend and four history-column headings. */
#racecard-local .raceTable__header__item--before {
  grid-column: 7 / 11;
  display: grid;
  grid-template-rows: 1fr auto;
  padding: 0;
  border-right: 0;
}
/* Match BC Dirt Mile mobile type scale. Prevent browser text inflation. */
#racecard-local .raceTable__header__item--before__details {
  display: block;
  position: static;
  width: 100%;
  height: auto;
  margin: 0;
  padding: 5px 4px;
  border-right: 1px solid #d2d2d2;
  border-bottom: 1px solid #d2d2d2;
  text-align: left;
  font-size: 12px !important;
  line-height: 1.45 !important;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}
#racecard-local .raceTable__header__item--before__list {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0;
  position: static;
  width: 100%;
  height: auto;
  margin: 0;
  padding: 0;
}
#racecard-local .raceTable__header__item--before__list__item {
  display: flex;
  align-items: center;
  justify-content: center;
  position: static;
  width: auto;
  height: auto;
  margin: 0;
  padding: 4px;
  border: 0;
  border-right: 1px solid #d2d2d2;
  text-align: center;
}
