:root {
  color-scheme: light;
  /* UI改修 1段目: JRA公式・実用ツール調の色と数字の決まり (tokens). The older names below now point at
     the same palette, so every screen moves to it at once; later stages restyle each screen. */
  --tm-bg: #eceff2;
  --tm-surface: #ffffff;
  --tm-surface-alt: #f4f6f8;
  --tm-ink: #111613;
  --tm-muted: #55605a;
  --tm-line: #d3d9df;
  --tm-line-strong: #1c2420;
  --tm-turf: #0a6335;
  --tm-turf-deep: #064825;
  --tm-dirt: #6c431e;
  --tm-dirt-deep: #4e2f14;
  --tm-red: #d61f26;
  --tm-blue: #1456b8;
  --tm-owner: #532c8c;
  --tm-side: #b45a06;
  --tm-select-turf: #e5f3eb;
  --tm-select-dirt: #f5ede5;
  --tm-radius: 4px;
  --ink: var(--tm-ink);
  --muted: var(--tm-muted);
  --forest: var(--tm-turf);
  --dark: var(--tm-turf-deep);
  --paper: var(--tm-surface);
  --cream: var(--tm-bg);
  --line: var(--tm-line);
  --gold: #ffffff;
  --accent: var(--tm-red);
  --ui-font: "Hiragino Sans", "Hiragino Kaku Gothic ProN", -apple-system, BlinkMacSystemFont, "Yu Gothic", Meiryo, sans-serif;
  --num-font: "Helvetica Neue", "DIN Condensed", "Hiragino Sans", sans-serif;
  font-family: var(--ui-font);
  color: var(--ink);
  background: var(--cream);
  font-synthesis: none;
  -webkit-font-smoothing: antialiased;
}
/* Numbers (odds, medals, times, margins, places) in the number font, all the same width. */
.num, .race-bar-wallet strong, .gate, .race-no { font-family: var(--num-font); font-variant-numeric: tabular-nums; letter-spacing: -.02em; }

