:root {
  --bg: #f3f5f6;
  --ink: #202428;
  --muted: #66717a;
  --line: #d6dde2;
  --header: #123c36;
  --header-2: #0f5b50;
  --accent: #f49a28;
  --link: #1769aa;
  --surface: #ffffff;
  --tab: #edf3f2;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Noto Sans JP", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 14px;
  line-height: 1.5;
}

a {
  color: var(--link);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.site-header {
  background: var(--header);
  color: #fff;
  border-bottom: 4px solid var(--accent);
}

.site-header__inner {
  width: min(1280px, 100%);
  min-height: 54px;
  margin: 0 auto;
  padding: 0 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.site-title {
  color: #fff;
  font-weight: 700;
  font-size: 18px;
}

.site-nav {
  display: flex;
  gap: 6px;
}

.site-nav a {
  color: #dcece9;
  padding: 8px 10px;
  border-radius: 4px;
}

.site-nav a:hover {
  background: rgba(255, 255, 255, 0.12);
  text-decoration: none;
}

.site-user {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #dcece9;
  font-size: 13px;
}

.site-user form {
  margin: 0;
}

.site-user button,
.site-user a {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 6px 10px;
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  font: inherit;
  cursor: pointer;
}

.site-user button:hover,
.site-user a:hover {
  background: rgba(255, 255, 255, 0.16);
  text-decoration: none;
}

.race-selector {
  background: #fff;
  border-bottom: 1px solid var(--line);
}

.race-selector__inner {
  width: min(1280px, 100%);
  margin: 0 auto;
  padding: 12px 16px;
  display: grid;
  grid-template-columns: 160px minmax(420px, 1fr);
  gap: 16px;
  align-items: center;
}

.race-selector__date {
  color: var(--muted);
  font-weight: 700;
}

.race-buttons {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.race-button {
  min-width: 58px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #fff;
  color: var(--ink);
  font-weight: 700;
  gap: 4px;
}

.race-button.is-active {
  background: var(--header-2);
  border-color: var(--header-2);
  color: #fff;
}

.race-button span {
  color: inherit;
  opacity: 0.72;
  font-size: 11px;
  font-weight: 600;
}

.date-filter {
  display: flex;
  justify-content: flex-end;
  align-items: end;
  gap: 8px;
  flex-wrap: wrap;
}

.date-filter label {
  display: grid;
  gap: 2px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.date-filter input {
  height: 32px;
  min-width: 138px;
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 0 8px;
  color: var(--ink);
  background: #fff;
}

.date-filter button,
.clear-filter {
  height: 32px;
  border-radius: 4px;
  border: 1px solid var(--header-2);
  padding: 0 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--header-2);
  color: #fff;
  font-weight: 700;
  cursor: pointer;
}

.clear-filter {
  background: #fff;
  color: var(--header-2);
}

.date-filter--empty {
  justify-content: flex-start;
  margin-top: 18px;
}

.race-hero {
  background: linear-gradient(180deg, #ffffff 0%, #eef4f3 100%);
  border-bottom: 1px solid var(--line);
}

.race-hero__inner {
  width: min(1280px, 100%);
  margin: 0 auto;
  padding: 18px 16px;
  display: grid;
  grid-template-columns: 86px 1fr;
  gap: 16px;
  align-items: center;
}

.race-number {
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--header-2);
  color: #fff;
  border-radius: 6px;
  font-size: 28px;
  font-weight: 800;
}

.race-main h1 {
  margin: 0 0 4px;
  font-size: 28px;
  line-height: 1.25;
}

.race-meta,
.race-submeta {
  margin: 0;
  color: var(--muted);
}

.race-submeta span {
  margin-left: 12px;
  color: var(--ink);
  font-weight: 700;
}

.race-tabs {
  background: #fff;
  border-bottom: 1px solid var(--line);
}

.race-tabs__inner {
  width: min(1280px, 100%);
  margin: 0 auto;
  padding: 0 16px;
  display: flex;
  align-items: center;
  gap: 6px;
  overflow-x: auto;
}

.race-tabs a {
  height: 44px;
  padding: 0 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-left: 1px solid var(--line);
  color: var(--ink);
  white-space: nowrap;
  font-weight: 700;
}

.race-tabs a:last-child {
  border-right: 1px solid var(--line);
}

.race-tabs a.is-active,
.race-tabs a.is-active-weak {
  color: #fff;
  background: var(--header-2);
}

.assistant-panel {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 60;
}

.assistant-panel__toggle {
  width: 64px;
  height: 44px;
  border: 0;
  border-radius: 8px;
  background: var(--header-2);
  color: #fff;
  font-weight: 800;
  box-shadow: 0 8px 24px rgba(18, 60, 54, 0.24);
  cursor: pointer;
}

.assistant-panel__drawer {
  position: absolute;
  right: 0;
  bottom: 54px;
  width: min(420px, calc(100vw - 24px));
  height: min(680px, calc(100vh - 92px));
  display: grid;
  grid-template-rows: auto auto 1fr auto;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 18px 44px rgba(32, 36, 40, 0.22);
}

.assistant-panel__drawer[hidden] {
  display: none;
}

.assistant-panel__header {
  padding: 12px 14px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
  border-bottom: 1px solid var(--line);
  background: #f7faf9;
}

.assistant-panel__header span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.assistant-panel__header strong {
  display: block;
  font-size: 14px;
  line-height: 1.35;
}

.assistant-panel__actions {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.assistant-panel__clear {
  height: 30px;
  padding: 0 9px;
  border: 1px solid #cfd8dc;
  border-radius: 6px;
  background: #fff;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
  cursor: pointer;
}

.assistant-panel__close {
  width: 30px;
  height: 30px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
}

.assistant-panel__prompts {
  padding: 10px 12px;
  display: flex;
  gap: 6px;
  overflow-x: auto;
  border-bottom: 1px solid var(--line);
}

.assistant-panel__prompts button {
  flex: 0 0 auto;
  height: 30px;
  border: 1px solid #c9d8d5;
  border-radius: 6px;
  background: #edf5f3;
  color: #174840;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.assistant-panel__messages {
  padding: 12px;
  display: grid;
  align-content: start;
  gap: 10px;
  overflow: auto;
  background: #f5f7f8;
}

.assistant-message {
  display: grid;
  gap: 6px;
}

.assistant-message__body {
  width: fit-content;
  max-width: 100%;
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  line-height: 1.55;
}

.assistant-message--user .assistant-message__body {
  justify-self: end;
  border-color: #b7d4cf;
  background: #e6f4f1;
}

.assistant-message__warnings {
  display: grid;
  gap: 4px;
  color: #9a5a00;
  font-size: 12px;
}

.assistant-sources {
  border: 1px solid #d9e1e5;
  border-radius: 8px;
  background: #fff;
}

.assistant-sources summary {
  padding: 7px 9px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}

.assistant-sources__list {
  display: grid;
  gap: 0;
  border-top: 1px solid #e5ebef;
}

.assistant-source {
  padding: 8px 9px;
  border-top: 1px solid #edf1f3;
}

.assistant-source:first-child {
  border-top: 0;
}

.assistant-source p {
  margin: 3px 0;
  color: var(--muted);
  font-size: 12px;
}

.assistant-source code {
  color: #5e6972;
  font-size: 11px;
}

.assistant-panel__form {
  padding: 10px;
  display: grid;
  grid-template-columns: 1fr 64px;
  gap: 8px;
  border-top: 1px solid var(--line);
  background: #fff;
}

.assistant-panel__form textarea {
  width: 100%;
  min-height: 54px;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 8px;
  font: inherit;
}

.assistant-panel__form button {
  border: 0;
  border-radius: 6px;
  background: var(--header-2);
  color: #fff;
  font-weight: 800;
  cursor: pointer;
}

.assistant-panel__form.is-loading button {
  opacity: 0.65;
  pointer-events: none;
}

.race-tabs a.is-active-weak {
  background: #2f7185;
}

.race-tabs__actions {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.race-refresh-form {
  display: inline-flex;
  align-items: center;
}

.race-refresh-form button {
  height: 32px;
  padding: 0 12px;
  border: 1px solid #b6c6c8;
  border-radius: 4px;
  background: #fff;
  color: #23494c;
  font-weight: 900;
  white-space: nowrap;
  cursor: pointer;
}

.race-refresh-form button:hover {
  background: #eef7f8;
}

.refresh-status,
.refresh-message {
  min-height: 24px;
  padding: 3px 8px;
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  background: #f3f7f8;
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  white-space: nowrap;
}

.refresh-message--updated {
  background: #eaf8ee;
  color: #1f6b35;
}

.refresh-message--error {
  background: #fff0f2;
  color: #8b1d2d;
}

.content-band {
  padding: 18px 0 40px;
}

.content-band__inner,
.empty-state {
  width: min(1280px, 100%);
  margin: 0 auto;
  padding: 0 16px;
}

.content-band__inner--axis {
  width: min(1840px, 100%);
}

.content-band__inner--past-detail {
  width: min(1840px, 100%);
}

.content-band__inner--time-rankings {
  width: min(1680px, 100%);
}

.content-band__inner--standard-times {
  width: min(1500px, 100%);
}

.content-band__inner--auth {
  width: min(920px, 100%);
}

.auth-panel {
  max-width: 520px;
  margin: 24px auto 0;
  padding: 22px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.auth-panel h1 {
  margin: 0 0 16px;
  font-size: 22px;
}

.auth-form {
  display: grid;
  gap: 14px;
}

.auth-form label {
  display: grid;
  gap: 6px;
  font-weight: 700;
}

.auth-form input,
.auth-form select {
  width: 100%;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 8px 10px;
  font: inherit;
  background: #fff;
}

.auth-form .checkbox-line {
  display: flex;
  align-items: center;
  gap: 8px;
}

.auth-form .checkbox-line input {
  width: auto;
  min-height: 0;
}

.auth-form button {
  min-height: 42px;
  border: 0;
  border-radius: 6px;
  background: var(--header-2);
  color: #fff;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.section-title {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 10px;
}

.section-title h2 {
  margin: 0;
  font-size: 20px;
}

.section-title p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.mono,
code {
  font-family: "Noto Sans Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.table-scroll {
  overflow-x: auto;
  border: 1px solid var(--line);
  background: var(--surface);
}

.newspaper-table {
  width: 100%;
  min-width: 1180px;
  border-collapse: collapse;
  table-layout: fixed;
}

.newspaper-table th {
  background: #dfe9e7;
  color: #27312f;
  font-size: 12px;
  padding: 8px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  text-align: center;
  white-space: nowrap;
}

.newspaper-table td {
  padding: 8px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  vertical-align: top;
  background: #fff;
}

.newspaper-table tbody tr:nth-child(even) td {
  background: #fbfcfd;
}

.col-frame {
  width: 42px;
}

.col-number {
  width: 52px;
}

.col-entry-mark {
  width: 72px;
}

.col-horse {
  width: 210px;
}

.col-jockey {
  width: 104px;
}

.col-trainer {
  width: 92px;
}

.col-weight {
  width: 92px;
}

.col-history {
  width: 580px;
}

.col-axis-status {
  width: 96px;
}

.col-axis-count {
  width: 82px;
}

.col-axis-best {
  width: 210px;
}

.col-axis-place {
  width: 64px;
}

.col-axis-front {
  width: 84px;
}

.col-axis-history {
  width: 620px;
}

.col-rank {
  width: 56px;
}

.col-time-latest,
.col-time-fastest {
  width: 190px;
}

.col-ranking-race {
  width: 260px;
}

.col-result-position {
  width: 48px;
}

.col-result-weight {
  width: 68px;
}

.col-result-time {
  width: 96px;
}

.col-result-margin {
  width: 110px;
}

.col-result-passing {
  width: 140px;
}

.frame-cell,
.horse-number {
  text-align: center;
  font-weight: 800;
}

.frame-cell {
  color: #fff;
}

.entry-mark-cell {
  text-align: center;
  vertical-align: middle !important;
}

.entry-mark-form {
  display: grid;
  justify-items: center;
  gap: 4px;
}

.entry-mark-select {
  width: 58px;
  height: 32px;
  border: 1px solid #cbd6dc;
  border-radius: 4px;
  background: #fff;
  color: #1d2a2f;
  font-size: 15px;
  font-weight: 900;
  text-align: center;
}

.entry-mark-form button {
  height: 24px;
  border: 1px solid var(--header-2);
  border-radius: 4px;
  background: var(--header-2);
  color: #fff;
  font-size: 11px;
  font-weight: 800;
}

.entry-mark-readonly {
  display: inline-flex;
  min-width: 34px;
  min-height: 28px;
  align-items: center;
  justify-content: center;
  border: 1px solid #cbd6dc;
  border-radius: 4px;
  background: #fff;
  color: #1d2a2f;
  font-size: 15px;
  font-weight: 900;
}

.entry-mark-readonly--empty {
  color: var(--muted);
  font-size: 13px;
}

.frame-none { background: #88939a !important; color: #fff; }
.frame-1 { background: #ffffff !important; color: #111; }
.frame-2 { background: #1c1c1c !important; }
.frame-3 { background: #d9272e !important; }
.frame-4 { background: #1b63b7 !important; }
.frame-5 { background: #f0cf2e !important; color: #111; }
.frame-6 { background: #2d9f4a !important; }
.frame-7 { background: #ee8f23 !important; }
.frame-8 { background: #f2a4bc !important; color: #111; }

.horse-name {
  display: inline-block;
  color: #075a92;
  font-size: 16px;
  font-weight: 800;
  margin-bottom: 2px;
}

.horse-profile,
.muted {
  color: var(--muted);
  font-size: 12px;
}

.bloodline {
  margin-top: 6px;
  color: #4b565c;
  font-size: 12px;
  display: grid;
  gap: 2px;
}

.strong {
  font-weight: 700;
}

.history-cell {
  padding: 0 !important;
}

.history-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  font-size: 12px;
}

.history-table th,
.history-table td {
  padding: 5px 6px;
  border-right: 1px solid #e5eaee;
  border-bottom: 1px solid #e5eaee;
  background: transparent;
}

.history-table th {
  background: #f4f7f8;
  color: #56626a;
  font-weight: 700;
}

.history-race-name {
  width: 190px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.finish-win {
  color: #b11626;
  font-weight: 800;
}

.finish-place {
  color: #1769aa;
  font-weight: 800;
}

.no-history {
  min-height: 86px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  background: #f8fafb;
}

.past-detail-scroll {
  max-width: 100%;
  overflow: auto;
  border: 1px solid var(--line);
  background: var(--surface);
}

.past-detail-table {
  width: max-content;
  min-width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  table-layout: fixed;
}

.past-detail-table th,
.past-detail-table td {
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: #fff;
  vertical-align: top;
}

.past-detail-table th {
  position: sticky;
  top: 0;
  z-index: 4;
  padding: 8px;
  background: #dfe9e7;
  color: #27312f;
  font-size: 12px;
  text-align: center;
  white-space: nowrap;
}

.past-detail-table tbody tr:nth-child(even) td {
  background: #fbfcfd;
}

.past-sticky {
  position: sticky;
  z-index: 2;
}

.past-detail-table th.past-sticky {
  z-index: 5;
}

.past-sticky--frame {
  left: 0;
  width: 42px;
  min-width: 42px;
  max-width: 42px;
}

.past-sticky--number {
  left: 42px;
  width: 52px;
  min-width: 52px;
  max-width: 52px;
}

.past-sticky--mark {
  left: 94px;
  width: 72px;
  min-width: 72px;
  max-width: 72px;
}

.past-sticky--horse {
  left: 166px;
  width: 220px;
  min-width: 220px;
  max-width: 220px;
}

td.past-sticky--number,
td.past-sticky--mark,
td.past-sticky--horse {
  background: #fff;
}

.past-detail-table tbody tr:nth-child(even) td.past-sticky--number,
.past-detail-table tbody tr:nth-child(even) td.past-sticky--mark,
.past-detail-table tbody tr:nth-child(even) td.past-sticky--horse {
  background: #fbfcfd;
}

.past-detail-table td.past-sticky--frame {
  z-index: 3;
}

.past-detail-table th.past-sticky--frame,
.past-detail-table th.past-sticky--number,
.past-detail-table th.past-sticky--mark,
.past-detail-table th.past-sticky--horse {
  background: #dfe9e7;
}

.past-sticky--horse {
  padding: 8px;
}

.entry-status-badge {
  display: inline-flex;
  height: 22px;
  align-items: center;
  border-radius: 999px;
  padding: 0 8px;
  background: #6f7780;
  color: #fff;
  font-size: 11px;
  font-weight: 800;
}

.transfer-badge {
  margin-top: 4px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  width: fit-content;
  max-width: 100%;
  padding: 3px 7px;
  border: 1px solid #d4c16c;
  border-radius: 999px;
  background: #fff8dc;
  color: #604810;
  font-size: 11px;
  font-weight: 900;
  line-height: 1.25;
  vertical-align: middle;
}

.transfer-badge em {
  color: #80621a;
  font-size: 10px;
  font-style: normal;
  font-weight: 800;
}

.transfer-badge--central {
  border-color: #e1a1a7;
  background: #fff0f2;
  color: #8b1d2d;
}

.transfer-badge--central em {
  color: #9e4250;
}

.transfer-badge--local {
  border-color: #9fc0e0;
  background: #edf6ff;
  color: #15527d;
}

.transfer-badge--local em {
  color: #416985;
}

.distance-change-badge {
  margin-top: 4px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  width: fit-content;
  max-width: 100%;
  padding: 3px 7px;
  border: 1px solid #b7c985;
  border-radius: 999px;
  background: #f6fbec;
  color: #405b12;
  font-size: 11px;
  font-weight: 900;
  line-height: 1.25;
  vertical-align: middle;
}

.distance-change-badge em {
  color: #667b38;
  font-size: 10px;
  font-style: normal;
  font-weight: 800;
}

.distance-change-badge--extend {
  border-color: #e5b078;
  background: #fff4e8;
  color: #7a3c0b;
}

.distance-change-badge--extend em {
  color: #8f5a2b;
}

.layoff-badge {
  margin-top: 4px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  width: fit-content;
  max-width: 100%;
  padding: 3px 7px;
  border: 1px solid #c6a6d7;
  border-radius: 999px;
  background: #f7effb;
  color: #5f2c78;
  font-size: 11px;
  font-weight: 900;
  line-height: 1.25;
  vertical-align: middle;
}

.layoff-badge em {
  color: #7b5590;
  font-size: 10px;
  font-style: normal;
  font-weight: 800;
}

.odds-badge {
  margin-top: 4px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  width: fit-content;
  max-width: 100%;
  padding: 3px 7px;
  border: 1px solid #9cb8d8;
  border-radius: 999px;
  background: #eef6ff;
  color: #164c7d;
  font-size: 11px;
  font-weight: 900;
  line-height: 1.25;
  vertical-align: middle;
}

.odds-badge em {
  color: #42647f;
  font-size: 10px;
  font-style: normal;
  font-weight: 800;
}

.past-result-col,
.past-result-cell {
  width: 260px;
  min-width: 260px;
}

.past-result-cell {
  padding: 0;
}

.past-result-card {
  min-height: 164px;
  padding: 8px;
  display: grid;
  grid-template-rows: auto auto auto 1fr;
  gap: 5px;
}

.past-result-card__head {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.past-result-card__head strong {
  color: #27312f;
}

.past-result-card__race {
  min-height: 36px;
  color: #1f2b30;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.past-result-card__meta {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.past-result-card__stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4px;
  font-size: 12px;
}

.past-result-card__stats span {
  min-height: 24px;
  padding: 3px 5px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border: 1px solid #e6ecef;
  border-radius: 4px;
  background: #fbfcfd;
  white-space: nowrap;
}

.past-result-card__stats .past-result-class-equivalent {
  grid-column: 1 / -1;
  border-color: #dfc474;
  background: #fff8df;
  color: #684b0d;
  cursor: help;
  font-weight: 900;
}

.past-result-card__stats b {
  color: var(--muted);
  font-size: 10px;
  font-weight: 900;
}

.past-result-card__stats em {
  font-style: normal;
}

.past-result-empty {
  min-height: 164px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
}

.content-band__inner--result {
  width: min(1500px, 100%);
}

.content-band__inner--video {
  width: min(1120px, 100%);
}

.result-summary {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}

.result-summary > div {
  min-height: 58px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  background: #fff;
}

.result-summary span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
}

.result-summary strong {
  display: block;
  margin-top: 4px;
  color: #18231f;
  font-size: 15px;
}

.race-video-summary {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.race-video-player {
  width: 100%;
}

.race-video-player video {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  height: auto;
  background: #101416;
  border: 1px solid var(--line);
}

.race-video-player__message {
  margin-top: 10px;
  padding: 10px 12px;
  border: 1px solid #efd0a6;
  background: #fff7ed;
  color: #7a4c10;
  font-weight: 700;
}

.result-section {
  margin-top: 18px;
}

.result-section__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.result-section__head h3 {
  margin: 0;
  font-size: 17px;
}

.result-section__head span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.result-table {
  min-width: 1320px;
}

.result-table td {
  vertical-align: middle;
}

.result-time {
  font-weight: 900;
  color: #123c36;
}

.result-row--non-finish td {
  color: #6f7780;
}

.payout-groups {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 12px;
}

.payout-group {
  border: 1px solid var(--line);
  background: #fff;
}

.payout-group__title {
  padding: 9px 10px;
  border-bottom: 1px solid var(--line);
  background: #dfe9e7;
  color: #27312f;
  font-weight: 900;
}

.payout-table {
  width: 100%;
  border-collapse: collapse;
}

.payout-table th,
.payout-table td {
  padding: 7px 9px;
  border-right: 1px solid #e5eaee;
  border-bottom: 1px solid #e5eaee;
  text-align: right;
}

.payout-table th {
  background: #f4f7f8;
  color: #56626a;
  font-size: 12px;
}

.payout-table th:first-child,
.payout-table td:first-child {
  text-align: left;
  font-weight: 800;
}

.content-band__inner--bets {
  width: min(1500px, 100%);
}

.bet-layout {
  display: grid;
  grid-template-columns: minmax(500px, 1fr) minmax(360px, 1fr);
  gap: 14px;
  align-items: start;
}

.bet-entry-panel,
.bet-summary-panel {
  border: 1px solid var(--line);
  background: #fff;
  padding: 12px;
}

.bet-entry-panel h3,
.bet-summary-panel h3 {
  margin: 0 0 10px;
  font-size: 16px;
}

.bet-form {
  display: grid;
  gap: 10px;
}

.bet-form-grid {
  display: grid;
  grid-template-columns: minmax(160px, 1fr) minmax(120px, 0.7fr);
  gap: 10px;
}

.bet-form label {
  display: grid;
  gap: 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.bet-form input,
.bet-form select {
  height: 36px;
  border: 1px solid #cbd6dc;
  border-radius: 4px;
  padding: 0 9px;
  color: #1d2a2f;
  font: inherit;
}

.bet-mode-options {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.bet-mode-options label {
  min-height: 30px;
  padding: 5px 9px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border: 1px solid #cbd6dc;
  border-radius: 4px;
  background: #f8fbfb;
  color: #233236;
  font-size: 12px;
}

.bet-mode-options label.is-active {
  border-color: var(--header-2);
  background: #e9f4f2;
  color: #173f38;
}

.bet-mode-panel {
  padding: 10px;
  border: 1px solid #e0e8eb;
  background: #fbfcfd;
}

.bet-form[data-enhanced="true"] .bet-mode-panel:not(.is-active) {
  display: none;
}

.bet-mode-panel h4,
.bet-mode-panel h5 {
  margin: 0 0 8px;
  color: #1d2a2f;
}

.bet-mode-panel h4 {
  font-size: 14px;
}

.bet-mode-panel h5 {
  font-size: 12px;
}

.bet-mode-panel__head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 10px;
}

.bet-mode-panel__head label {
  max-width: 132px;
}

.bet-flow-controls {
  display: grid;
  grid-template-columns: minmax(110px, 1fr);
  gap: 8px;
  width: min(100%, 150px);
}

.bet-mode-panel__head .bet-flow-controls label {
  max-width: none;
}

.bet-fixed-axis-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 8px;
  margin: 10px 0;
}

.bet-flow-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.bet-formation-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.bet-number-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(148px, 1fr));
  gap: 5px;
}

.bet-number-option {
  min-height: 42px;
  padding: 5px;
  display: grid !important;
  grid-template-columns: auto 22px 1fr;
  align-items: center;
  gap: 4px !important;
  border: 1px solid #d8e2e6;
  border-radius: 4px;
  background: #fff;
  color: #1d2a2f !important;
  font-size: 11px !important;
  font-weight: 800 !important;
}

.bet-number-option span {
  min-width: 22px;
  min-height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: #edf5f3;
  color: #174840;
  font-weight: 900;
}

.bet-number-option em {
  min-width: 0;
  color: #45545b;
  font-style: normal;
  line-height: 1.25;
  overflow-wrap: anywhere;
  white-space: normal;
}

.bet-form button,
.inline-delete-form button,
.inline-stake-form button,
.bet-bulk-actions button {
  height: 34px;
  border: 1px solid var(--header-2);
  border-radius: 4px;
  background: var(--header-2);
  color: #fff;
  font-weight: 900;
  cursor: pointer;
}

.inline-delete-form button,
.inline-stake-form button {
  height: 28px;
  padding: 0 9px;
  border-color: #c7d1d5;
  background: #fff;
  color: #44525a;
}

.inline-stake-form {
  display: grid;
  grid-template-columns: minmax(0, 82px) auto;
  gap: 5px;
  align-items: center;
  justify-content: center;
}

.inline-stake-form input {
  min-width: 0;
  width: 100%;
  height: 28px;
  border: 1px solid #cbd6dc;
  border-radius: 4px;
  padding: 0 6px;
  font: inherit;
}

.bet-bulk-actions {
  margin-bottom: 8px;
  display: flex;
  justify-content: flex-end;
}

.bet-select-checkbox,
[data-bet-select-all] {
  width: 16px;
  height: 16px;
}

.bet-summary-filter {
  margin-bottom: 14px;
}

.bet-summary-panel--wide {
  margin-bottom: 18px;
}

.bet-summary-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.bet-summary-grid--wide {
  grid-template-columns: repeat(7, minmax(0, 1fr));
}

.bet-summary-grid > div {
  min-height: 58px;
  padding: 9px 10px;
  border: 1px solid #e1e8eb;
  background: #f8fbfb;
}

.bet-summary-grid span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
}

.bet-summary-grid strong {
  display: block;
  margin-top: 4px;
  font-size: 15px;
}

.bet-scroll .newspaper-table {
  min-width: 1160px;
}

.bet-table th:nth-child(1),
.bet-table td:nth-child(1) {
  width: 48px;
}

.bet-table th:nth-child(4),
.bet-table td:nth-child(4) {
  width: 150px;
}

.bet-table th:nth-child(10),
.bet-table td:nth-child(10) {
  width: 72px;
}

.bet-type-table {
  max-width: 820px;
}

.bet-result-badge,
.bet-message {
  min-height: 24px;
  padding: 3px 8px;
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  background: #f3f7f8;
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  white-space: nowrap;
}

.bet-message {
  margin-bottom: 12px;
}

.bet-result-badge--hit,
.bet-message--updated {
  background: #eaf8ee;
  color: #1f6b35;
}

.bet-result-badge--lost,
.bet-message--error {
  background: #fff0f2;
  color: #8b1d2d;
}

.bet-profit--plus {
  color: #1f6b35 !important;
  font-weight: 900;
}

.bet-profit--minus {
  color: #8b1d2d !important;
  font-weight: 900;
}

.content-band__inner--notes {
  width: min(1400px, 100%);
}

.notes-form {
  display: grid;
  gap: 14px;
}

.note-panel,
.horse-note-race {
  border: 1px solid var(--line);
  background: #fff;
}

.note-panel {
  padding: 12px;
}

.note-panel__head {
  margin-bottom: 10px;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}

.note-panel__head h3 {
  margin: 0;
  color: #17221f;
  font-size: 16px;
}

.note-panel__head span,
.note-updated,
.horse-note-race__form > span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.notes-form textarea,
.horse-note-race__form textarea {
  width: 100%;
  min-height: 96px;
  border: 1px solid #cbd6dc;
  border-radius: 4px;
  padding: 9px 10px;
  color: #1d2a2f;
  background: #fff;
  font: inherit;
  resize: vertical;
}

.note-entry-list {
  display: grid;
  border: 1px solid var(--line);
}

.note-entry-row {
  display: grid;
  grid-template-columns: 48px 58px 70px minmax(240px, 0.8fr) minmax(360px, 1.2fr);
  gap: 8px;
  align-items: start;
  padding: 9px;
  border-bottom: 1px solid #e6ecef;
}

.note-entry-row:last-child {
  border-bottom: 0;
}

.note-entry-row--head {
  min-height: 36px;
  align-items: center;
  background: #dfe9e7;
  color: #27312f;
  font-size: 12px;
  font-weight: 900;
}

.note-entry-horse {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 6px;
}

.note-entry-horse .horse-name {
  margin-bottom: 0;
}

.note-entry-horse .note-updated {
  flex-basis: 100%;
}

.note-external-link,
.horse-note-hero__actions a,
.horse-note-race__link {
  min-height: 24px;
  padding: 2px 7px;
  display: inline-flex;
  align-items: center;
  border: 1px solid #cbd6dc;
  border-radius: 4px;
  background: #f8fbfb;
  color: #38515b;
  font-size: 11px;
  font-weight: 900;
}

.notes-actions {
  display: flex;
  justify-content: flex-end;
}

.notes-actions button,
.horse-note-race__form button {
  height: 36px;
  border: 1px solid var(--header-2);
  border-radius: 4px;
  padding: 0 14px;
  background: var(--header-2);
  color: #fff;
  font-weight: 900;
  cursor: pointer;
}

.horse-note-hero {
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, #ffffff 0%, #edf4f2 100%);
}

.horse-note-hero__inner {
  width: min(1280px, 100%);
  margin: 0 auto;
  padding: 20px 16px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
}

.horse-note-hero h1 {
  margin: 0 0 4px;
  font-size: 30px;
  line-height: 1.25;
}

.horse-note-hero p {
  margin: 0;
  color: var(--muted);
}

.horse-note-hero p span {
  margin-left: 12px;
  color: #2f3f45;
  font-weight: 800;
}

.horse-note-hero__eyebrow {
  margin-bottom: 4px !important;
  color: var(--header-2) !important;
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.horse-note-hero__actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}

.horse-note-list {
  display: grid;
  gap: 12px;
}

.horse-note-race {
  display: grid;
  grid-template-columns: minmax(280px, 0.8fr) minmax(360px, 1.2fr);
  gap: 12px;
  padding: 12px;
}

.horse-note-race.is-active {
  border-color: var(--header-2);
  box-shadow: inset 4px 0 0 var(--header-2);
}

.horse-note-race__meta {
  display: grid;
  gap: 10px;
  align-content: start;
}

.horse-note-race__race-head {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
  gap: 10px;
  align-items: stretch;
}

.horse-note-race__date {
  min-height: 64px;
  padding: 7px 8px;
  display: grid;
  align-content: center;
  border: 1px solid #c9d8d5;
  border-radius: 4px;
  background: #edf5f3;
  color: #173f38;
}

.horse-note-race__date span {
  display: block;
  font-size: 11px;
  font-weight: 900;
}

.horse-note-race__date strong {
  display: block;
  margin-top: 2px;
  font-size: 14px;
  line-height: 1.25;
}

.horse-note-race__title {
  min-width: 0;
  display: grid;
  align-content: center;
  gap: 3px;
}

.horse-note-race__title strong {
  color: #17221f;
  font-size: 18px;
  line-height: 1.25;
}

.horse-note-race__title span {
  color: #34454c;
  font-size: 13px;
  font-weight: 900;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.horse-note-race__details {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}

.horse-note-race__details > div {
  min-height: 44px;
  padding: 6px 8px;
  border: 1px solid #e1e8eb;
  border-radius: 4px;
  background: #f8fbfb;
}

.horse-note-race__details span {
  display: block;
  color: var(--muted);
  font-size: 10px;
  font-weight: 900;
}

.horse-note-race__details strong {
  display: block;
  margin-top: 2px;
  color: #203035;
  font-size: 13px;
  line-height: 1.2;
}

.horse-note-race__badges {
  display: flex;
  align-items: center;
  gap: 6px;
}

.horse-note-race__badge-label {
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
}

.horse-note-race__link {
  width: fit-content;
}

.horse-note-race__form {
  display: grid;
  gap: 7px;
}

.horse-note-race__form label {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.horse-note-race__form button {
  justify-self: end;
}

.horse-note-race__race-note {
  grid-column: 1 / -1;
  padding: 10px;
  border: 1px solid #e2d2a4;
  background: #fff9e9;
}

.horse-note-race__race-note span {
  display: block;
  margin-bottom: 4px;
  color: #735313;
  font-size: 11px;
  font-weight: 900;
}

.horse-note-race__race-note p {
  margin: 0;
  color: #2b2f31;
  white-space: pre-wrap;
}

.time-ranking-groups {
  display: grid;
  gap: 18px;
}

.time-ranking-group {
  border: 1px solid var(--line);
  background: var(--surface);
}

.time-ranking-group__head {
  display: flex;
  align-items: stretch;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  background: #f7faf9;
}

.time-ranking-group__title {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px;
  color: #17221f;
  font-size: 18px;
  font-weight: 900;
}

.time-ranking-group__title span {
  color: #4f5d58;
  font-size: 13px;
  font-weight: 800;
}

.time-ranking-group__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}

.time-ranking-group__meta span {
  display: inline-flex;
  align-items: center;
  height: 24px;
  padding: 0 8px;
  border: 1px solid #cad8d4;
  border-radius: 999px;
  background: #fff;
  color: #40504b;
  font-size: 12px;
  font-weight: 800;
}

.time-ranking-group__best {
  min-width: 110px;
  padding: 8px 10px;
  border: 1px solid #9fc2e4;
  background: #eef6fd;
  color: #164c7d;
  text-align: right;
}

.time-ranking-group__best span {
  display: block;
  font-size: 11px;
  font-weight: 900;
}

.time-ranking-group__best strong {
  display: block;
  margin-top: 2px;
  font-size: 18px;
  line-height: 1.2;
}

.time-ranking-scroll {
  border: 0;
  border-radius: 0;
}

.time-ranking-table {
  min-width: 1220px;
}

.rank-cell {
  color: #17221f;
  font-size: 18px;
  font-weight: 900;
  text-align: center;
}

.time-ranking-race-cell {
  vertical-align: middle;
}

.time-ranking-race {
  display: grid;
  gap: 6px;
  font-size: 12px;
}

.time-ranking-race div {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  color: #4d5b56;
  font-weight: 700;
}

.time-ranking-race a,
.time-ranking-race strong {
  color: #075a92;
  font-weight: 800;
}

.standard-time-note {
  margin-bottom: 14px;
  padding: 10px 12px;
  border: 1px solid #c9d9d4;
  background: #f7faf9;
  color: #40504b;
  font-size: 13px;
  font-weight: 700;
}

.standard-time-groups {
  display: grid;
  gap: 18px;
}

.standard-time-group {
  border: 1px solid var(--line);
  background: var(--surface);
}

.standard-time-group__head {
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  background: #dfe9e7;
  color: #27312f;
  font-size: 17px;
  font-weight: 900;
}

.standard-time-scroll {
  border: 0;
}

.standard-time-table {
  width: 100%;
  min-width: 980px;
  border-collapse: collapse;
  table-layout: fixed;
}

.standard-time-table th,
.standard-time-table td {
  padding: 8px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  text-align: center;
  white-space: nowrap;
}

.standard-time-table th {
  background: #f4f7f8;
  color: #27312f;
  font-size: 12px;
  font-weight: 900;
}

.standard-time-table td {
  background: #fff;
  font-size: 13px;
  font-weight: 800;
}

.standard-time-table tbody tr:nth-child(even) td,
.standard-time-table tbody tr:nth-child(even) th {
  background: #fbfcfd;
}

.standard-time-distance {
  width: 84px;
  color: #17221f;
}

.axis-toolbar {
  margin-bottom: 12px;
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}

.axis-condition-form {
  display: flex;
  align-items: end;
  gap: 8px;
  flex-wrap: wrap;
}

.axis-condition-form label {
  display: grid;
  gap: 2px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.axis-condition-form select {
  height: 34px;
  min-width: 118px;
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 0 8px;
  background: #fff;
  color: var(--ink);
  font-weight: 700;
}

.axis-condition-form button {
  height: 34px;
  border: 1px solid var(--header-2);
  border-radius: 4px;
  padding: 0 14px;
  background: var(--header-2);
  color: #fff;
  font-weight: 700;
  cursor: pointer;
}

.axis-condition-note {
  color: var(--muted);
  font-size: 12px;
}

.axis-summary {
  margin-bottom: 12px;
  padding: 12px 14px;
  display: grid;
  grid-template-columns: minmax(220px, 0.9fr) minmax(260px, 1.5fr) minmax(160px, 0.6fr);
  gap: 12px;
  align-items: center;
  border: 1px solid var(--line);
  border-left: 6px solid var(--header-2);
  background: #fff;
}

.axis-summary--pattern-1 {
  border-left-color: #16834c;
}

.axis-summary--pattern-2 {
  border-left-color: #d4861c;
}

.axis-summary--pattern-3 {
  border-left-color: #8b4d56;
}

.axis-summary__label {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.axis-candidate-name {
  display: inline-flex;
  margin: 2px 4px 2px 0;
  padding: 2px 7px;
  border-radius: 999px;
  background: #e6f4ee;
  color: #10613a;
  font-weight: 800;
}

.axis-alert {
  margin-bottom: 12px;
  padding: 10px 12px;
  border: 1px solid #e5c072;
  background: #fff7df;
  color: #65440b;
  font-weight: 700;
}

.axis-table-scroll .axis-table {
  min-width: 0;
}

.axis-table {
  table-layout: fixed;
}

.axis-table .col-horse {
  width: 160px;
}

.axis-table .col-axis-status {
  width: 86px;
}

.axis-table .col-axis-count {
  width: 74px;
}

.axis-table .col-axis-best {
  width: 190px;
}

.axis-table .col-axis-place {
  width: 56px;
}

.axis-table .col-axis-front {
  width: 70px;
}

.axis-table .col-axis-history {
  width: 40%;
}

.axis-row--candidate td {
  background: #f1fbf6 !important;
}

.axis-row--uncertain td {
  background: #fff8df !important;
}

.axis-row--excluded td {
  background: #f0f2f4 !important;
  color: #66717a;
}

.axis-pill {
  display: inline-flex;
  min-width: 62px;
  height: 24px;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  padding: 0 8px;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.axis-pill--candidate {
  background: #16834c;
  color: #fff;
}

.axis-pill--ranked {
  background: #dfe9e7;
  color: #27312f;
}

.axis-pill--uncertain {
  background: #d99616;
  color: #fff;
}

.axis-pill--excluded {
  background: #6f7780;
  color: #fff;
}

.axis-history-cell {
  padding: 0 !important;
}

.axis-best-time {
  color: #10251f;
  font-size: 18px;
  font-weight: 900;
  line-height: 1.2;
}

.axis-best-detail {
  margin-top: 3px;
  color: #2d3a36;
  font-size: 12px;
  font-weight: 800;
}

.axis-latest-time {
  margin-top: 8px;
  padding: 7px 8px;
  border: 1px solid #9fc2e4;
  border-radius: 6px;
  background: #eef6fd;
  color: #164c7d;
}

.axis-latest-time span {
  display: block;
  font-size: 10px;
  font-weight: 900;
}

.axis-latest-time strong {
  display: block;
  font-size: 16px;
  line-height: 1.25;
}

.axis-latest-time div {
  color: #42647f;
  font-size: 11px;
  font-weight: 700;
}

.axis-latest-time--primary {
  margin-top: 0;
}

.axis-fastest-time {
  margin-top: 8px;
  padding: 7px 8px;
  border: 1px solid #99c9ad;
  border-radius: 6px;
  background: #eef9f2;
  color: #10613a;
}

.axis-fastest-time span {
  display: block;
  font-size: 10px;
  font-weight: 900;
}

.axis-fastest-time strong {
  display: block;
  font-size: 16px;
  line-height: 1.25;
}

.axis-fastest-time div {
  color: #3e7152;
  font-size: 11px;
  font-weight: 700;
}

.class-equivalent {
  margin-top: 7px;
  padding: 6px 7px;
  border: 1px solid #dfc474;
  border-radius: 5px;
  background: #fff8df;
  color: #684b0d;
}

.class-equivalent[title] {
  cursor: help;
}

.class-equivalent span,
.axis-latest-time .class-equivalent span,
.axis-fastest-time .class-equivalent span {
  display: block;
  color: #7a5b13;
  font-size: 10px;
  font-weight: 900;
}

.class-equivalent strong,
.axis-latest-time .class-equivalent strong,
.axis-fastest-time .class-equivalent strong {
  display: block;
  color: #4f3808;
  font-size: 13px;
  line-height: 1.25;
}

.class-equivalent em,
.axis-latest-time .class-equivalent em,
.axis-fastest-time .class-equivalent em {
  display: block;
  color: #7a5b13;
  font-size: 11px;
  font-style: normal;
  font-weight: 800;
}

.class-equivalent--fastest {
  border-color: #c2d69a;
  background: #f7fbec;
  color: #415d10;
}

.time-value-with-equivalent {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 5px;
}

.time-value-with-equivalent strong,
.axis-latest-time .time-value-with-equivalent strong,
.axis-fastest-time .time-value-with-equivalent strong,
.time-ranking-group__best .time-value-with-equivalent strong {
  display: inline-block;
}

.time-value-with-equivalent--group {
  justify-content: flex-end;
}

.time-equivalent-badge {
  display: inline-flex;
  align-items: center;
  min-height: 18px;
  padding: 1px 5px;
  border: 1px solid #caa848;
  border-radius: 999px;
  background: #fff8df;
  color: #684b0d;
  font-size: 10px;
  font-weight: 900;
  line-height: 1.2;
  white-space: nowrap;
  cursor: help;
}

.time-equivalent-badge--fastest {
  border-color: #a8c770;
  background: #f7fbec;
  color: #415d10;
}

.time-equivalent-detail,
.axis-latest-time .time-equivalent-detail,
.axis-fastest-time .time-equivalent-detail,
.time-ranking-group__best .time-equivalent-detail {
  display: block;
  margin-top: 3px;
  color: #7a5b13;
  font-size: 11px;
  font-style: normal;
  font-weight: 800;
  line-height: 1.3;
}

.time-equivalent-detail--fastest,
.axis-fastest-time .time-equivalent-detail--fastest {
  color: #55751c;
}

.axis-proof-list {
  display: grid;
  gap: 8px;
  padding: 8px;
}

.axis-proof-item {
  border: 1px solid #dde5e9;
  border-radius: 6px;
  background: #fff;
  overflow: hidden;
}

.axis-proof-item--best {
  border-color: #16834c;
  box-shadow: inset 4px 0 0 #16834c;
}

.axis-proof-item--latest {
  border-color: #6ea7d8;
  box-shadow: inset 4px 0 0 #2e77aa;
}

.axis-proof-head {
  min-height: 30px;
  padding: 6px 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
  background: #f4f7f8;
}

.axis-proof-date {
  color: #202428;
  font-size: 12px;
  font-weight: 900;
}

.axis-proof-meta {
  margin-left: 8px;
  color: #55636a;
  font-size: 12px;
  font-weight: 700;
}

.axis-proof-badge {
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  padding: 0 8px;
  background: #16834c;
  color: #fff;
  font-size: 11px;
  font-weight: 900;
  white-space: nowrap;
}

.axis-proof-badges {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
}

.axis-proof-badge--latest {
  background: #2e77aa;
}

.axis-proof-race {
  padding: 7px 8px 2px;
  display: flex;
  align-items: baseline;
  gap: 8px;
  color: #1f2b30;
  font-weight: 800;
  overflow-wrap: anywhere;
}

.axis-proof-race-no {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.axis-proof-stats {
  padding: 6px 8px 8px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(76px, 1fr));
  gap: 5px;
  font-size: 12px;
}

.axis-proof-stats span {
  min-height: 26px;
  padding: 3px 5px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border: 1px solid #e6ecef;
  border-radius: 4px;
  background: #fbfcfd;
  white-space: nowrap;
}

.axis-proof-stats .axis-proof-time--latest {
  border-color: #9fc2e4;
  background: #e7f2fb;
  color: #164c7d;
  font-weight: 900;
}

.axis-proof-stats .axis-proof-class-equivalent {
  border-color: #dfc474;
  background: #fff8df;
  color: #684b0d;
  font-weight: 900;
}

.axis-proof-stats .axis-proof-class-equivalent[title] {
  cursor: help;
}

.axis-proof-stats b {
  color: var(--muted);
  font-size: 10px;
  font-weight: 900;
}

.axis-proof-stats em {
  font-style: normal;
}

.empty-state {
  padding-top: 60px;
}

.empty-state h1 {
  margin: 0 0 10px;
  font-size: 28px;
}

.command-strip {
  margin-top: 20px;
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.command-strip code {
  background: #15211f;
  color: #e8f4ef;
  border-radius: 4px;
  padding: 8px 10px;
}

.mobile-cards {
  display: none;
}

.mobile-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  overflow: hidden;
}

.mobile-card__head {
  padding: 10px 12px;
  display: grid;
  gap: 8px;
  border-bottom: 1px solid #e5ebef;
  background: #f8faf9;
}

.mobile-card__identity {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.mobile-card__title {
  color: #075a92;
  font-size: 17px;
  font-weight: 900;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.mobile-card__head .transfer-badge,
.mobile-card__head .distance-change-badge,
.mobile-card__head .layoff-badge,
.mobile-card__head .odds-badge {
  justify-self: start;
  margin-top: -2px;
}

.mobile-card__meta,
.mobile-card__subline {
  padding: 8px 12px 0;
  display: flex;
  flex-wrap: wrap;
  gap: 6px 10px;
  color: #52615c;
  font-size: 12px;
  font-weight: 700;
}

.mobile-card__subline {
  padding-bottom: 10px;
}

.mobile-frame,
.mobile-number,
.mobile-rank,
.mobile-result-position {
  min-width: 30px;
  min-height: 28px;
  padding: 3px 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  color: #fff;
  font-size: 13px;
  font-weight: 900;
}

.mobile-number,
.mobile-rank,
.mobile-result-position {
  border: 1px solid #cbd6dc;
  background: #fff;
  color: #1d2a2f;
}

.mobile-stat-grid {
  padding: 10px 12px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}

.mobile-stat-grid div {
  min-height: 48px;
  padding: 6px 8px;
  border: 1px solid #e4ebee;
  border-radius: 6px;
  background: #fbfcfd;
}

.mobile-stat-grid span,
.mobile-time-block span {
  display: block;
  color: var(--muted);
  font-size: 10px;
  font-weight: 900;
}

.mobile-stat-grid strong,
.mobile-time-block strong {
  display: block;
  margin-top: 2px;
  color: #1d2a2f;
  font-size: 15px;
  line-height: 1.25;
}

.mobile-history-list {
  padding: 10px 12px 12px;
  display: grid;
  gap: 8px;
}

.mobile-history-item {
  padding: 8px;
  display: grid;
  gap: 6px;
  border: 1px solid #e2e9ed;
  border-radius: 6px;
  background: #fbfcfd;
  font-size: 12px;
}

.mobile-history-item > div {
  display: flex;
  flex-wrap: wrap;
  gap: 5px 8px;
}

.mobile-history-item strong {
  color: #26332f;
}

.mobile-history-item span {
  color: #52615c;
  font-weight: 700;
}

.mobile-history-item .finish-win {
  color: #b11626;
}

.mobile-history-item .finish-place {
  color: #1769aa;
}

.mobile-time-block {
  margin: 10px 12px 0;
  padding: 8px;
  display: grid;
  gap: 4px;
  border: 1px solid #9fc2e4;
  border-radius: 6px;
  background: #eef6fd;
  color: #164c7d;
}

.mobile-time-block--fastest {
  border-color: #a8d6aa;
  background: #eef9ef;
  color: #1f6b35;
}

.mobile-time-block em {
  color: #42647f;
  font-style: normal;
  font-size: 11px;
  font-weight: 800;
}

.mobile-equivalent-badge {
  margin: 0 12px 10px;
  padding: 4px 7px;
  display: inline-flex;
  width: fit-content;
  border: 1px solid #dfc474;
  border-radius: 999px;
  background: #fff8df;
  color: #684b0d;
  font-size: 11px;
  font-weight: 900;
}

.mobile-time-block .mobile-equivalent-badge,
.mobile-history-item .mobile-equivalent-badge {
  margin: 2px 0 0;
}

.mobile-equivalent-badge--fastest {
  border-color: #a8c770;
  background: #f7fbec;
  color: #415d10;
}

.mobile-details {
  margin: 10px 12px 12px;
  border: 1px solid #dce5e9;
  border-radius: 6px;
  background: #fff;
}

.mobile-details summary {
  padding: 8px 10px;
  cursor: pointer;
  color: #26332f;
  font-weight: 900;
}

.mobile-empty {
  margin: 10px 12px 12px;
  padding: 12px;
  border-radius: 6px;
  background: #f8fafb;
  color: var(--muted);
  text-align: center;
  font-weight: 800;
}

.standard-time-mobile-grid {
  padding: 10px 12px 12px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}

.standard-time-mobile-grid div {
  min-height: 45px;
  padding: 6px;
  border: 1px solid #e4ebee;
  border-radius: 6px;
  background: #fbfcfd;
}

.standard-time-mobile-grid span {
  display: block;
  color: var(--muted);
  font-size: 10px;
  font-weight: 900;
}

.standard-time-mobile-grid strong {
  display: block;
  margin-top: 2px;
  color: #1d2a2f;
  font-size: 13px;
  line-height: 1.25;
}

@media (max-width: 780px) {
  .site-header__inner,
  .section-title,
  .race-selector__inner,
  .race-hero__inner {
    display: flex;
    align-items: stretch;
    flex-direction: column;
  }

  .site-header__inner {
    min-height: auto;
    padding: 10px 12px;
    gap: 8px;
  }

  .site-nav {
    width: 100%;
    overflow-x: auto;
    gap: 4px;
  }

  .site-nav a {
    flex: 0 0 auto;
    padding: 7px 9px;
  }

  .race-selector__inner {
    padding: 10px 12px;
    gap: 10px;
  }

  .race-buttons {
    width: 100%;
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 2px;
  }

  .race-button {
    flex: 0 0 auto;
  }

  .date-filter {
    justify-content: flex-start;
    width: 100%;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .date-filter label,
  .date-filter input,
  .date-filter button,
  .clear-filter {
    width: 100%;
    min-width: 0;
  }

  .race-hero__inner {
    padding: 12px;
    gap: 10px;
  }

  .race-number {
    width: 68px;
    height: 44px;
    font-size: 22px;
  }

  .race-main h1 {
    font-size: 20px;
  }

  .race-meta,
  .race-submeta {
    font-size: 12px;
  }

  .race-tabs__inner {
    padding: 0 8px;
  }

  .race-tabs a {
    height: 40px;
    padding: 0 12px;
    font-size: 13px;
  }

  .race-tabs__actions {
    margin-left: 0;
    flex: 0 0 auto;
  }

  .race-refresh-form button {
    height: 30px;
    padding: 0 10px;
    font-size: 12px;
  }

  .content-band {
    padding: 14px 0 28px;
  }

  .content-band__inner,
  .content-band__inner--axis,
  .content-band__inner--past-detail,
  .content-band__inner--time-rankings,
  .content-band__inner--standard-times,
  .content-band__inner--result,
  .content-band__inner--video,
  .content-band__inner--bets,
  .content-band__inner--notes {
    width: 100%;
    padding: 0 10px;
  }

  .section-title {
    gap: 4px;
    margin-bottom: 10px;
  }

  .section-title h2 {
    font-size: 18px;
  }

  .section-title p {
    display: none;
  }

  .desktop-table {
    display: none !important;
  }

  .mobile-cards {
    display: grid;
    gap: 10px;
  }

  .entry-mark-select {
    width: 54px;
    height: 30px;
  }

  .entry-mark-readonly {
    min-height: 30px;
  }

  .mobile-card > .entry-status-badge {
    margin: 8px 12px 0;
  }

  .axis-summary {
    grid-template-columns: 1fr;
    padding: 10px;
  }

  .result-summary {
    grid-template-columns: 1fr;
  }

  .race-video-summary {
    grid-template-columns: 1fr;
  }

  .bet-layout,
  .bet-form-grid,
  .bet-fixed-axis-grid,
  .bet-flow-grid,
  .bet-formation-grid,
  .bet-summary-grid,
  .bet-summary-grid--wide,
  .note-entry-row,
  .horse-note-race {
    grid-template-columns: 1fr;
  }

  .note-entry-row--head {
    display: none;
  }

  .note-entry-row {
    grid-template-columns: 44px 54px 64px minmax(0, 1fr);
    gap: 6px;
    padding: 10px;
  }

  .note-entry-row > div:nth-child(4),
  .note-entry-row > div:nth-child(5) {
    grid-column: 1 / -1;
  }

  .notes-actions button {
    width: 100%;
  }

  .horse-note-hero__inner {
    align-items: stretch;
    flex-direction: column;
    padding: 14px 12px;
  }

  .horse-note-hero h1 {
    font-size: 22px;
  }

  .horse-note-hero__actions {
    justify-content: flex-start;
  }

  .horse-note-race {
    gap: 10px;
  }

  .horse-note-race__race-head,
  .horse-note-race__details {
    grid-template-columns: 1fr;
  }

  .horse-note-race__date {
    min-height: 0;
  }

  .horse-note-race__form button {
    width: 100%;
  }

  .bet-mode-panel__head {
    align-items: stretch;
    flex-direction: column;
  }

  .bet-flow-controls {
    width: 100%;
    grid-template-columns: minmax(0, 1fr);
  }

  .axis-toolbar,
  .time-ranking-group__head {
    align-items: stretch;
    flex-direction: column;
  }

  .axis-condition-form {
    width: 100%;
  }

  .axis-condition-form label,
  .axis-condition-form select,
  .axis-condition-form button {
    width: 100%;
  }

  .time-ranking-group {
    border-radius: 8px;
    overflow: hidden;
  }

  .time-ranking-group__best {
    min-width: 0;
    text-align: left;
  }

  .payout-groups {
    grid-template-columns: 1fr;
  }

  .payout-table th,
  .payout-table td {
    padding: 6px 7px;
  }

  .standard-time-note {
    padding: 10px 12px;
    font-size: 12px;
  }

  .standard-time-group__head {
    padding: 9px 12px;
  }

  .standard-time-mobile-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .assistant-panel {
    right: 10px;
    bottom: 10px;
  }

  .assistant-panel__drawer {
    position: fixed;
    inset: auto 0 0 0;
    width: 100%;
    height: min(78vh, 680px);
    border-right: 0;
    border-bottom: 0;
    border-left: 0;
    border-radius: 10px 10px 0 0;
  }

  .assistant-panel__form {
    grid-template-columns: 1fr 58px;
  }
}

@media (max-width: 1100px) {
  .axis-table-scroll {
    overflow: visible;
    border: 0;
    background: transparent;
  }

  .axis-table-scroll .axis-table,
  .axis-table thead,
  .axis-table tbody,
  .axis-table tr,
  .axis-table th,
  .axis-table td {
    display: block;
    width: 100%;
    min-width: 0;
  }

  .axis-table thead {
    display: none;
  }

  .axis-table tbody {
    display: grid;
    gap: 12px;
  }

  .axis-table tbody tr {
    border: 1px solid var(--line);
    background: #fff;
  }

  .axis-table td {
    display: grid;
    grid-template-columns: 86px minmax(0, 1fr);
    gap: 8px;
    align-items: start;
    border-right: 0;
    padding: 8px 10px;
  }

  .axis-table td::before {
    content: attr(data-label);
    color: var(--muted);
    font-size: 11px;
    font-weight: 900;
  }

  .axis-table .frame-cell,
  .axis-table .horse-number {
    text-align: left;
  }

  .axis-table .axis-history-cell {
    display: block;
    padding: 0 !important;
  }

  .axis-table .axis-history-cell::before {
    display: block;
    padding: 8px 10px;
    border-bottom: 1px solid #e5eaee;
    background: #f4f7f8;
  }

  .axis-proof-list {
    padding: 10px;
  }
}