* { box-sizing: border-box; }
body { margin: 0; min-width: 0; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; color: inherit; }
button:disabled { cursor: default; }
button:focus-visible, input:focus-visible { outline: 2px solid #b55a37; outline-offset: 2px; }
h1, h2, h3, p, ul, ol, dl { margin: 0; }
button { -webkit-tap-highlight-color: transparent; }
.loading { margin: 10vh auto; padding: 20px; text-align: center; }

.main { max-width: 1120px; margin: 0 auto; padding: 24px 24px 36px; }
.bet-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(290px, 360px); gap: 16px; align-items: start; }
.panel { background: var(--paper); border: 1px solid var(--line); border-radius: var(--tm-radius); }
.field { overflow: hidden; }
.field-tabs { display: grid; grid-template-columns: 1fr 1fr; background: #eeeee3; }
.field-tabs button { border: 0; border-bottom: 2px solid transparent; min-height: 49px; background: transparent; color: var(--muted); font-size: .87rem; font-weight: 750; }
.field-tabs button[aria-pressed="true"] { background: var(--paper); border-color: var(--forest); color: var(--forest); }
.field-tools { padding: 12px 13px 9px; display: flex; justify-content: space-between; align-items: center; gap: 6px; }
.field-tools h2 { font-size: 1.13rem; letter-spacing: .04em; }
.field-tools > div > span { display: block; font-size: .69rem; color: var(--muted); }
.sort { display: flex; flex-shrink: 0; border: 1px solid var(--line); border-radius: var(--tm-radius); overflow: hidden; }
.sort button { border: 0; background: #f7f6ee; padding: 0 8px; min-height: 37px; color: var(--muted); font-weight: 700; font-size: .67rem; }
.sort button + button { border-left: 1px solid var(--line); }
.sort button[aria-pressed="true"] { color: white; background: var(--forest); }
.sort button:focus-visible { outline-offset: -3px; }
.table-head, .horse-row { display: grid; grid-template-columns: 34px minmax(0, 1fr) 108px 53px; align-items: center; gap: 8px; padding-inline: 13px; }
.table-head { background: #eeede2; min-height: 29px; color: var(--muted); font-size: .66rem; }
.table-head span:nth-child(3) { text-align: center; }
.table-head span:last-child { text-align: right; }
.horse-row { text-align: left; min-height: 51px; width: 100%; border: 0; border-bottom: 1px solid #eae9df; background: var(--paper); }
.horse-row:hover { background: #f2f4e9; }
.horse-row:focus-visible { outline-offset: -2px; }
.horse-row.is-focused { background: #f1f4f2; }
.horse-row.is-picked { background: #e4eddf; }
.gate { display: inline-grid; place-items: center; min-width: 27px; width: 27px; height: 27px; color: white; font-weight: 800; font-size: .8rem; line-height: 1; border-radius: 5px; background: var(--gate); border: 1px solid #212a232b; font-variant-numeric: tabular-nums; flex-shrink: 0; }
.gate-light { color: #252c23; }
.horse-label { min-width: 0; line-height: 1.35; }
.horse-label > strong { display: block; color: #23372b; font-size: .87rem; }
.horse-label small { display: flex; align-items: center; flex-wrap: wrap; gap: 3px; color: var(--muted); font-size: .66rem; }
.horse-label small b { color: #6c4728; }
.silk { display: inline-block; height: 8px; width: 8px; border: 1px solid #27383065; border-radius: 50%; background: var(--silk, #b2794c); }
.horse-form { color: #486052; font-size: .72rem; font-weight: 750; text-align: center; }
.horse-odds { text-align: right; white-space: nowrap; font-size: .91rem; font-weight: 780; font-variant-numeric: tabular-nums; }
.paper-head, .horse-row.paper-row { display: grid; grid-template-columns: 28px minmax(57px, .65fr) minmax(38px, .5fr) minmax(0, 1fr) 48px 51px; grid-template-areas: "number name name name mark price" "number style last comment form price"; align-items: center; column-gap: 5px; padding: 5px 8px; }
.paper-head { color: #ecf2e7; background: #254837; font-size: .64rem; text-align: center; line-height: 1.25; row-gap: 1px; }
.paper-head .paper-name { justify-content: flex-start; text-align: left; }
.paper-row { min-height: 49px; row-gap: 3px; font-variant-numeric: tabular-nums; }
.paper-row:nth-of-type(even):not(.is-picked):not(:hover) { background: #f4f3e9; }
.paper-row > .gate, .paper-no { grid-area: number; }
.paper-name { grid-area: name; display: flex; align-items: baseline; flex-wrap: wrap; column-gap: 4px; }
.paper-name strong { font-size: .86rem; line-height: 1.25; }
.paper-mark { grid-area: mark; text-align: center; }
.paper-row .paper-mark { color: #963e2f; font-size: .95rem; font-weight: 800; line-height: 1; }
.paper-price { grid-area: price; display: grid; justify-items: end; text-align: right; line-height: 1.15; white-space: nowrap; }
.paper-row .paper-price { align-self: stretch; align-content: center; gap: 2px; border-left: 1px solid #dddfd1; }
.paper-price strong { font-size: .96rem; }
.paper-price strong small { margin-left: 1px; font-size: .63rem; }
.paper-price > span { color: #43564a; font-size: .67rem; }
.paper-style { grid-area: style; }
.paper-row .paper-style { display: grid; grid-template-columns: repeat(4, 1fr); align-items: center; justify-items: center; max-width: 60px; }
:is(.paper-style, .course-style) i { display: flex; align-items: center; justify-content: center; color: #899489; }
:is(.paper-style, .course-style) i::before, :is(.paper-style, .course-style) i.double::after { content: ""; width: 5px; height: 8px; background: currentColor; clip-path: polygon(0 50%, 100% 0, 100% 100%); }
:is(.paper-style, .course-style) i.active { color: #a62325; }
:is(.paper-style, .course-style) i.active::before, :is(.paper-style, .course-style) i.double::after { width: 6px; height: 9px; }
:is(.paper-style, .course-style) i.double::after { margin-left: -1px; }
.paper-last { grid-area: last; text-align: center; white-space: nowrap; }
.paper-row .paper-last { display: flex; flex-wrap: wrap; justify-content: center; column-gap: 3px; font-size: .61rem; line-height: 1.15; color: var(--muted); }
.paper-last b { color: var(--ink); }
.paper-comment { grid-area: comment; text-align: center; }
.paper-row .paper-comment { font-size: .65rem; line-height: 1.16; }
.paper-form { grid-area: form; justify-self: center; text-align: center; white-space: nowrap; }
.paper-row .paper-form { border-radius: 3px; padding: 1px 3px; background: #e8ebdf; color: #40554a; font-size: .64rem; font-weight: 700; }
.paper-row .paper-form.good { color: #245b3b; background: #d7ead9; }
.paper-row .paper-form.heavy { color: #744627; background: #f2e5d4; }
.paper-row .paper-form.rise { color: #4f7a3a; background: #e3ecd8; }
.paper-row .paper-form.dip { color: #8a5a32; background: #f3eadc; }
.paper-side, .paper-bet { color: #8b512c; font-size: .69rem; }
.paper-bet { color: #4b755b; }
.pick-display .gate { min-width: 23px; width: 23px; height: 22px; font-size: .73rem; }

.betting-panel { position: sticky; top: 10px; padding: 15px; }
.bet-heading { display: flex; justify-content: space-between; align-items: center; margin-bottom: 9px; }
.bet-heading h2 { font-size: 1.13rem; letter-spacing: .05em; }
.bet-status { color: #456252; font-size: .67rem; font-weight: 700; white-space: nowrap; }
.bet-status i { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: #3f775d; vertical-align: 1px; }
.bet-types { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; background: #f0eee3; padding: 3px; border-radius: var(--tm-radius); }
.bet-types button { background: transparent; border: 1px solid transparent; border-radius: 6px; min-height: 43px; color: #43584b; font-size: .77rem; font-weight: 760; }
.bet-types button[aria-pressed="true"] { background: var(--forest); color: white; }
.bet-slip { margin: 9px 0; padding: 2px 9px 4px; background: #f9f6eb; border: 1px solid #e8e0cd; border-radius: var(--tm-radius); }
.slip-line { display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: center; min-height: 34px; border-bottom: 1px solid #e5e1d4; }
.slip-label, .stake-line label, .projection span { font-size: .70rem; color: var(--muted); white-space: nowrap; }
.pick-display { color: #4a6155; display: flex; align-items: center; gap: 4px; font-size: .73rem; }
.slip-odds { color: var(--forest); font-size: .88rem; }
.stake-line { display: grid; grid-template-columns: auto 1fr auto; gap: 7px; align-items: center; min-height: 45px; }
.stake-field { display: grid; grid-template-columns: 30px minmax(24px, 57px) 30px; justify-content: start; }
.stake-field button, .stake-field input { padding: 0; min-height: 39px; text-align: center; border: 1px solid #d7d8cc; }
.stake-field button { background: #edeee5; font-weight: 800; }
.stake-field button:first-child { border-radius: 5px 0 0 5px; }
.stake-field button:last-child { border-radius: 0 5px 5px 0; }
.stake-field input { min-width: 0; width: 100%; color: var(--ink); border-inline: 0; background: #fffdf7; font-size: 16px; font-weight: 750; border-radius: 0; appearance: none; }
.projection { display: grid; justify-items: end; line-height: 1.12; gap: 2px; }
.projection strong { font-size: .86rem; font-variant-numeric: tabular-nums; }
.side-info { padding: 5px 0; display: grid; gap: 4px; color: var(--muted); font-size: .69rem; }
.side-info div { display: flex; justify-content: space-between; gap: 3px; }
.side-info b { color: var(--ink); }
.bet-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
.button { min-height: 44px; border: 1px solid transparent; border-radius: var(--tm-radius); padding: 7px 8px; font-weight: 760; font-size: .8rem; }
.primary { background: var(--forest); color: #fffefa; }
.primary:hover:not(:disabled) { background: #255b48; }
.primary:disabled { background: #e2e8dc; color: #566b5e; }
.secondary { background: var(--paper); border-color: #a2b1a1; color: var(--forest); }
.secondary:hover { background: #edf2e7; }
.wide { width: 100%; }
.notice { font-size: .72rem; font-weight: 700; margin-top: 5px; color: var(--forest); }
.notice:empty { display: none; }
.notice.error { color: #9d382b; }

.receipts { margin-top: 10px; padding: 12px 13px; }
.receipts h2 { font-size: .88rem; }
.receipts h2 small { margin-left: 5px; font-size: .68rem; color: var(--muted); }
.receipts ul, .ticket-results, #archive ul { list-style: none; padding: 0; }
.watch-page { max-width: 950px; }
#spectator { margin-top: 10px; }

.section-label { color: var(--accent); font-size: .72rem; font-weight: 800; letter-spacing: .1em; }
.placings { list-style: none; padding: 0; }
.rank { text-align: center; font-weight: 800; }
.result-actions { display: grid; gap: 5px; margin-top: 10px; }

#archive { width: min(92vw, 440px); max-height: min(85dvh, calc(100svh - 24px)); padding: 0; border: 1px solid #8a9a8b; border-radius: 8px; background: var(--paper); color: var(--ink); overflow-y: auto; overscroll-behavior: contain; }
#archive::backdrop { background: #142b25a8; }
.archive-head { position: sticky; top: 0; z-index: 1; display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 14px; border-bottom: 1px solid #e2e8e4; background: #fff; }
.archive-head form button { min-height: 0; height: 28px; padding: 0 10px; border: 1px solid #9aa4ad; border-radius: 3px; background: #fff; color: var(--tm-ink); font-size: .72rem; font-weight: 800; }
.archive-title-wrap { display: flex; align-items: center; gap: 7px; }
.archive-title-wrap h2 { margin: 0; font-size: 1rem; font-weight: 900; }
.archive-title-wrap .help-button { width: 24px; height: 24px; padding: 0; display: grid; place-items: center; border-color: #9aa4ad; background: #fff; color: var(--tm-ink); font-size: .74rem; }
.archive-help { padding: 9px 14px; border-bottom: 1px solid #d9e4dd; background: #f6faf7; font-size: .7rem; }
.archive-help dl { margin: 0; display: grid; gap: 5px; }
.archive-help dl > div { display: grid; grid-template-columns: 70px minmax(0, 1fr); gap: 6px; align-items: baseline; }
.archive-help dt { font-weight: 800; color: var(--tm-ink); }
.archive-help dd { margin: 0; color: #3d4a42; line-height: 1.45; }
.archive-summary { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; padding: 9px 12px; border-bottom: 1px solid #e2e8e4; background: #f4f7f5; }
.arc-stat { padding: 5px 4px; border: 1px solid #e0e7e2; border-radius: 5px; background: #fff; text-align: center; }
.arc-stat small { display: block; color: var(--tm-muted); font-size: .62rem; font-weight: 700; }
.arc-stat b { display: block; margin-top: 1px; color: var(--tm-ink); font-size: .78rem; font-weight: 900; white-space: nowrap; }
.arc-stat b.is-plus { color: var(--tm-turf-deep); }
.arc-stat b.is-minus { color: #b93838; }
.archive-tabs { display: grid; grid-template-columns: 1fr 1fr; border-bottom: 1px solid #e2e8e4; background: #fff; }
.archive-tabs button { min-height: 36px; padding: 6px 8px; border: 0; border-bottom: 2px solid transparent; background: transparent; color: var(--tm-muted); font-size: .76rem; font-weight: 800; cursor: pointer; }
.archive-tabs button[aria-selected="true"] { border-bottom-color: var(--tm-turf-deep); color: var(--tm-turf-deep); }
.archive-pane { padding: 4px 14px 14px; }
.archive-list { margin: 0; padding: 0; list-style: none; }
.arc-row, .arc-album-row { padding: 8px 0; border-bottom: 1px solid #edf1ee; }
.arc-row:last-child, .arc-album-row:last-child { border-bottom: 0; }
.arc-top, .arc-sub { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.arc-sub { margin-top: 2px; font-size: .7rem; color: var(--tm-muted); }
.arc-race { display: flex; align-items: center; gap: 6px; min-width: 0; font-size: .8rem; }
.arc-race strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--tm-ink); font-weight: 800; }
.arc-net { flex: none; font-size: .8rem; font-weight: 900; }
.arc-net.is-plus { color: var(--tm-turf-deep); }
.arc-net.is-minus { color: #b93838; }
.arc-watch { flex: none; padding: 1px 7px; border: 1px solid #cbd5e1; border-radius: 3px; background: #fff; color: #374151; font-size: .64rem; font-weight: 800; }
.arc-win { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #27302c; font-weight: 600; }
.arc-r1 { margin-right: 5px; font-style: normal; font-weight: 800; color: var(--tm-muted); }
.arc-pay { flex: none; color: var(--tm-muted); font-weight: 600; }
.arc-album-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.arc-album-main { min-width: 0; }
.arc-album-horse { display: flex; align-items: center; gap: 6px; font-size: .82rem; color: var(--tm-ink); }
.arc-album-horse strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 900; }
.arc-owner-chip { flex: none; padding: 1px 5px; border: 1px solid rgba(180, 90, 6, .35); border-radius: 3px; background: rgba(180, 90, 6, .1); color: #b45a06; font-size: .6rem; font-weight: 800; }
.arc-album-race { display: flex; align-items: center; gap: 5px; margin-top: 3px; font-size: .7rem; color: var(--tm-muted); }
.arc-album-meta { flex: none; text-align: right; display: grid; gap: 1px; }
.arc-album-prize { font-size: .76rem; font-weight: 800; color: var(--tm-ink); }
.arc-album-day { font-size: .64rem; color: var(--tm-muted); font-weight: 700; }
.arc-empty { margin: 0; padding: 26px 8px; display: grid; justify-items: center; gap: 7px; text-align: center; }
.arc-empty strong { font-size: .8rem; color: var(--tm-ink); }
.arc-empty span { padding: 4px 11px; border: 1px solid #dce4df; border-radius: 999px; background: #f3f6f4; color: #3f5046; font-size: .68rem; font-weight: 700; }

@media (max-width: 700px) {
  /* B-6b: a little more room at the sides and the bottom (and the notch's own inset), so a phone's rounded corners do not cut a button's edge */
  .main { padding: 10px max(14px, env(safe-area-inset-right)) calc(22px + env(safe-area-inset-bottom)) max(14px, env(safe-area-inset-left)); }
  .bet-grid { display: block; padding-bottom: var(--bet-dock, 225px); }
  html:has(.betting-panel) { scroll-padding-bottom: calc(var(--bet-dock, 225px) + 8px); }
  .table-head, .horse-row { grid-template-columns: 29px minmax(0, 1fr) 93px 45px; gap: 5px; padding-inline: 8px; }
  .horse-row { min-height: 48px; }
  .field-tabs button { min-height: 44px; }
  .field-tools { padding: 7px 8px; }
  .field-tools h2 { font-size: 1.02rem; }
  .betting-panel { position: fixed; z-index: 2; inset: auto 0 0; padding: 7px max(16px, env(safe-area-inset-right)) calc(20px + env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left)); border-radius: var(--tm-radius) 12px 0 0; border-bottom: 0; box-shadow: 0 -7px 20px #243a3020; }
  .bet-heading { margin-bottom: 4px; }
  .bet-heading h2 { font-size: 1rem; }
  .bet-types button { min-height: 40px; }
  .bet-slip { margin-block: 5px; }
  .betting-panel.is-empty .bet-slip { display: none; }
  .betting-panel.is-empty .bet-actions { margin-top: 5px; }
}

@media (max-width: 350px) {
  .table-head, .horse-row { grid-template-columns: 27px minmax(0, 1fr) 84px 40px; gap: 3px; }
  .table-head { font-size: .61rem; }
  .paper-head, .horse-row.paper-row { padding-inline: 5px; column-gap: 3px; grid-template-columns: 26px 53px minmax(36px, .6fr) minmax(0, 1fr) 44px 42px; }
  .paper-row .gate { min-width: 24px; width: 24px; }
}

@media (max-height: 550px) and (max-width: 700px) {
  .bet-grid { padding-bottom: 0; }
  html:has(.betting-panel) { scroll-padding-bottom: 0; }
  .betting-panel { position: static; margin-top: 9px; border: 1px solid var(--line); border-radius: var(--tm-radius); }
}

/* Shared columns keep the headings aligned with each horse at phone widths. */
.course-paper-head, .horse-row.course-paper-row {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr) 46px 60px 76px 28px;
  align-items: center;
  column-gap: 3px;
  padding: 4px 6px;
}
.horse-row.course-paper-row { min-height: 55px; }
.course-paper-row > .gate { width: 24px; min-width: 24px; }
.course-tabs { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.course-field-condition { color: var(--muted); font-size: .67rem; }
.course-paper-head { background: #e4ebdd; color: #294339; font-size: .64rem; text-align: center; }
.course-paper-head > span:first-child { grid-column: 1 / 3; text-align: left; padding-left: 27px; }
.course-opinion-head, .course-opinions {
  display: grid;
  justify-items: center;
  gap: 2px;
  padding-left: 3px;
  min-width: 0;
}
.course-opinions { border-left: 1px solid #d2dbd0; }
/* The dark head has no white line between 短評 and the four papers' names. */
.course-opinion-head { padding-left: 4px; border-left: 0; }
.course-mark-group {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  align-items: center;
  justify-content: center;
  text-align: center;
  width: 100%;
}
.course-opinions .course-mark-group { font-size: 1rem; color: #263630; font-weight: 800; line-height: 1; min-height: 17px; }
.course-mark-group .is-unmarked { color: #6c786c; font-size: .8rem; }
.course-short-comment { display: grid; justify-items: center; gap: 1px; color: #3f4c45; font-size: .68rem; font-weight: 700; line-height: 1.2; text-align: center; }
.course-short-comment span { white-space: nowrap; }
.course-mark-group .steady { color: #245e94; }
.course-mark-group .longshot { color: #a14c27; }
.course-paper-row:nth-of-type(even):not(.is-picked):not(:hover) { background: #f4f3e9; }
.course-horse { display: grid; grid-template-columns: minmax(0, 1fr); min-width: 0; gap: 3px; }
.course-horse-name { display: flex; align-items: baseline; gap: 3px; min-width: 0; line-height: 1.25; }
.course-horse-name strong { min-width: 0; overflow-wrap: anywhere; text-wrap: balance; font-size: .86rem; }
.course-run-line { display: grid; justify-items: start; gap: 1px; }
.course-style { display: flex; align-items: center; justify-content: flex-end; gap: 2px; min-height: 9px; width: 69px; }
.course-style i { color: #889387; }
.recent-results { display: flex; gap: 2px; }
/* A box grows for a two-figure place (10着〜) instead of the figures running into the next box. */
.recent-result { display: grid; place-items: center; min-width: 15px; height: 14px; padding: 0 2px; background: #555f5c; color: white; border-radius: 2px; font: 800 .58rem/1 var(--ui-font); font-variant-numeric: tabular-nums; letter-spacing: -.05em; }
.recent-result.g1 { background: #245e94; }
.recent-result.g2 { background: #9f3c42; }
.recent-result.g3 { background: #306a4a; }
.recent-result.is-empty { background: #e8e9de; color: #69796d; }
/* 調子: white with a thin frame and a clear arrow (up red, a little up orange, level grey, a little down blue, down navy) */
.course-form { display: grid; place-items: center; width: 28px; height: 28px; border: 1px solid #d3d9df; background: #fff; color: #55605a; border-radius: 3px; }
.course-form i { width: 18px; height: 17px; background: currentColor; clip-path: polygon(0 33%,48% 33%,48% 2%,100% 50%,48% 98%,48% 67%,0 67%); }
.course-form.good { color: #d61f26; }
.course-form.good i { transform: rotate(-90deg); }
.course-form.heavy { color: #1e3a8a; }
.course-form.heavy i { transform: rotate(90deg); }
.course-form.rise { color: #d97706; }
.course-form.rise i { transform: rotate(-45deg); }
.course-form.dip { color: #2563eb; }
.course-form.dip i { transform: rotate(45deg); }
.course-price { display: grid; justify-items: center; align-content: center; gap: 1px; min-width: 0; white-space: nowrap; font-size: .91rem; line-height: 1.1; }
.course-price small { color: var(--muted); font-size: .62rem; font-weight: 700; line-height: 1; }
/* Every horse's popularity in the same small tag. */
.course-price .course-pop { margin-top: 3px; padding: 2px 5px; border-radius: 2px; background: #1f2622; color: #fff; font-size: .64rem; line-height: 1.1; letter-spacing: .02em; }
.course-style-line .course-age { flex-shrink: 0; font-size: .58rem; font-weight: 800; color: #6b5a3a; line-height: 1; }
.course-style-line .course-age.sex-colt { color: #1f5fb4; }
.course-style-line .course-age.sex-filly { color: #c8263a; }
.course-style-line .course-age.sex-gelding { color: #4f6b5b; }
.course-horse-name.is-long strong { font-size: .76rem; letter-spacing: -.02em; }
.course-price .low-odds, .paper-price .low-odds, .horse-odds .low-odds { color: #a62325; }
@media (max-width: 374px) {
  /* 近5走 needs about 84px for five two-figure boxes: a narrower gutter and mark column leave it that. */
  .course-paper-head, .horse-row.course-paper-row { grid-template-columns: 22px minmax(0, 1fr) 40px 54px 60px 24px; column-gap: 3px; padding-inline: 4px; }
  .main:has(.course-paper-row) { padding-inline: 6px; }
  .course-paper-head > span:first-child { padding-left: 25px; }
  .course-style { width: 64px; }
  .course-paper-row > .gate { width: 22px; min-width: 22px; }
  .course-form { width: 24px; height: 25px; }
  .course-opinions .course-mark-group { font-size: .79rem; }
  .course-horse-name strong { font-size: .81rem; }
  .course-price { font-size: .84rem; }
  .course-horse-name.is-long strong { font-size: .72rem; }
  .course-short-comment { font-size: .62rem; }
}
.course-interviews article { display: flex; gap: 8px; padding: 12px; }
.course-interviews article + article { border-top: 1px solid #e6e4d8; }
.course-interviews h3, .course-interviews p { margin: 0 0 4px; }
.course-interviews p { font-size: .80rem; }


.course-portrait { width:20px; height:20px; border-radius:50%; background:#d1e4d6; position:relative; display:inline-block; flex-shrink:0; overflow:hidden; }
.course-portrait.longshot { background:#efd5bc; }
.course-portrait::before { content:""; position:absolute; width:57%; height:60%; top:18%; left:22%; border-radius:45%; background:#dab189; box-shadow:0 -.15em 0 .08em #2c453b; }
.course-portrait.longshot::before { background:#d5a27e; box-shadow:0 -.17em 0 .09em #77573c; }
.course-portrait::after { content:""; position:absolute; width:76%; height:37%; left:12%; bottom:-11%; background:#4b7762; border-radius:45% 45% 0 0; }
.course-portrait.longshot::after { background:#a45239; }
.course-portrait i { position:absolute; width:10%; height:9%; background:#2d322a; border-radius:50%; left:36%; top:44%; box-shadow:.34em 0 #2d322a; }
.course-portrait.steady i { box-shadow:.34em 0 #2d322a,0 0 0 1px #41392b,.34em 0 0 1px #41392b; }
.course-interviews .course-portrait { width: 32px; height: 32px; }
.course-paddock { background: #e4ebdd; }
.course-paddock canvas { display: block; width: 100%; max-width: 470px; margin: auto; }
.course-paddock p { padding: 3px 10px; margin: 0; font-size: .76rem; text-align: center; }

/* Mark column heads: one short name over each paper's column. */
.course-paper-head .course-opinion-head .course-mark-group { font-size: .5rem; white-space: nowrap; font-weight: 700; color: #294339; letter-spacing: -.02em; }
/* Jockey beside the run line (program races). */
.course-style-line { display: flex; align-items: center; gap: 4px; white-space: nowrap; min-width: 0; }
.course-style-line .course-jockey { flex-shrink: 0; font-size: .6rem; line-height: 1; font-weight: 700; color: #3d4f46; white-space: nowrap; }
.paper-name .paper-jockey { margin-left: 4px; font-size: .62rem; color: #3d4f46; font-weight: 700; }
/* Eight ticket buttons in two rows of four. */
.bet-types { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 4px; }
.bet-types button { min-width: 0; min-height: 36px; padding-left: 2px; padding-right: 2px; font-size: .78rem; white-space: nowrap; }
.pick-display .pick-arrow { margin: 0 2px; font-style: normal; font-weight: 800; color: #6b7d72; }
/* The style arrows take only their own width beside the sex/age and the jockey (a 3-character
   name such as 朝比奈 ran into the odds column). */
.course-style-line .course-style { width: auto; gap: 1px; }
.course-style-line { max-width: 100%; overflow: hidden; }
.recent-results .recent-debut { font-style: normal; font-size: .58rem; font-weight: 800; color: #8a5a20; letter-spacing: .02em; }

/* Race bar: see below (UI改修 1段目). */
.bet-grid { margin-top: 8px; }
/* ながし・ボックス */
.bet-methods { display: grid; grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 4px; margin-top: 5px; }
.bet-methods button { min-height: 34px; border: 1px solid #d6d6c6; border-radius: 6px; background: #fbfaf3; color: #43584b; font-size: .74rem; font-weight: 760; }
.bet-methods button[aria-pressed="true"] { border-color: #a5803a; background: #f6e7c2; color: #5b3f12; }
.pick-display { flex-wrap: wrap; row-gap: 3px; }
.pick-role { padding: 1px 4px; border-radius: 3px; background: #2b5a45; color: #fff8e6; font-size: .62rem; font-weight: 800; }
.pick-role + .gate { margin-right: 4px; }
.pick-display small { color: var(--muted); font-size: .66rem; }
.slip-spread { display: flex; justify-content: space-between; gap: 8px; padding: 4px 0; border-bottom: 1px solid #e5e1d4; color: var(--muted); font-size: .7rem; }
.slip-spread b { color: var(--ink); }
.horse-row.is-axis { background: #f6e7c2; }
.course-interviews p { line-height: 1.55; }
.talk-ticket { display: inline-block; margin-top: 2px; padding: 2px 7px; border-radius: 4px; background: #e4eddf; color: #23513d; font-size: .68rem; font-weight: 800; }
.talk-ticket.longshot { background: #f7e3d3; color: #8a3a22; }

/* Result: order with margins and odds, payouts, and a recap that reads at a glance. */
/* The name takes only what a long name needs (about 9 letters); 着差・通過・上3F share the rest, each centred
   under its label, and 通過 is wide enough for four corners of a 16-runner field (16-14-13-12). */
.placing-name { display: grid; min-width: 0; line-height: 1.2; }
.placing-name strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.placing-odds { display: grid; justify-items: end; line-height: 1.1; font-variant-numeric: tabular-nums; }
.placing-odds b { font-size: .8rem; }
.placing-odds small { color: var(--muted); font-size: .58rem; }

.last3f { text-align: center; font-size: .74rem; font-weight: 750; font-variant-numeric: tabular-nums; }

/* 上がり3F: the three fastest, 1 red, 2 blue, 3 green. */

/* 厩舎 (所有馬) */
.paper-owner { margin-left: 3px; padding: 0 4px; border-radius: 3px; background: #7a3f9e; color: #fff; font-size: .58rem; vertical-align: 1px; }

/* Race bar: line 1 the race and the medals, line 2 the conditions and the buttons. */
.race-bar { display: grid; gap: 5px; padding: 7px 10px 7px; border-radius: var(--tm-radius); color: #fff; background: var(--tm-turf); }
.race-bar[data-surface="dirt"] { background: var(--tm-dirt); }
.race-bar-line { display: flex; align-items: center; gap: 6px; min-width: 0; }
.race-bar .race-no { flex: none; padding: 2px 7px; border-radius: 3px; background: #fff; color: var(--tm-turf); font-size: .9rem; font-weight: 900; line-height: 1.1; }
.race-bar[data-surface="dirt"] .race-no { color: var(--tm-dirt); }
.race-bar h1 { flex: 1; min-width: 0; overflow: hidden; font-size: .98rem; font-weight: 900; white-space: nowrap; text-overflow: ellipsis; }
/* The medals: plain white figures, no coin, no frame, no yellow. */
.race-bar-wallet { flex: none; display: flex; align-items: baseline; gap: 2px; color: #fff; }
.race-bar-wallet strong { color: #fff; font-size: 1.15rem; font-weight: 900; line-height: 1; }
.race-bar-wallet i { color: #fff; opacity: .9; font-size: .62rem; font-style: normal; font-weight: 800; }
.race-bar-line.sub { justify-content: space-between; }
.race-bar-meta { min-width: 0; display: flex; gap: 3px; overflow: hidden; }
.meta-chip { display: inline-flex; align-items: center; gap: 3px; height: 19px; padding: 0 5px; border-radius: 2px; background: #ffffff24; border: 1px solid #ffffff38; color: #fff; font-size: .64rem; font-weight: 800; line-height: 1; white-space: nowrap; }
.meta-chip.solid { background: #fff; border-color: #fff; color: var(--tm-ink); }
.meta-chip svg { width: 11px; height: 11px; flex: none; }
.race-bar-actions { flex: none; display: flex; gap: 4px; }
.race-bar-button { min-height: 26px; padding: 0 8px; border: 1px solid #ffffff7a; border-radius: 3px; background: #ffffff1f; color: #fff; font-size: .66rem; font-weight: 800; }
/* ? : the screen's own help. Glows until it has been opened once. */
.help-button { flex: none; width: 24px; height: 24px; display: inline-grid; place-items: center; padding: 0; border: 1px solid #ffffff85; border-radius: 3px; background: #ffffff1f; color: #fff; font-size: .74rem; font-weight: 900; line-height: 1; }
.help-button.new { animation: help-glow 1.6s ease-in-out infinite; }
@keyframes help-glow { 0%, 100% { box-shadow: 0 0 0 0 #ffffff00; } 50% { box-shadow: 0 0 0 4px #ffffff70; } }
dialog.help { width: min(92vw, 420px); max-height: min(82dvh, calc(100svh - 32px)); margin: auto; padding: 0 12px 12px; border: 1.5px solid var(--tm-ink); border-radius: 5px; background: #fff; color: var(--tm-ink); overflow-y: auto; overscroll-behavior: contain; }
dialog.help::backdrop { background: #11161394; }
.help-head { position: sticky; top: 0; z-index: 1; display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 12px 0 7px; background: #fff; border-bottom: 1.5px solid var(--tm-ink); }
.help-head h2 { font-size: .9rem; font-weight: 900; }
.help-head button { padding: 2px 9px; border: 1px solid #9aa4ad; border-radius: 3px; background: #fff; font-size: .72rem; font-weight: 800; }
.help code { font-family: var(--num-font); font-weight: 800; }
.race-bar-button.refill { background: #c8352a; border-color: #ffffff66; color: #fff; }
/* Grade chips: GⅠ blue, GⅡ red, GⅢ green, OP amber, the classes below grey. */
.grade-chip { flex: none; display: inline-grid; place-items: center; min-width: 30px; padding: 1px 5px; border-radius: 3px; background: #5f6b64; color: #fff; font-size: .62rem; font-style: normal; font-weight: 800; line-height: 1.35; }
.grade-chip.op, .recent-result.op { background: #c27a12; }
.grade-chip.g1 { background: #245e94; } .grade-chip.g2 { background: #9f3c42; } .grade-chip.g3 { background: #306a4a; }
/* パドック中継 */
.spotlight { display: grid; grid-template-columns: 46% minmax(0, 1fr); gap: 8px; align-items: center; margin-top: 6px; padding: 5px; border-radius: var(--tm-radius); background: #1d3328; color: #f7f0dc; }
.spot-canvas { position: relative; overflow: hidden; border-radius: 6px; background: #b8d2a6; }
.spot-canvas canvas { display: block; width: 100%; height: auto; max-width: none; }
.spot-live { position: absolute; left: 4px; top: 4px; padding: 0 5px; border-radius: 3px; background: #c8352a; color: #fff; font-size: .56rem; font-weight: 800; }
.spot-info p { margin: 0; }
.spot-name { display: flex; align-items: center; gap: 5px; min-width: 0; }
.spot-name .gate { width: 22px; min-width: 22px; height: 21px; font-size: .72rem; }
.spot-name strong { overflow: hidden; font-size: .9rem; white-space: nowrap; text-overflow: ellipsis; }
.spot-odds { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 5px; margin-top: 3px !important; }
.spot-odds > * { white-space: nowrap; }
.spot-odds b { color: #ffd77a; font: 700 1.25rem/1 var(--ui-font); font-variant-numeric: tabular-nums; }
.spot-odds small { color: #d9d2bb; font-size: .64rem; }
.spot-form { margin-left: auto; padding: 1px 6px; border-radius: 3px; background: #ffffff1c; font-size: .62rem; font-weight: 700; }
.spot-comment { margin-top: 3px !important; color: #e9e2c8; font-size: .7rem; }
/* 厩舎: rows like the paper's */

/* 厩舎: rows made like the paper's (same name size, run boxes, style arrows, sex colours); the price and
   prize money in the odds column's type. */
/* 所有馬 on the paper: a small chip on the run line (the name keeps its width) and a purple edge. */
.course-style-line .paper-owner { flex-shrink: 0; margin: 0; padding: 1px 3px; font-size: .52rem; line-height: 1.1; vertical-align: 0; }
.horse-row.is-mine { background: #f6f2fa; }
.side-closed { margin: 4px 0 0; color: var(--muted); font-size: .66rem; }
/* 予想士 in the paper: one line each (their ticket), tapped open for their words. */
.talk-strip { display: grid; border-top: 1px solid #e6e4d8; }
.talk-line + .talk-line { border-top: 1px solid #eeece2; }
.talk-line summary { display: flex; align-items: center; gap: 6px; min-height: 34px; padding: 4px 8px; list-style: none; cursor: pointer; font-size: .7rem; }
.talk-line summary::-webkit-details-marker { display: none; }
.talk-line summary::after { content: "▸"; margin-left: auto; color: #7d8a80; font-size: .7rem; }
.talk-line[open] summary::after { content: "▾"; }
.talk-line summary b { flex-shrink: 0; font-size: .7rem; }
.talk-line .talk-ticket { margin: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-size: .64rem; }
.talk-line p { margin: 0; padding: 0 10px 8px 34px; font-size: .74rem; line-height: 1.5; }
.bet-types button:disabled { color: #a3aaa0; text-decoration: line-through; text-decoration-thickness: 1px; }

/* 出走登録 (㊵): the 所有馬 and their choices of race, and the day's eight races. */
/* ㊶ 2場開催 and the main races ahead. */


/* ㊸ 騎手 on the 出走登録. */

/* ===== UI改修 2段目: 出走表と投票ドック ===== */
/* Badges: 所有 (purple star) and 1日馬主 (amber crown), after the jockey. */
.badge-owner, .badge-side { display: inline-flex; align-items: center; gap: 2px; flex: none; padding: 1px 4px; border-radius: 2px; color: #fff; font-size: .54rem; font-weight: 900; line-height: 1.15; }
.badge-owner { background: var(--tm-owner); }
.badge-side { background: var(--tm-side); }
.badge-owner svg, .badge-side svg { width: 9px; height: 9px; }
.order-tri { width: 8px; height: 8px; color: #78847e; flex: none; margin: 0 1px; }
.pick-dash { font-style: normal; color: #9aa4ad; font-weight: 900; margin: 0 1px; }
.receipt-picks { display: inline-flex; align-items: center; vertical-align: middle; }
.receipt-picks .gate { width: 20px; min-width: 20px; height: 20px; font-size: .68rem; }
/* パドック: a white strip, the canvas on the left. */
.spotlight { grid-template-columns: 112px minmax(0, 1fr); gap: 9px; padding: 6px 10px; border: 0; border-bottom: 1.5px solid var(--tm-line); border-radius: 0; background: #fff; color: var(--tm-ink); }
.spot-canvas { border: 1px solid #c3cbd2; border-radius: 3px; }
.spot-live { background: var(--tm-red); border-radius: 2px; }
.spot-name strong { font-size: .84rem; font-weight: 900; }
.spot-odds b { color: var(--tm-ink); font: 900 1.2rem/1 var(--num-font); }
.spot-odds b.low-odds { color: var(--tm-red); }
.spot-odds b small { font-size: .64rem; }
.spot-odds small { color: var(--tm-muted); font-weight: 800; }
.spot-form { background: var(--tm-surface-alt); color: #2e3833; font-weight: 800; }
.spot-comment { display: flex; gap: 6px; align-items: baseline; color: #2e3833; font-size: .7rem; font-weight: 700; }
.spot-comment small { margin-left: auto; color: var(--tm-muted); font-size: .64rem; }
/* One utility row: the forecasters' chip, and 馬番 | オッズ. */
.field-tools.util-bar { position: relative; display: block; padding: 4px 8px; background: var(--tm-surface-alt); border-bottom: 1px solid var(--tm-line); }
.util-bar .sort button { padding: 0 9px; background: transparent; color: #3a4540; font-size: .66rem; font-weight: 800; }
.util-bar .sort button[aria-pressed="true"] { background: var(--tm-ink); color: #fff; }
.course-field-condition { display: none; }
/* The table: a dark sticky head, plain rows, the picked row with a 4px line in the course colour. */
.course-paper-head { position: sticky; top: 0; z-index: 1; background: #222925; color: #fff; font-weight: 800; }
.course-paper-head .course-opinion-head .course-mark-group { color: #fff; }
.horse-row.course-paper-row { background: #fff; border-bottom: 1px solid var(--tm-line); border-radius: 0; }
.course-paper-row:nth-of-type(even):not(.is-picked):not(:hover) { background: #f6f8fa; }
.horse-row.course-paper-row.is-picked { background: var(--tm-select-turf); box-shadow: inset 0 0 0 1px var(--tm-turf); }
.field[data-surface="dirt"] .horse-row.course-paper-row.is-picked { background: var(--tm-select-dirt); box-shadow: inset 0 0 0 1px var(--tm-dirt); }
.course-price strong { font-family: var(--num-font); font-weight: 900; color: var(--tm-ink); }
.course-price strong.low-odds { color: var(--tm-red); }
.course-pop { font-family: var(--num-font); background: transparent !important; color: #5c6862 !important; font-weight: 800; }
.course-price, .course-short-comment, .course-opinions { border-left: 1px solid #dde2e7; }
/* The dock: 4 x 2 ticket types, no headings, quick stakes, plain buttons. */
.betting-panel { border-top: 2px solid var(--tm-turf); border-radius: 0; }
.betting-panel[data-surface="dirt"] { border-top-color: var(--tm-dirt); }
.bet-heading, .bet-status, .slip-label, .side-closed { display: none; }
.bet-types { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 4px; padding: 0; background: transparent; }
.bet-types button { min-height: 27px; height: 27px; padding: 0 4px; border: 1px solid #c3cbd3; border-radius: 3px; background: #f3f5f7; color: #26302b; font-size: .7rem; font-weight: 800; display: inline-flex; align-items: center; justify-content: center; gap: 3px; }
.bet-types button[aria-pressed="true"] { background: var(--tm-turf); border-color: var(--tm-turf); color: #fff; }
.betting-panel[data-surface="dirt"] .bet-types button[aria-pressed="true"] { background: var(--tm-dirt); border-color: var(--tm-dirt); }
.bet-types .side-tab { border-color: #d6a46c; background: #fbf5ee; color: #8f4704; }
.bet-types .side-tab svg { width: 10px; height: 10px; }
.bet-types .side-tab[aria-pressed="true"] { background: var(--tm-side) !important; border-color: var(--tm-side) !important; color: #fff; }
.bet-types button:disabled { opacity: .42; background: #eceff2; border-color: #d3d9df; color: #77827c; text-decoration: none; }
.bet-slip { margin: 6px 0; padding: 4px 8px; border: 1px solid #cfd6dd; border-radius: var(--tm-radius); background: #f7f9fb; }
.betting-panel.is-side .bet-slip { border-color: #d6a46c; background: #fbf6f0; }
.slip-line { grid-template-columns: auto 1fr auto; gap: 6px; min-height: 30px; border-bottom: 1px solid #e1e6eb; }
.slip-type { padding: 1px 5px; border-radius: 2px; background: var(--tm-turf); color: #fff; font-size: .62rem; font-weight: 800; white-space: nowrap; }
.betting-panel[data-surface="dirt"] .slip-type { background: var(--tm-dirt); }
.betting-panel.is-side .slip-type { background: var(--tm-side); }
.pick-display { display: flex; align-items: center; flex-wrap: wrap; gap: 2px; font-size: .7rem; color: var(--tm-muted); }
.slip-odds { font-size: 1rem; font-weight: 900; }
.betting-panel.is-side .slip-odds { color: #8f4704; font-size: .86rem; }
.stake-line { grid-template-columns: auto auto 1fr; gap: 6px; min-height: 36px; }
.stake-quick { display: flex; gap: 3px; }
.stake-quick button { height: 26px; padding: 0 7px; border: 1px solid #bfc7cf; border-radius: 3px; background: #fff; font-size: .7rem; font-weight: 800; }
.stake-quick button[aria-pressed="true"] { border-color: var(--tm-turf); background: var(--tm-select-turf); }
.stake-field { grid-template-columns: 26px minmax(34px, 54px) 26px; }
.stake-field button, .stake-field input { min-height: 26px; height: 26px; border-color: #bfc7cf; }
.stake-field button { background: #f3f5f7; }
.stake-field button:first-child { border-radius: 3px 0 0 3px; }
.stake-field button:last-child { border-radius: 0 3px 3px 0; }
.stake-field input { background: #fff; font-family: var(--num-font); }
.projection { display: flex; align-items: baseline; justify-content: flex-end; gap: 4px; }
.projection span { font-size: .62rem; font-weight: 800; color: var(--tm-muted); }
.projection strong { color: var(--tm-turf); font-size: .95rem; font-weight: 900; }
.betting-panel[data-surface="dirt"] .projection strong { color: var(--tm-dirt); }
.side-info { display: flex; justify-content: space-between; align-items: baseline; padding-top: 4px; font-size: .7rem; font-weight: 800; color: #6b4b2a; }
.side-info strong { font-size: .95rem; color: var(--tm-ink); }
.bet-actions { grid-template-columns: 1fr 1fr; gap: 6px; }
.bet-actions .button { min-height: 36px; border-radius: var(--tm-radius); }
.bet-actions .button.secondary { background: #fff; border: 1.5px solid #8f9aa3; color: var(--tm-ink); }
.bet-actions .button.primary { background: var(--tm-turf); }
.betting-panel[data-surface="dirt"] .bet-actions .button.primary { background: var(--tm-dirt); }
.betting-panel.is-side .bet-actions .button.primary { background: var(--tm-side); }
.bet-methods button { border-radius: 3px; }
.projection strong { white-space: nowrap; font-size: .9rem; }
.bet-methods { gap: 4px; margin-top: 4px; }
.bet-methods button { min-height: 26px; border: 1px solid #c3cbd3; border-radius: 3px; background: #fff; color: #26302b; font-size: .68rem; font-weight: 800; }
.bet-methods button[aria-pressed="true"] { background: var(--tm-ink); border-color: var(--tm-ink); color: #fff; }

/* ===== UI改修 2段目b: 大きいパドック、馬体重、予想家の顔 ===== */
.spotlight { grid-template-columns: 54% minmax(0, 1fr); gap: 10px; padding: 8px 10px; }
.spot-name strong { font-size: .92rem; }
.spot-odds b { font-size: 1.35rem; }
.spot-facts { display: grid; grid-template-columns: auto 1fr; align-items: baseline; gap: 2px 7px; margin: 5px 0 0; font-size: .72rem; }
.spot-facts dt { color: var(--tm-muted); font-weight: 700; }
.spot-facts dd { margin: 0; font-weight: 900; color: var(--tm-ink); }
.spot-facts dd small { font-size: .62rem; font-weight: 700; margin-left: 1px; }
.weight-change { font-weight: 800; color: var(--tm-muted); }
.weight-change.up { color: var(--tm-red); }
.weight-change.down { color: var(--tm-blue); }
.forecaster-face { display: block; flex: none; border-radius: 50%; background: #eef2f0; }
.forecaster-faces { display: flex; }
.forecaster-faces .forecaster-face + .forecaster-face { margin-left: -5px; }
.talk-line.is-locked { color: var(--tm-muted); }
.talk-line.is-locked .forecaster-face { filter: grayscale(1); opacity: .7; }
.lock-icon { width: 11px; height: 11px; vertical-align: -1px; margin-right: 3px; }

/* ===== UI改修 3段目（作業1）: 予想家の案B、近5走、細部 ===== */
/* One row: [顔×2] 予想家 ▾ on the left, 馬番 | オッズ (two equal halves) on the right, both 28px. */
.field-tools.util-bar { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.util-bar .sort { position: static; display: grid; grid-template-columns: 1fr 1fr; width: 108px; height: 28px; border: 1px solid #b5bfc8; border-radius: 3px; background: #fff; }
.util-bar .sort button { min-height: 0; height: 26px; padding: 0 4px; text-align: center; }
.talk-bar { display: inline-flex; align-items: center; gap: 5px; height: 28px; min-width: 0; padding: 0 8px 0 3px; border: 1px solid #b5bfc8; border-radius: 3px; background: #fff; color: var(--tm-ink); font-family: var(--ui-font); font-size: .7rem; font-weight: 800; white-space: nowrap; }
.talk-bar:hover { background: var(--tm-surface-alt); }
.talk-bar-caret { color: var(--tm-muted); font-size: .62rem; }
/* The sheet: from the bottom on a phone, in the middle on a wide screen. */
dialog.talk-sheet { width: min(100vw, 460px); max-width: 100vw; max-height: 80dvh; margin: auto auto 0; padding: 0; border: 0; border-top: 2px solid var(--tm-turf); border-radius: 4px 4px 0 0; background: var(--tm-surface); color: var(--tm-ink); font-family: var(--ui-font); overflow-y: auto; }
.field[data-surface="dirt"] dialog.talk-sheet { border-top-color: var(--tm-dirt); }
dialog.talk-sheet::backdrop { background: #11161394; }
@media (min-width: 701px) {
  dialog.talk-sheet { margin: auto; border: 1px solid var(--tm-line); border-top: 2px solid var(--tm-turf); border-radius: 4px; }
  .field[data-surface="dirt"] dialog.talk-sheet { border-top-color: var(--tm-dirt); }
}
.talk-sheet-head { position: sticky; top: 0; z-index: 1; display: flex; align-items: center; gap: 8px; padding: 8px 10px; background: var(--tm-surface); border-bottom: 1px solid var(--tm-line); }
.talk-sheet-head h2 { font-size: .9rem; font-weight: 900; }
.talk-sheet-head small { color: var(--tm-muted); font-size: .64rem; font-weight: 700; }
.talk-sheet-head form { margin-left: auto; }
.talk-sheet-head .help-button { margin-left: auto; width: 24px; height: 24px; padding: 0; display: grid; place-items: center; border-color: #9aa4ad; background: #fff; color: var(--tm-ink); }
.talk-sheet-head .help-button + form { margin-left: 0; }
.talk-sheet-head button { height: 28px; padding: 0 10px; border: 1px solid #9aa4ad; border-radius: 3px; background: #fff; font-size: .72rem; font-weight: 800; }
.talk-sheet .talk-strip { border-top: 0; padding-bottom: env(safe-area-inset-bottom); }
.talk-sheet .talk-line { padding: 9px 10px 10px; }
.talk-sheet .talk-line + .talk-line { border-top: 1px solid var(--tm-line); }
.talk-row { display: flex; align-items: center; gap: 8px; min-width: 0; font-size: .72rem; }
.talk-body { display: grid; gap: 2px; min-width: 0; }
.talk-body b { font-size: .74rem; font-weight: 900; }
.talk-body p { margin: 0; padding: 0; color: #27302c; font-size: .78rem; font-weight: 700; line-height: 1.45; }
.talk-locked { margin-left: auto; color: var(--tm-muted); font-size: .7rem; font-weight: 800; }
.talk-picks { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 7px; padding-left: 40px; }
.talk-pick { display: inline-flex; align-items: center; gap: 5px; min-height: 34px; padding: 3px 8px 3px 6px; border: 1px solid #b5bfc8; border-radius: 3px; background: #fff; color: var(--tm-ink); font-family: var(--ui-font); }
.talk-pick:hover { border-color: var(--tm-turf); background: var(--tm-select-turf); }
.talk-pick-type { font-size: .66rem; font-weight: 800; color: var(--tm-muted); white-space: nowrap; }
.talk-pick-nos { display: inline-flex; align-items: center; gap: 2px; }
.talk-pick .gate { width: 24px; min-width: 24px; height: 24px; font-size: .74rem; border-radius: 3px; }
.talk-pick .pick-role { padding: 1px 3px; border-radius: 2px; background: var(--tm-ink); color: #fff; font-size: .56rem; }
.talk-pass { color: var(--tm-muted); font-size: .72rem; font-weight: 800; }
@media (max-width: 350px) { .talk-picks { padding-left: 0; } .talk-pick { padding-inline: 5px 6px; } }
/* 馬を選んでいない時の投票ボタン: light grey with dark grey letters (over the course colours above). */
.betting-panel .bet-actions .button.primary:disabled { background: #dfe4e8; color: #55605a; border-color: #dfe4e8; }

/* ===== UI改修 3段目（作業2）: レース観戦 ===== */
/* While the race is on: one thin line (about 32px) so the picture gets the room. */
.race-bar.is-slim { display: flex; align-items: center; height: 32px; padding: 0 8px; gap: 0; }
.race-bar.is-slim .race-bar-line { flex: 1; gap: 6px; }
.race-bar.is-slim .race-no { padding: 1px 6px; font-size: .82rem; }
.race-bar.is-slim h1 { font-size: .9rem; }
.race-bar.is-slim .help-button { width: 22px; height: 22px; font-size: .7rem; }
.watch-page #spectator { margin-top: 6px; }
.watch-page .sp-live { display: none; }

/* ===== UI改修 4段目: 結果・精算画面（上に精算、下に3タブ） ===== */
.muted { color: var(--tm-muted); margin-top: 8px; font-size: .73rem; }
.settle { margin-top: 8px; border: 1px solid var(--tm-line); border-top: 2px solid var(--tm-turf); border-radius: 4px; background: #fff; font-family: var(--ui-font); }
.settle.is-dirt { border-top-color: var(--tm-dirt); }
.result-tabs-wrap.is-dirt { --tab-accent: var(--tm-dirt); }
.settle-top { display: grid; gap: 8px; padding: 10px 12px; border-bottom: 1px solid var(--tm-line); }
.settle-total small { display: block; color: var(--tm-muted); font-size: .7rem; font-weight: 800; }
.settle-total strong { color: var(--tm-ink); font: 800 2.2rem/1.15 var(--ui-font); font-variant-numeric: tabular-nums; }
.settle-total strong span { margin-left: 3px; font-size: .8rem; font-weight: 800; }
.settle .result-actions { display: grid; gap: 6px; margin: 0; }
.settle .result-actions .button { margin: 0; min-height: 42px; border-radius: 3px; }
@media (min-width: 701px) { .settle-top { grid-template-columns: 1fr minmax(240px, 320px); align-items: end; } }
.settle-note { margin: 0; padding: 8px 12px 0; color: var(--tm-muted); font-size: .7rem; line-height: 1.5; }
.settle-lines { display: grid; gap: 5px; margin: 0; padding: 10px 10px 8px; list-style: none; }
.settle-line { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 2px 8px; padding: 6px 8px; border: 1px solid #e3e7eb; border-radius: 3px; background: #f4f6f8; color: var(--tm-muted); font-size: .74rem; font-variant-numeric: tabular-nums; }
.settle-line .what { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; min-width: 0; }
.settle-line .kind, .settle-line .rank-text { color: var(--tm-ink); font-weight: 800; }
.settle-line strong { color: var(--tm-ink); font-weight: 800; text-align: right; white-space: nowrap; }
.settle-line.is-miss strong { color: var(--tm-muted); }
.settle-line small { grid-column: 1 / -1; font-size: .64rem; }
.settle-line .gate { width: 22px; min-width: 22px; height: 21px; font-size: .7rem; border-radius: 3px; }
.settle-line .pick-dash { color: #8a949c; font-style: normal; }
.settle-line .order-tri { width: 8px; height: 8px; color: #78847e; }
.settle-line.is-hit { border-color: #d61f26; background: #fff; color: var(--tm-ink); background: #fdecec; }
.settle-line.is-owner { border-color: #532c8c; background: #fff; color: var(--tm-ink); }
.settle-line.is-side { border-color: #b45a06; background: #fff; color: var(--tm-ink); }
.settle-line.is-none { display: block; text-align: center; }
.stamp { padding: 1px 5px; border-radius: 2px; background: #d61f26; color: #fff; font-size: .62rem; font-weight: 800; }
.is-owner .stamp { background: #532c8c; }
.is-side .stamp { background: #b45a06; }
.settle .notice:empty { display: none; }
.settle .notice { margin: 0 10px 10px; }
/* The three tabs under it. */
.result-tabs-wrap { margin-top: 10px; font-family: var(--ui-font); }
.result-tabs { display: grid; grid-template-columns: repeat(2, 1fr); border: 1px solid var(--tm-line); border-radius: 4px 4px 0 0; overflow: hidden; background: #eceff2; }
.result-tabs button { min-height: 42px; border: 0; border-right: 1px solid var(--tm-line); background: #eceff2; color: var(--tm-muted); font-family: var(--ui-font); font-size: .8rem; font-weight: 800; cursor: pointer; }
.result-tabs button:last-child { border-right: 0; }
.result-tabs button[aria-pressed="true"] { background: #fff; color: var(--tm-ink); box-shadow: inset 0 -2px 0 var(--tab-accent, var(--tm-turf)); }
.result-pane { min-height: 120px; padding: 8px 10px 12px; border: 1px solid var(--tm-line); border-top: 0; border-radius: 0 0 4px 4px; background: #fff; font-family: var(--ui-font); }
@media (max-width: 350px) { .result-pane { padding-inline: 6px; } }
/* 着順 */
.placings { margin: 0; padding: 0; list-style: none; }
.placings-head, .placings li { display: grid; grid-template-columns: 20px 26px minmax(0, 1fr) minmax(40px, auto) minmax(44px, auto) 34px; align-items: center; gap: 4px; }
.placings-head { padding: 0 2px 4px; border-bottom: 1px solid var(--tm-line); color: var(--tm-muted); font-size: .6rem; font-weight: 800; }
.placings-head span:nth-child(n+4) { text-align: center; }
.placings li { min-height: 40px; padding: 3px 2px; border-top: 1px solid #e3e7eb; font-size: .8rem; font-variant-numeric: tabular-nums; }
.placings li:first-child { border-top: 0; }
.rank { display: grid; place-items: center; width: 20px; height: 20px; border-radius: 3px; font-weight: 800; font-size: .74rem; }
.top-1 .rank { background: #d9b34a; color: #111613; }
.top-2 .rank { background: #b9c1c8; color: #111613; }
.top-3 .rank { background: #c58a5b; color: #111613; }
.placing-name { display: grid; min-width: 0; line-height: 1.25; }
.placing-name strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.placing-name small { display: flex; flex-wrap: wrap; gap: 0 4px; align-items: center; color: var(--tm-muted); font-size: .62rem; }
.tag { padding: 0 4px; border-radius: 2px; background: #0a6335; color: #fff; font-size: .56rem; font-weight: 800; }
.tag.owner { background: #532c8c; }
.tag.side { background: #b45a06; }
.margin { text-align: center; color: var(--tm-muted); font-size: .68rem; white-space: nowrap; }
.placings .passing { justify-self: center; color: var(--tm-muted); font-size: .62rem; letter-spacing: -.03em; white-space: nowrap; }
.last3f { justify-self: center; font-size: .72rem; font-weight: 700; }
.last3f.fast-1, .last3f.fast-2, .last3f.fast-3 { padding: 1px 3px; border-radius: 3px; color: #fff; font-weight: 800; }
.last3f.fast-1 { background: #d61f26; } .last3f.fast-2 { background: #1456b8; } .last3f.fast-3 { background: #0a6335; }
/* 払戻金 */
.hit-badge { display: block; width: max-content; margin: 0 0 1px auto; padding: 0 4px; border-radius: 2px; background: #d61f26; color: #fff; font-size: .58rem; font-weight: 800; }
/* レース回顧 */
.recap-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 4px; }
.recap-stats div { display: grid; justify-items: center; padding: 6px 2px; border: 1px solid var(--tm-line); border-radius: 3px; background: #fff; }
.recap-stats small { color: var(--tm-muted); font-size: .58rem; font-weight: 700; white-space: nowrap; }
.recap-stats strong { font: 800 .98rem/1.3 var(--ui-font); font-variant-numeric: tabular-nums; white-space: nowrap; }
/* B-6b: the pace boxes have the plain 1px frame of the others; only the figure's colour tells them apart */
.recap-stats .pace-S strong { color: #1456b8; }
.recap-stats .pace-M strong { color: #0a6335; }
.recap-stats .pace-H strong { color: #d61f26; }
.recap-winner { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 10px; padding: 6px 8px; border: 1px solid var(--tm-line); border-radius: 3px; background: #f4f6f8; }
.recap-winner small { padding: 1px 5px; border-radius: 2px; background: var(--tm-ink); color: #fff; font-size: .6rem; font-weight: 800; }
.recap-winner .gate { width: 24px; min-width: 24px; height: 23px; font-size: .74rem; border-radius: 3px; }
.recap-winner strong { flex: 1 1 auto; min-width: 0; overflow: hidden; font-size: .92rem; text-overflow: ellipsis; white-space: nowrap; }
.recap-tag { padding: 1px 6px; border: 1px solid #0a6335; border-radius: 2px; background: #fff; color: #0a6335; font-size: .66rem; font-style: normal; font-weight: 800; white-space: nowrap; }
.recap-block { margin-top: 12px; }
.recap-block h3 { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px; margin: 0 0 6px; color: var(--tm-ink); font-size: .78rem; }
.recap-block h3 small { color: var(--tm-muted); font-size: .6rem; font-weight: 600; }
.recap-block-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 6px; }
.recap-block-head h3 { margin: 0; }
.corner-help { min-height: 26px; padding: 0 8px; border: 1px solid #9aa4ad; border-radius: 3px; background: #fff; color: var(--tm-ink); font-family: var(--ui-font); font-size: .66rem; font-weight: 800; cursor: pointer; }
.furlongs { display: grid; grid-template-columns: repeat(auto-fill, minmax(27px, 1fr)); gap: 2px 3px; align-items: end; padding: 6px 4px 4px; border: 1px solid var(--tm-line); border-radius: 3px; }
.lap { display: grid; grid-template-rows: 56px auto auto; justify-items: center; align-items: end; min-width: 0; }
.lap-bar { display: block; width: 70%; max-width: 16px; min-height: 8px; background: #b5bfc8; border-radius: 2px 2px 0 0; }
.lap.is-quick .lap-bar { background: #0a6335; }
.lap.is-fast .lap-bar { background: #d61f26; }
.lap small { margin-top: 2px; color: var(--tm-muted); font-size: .52rem; font-weight: 700; }
.lap b { font-size: .62rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.lap.is-fast b { color: #d61f26; }
.corner-orders { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 4px 8px; margin: 0; font-size: .78rem; }
.corner-orders dt { align-self: start; padding: 1px 6px; border-radius: 2px; background: var(--tm-ink); color: #fff; font-size: .66rem; font-weight: 800; }
.corner-orders dd { margin: 0; font-variant-numeric: tabular-nums; letter-spacing: .02em; word-break: break-all; }
.win-no { display: inline-block; min-width: 18px; padding: 0 3px; border-radius: 3px; background: #0a6335; color: #fff; font-weight: 800; text-align: center; letter-spacing: 0; }
.recap-course { margin: 10px 0 0; color: var(--tm-muted); font-size: .66rem; }

/* ===== UI改修 5段目: 厩舎・出走登録、未受取のボタン、近5走、着順タブ ===== */
/* 近5走: one fixed width for one and two figures. */
.recent-result { box-sizing: border-box; width: 17px; min-width: 0; padding: 0; letter-spacing: -.06em; }
@media (max-width: 384px) { .recent-result { width: 15px; } }
/* 未受取の払戻し: a bordered strip with two plain buttons. */
.pending-strip { display: grid; gap: 6px; margin-top: 7px; padding: 8px; border: 1px solid var(--tm-line); border-radius: 3px; background: var(--tm-surface-alt); color: var(--tm-ink); font-size: .73rem; }
.pending-strip strong, .pending-strip small { display: block; }
.pending-strip small { margin-top: 2px; color: var(--tm-muted); }
.pending-strip > div:last-child { display: flex; gap: 6px; }
.pending-btn { flex: 1; min-height: 38px; padding: 0 10px; border: 1px solid #9aa4ad; border-radius: 3px; background: #fff; color: var(--tm-ink); font-family: var(--ui-font); font-size: .78rem; font-weight: 800; cursor: pointer; }
.pending-btn.primary { border-color: var(--tm-turf); background: var(--tm-turf); color: #fff; }
/* 精算: 賞金 stamp and ★所有 / 一日馬主 badge are one size. */
.settle-line .stamp, .settle-line .badge-owner, .settle-line .badge-side { display: inline-flex; align-items: center; gap: 2px; box-sizing: border-box; height: 16px; padding: 0 5px; border-radius: 2px; font-size: .6rem; font-weight: 800; line-height: 1; }
.settle-line .badge-owner svg, .settle-line .badge-side svg { width: 9px; height: 9px; }
/* 着順: names give way so the corners fit (13-13-13-13); five places, then the main payouts. */
.placings-head, .placings li { grid-template-columns: 18px 24px minmax(0, 1fr) 34px 58px 32px; gap: 3px; }
.placings .passing { font-size: .6rem; letter-spacing: -.05em; }
.placings-more { display: block; width: 100%; min-height: 36px; margin-top: 6px; border: 1px solid #9aa4ad; border-radius: 3px; background: var(--tm-surface-alt); color: var(--tm-ink); font-family: var(--ui-font); font-size: .74rem; font-weight: 800; cursor: pointer; }
.pane-sub { margin: 14px 0 6px; padding-top: 8px; border-top: 1px solid var(--tm-line); font-size: .78rem; }
@media (max-width: 350px) { .placings-head, .placings li { grid-template-columns: 17px 22px minmax(0, 1fr) 32px 56px 30px; gap: 2px; } .result-pane { padding-inline: 4px; } }

/* 厩舎 */
#stable { width: min(94%, 520px); max-height: 88dvh; padding: 0; border: 1px solid #9aa4ad; border-top: 2px solid var(--tm-turf); border-radius: 4px; background: #fff; color: var(--tm-ink); font-family: var(--ui-font); overflow-y: auto; }
#stable::backdrop { background: #11161394; }
.stb-head { position: sticky; top: 0; z-index: 2; display: flex; align-items: center; gap: 8px; padding: 8px 10px; background: #fff; border-bottom: 1px solid var(--tm-line); }
.stb-head h2 { font-size: 1rem; font-weight: 900; }
.stb-head .help-button { border-color: #9aa4ad; background: #fff; color: var(--tm-ink); }
.stb-head form { margin-left: auto; }
.stb-head form button { min-height: 0; height: 28px; padding: 0 10px; border: 1px solid #9aa4ad; border-radius: 3px; background: #fff; color: var(--tm-ink); font-family: var(--ui-font); font-size: .72rem; font-weight: 800; }
.stb-tabs { display: grid; grid-template-columns: 1fr 1fr; border-bottom: 1px solid var(--tm-line); background: var(--tm-surface-alt); }
.stb-tabs button { min-height: 38px; border: 0; border-right: 1px solid var(--tm-line); background: #eceff2; color: var(--tm-muted); font-family: var(--ui-font); font-size: .78rem; font-weight: 800; cursor: pointer; }
.stb-tabs button:last-child { border-right: 0; }
.stb-tabs button[aria-pressed="true"] { background: #fff; color: var(--tm-ink); box-shadow: inset 0 -2px 0 var(--tm-turf); }
#stable section { margin: 0; padding: 10px 10px 4px; border: 0; }
#stable h3 { display: flex; align-items: baseline; gap: 6px; margin: 0 0 6px; font-size: .84rem; }
#stable h3 small { color: var(--tm-muted); font-size: .66rem; font-weight: 700; }
#stable .muted { margin: 4px 0 8px; }
#stable .notice:empty { display: none; }
#stable .notice { margin: 4px 10px 0; }
.stb-cards, .stb-offers { display: grid; gap: 6px; margin: 0; padding: 0; list-style: none; }
.stb-card { padding: 7px 9px; border: 1px solid #cfc4e0; border-radius: 3px; background: #fff; }
.stb-card.retired { opacity: .55; }
.stb-line { display: flex; align-items: center; gap: 6px; min-width: 0; }
.stb-line.sub { flex-wrap: wrap; margin-top: 4px; }
.stb-name { display: flex; flex: 1; align-items: center; gap: 5px; min-width: 0; }
.stb-name strong { overflow: hidden; font-size: .92rem; text-overflow: ellipsis; white-space: nowrap; }
.stb-tag { flex: none; padding: 1px 6px; border-radius: 2px; background: #eceff2; color: var(--tm-muted); font-size: .62rem; font-weight: 800; }
.stb-tag.today { background: #532c8c; color: #fff; }
.stb-range { color: var(--tm-muted); font-size: .7rem; font-variant-numeric: tabular-nums; }
.stb-money { display: flex; gap: 14px; margin-top: 5px; padding-top: 5px; border-top: 1px solid #e3e7eb; color: var(--tm-muted); font-size: .68rem; }
.stb-money b { color: var(--tm-ink); font-size: .84rem; font-variant-numeric: tabular-nums; }
.stb-money b small { margin-left: 1px; font-size: .6rem; }
.stb-empty { display: grid; place-items: center; height: 30px; border: 1px dashed #9aa4ad; border-radius: 3px; color: var(--tm-muted); font-size: .7rem; font-weight: 700; }
.gauge { display: inline-flex; align-items: center; gap: 5px; margin-left: auto; }
.gauge-boxes { display: inline-flex; gap: 2px; }
.gauge-boxes i { box-sizing: border-box; width: 9px; height: 9px; border: 1px solid #532c8c; border-radius: 1px; }
.gauge-boxes i.on { background: #532c8c; }
.gauge b { color: var(--tm-ink); font-size: .68rem; font-variant-numeric: tabular-nums; }
.surf-chip { display: inline-block; flex: none; padding: 1px 5px; border-radius: 2px; color: #fff; font-size: .62rem; font-weight: 800; line-height: 1.3; white-space: nowrap; }
.surf-chip.turf { background: var(--tm-turf); }
.surf-chip.dirt { background: var(--tm-dirt); }
.stable-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; column-gap: 8px; padding: 7px 8px; border: 1px solid var(--tm-line); border-radius: 3px; background: #fff; }
.stable-row .course-horse-name { align-items: center; gap: 5px; }
.stable-row .course-horse-name strong { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.stable-row .grade-chip { min-width: 26px; font-size: .56rem; }
.stable-side { display: grid; justify-items: end; align-content: center; gap: 2px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.stable-price { display: flex; align-items: baseline; justify-content: center; min-width: 64px; min-height: 36px; padding: 4px 10px; border: 1px solid #9aa4ad; border-radius: 3px; background: #eceff2; color: var(--tm-muted); font-family: var(--ui-font); font-size: .91rem; font-weight: 800; }
.stable-price.ready { border-color: var(--tm-turf); background: var(--tm-turf); color: #fff; }
.stable-price small { margin-left: 1px; font-size: .6rem; font-weight: 700; color: inherit; }
.stable-reason { color: #d61f26; font-size: .58rem; font-weight: 700; }

/* 重賞予定 (the main races) */
.main-schedule { display: grid; margin: 0; padding: 0; border: 1px solid var(--tm-line); border-radius: 3px; list-style: none; }
.main-schedule li { display: grid; grid-template-columns: 42px auto 1fr auto; grid-template-rows: auto auto; column-gap: 6px; row-gap: 2px; align-items: center; padding: 7px 8px; border-top: 1px solid #e3e7eb; font-size: .84rem; }
.main-schedule li:first-child { border-top: 0; }
.main-schedule small { grid-row: 1 / 3; color: var(--tm-muted); font-size: .72rem; }
.main-schedule .grade-chip { grid-column: 2; grid-row: 1; justify-self: start; }
.main-schedule b { grid-column: 3; grid-row: 1; font-weight: 800; }
.main-schedule span { grid-column: 2 / 4; grid-row: 2; color: var(--tm-muted); font-size: .74rem; }
.main-schedule i { grid-column: 4; grid-row: 1 / 3; justify-self: end; color: var(--tm-ink); font-size: .76rem; font-style: normal; font-weight: 800; white-space: nowrap; font-variant-numeric: tabular-nums; }

/* 出走登録 */
.entry-page .entry-card { margin-top: 10px; padding: 10px; font-family: var(--ui-font); }
.entry-card .section-label { margin-bottom: 8px; }
.entry-horses { display: grid; gap: 10px; margin: 0 0 10px; padding: 0; list-style: none; }
.entry-horse { padding: 8px; border: 1px solid #cfc4e0; border-radius: 3px; }
.entry-horse-head { display: flex; align-items: center; gap: 6px; }
.entry-horse-head strong { flex: 1; min-width: 0; overflow: hidden; font-size: 1rem; text-overflow: ellipsis; white-space: nowrap; }
.entry-horse-sub { display: flex; align-items: center; gap: 6px; margin-top: 4px; color: var(--tm-muted); font-size: .7rem; font-variant-numeric: tabular-nums; }
.entry-choices { display: grid; gap: 4px; margin-top: 8px; }
.entry-choice { display: flex; align-items: center; justify-content: space-between; gap: 6px; width: 100%; min-height: 38px; padding: 4px 8px; border: 1px solid #b5bfc8; border-radius: 3px; background: #fff; color: var(--tm-ink); font-family: var(--ui-font); text-align: left; cursor: pointer; }
.entry-choice.picked { border-color: var(--tm-turf); background: #e5f3eb; box-shadow: inset 0 0 0 1px var(--tm-turf); }
.ec-main { display: flex; align-items: center; gap: 5px; min-width: 0; }
.ec-side { display: flex; align-items: center; gap: 6px; flex: none; }
.ec-side small { color: var(--tm-muted); font-size: .66rem; font-weight: 700; }
.ec-dist { font-size: .78rem; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.ec-rest { font-size: .82rem; }
.ent-no { min-width: 22px; font-size: .8rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.entry-prize { color: var(--tm-ink); font-size: .72rem; font-style: normal; font-weight: 800; white-space: nowrap; font-variant-numeric: tabular-nums; }
.fit { display: inline-grid; place-items: center; width: 20px; height: 20px; border-radius: 3px; color: #fff; font-size: .74rem; font-weight: 800; }
.fit.is-fit { background: var(--tm-turf); }
.fit.is-off { background: #b45a06; }
.entry-riders-label { margin: 8px 0 4px; color: var(--tm-muted); font-size: .7rem; font-weight: 800; }
.entry-riders { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px; }
.entry-rider { display: flex; flex-direction: column; align-items: center; gap: 1px; padding: 5px 3px; border: 1px solid #b5bfc8; border-radius: 3px; background: #fff; color: var(--tm-ink); font-family: var(--ui-font); font-size: .8rem; font-weight: 800; cursor: pointer; }
.entry-rider small { color: var(--tm-muted); font-size: .62rem; font-weight: 600; }
.entry-rider.picked { border-color: var(--tm-turf); background: #e5f3eb; box-shadow: inset 0 0 0 1px var(--tm-turf); }
.entry-rider.taken { background: var(--tm-surface-alt); opacity: .55; cursor: default; }
/* 今日の番組: a band for each venue, then one line for each race with the 1着 prize in a straight column. */
.entry-races { margin: 0; padding: 0; border: 1px solid var(--tm-line); border-radius: 3px; list-style: none; overflow: hidden; }
.ent-venue { display: flex; align-items: center; gap: 6px; padding: 6px 8px; border-bottom: 1px solid var(--tm-line); background: #eceff2; font-size: .8rem; }
.ent-venue:not(:first-child) { border-top: 1px solid var(--tm-line); }
.ent-venue .wx svg { display: block; width: 15px; height: 15px; color: var(--tm-ink); }
.ent-venue b { font-weight: 900; }
.going { padding: 0 6px; border: 1px solid #9aa4ad; border-radius: 2px; background: #fff; font-size: .66rem; font-weight: 800; }
.ent-venue small { margin-left: auto; color: var(--tm-muted); font-size: .66rem; font-variant-numeric: tabular-nums; }
.ent-race { display: grid; grid-template-columns: 26px 38px minmax(0, 1fr) auto 70px; align-items: center; gap: 5px; padding: 6px 8px; border-bottom: 1px solid #e3e7eb; font-size: .8rem; }
.ent-race:last-child { border-bottom: 0; }
.ent-race .grade-chip { justify-self: start; }
.ent-cond { display: flex; align-items: center; gap: 4px; min-width: 0; }
.ent-cond b { font-size: .78rem; font-variant-numeric: tabular-nums; white-space: nowrap; }
.age-chip { padding: 0 4px; border: 1px solid var(--tm-line); border-radius: 2px; color: var(--tm-muted); font-size: .6rem; font-weight: 800; white-space: nowrap; }
.ent-race .entry-prize { text-align: right; }
.ent-sub { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; grid-column: 2 / -1; font-size: .7rem; }
.ent-sub em { font-style: normal; font-weight: 800; }
.ent-sub b { font-weight: 800; }
.ent-sub .badge-owner { height: 16px; padding: 0 5px; box-sizing: border-box; align-items: center; font-size: .6rem; }
.ent-race.mine { background: #f4f0f9; }
@media (max-width: 350px) { .ent-race { grid-template-columns: 24px 36px minmax(0, 1fr) auto 62px; gap: 4px; padding-inline: 6px; } }
/* the 未勝利 chip stays on one line; the card headings are ink, not the hit red */
.ent-race .grade-chip, .entry-choice .grade-chip { white-space: nowrap; min-width: 0; padding-inline: 4px; }
.ent-race { grid-template-columns: 26px 44px minmax(0, 1fr) auto 70px; }
.entry-card .section-label { color: var(--tm-ink); }
@media (max-width: 350px) { .ent-race { grid-template-columns: 24px 42px minmax(0, 1fr) auto 62px; } }
/* the number chip takes its column's width, so it never runs into the name */
.placings .gate { width: 24px; min-width: 24px; height: 24px; font-size: .78rem; border-radius: 3px; }
@media (max-width: 350px) { .placings .gate { width: 22px; min-width: 22px; height: 22px; font-size: .72rem; } }


/* ===== UI改修 6段目: 仕上げ・軽バグ一掃 ===== */
/* 投票ドック: 全額が崩れない。払戻の幅が足りないときだけ次の行へ。 */
.stake-line { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; min-height: 36px; }
.stake-quick { flex: none; }
.stake-quick button { flex-shrink: 0; white-space: nowrap; }
.stake-field { flex: none; }
.projection { display: flex; justify-content: flex-end; align-items: baseline; gap: 6px; min-width: 0; margin-top: 4px; white-space: nowrap; }
.projection strong { white-space: nowrap; }
/* 一日馬主の賞金（1〜3着） */
.side-prizes { display: flex; flex-wrap: wrap; gap: 4px 10px; padding: 2px 0 3px; color: var(--tm-muted); font-size: .7rem; font-weight: 800; }
.side-prizes b { margin-left: 2px; color: var(--tm-ink); font-size: .8rem; }
/* ころがし待機中 */
.betting-panel .pending-strip { margin-top: 6px; }
#ride-confirm { line-height: 1.25; padding-inline: 6px; font-size: .78rem; }
/* 確定済みの投票: 券種・買い目・枚数を列に揃える */
.receipts ul { display: grid; margin: 6px 0 0; border: 1px solid var(--tm-line); border-radius: 3px; }
.r-type { color: var(--tm-ink); font-size: .72rem; font-weight: 800; white-space: nowrap; }
.r-type.side { color: var(--tm-side); }
.r-pay { display: inline-flex; align-items: baseline; justify-content: flex-end; gap: 4px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.r-pay b { font-weight: 800; }
.r-pay small { color: var(--tm-muted); font-size: .68rem; }
.r-pay em { padding: 0 4px; border: 1px solid #b6c0c8; border-radius: 2px; color: var(--tm-muted); font-size: .58rem; font-style: normal; font-weight: 800; }
/* ヘルプ: 左に見出し（チップ・アイコン）、右に1行の説明 */
.help-list { display: grid; grid-template-columns: minmax(64px, 28%) minmax(0, 1fr); margin: 6px 0 0; font-size: .74rem; line-height: 1.55; }
.help-list dt, .help-list dd { margin: 0; padding: 7px 0; border-top: 1px solid #e3e7eb; }
.help-list dt:first-of-type, .help-list dt:first-of-type + dd { border-top: 0; }
.help-list dt { padding-right: 8px; color: var(--tm-ink); font-weight: 800; display: flex; flex-wrap: wrap; align-items: center; align-content: flex-start; gap: 3px 4px; }
.help-list dd { color: #27302c; }
.help-sample { display: inline-flex; gap: 2px; align-items: center; }
.help-sample .recent-result { width: 17px; }
.hit-badge.is-inline { display: inline-block; margin: 0; padding: 1px 5px; font-size: .64rem; }
.help .badge-owner, .help .badge-side { font-size: .64rem; }
.help-prizes { width: 100%; margin-top: 8px; border-collapse: collapse; font-size: .74rem; font-variant-numeric: tabular-nums; }
.help-prizes th { padding: 4px 6px; background: #eceff2; border: 1px solid var(--tm-line); color: var(--tm-muted); font-size: .68rem; font-weight: 800; text-align: left; }
.help-prizes th:last-child, .help-prizes td:last-child { text-align: right; }
.help-prizes td { padding: 3px 6px; border: 1px solid var(--tm-line); font-weight: 800; }
/* メイン（8R）の予定: 日付チップ・芝ダチップを番組と同じに */
.main-schedule li { grid-template-columns: 46px minmax(0, 1fr) auto; grid-template-rows: auto auto; column-gap: 8px; row-gap: 3px; align-items: center; }
.main-schedule .day-chip { grid-column: 1; grid-row: 1 / 3; justify-self: start; align-self: center; display: inline-grid; place-items: center; min-width: 40px; padding: 2px 4px; border: 1px solid #9aa4ad; border-radius: 3px; background: #fff; color: var(--tm-ink); font-size: .68rem; font-weight: 800; font-style: normal; white-space: nowrap; }
.main-schedule .day-chip.now { border-color: var(--tm-turf); background: var(--tm-turf); color: #fff; }
.main-schedule .ms-main { grid-column: 2; grid-row: 1; display: flex; align-items: center; gap: 5px; min-width: 0; }
.main-schedule .ms-main b { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 800; }
.main-schedule .ms-main .grade-chip { grid-column: auto; grid-row: auto; flex: none; }
.main-schedule i { grid-column: 3; grid-row: 1 / 3; align-self: center; }
.main-schedule .ms-cond { grid-column: 2; grid-row: 2; display: flex; align-items: center; gap: 6px; color: var(--tm-muted); font-size: .72rem; }
/* 払戻金: JRA風。1枚の外枠と細い罫線。上は2列、3連複・3連単は全幅。全券種でラベル列幅（42px）が同じ。 */
.pane-sub-gap { height: 12px; }
.pay-board { border: 1px solid #111613; border-radius: 3px; overflow: hidden; font-variant-numeric: tabular-nums; }
.pay-head { display: flex; align-items: center; justify-content: space-between; gap: 6px; padding: 4px 8px; background: #111613; color: #fff; font-size: .74rem; }
.pay-head b { font-weight: 800; }
.pay-head span { color: #d3d9df; font-size: .62rem; font-weight: 700; }
.pay-cols { display: grid; grid-template-columns: 1fr 1fr; }
.pay-col + .pay-col { border-left: 1px solid var(--tm-line); }
.pay-group { display: grid; grid-template-columns: 42px minmax(0, 1fr); border-top: 1px solid var(--tm-line); }
.pay-group h4 { display: grid; place-items: center; margin: 0; padding: 2px 0; border-right: 1px solid var(--tm-line); background: #eceff2; color: var(--tm-ink); font-size: .68rem; font-weight: 800; white-space: nowrap; }
.pay-group ul { display: grid; margin: 0; padding: 0; list-style: none; }
.pay-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "combo pay" "badge pop"; align-items: center; column-gap: 4px; padding: 3px 6px; border-top: 1px solid #e3e7eb; }
.pay-row:first-child { border-top: 0; }
.pay-row .combo { grid-area: combo; display: flex; align-items: center; white-space: nowrap; }
.pay-row .combo .gate { min-width: 20px; width: 20px; height: 20px; font-size: .68rem; border-radius: 3px; }
.pay-sep { display: inline-grid; place-items: center; width: 10px; flex: none; color: #78847e; font-style: normal; font-size: .7rem; line-height: 1; }
.pay-sep .order-tri { width: 7px; height: 7px; margin: 0; }
.pay-row .pay { grid-area: pay; text-align: right; font-size: .78rem; font-weight: 800; white-space: nowrap; }
.pay-row .pay small { margin-left: 1px; font-size: .6rem; font-weight: 600; }
.pay-row .pop { grid-area: pop; text-align: right; color: var(--tm-muted); font-size: .64rem; white-space: nowrap; }
.pay-row .hit-badge { grid-area: badge; margin: 0; justify-self: start; }
.pay-row.is-mine { background: #fef2f2; }
.pay-row.is-mine .pay { color: #d61f26; }
.pay-wide .pay-row { grid-template-columns: minmax(0, 1fr) auto auto auto; grid-template-areas: "combo badge pay pop"; column-gap: 8px; padding: 4px 8px; }
.pay-wide .pay-row .pop { min-width: 3.6em; }
@media (max-width: 339px) { .pay-cols { grid-template-columns: 1fr; } .pay-col + .pay-col { border-left: 0; border-top: 1px solid var(--tm-line); } .pay-col + .pay-col .pay-group:first-child { border-top: 0; } }

/* ===== UI改修 6段目b ===== */
.dist-chip { display: inline-block; padding: 1px 6px; border: 1px solid #9aa4ad; border-radius: 3px; background: #fff; color: var(--tm-ink); font-size: .7rem; font-weight: 800; font-variant-numeric: tabular-nums; white-space: nowrap; }
.main-schedule .surf-chip { color: #fff; font-size: .64rem; }
.main-schedule .ms-cond { align-items: baseline; gap: 6px; color: var(--tm-ink); }
.main-schedule .ms-cond .ms-dist { grid-column: auto; grid-row: auto; color: var(--tm-ink); font-size: .78rem; font-weight: 800; }
.main-schedule .ms-cond .ms-venue { grid-column: auto; grid-row: auto; color: #27302c; font-size: .76rem; font-weight: 700; }
.main-schedule .ms-cond .surf-chip { align-self: center; }
.spot-odds b small { margin-left: 2px; }
.placings-head, .placings li { grid-template-columns: 18px 24px minmax(0, 1fr) 32px 66px 36px; gap: 4px; }
.placings .passing { justify-self: start; }
.placings-head span:nth-child(5) { text-align: left; }
@media (max-width: 350px) { .placings-head, .placings li { grid-template-columns: 17px 22px minmax(0, 1fr) 30px 62px 34px; gap: 3px; } }
.main-schedule .ms-cond { min-width: 0; flex-wrap: nowrap; gap: 5px; }
.main-schedule .ms-cond .ms-dist { flex: none; }
.main-schedule .ms-cond .ms-venue { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 359px) { .main-schedule li { grid-template-columns: 44px minmax(0, 1fr) auto; column-gap: 6px; padding-inline: 6px; } .main-schedule i { font-size: .7rem; } }

/* ===== ロジック改善 B-1 ===== */
/* 厩舎: 買った日の出走予定（残りレースから選ぶ） */
.stb-today { margin-top: 6px; padding-top: 6px; border-top: 1px solid #e3e7eb; }
.stb-today-label { color: var(--tm-muted); font-size: .7rem; font-weight: 800; }
.stb-today .entry-choices { margin-top: 5px; }
.stb-today .entry-riders-label { margin-top: 6px; }

html, body { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
/* B-1b 着順: 着 | 馬番 | 馬名 | 着差(右) | 通過(中央) | 上3F(中央), clear of each other. */
.placings-head, .placings li { grid-template-columns: 20px 24px minmax(0, 1fr) 46px 64px 38px; gap: 6px; }
.placings-head span:nth-child(4) { text-align: right; }
.placings-head span:nth-child(5) { text-align: center; }
.placings .margin { text-align: right; }
.placings .passing { justify-self: center; text-align: center; }
@media (max-width: 350px) { .placings-head, .placings li { grid-template-columns: 18px 22px minmax(0, 1fr) 42px 58px 36px; gap: 4px; } }
/* 開催終了: the carry-over as three chips (the details are in the ? help). */
/* B-2 3連複・3連単: the 人気 column a fixed width, so 倍 stands in one line (53人気 and 464人気 alike). */
.pay-wide .pay-row { grid-template-columns: minmax(0, 1fr) auto auto 54px; }
.pay-wide .pay-row .pop { min-width: 0; width: 54px; }
/* B-2 厩舎: the race a horse bought today is entered in, a tag on the top edge of its row (the row keeps its width at 320px). */
.stb-today .entry-choices { gap: 7px; margin-top: 9px; }
.stb-today .entry-choice { position: relative; }
.ec-done { position: absolute; top: -7px; right: 8px; padding: 0 5px; border-radius: 2px; background: var(--tm-turf); color: #fff; font-size: .6rem; font-style: normal; font-weight: 800; line-height: 13px; white-space: nowrap; }
/* B-2 引退ボーナス */
.settle-line.is-bonus .bonus-why { color: #532c8c; font-size: .72rem; font-weight: 800; }
.settle-line.is-bonus strong { color: #532c8c; }

/* ===== B-3b 予想家・競馬新聞・加算式・馬券風 ===== */
/* 出走表の道具行: 予想家 と 新聞 を左に、馬番|オッズ を右に（320pxでも1行） */
.util-left { display: flex; align-items: center; gap: 6px; min-width: 0; }
.paper-bar { padding-left: 6px; }
.paper-icon { display: inline-grid; place-items: center; width: 18px; height: 18px; color: var(--tm-ink); }
.paper-icon svg { width: 16px; height: 16px; }
@media (max-width: 359px) {
  .util-left { gap: 4px; }
  .util-left .talk-bar { gap: 3px; padding-right: 5px; font-size: .66rem; }
  .util-left .forecaster-faces img { width: 18px; height: 18px; }
  .util-bar .sort { width: 92px; }
}
/* 競馬新聞 */
.paper-list { display: grid; margin: 0; padding: 0 0 env(safe-area-inset-bottom); list-style: none; }
.paper-line { padding: 9px 10px 10px; }
.paper-line + .paper-line { border-top: 1px solid var(--tm-line); }
.paper-line-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.paper-line-head b { font-size: .84rem; font-weight: 900; }
.paper-roi { display: inline-flex; align-items: baseline; gap: 5px; white-space: nowrap; }
.paper-roi small, .talk-roi { color: var(--tm-muted); font-size: .62rem; font-weight: 700; }
.paper-roi i { font-size: .95rem; font-style: normal; font-weight: 900; font-variant-numeric: tabular-nums; }
.paper-policy { margin: 2px 0 0; color: #27302c; font-size: .72rem; font-weight: 700; }
.paper-pick { display: flex; align-items: center; gap: 6px; min-height: 26px; margin: 6px 0 0; font-size: .8rem; }
.paper-pick small { color: var(--tm-muted); font-size: .64rem; font-weight: 700; white-space: nowrap; }
.paper-pick strong { min-width: 0; overflow: hidden; font-weight: 800; text-overflow: ellipsis; white-space: nowrap; }
.paper-pick em { color: var(--tm-muted); font-style: normal; font-weight: 800; }
.paper-pick .gate { width: 22px; min-width: 22px; height: 22px; font-size: .72rem; border-radius: 3px; }
/* 予想家の見出しの直近回収率 */
.talk-roi { margin-left: 8px; white-space: nowrap; }
.talk-roi i { margin-left: 2px; color: var(--tm-ink); font-size: .74rem; font-style: normal; font-weight: 900; font-variant-numeric: tabular-nums; }
/* まとめ買い */
.talk-bundle-row { display: grid; gap: 3px; margin-top: 8px; padding-left: 40px; }
.talk-bundle { min-height: 36px; padding: 4px 10px; border: 1px solid var(--tm-turf); border-radius: 3px; background: var(--tm-turf); color: #fff; font-family: var(--ui-font); font-size: .74rem; font-weight: 800; cursor: pointer; }
.talk-bundle:disabled { border-color: #c3cbd3; background: #eceff2; color: #77827c; cursor: default; }
.talk-bundle-reason { color: var(--tm-red); font-size: .64rem; font-weight: 700; }
@media (max-width: 350px) { .talk-bundle-row { padding-left: 0; } }
/* 加算式の枚数ボタン: +10 +50 +100 全額 C */
.stake-quick { gap: 3px; }
.stake-quick button { min-width: 30px; padding: 0 6px; }
.stake-quick button[data-action="stakeClear"] { min-width: 26px; padding: 0 5px; color: var(--tm-red); }
@media (max-width: 350px) { .stake-quick { gap: 2px; } .stake-quick button { min-width: 0; padding: 0 5px; font-size: .66rem; } }
/* ===== B-4 ===== */
/* 賞金: 「1着」と金額を分け、金額の欄は幅を決めて右揃え（560枚と1,000枚でも1着の位置が動かない） */
.entry-prize { display: inline-flex; align-items: baseline; gap: 3px; }
.entry-prize .pz-label { font-weight: 700; }
.entry-prize .pz-amount { display: inline-block; min-width: 3.8em; text-align: right; font-variant-numeric: tabular-nums; }
.main-schedule i.entry-prize { justify-self: end; font-size: .72rem; gap: 2px; }
.ent-race { grid-template-columns: 26px 44px minmax(0, 1fr) auto 78px; }
.ent-race .entry-prize { justify-self: end; font-size: .7rem; }
@media (max-width: 350px) { .ent-race { grid-template-columns: 24px 42px minmax(0, 1fr) auto 70px; } .ent-race .entry-prize { font-size: .66rem; } .entry-choice .entry-prize { font-size: .68rem; } }
.age-chip.is-two { flex: none; border-color: #9aa4ad; background: #fff; color: var(--tm-ink); font-style: normal; }
.main-schedule .ms-main .age-chip { grid-column: auto; grid-row: auto; font-size: .6rem; }
.entry-choice.is-blocked { opacity: .55; background: #f1f3f5; cursor: default; }
.entry-choice.is-blocked .ec-side small { max-width: 8.5em; text-align: right; line-height: 1.25; }
/* 競馬新聞: 回収率の数字は幅を決めて右揃え */
.paper-roi i { display: inline-block; min-width: 3.4em; text-align: right; }
/* まとめ買いの枚数 */
/* B-5b: the three presets are small and of one width, at the right; the slider (in tens) under them */
.bundle-stake { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 4px 8px; padding: 8px 10px 0; font-size: .7rem; font-weight: 800; }
.bundle-stake > span { color: var(--tm-muted); }
.bundle-stake > span b { margin-left: 3px; color: var(--tm-ink); }
.bundle-presets { display: flex; gap: 4px; justify-content: flex-end; }
.bundle-stake button { flex: none; width: 56px; min-width: 0; height: 28px; padding: 0; border: 1px solid #b5bfc8; border-radius: 3px; background: #fff; color: var(--tm-ink); font-family: var(--ui-font); font-size: .72rem; font-weight: 800; cursor: pointer; }
.bundle-stake button[aria-pressed="true"] { border-color: var(--tm-turf); background: var(--tm-turf); color: #fff; }
.bundle-stake .tm-range { flex: 1 0 100%; }
/* sliders (the betting dock's and the sheet's): a thumb a thumb can hold (22px), and a pan that does not fight the page's scroll */
.stake-slider input[type="range"], .tm-range { -webkit-appearance: none; appearance: none; height: 28px; background: transparent; touch-action: pan-x; }
.tm-range { width: 100%; margin: 0; }
.stake-slider input[type="range"]::-webkit-slider-runnable-track, .tm-range::-webkit-slider-runnable-track { height: 4px; border-radius: 2px; background: #c3ccc6; }
.stake-slider input[type="range"]::-moz-range-track, .tm-range::-moz-range-track { height: 4px; border-radius: 2px; background: #c3ccc6; }
.stake-slider input[type="range"]::-webkit-slider-thumb, .tm-range::-webkit-slider-thumb { -webkit-appearance: none; appearance: none; width: 22px; height: 22px; margin-top: -9px; border: 2px solid #fff; border-radius: 50%; background: var(--tm-turf); box-shadow: 0 1px 3px rgba(0, 0, 0, .35); }
.stake-slider input[type="range"]::-moz-range-thumb, .tm-range::-moz-range-thumb { box-sizing: border-box; width: 22px; height: 22px; border: 2px solid #fff; border-radius: 50%; background: var(--tm-turf); box-shadow: 0 1px 3px rgba(0, 0, 0, .35); }
/* 性齢 on the stable's and the entry page's horse cards */
.stb-line .course-age, .entry-horse-sub .course-age { flex-shrink: 0; font-size: .64rem; font-weight: 800; color: #6b5a3a; line-height: 1; }
.stb-line .course-age.sex-colt, .entry-horse-sub .course-age.sex-colt { color: #1f5fb4; }
.stb-line .course-age.sex-filly, .entry-horse-sub .course-age.sex-filly { color: #c8263a; }
.stb-line .course-age.sex-gelding, .entry-horse-sub .course-age.sex-gelding { color: #4f6b5b; }
/* ---- B-5a ---- */
/* パドックの調教: the row of its own under 馬体重, with the grade as a chip (S red, A orange, B grey-green, C blue-grey) on the same baseline as the others. */
.spot-facts dt, .spot-facts dd { min-height: 17px; display: flex; align-items: center; }
.spot-facts dd.spot-train { gap: 6px; }
.train-grade { display: inline-grid; place-items: center; min-width: 17px; height: 15px; padding: 0 3px; border-radius: 2px; color: #fff; font: 900 .66rem/1 var(--num-font); }
.train-grade.g-S { background: #d61f26; }
.train-grade.g-A { background: #e0750f; }
.train-grade.g-B { background: #5f7d6c; }
.train-grade.g-C { background: #6e7e8c; }

/* 予想家: 推し印 */
.talk-marks { display: flex; flex-wrap: wrap; align-items: center; gap: 3px 8px; margin: 1px 0 2px; }
.fm { display: inline-flex; align-items: center; gap: 2px; }
.fm-mark { min-width: 1em; font-style: normal; font-size: .82rem; font-weight: 900; text-align: center; color: var(--tm-ink); }
.fm .gate { width: 20px; min-width: 20px; height: 20px; font-size: .68rem; border-radius: 3px; }
.fm-none { color: var(--tm-muted); font-size: .68rem; font-weight: 700; }

/* 買い方: 軸2頭ながし is longer, so the four share a row in a smaller type; 全頭 stands where the point count was */
.bet-methods button { padding: 0 2px; white-space: nowrap; }
@media (max-width: 350px) { .bet-methods button { font-size: .62rem; } }
.all-horses { flex: none; min-width: 44px; height: 26px; padding: 0 9px; border: 1px solid #bfc7cf; border-radius: 3px; background: #fff; color: var(--tm-ink); font-family: var(--ui-font); font-size: .7rem; font-weight: 800; cursor: pointer; }
.all-horses:not(:disabled):active { background: var(--tm-select-turf); }
.all-horses:disabled { opacity: .4; cursor: default; }

/* 枚数: the slider under the box, with the payout beside it; − and + held down repeat */
.stake-slider { display: flex; align-items: center; gap: 8px; min-height: 26px; margin-top: 1px; }
.stake-slider input[type="range"] { flex: 1; min-width: 0; height: 26px; margin: 0; accent-color: var(--tm-turf); }
.stake-slider .projection { flex: none; margin-top: 0; }
.stake-field button { -webkit-touch-callout: none; -webkit-user-select: none; user-select: none; touch-action: manipulation; }

/* 厩舎の通知: a pale green bar with a frame above the 所有馬 */
#stable .notice.stb-notice { margin: 8px 10px 0; padding: 6px 9px; border: 1px solid #9cc7ac; border-radius: 3px; background: #edf7f0; color: #1d4a2e; font-size: .66rem; font-weight: 700; line-height: 1.55; text-wrap: balance; overflow-wrap: anywhere; }
#stable .notice.stb-notice.error { border-color: #e1a39e; background: #fcefed; color: #8a2a22; }
#stable .notice.stb-notice:empty { display: none; }
#stable .notice.stb-notice span { display: inline-block; }

/* 開催終了: the day's record in small cards, the carry-over as a quiet note at the bottom */
.day-summary { padding: 10px 12px 6px; }
.day-summary h2 { margin: 0 0 6px; font-size: .82rem; font-weight: 900; }
.day-cells { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.day-summary.cells-4 .day-cells { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 4px; }
.day-cell { display: grid; gap: 2px; min-width: 0; padding: 7px 4px 6px; border: 1px solid var(--tm-line); border-radius: 3px; background: #fff; text-align: center; }
.day-cell small { color: var(--tm-muted); font-size: .6rem; font-weight: 800; white-space: nowrap; }
.day-cell b { font-size: 1rem; font-weight: 900; line-height: 1.15; white-space: nowrap; }
.day-cell b span { margin-left: 1px; font-size: .58rem; font-weight: 800; }
.day-summary.cells-4 .day-cell b { font-size: .86rem; }
.day-cell.is-plus b { color: var(--tm-turf); }
.day-cell.is-minus b { color: var(--tm-red); }
.settle-fine { margin: 6px 14px 14px; color: var(--tm-muted); font-size: .62rem; font-weight: 600; line-height: 1.7; text-align: center; }

/* 勝馬投票券: an original ticket of the racecourse kind (no JRA name or mark). A pale light-blue band down the left and two very faint
   circles, a 1px frame, 2px corners; 一日馬主 in a pale brown-orange. Three columns (left 92 / kind 30 / right), the small print under them. */
.receipts ul, .settle-lines { gap: 10px; }
.receipts ul { border: 0; border-radius: 0; }
.slip { --edge: #8c9a91; --side: #b45a06; position: relative; display: grid; grid-template-columns: 82px 30px minmax(0, 1fr); column-gap: 7px; align-items: stretch; margin: 0; padding: 7px 8px 5px; overflow: hidden; border: 1px solid var(--edge); border-radius: 2px; color: #111613; box-shadow: 0 1px 2px rgba(0, 0, 0, .07);
  background-color: #fbfdfb;
  background-image: linear-gradient(90deg, transparent 19%, rgba(112, 212, 224, .24) 19%, rgba(112, 212, 224, .24) 28%, transparent 28%), radial-gradient(circle at 72% 45%, rgba(28, 168, 112, .08) 0, rgba(28, 168, 112, .08) 28px, transparent 29px), radial-gradient(circle at 86% 72%, rgba(28, 168, 112, .06) 0, rgba(28, 168, 112, .06) 24px, transparent 25px); }
.receipts li.slip { display: grid; min-height: 0; border-top: 1px solid var(--edge); }
.slip[data-type="side"] { --edge: #c29b70; background-color: #fdfaf5; background-image: linear-gradient(90deg, transparent 19%, rgba(224, 158, 86, .22) 19%, rgba(224, 158, 86, .22) 28%, transparent 28%); }
.slip-left { display: flex; flex-direction: column; justify-content: space-between; gap: 3px; min-width: 0; }
.sl-day { color: #2b3530; font-size: .56rem; font-weight: 800; line-height: 1.1; letter-spacing: -.02em; }
.sl-place { font-size: .8rem; font-weight: 900; line-height: 1.05; letter-spacing: .08em; white-space: nowrap; }
.sl-race { display: flex; align-items: center; gap: 3px; }
.sl-rbox { display: inline-grid; place-items: center; min-width: 32px; padding: 1px 4px; background: #111613; color: #fff; font-size: .8rem; font-weight: 900; line-height: 1.15; letter-spacing: .04em; }
.sl-rlabel { font-size: .62rem; font-weight: 900; }
.sl-codes { display: flex; gap: 3px; margin: 2px 0; }
.slip-code { width: 22px; height: 22px; color: #1a221e; }
.sl-name { max-width: 100%; overflow: hidden; color: #26302b; font-size: .56rem; font-weight: 800; line-height: 1.2; text-overflow: ellipsis; white-space: nowrap; }
.slip-kind { display: flex; flex-direction: column; align-items: center; justify-content: space-between; box-sizing: border-box; padding: 2px 1px; border: 1.5px solid #1a221e; background: rgba(255, 255, 255, .55); text-align: center; }
.slip[data-type="side"] .slip-kind { border-color: var(--side); color: var(--side); }
.sk-en { font: 900 5.5px/1 var(--num-font); letter-spacing: -.02em; transform: scaleX(.9); white-space: nowrap; }
.sk-sub { color: #3a4540; font-size: 7.5px; font-weight: 800; line-height: 1; }
.slip[data-type="side"] .sk-sub { color: var(--side); }
.sk-jp { display: flex; flex-direction: column; align-items: center; margin: 2px 0; font-size: .75rem; font-weight: 900; line-height: 1.08; }
.sk-stack { display: flex; flex-direction: column; align-items: center; }
.sk-stack i { display: block; font-style: normal; }
.slip-right { display: flex; flex-direction: column; justify-content: center; gap: 5px; min-width: 0; }
.sr-line { display: flex; align-items: center; justify-content: space-between; gap: 4px; }
.sr-picks { display: inline-flex; align-items: center; gap: 2px; min-width: 0; }
.slip .gate { width: auto; min-width: 22px; height: 22px; padding: 0 3px; border: 1.5px solid #1a221e; border-radius: 0; background: rgba(255, 255, 255, .8) !important; color: #111613 !important; font-size: .88rem; font-weight: 900; }
.slip .pick-dash { display: inline-grid; place-items: center; width: 8px; color: #1a221e; font-style: normal; font-size: .62rem; font-weight: 900; }
.slip .order-tri { width: 9px; height: 8px; color: #1a221e; }
.sr-amt { display: inline-flex; align-items: baseline; gap: 2px; white-space: nowrap; }
.sr-amt span { color: #2b3530; font-size: 9px; letter-spacing: -1px; }
.sr-amt b { font-size: 1rem; font-weight: 900; line-height: 1; }
.sr-amt small { font-size: .62rem; font-weight: 800; }
.slip-horse { min-width: 0; overflow: hidden; color: #26302b; font-size: .66rem; font-weight: 800; text-overflow: ellipsis; white-space: nowrap; }
.sr-low { display: flex; align-items: baseline; justify-content: space-between; gap: 6px; padding-top: 3px; border-top: 1px dashed rgba(17, 22, 19, .18); color: #55605a; font-size: .66rem; font-weight: 800; font-variant-numeric: tabular-nums; white-space: nowrap; }
.sr-low .r-expect { color: #111613; font-size: .72rem; font-weight: 900; }
.slip.is-hit .sr-low .r-expect { color: #d61f26; font-size: .8rem; }
.slip-foot { grid-column: 1 / -1; display: flex; align-items: center; justify-content: space-between; gap: 6px; margin-top: 5px; padding-top: 3px; border-top: 1px solid rgba(17, 22, 19, .1); color: #3c4741; font-size: .53rem; font-weight: 700; line-height: 1.3; letter-spacing: .04em; }
.slip-ride { margin-left: 5px; padding: 1px 4px; border: 1px solid var(--side); border-radius: 2px; color: var(--side); font-size: .53rem; font-style: normal; font-weight: 900; }
.slip-no { white-space: nowrap; }
/* settle page: a hit has a red frame and a red slanted 的中 stamp at the top right; a miss is pale with a はずれ stamp */
.slip-stamp { position: absolute; top: 3px; right: 8px; z-index: 1; padding: 1px 6px; border: 2px solid currentColor; border-radius: 3px; background: rgba(255, 255, 255, .92); font-size: .7rem; font-weight: 900; letter-spacing: .08em; line-height: 1.3; transform: rotate(-6deg); }
.slip.is-hit { --edge: #d61f26; box-shadow: 0 0 0 1px rgba(214, 31, 38, .25); }
.slip.is-hit .slip-stamp { color: #d61f26; }
.slip.is-miss { opacity: .62; filter: saturate(.35); }
.slip.is-miss .slip-stamp { border-width: 1px; border-radius: 2px; color: #5d6862; font-size: .62rem; font-weight: 800; letter-spacing: 0; }
.slip.is-hit .slip-right, .slip.is-miss .slip-right { padding-top: 24px; } /* B-6b: the stamp is higher (top: 3px) and the amount sits 6px clear of it */
@media (max-width: 340px) {
  .slip { grid-template-columns: 70px 30px minmax(0, 1fr); column-gap: 5px; padding-inline: 6px; }
  .slip .gate { min-width: 19px; height: 20px; padding: 0 2px; font-size: .8rem; }
  .slip .pick-dash { width: 6px; }
  .slip .order-tri { width: 7px; }
  .sr-amt b { font-size: .9rem; }
}
/* the four heads (本紙 広場 速報 調教) are two letters each; in cells of 14px (under 375px) they stand one letter above the other, so they keep clear */
@media (max-width: 374px) {
  .course-paper-head .course-opinion-head .course-mark-group { align-items: start; line-height: 1.05; }
  .course-paper-head .course-opinion-head .course-mark-group span { justify-self: center; width: 1.1em; white-space: normal; overflow-wrap: anywhere; }
}
/* B-5b: the stable's cards may shrink to the dialog (at 320px the day's entry choices pushed it 30px wide) */
.stb-card, .stb-today, .entry-choices { min-width: 0; }
.entry-choice { min-width: 0; max-width: 100%; }
.entry-choice .ec-main { min-width: 0; flex-wrap: wrap; }

/* B-6b: while the race's limit is spent the stake controls are dimmed, and the button reads 投票上限; a ころがし shows one line of what it pays */
.stake-line :disabled, .stake-slider input:disabled { opacity: .4; cursor: not-allowed; }
.ride-line .projection { margin-left: auto; }

/* B-7 ベータ公開: the first-visit guide (white, thin rules, a deep-green heading, 3px corners), the footer line, the reset dialog, the record copy */
dialog.guide { width: min(92vw, 380px); max-height: min(92dvh, calc(100svh - 24px)); margin: auto; padding: 0; border: 1px solid var(--tm-line-strong); border-radius: 3px; background: #fff; color: var(--tm-ink); overflow-y: auto; overscroll-behavior: contain; }
dialog.guide::backdrop { background: #11161394; }
.guide h2 { margin: 0; padding: 12px 14px 9px; border-bottom: 2px solid var(--tm-turf-deep); color: var(--tm-turf-deep); font-size: .98rem; font-weight: 900; }
.guide-steps { list-style: none; margin: 0; padding: 2px 14px; }
.guide-steps li { display: flex; align-items: flex-start; gap: 10px; padding: 7px 0; border-top: 1px solid var(--tm-line); font-size: .76rem; line-height: 1.55; }
.guide-steps li:first-child { border-top: 0; }
.guide-no { flex: none; width: 20px; height: 20px; display: grid; place-items: center; border-radius: 3px; background: var(--tm-turf-deep); color: #fff; font-size: .72rem; font-weight: 900; }
.guide-steps span { min-width: 0; }
.guide-steps strong { display: block; color: var(--tm-turf-deep); font-weight: 900; font-size: .8rem; }
.guide-tip { margin: 2px 14px 0; padding: 6px 10px 7px; border: 1px solid #d3d9df; border-left: 3px solid #0a6335; border-radius: 3px; background: #f4f6f8; }
.guide-tip h3 { margin: 0 0 4px; color: #0a6335; font-size: .78rem; font-weight: 900; }
.guide-tip ul { margin: 0; padding: 0; list-style: none; }
.guide-tip li { padding: 2px 0 2px 10px; position: relative; font-size: .72rem; line-height: 1.5; }
.nw { display: inline-block; white-space: nowrap; }
.guide-tip li::before { content: ''; position: absolute; left: 0; top: .72em; width: 4px; height: 4px; border-radius: 50%; background: #0a6335; }
.guide-start { display: block; width: calc(100% - 28px); margin: 8px 14px 12px; border-radius: 3px; }
.help-guide { margin: 8px 0 0; padding-top: 8px; border-top: 1px solid #e3e7eb; text-align: right; }
.help-guide button, .beta-foot button { padding: 4px 2px; border: 0; background: none; color: var(--tm-turf-deep); font: inherit; font-size: .72rem; font-weight: 700; text-decoration: underline; cursor: pointer; }
.beta-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 2px 14px; margin: 14px 0 8px; padding: 6px 10px; border: 1px solid var(--tm-line); border-radius: var(--tm-radius); background: #fff; color: var(--tm-muted); font-size: .68rem; line-height: 1.4; }
.beta-foot a { padding: 4px 2px; color: var(--tm-turf-deep); font-weight: 700; text-decoration: underline; }
.beta-foot button { color: var(--tm-muted); font-size: .68rem; }
.beta-ver { font-weight: 800; letter-spacing: .02em; }
dialog.reset-dialog { width: min(92vw, 360px); }
.reset-text { margin: 10px 0 12px; font-size: .76rem; line-height: 1.6; color: #27302c; }
.reset-actions { display: flex; gap: 8px; }
.reset-actions .button { flex: 1; min-height: 40px; border-radius: 3px; }
.reset-actions .button.primary { background: var(--tm-red); }
.day-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 0 0 6px; }
.day-head h2 { margin: 0; }
.day-copy { flex: none; min-height: 26px; padding: 0 9px; border: 1px solid #9aa4ad; border-radius: 3px; background: #fff; color: var(--tm-ink); font-size: .66rem; font-weight: 800; }
.day-copy.is-done { border-color: var(--tm-turf); background: var(--tm-select-turf); color: var(--tm-turf-deep); }
.race-bar-wallet.is-counting strong { color: #ffe27a; text-shadow: 0 0 6px rgba(255, 226, 122, .55); }
.race-bar-wallet strong { transition: color .4s, text-shadow .4s; }
.ride-note { display: block; margin: -2px 0 0; color: var(--tm-muted); font-size: .68rem; line-height: 1.4; }
.ride-note.is-short { color: #b3261e; font-weight: 800; }
@media (prefers-reduced-motion: reduce) { .race-bar-wallet strong { transition: none; } }
.settle .result-actions .button:disabled { opacity: .45; cursor: not-allowed; }
.slip-toast { position: absolute; left: max(14px, env(safe-area-inset-left)); right: max(14px, env(safe-area-inset-right)); bottom: calc(100% + 6px); z-index: 12; padding: 7px 8px 8px; border: 1.5px solid var(--tm-turf-deep); border-radius: 5px; background: #f8fbf9; box-shadow: 0 8px 24px #0e201738; animation: slip-pop .18s ease-out; }
@keyframes slip-pop { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
.slip-toast-head { display: flex; align-items: center; gap: 6px; margin-bottom: 5px; font-size: .7rem; font-weight: 800; color: var(--tm-turf-deep); }
.slip-toast-head strong { flex: 1; min-width: 0; }
.slip-toast-jump { padding: 2px 7px; border: 1px solid var(--tm-turf-deep); border-radius: 3px; background: #fff; color: var(--tm-turf-deep); font-size: .66rem; font-weight: 800; }
.slip-toast-close { width: 24px; height: 24px; padding: 0; border: 1px solid #c2cbd2; border-radius: 3px; background: #fff; color: var(--tm-muted); font-size: .76rem; font-weight: 900; line-height: 1; }
.slip-toast-list { margin: 0; padding: 0; list-style: none; }
.slip-toast-more { margin: 5px 0 0; font-size: .66rem; font-weight: 700; color: var(--tm-muted); text-align: right; }
.bet-foot-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 5px; }
.bet-foot-row:empty { display: none; }
.bet-foot-row .notice { flex: 1; min-width: 0; margin-top: 0; }
.receipt-jump { flex: none; padding: 2px 7px; border: 1px solid #b8c4bc; border-radius: 3px; background: #f3f7f4; color: var(--tm-turf-deep); font-size: .66rem; font-weight: 800; white-space: nowrap; }
.slip-share { grid-column: 1 / -1; display: flex; justify-content: flex-end; margin-top: 4px; padding-top: 4px; border-top: 1px dashed rgba(214, 31, 38, .22); }
.slip-share-btn { min-height: 27px; padding: 2px 11px; border: 1px solid #1d2420; border-radius: 3px; background: #1d2420; color: #fff; font-size: .68rem; font-weight: 800; line-height: 1.2; }
.slip-share-btn:disabled { opacity: .6; }
.slip-share-btn.is-done { border-color: var(--tm-turf-deep); background: var(--tm-turf-deep); color: #fff; }
.share-intent-bar { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 4px 10px 10px; padding: 7px 10px; border: 1px solid #b8c4bc; border-radius: 4px; background: #f3f7f4; font-size: .72rem; font-weight: 700; color: var(--tm-ink); }
.share-x-btn { flex: none; padding: 5px 11px; border: 0; border-radius: 3px; background: #111613; color: #fff; font-size: .7rem; font-weight: 800; line-height: 1.2; white-space: nowrap; }
