/* ===== リセット・基本 ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: 'Hiragino Sans', 'Meiryo', sans-serif; background: #f4f6f9; color: #222; font-size: 14px; }
a { color: #2563eb; text-decoration: none; }
a:hover { text-decoration: underline; }

/* ===== ナビ ===== */
.navbar {
  background: #1e3a5f; color: #fff;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 16px; height: 48px; position: sticky; top: 0; z-index: 100;
}

.nav-logo { color: #fff; font-weight: bold; font-size: 16px; }
.nav-links a { color: #cbd5e1; margin-left: 16px; font-size: 13px; }
.nav-links a:hover { color: #fff; text-decoration: none; }

/* ===== コンテナ ===== */
.container { max-width: 1000px; margin: 0 auto; padding: 16px; }

/* ===== フラッシュ ===== */
.flash { background: #dbeafe; border-left: 4px solid #2563eb; padding: 10px 14px; margin-bottom: 12px; border-radius: 4px; }

/* ===== ページヘッダー ===== */
.page-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; flex-wrap: wrap; gap: 8px; }
.page-header h1 { font-size: 20px; font-weight: bold; }
.header-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.card { background: #fff; border-radius: 8px; padding: 16px; box-shadow: 0 1px 3px rgba(0,0,0,.08); }
.small { font-size: 12px; }
.muted { color: #64748b; }

/* ===== ボタン ===== */
.btn { display: inline-block; padding: 7px 14px; border-radius: 5px; font-size: 13px; cursor: pointer; border: none; font-weight: 500; transition: opacity .15s; }
.btn:hover { opacity: .85; text-decoration: none; }
.btn-primary { background: #2563eb; color: #fff; }
.btn-secondary { background: #e2e8f0; color: #334155; }
.btn-xs { padding: 3px 8px; font-size: 12px; background: #e2e8f0; color: #334155; border-radius: 4px; }

/* ===== 日付一覧 ===== */
.race-year-switcher {
  display: flex;
  gap: 7px;
  overflow-x: auto;
  padding: 0 0 12px;
  scrollbar-width: none;
}
.race-year-switcher::-webkit-scrollbar { display: none; }
.race-year-button {
  flex: 0 0 74px;
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #cbd5e1;
  border-radius: 5px;
  background: #fff;
  color: #334155;
  font-weight: 800;
}
.race-year-button:hover { text-decoration: none; background: #f1f5f9; }
.race-year-button.is-active { border-color: #2563eb; background: #2563eb; color: #fff; }
.date-list { display: flex; flex-direction: column; gap: 8px; }
.date-card {
  display: flex; align-items: center; justify-content: space-between;
  background: #fff; border-radius: 8px; padding: 14px 18px;
  box-shadow: 0 1px 3px rgba(0,0,0,.08); color: #222;
}
.date-card:hover { background: #f0f4ff; text-decoration: none; }
.date-label { font-size: 16px; font-weight: 600; }
.date-arrow { color: #94a3b8; font-size: 20px; }

/* ===== レースカード ===== */
.track-heading { font-size: 16px; font-weight: bold; margin: 20px 0 8px; color: #1e3a5f; border-bottom: 2px solid #1e3a5f; padding-bottom: 4px; }
.race-card {
  display: flex; align-items: center; flex-wrap: wrap; gap: 7px 12px;
  background: #fff; border-radius: 8px; padding: 12px 16px;
  box-shadow: 0 1px 3px rgba(0,0,0,.08); margin-bottom: 6px; color: #222;
}
.race-card:hover { background: #f0f4ff; text-decoration: none; }

/* 印エントリー全体（縦積み） */
.race-entry {
  display: flex;
  flex-direction: column;
  margin-bottom: 6px;
}
/* ★ボタン＋コメント横並び行 */
.mark-row {
  display: flex;
  align-items: center;
  gap: 0;
}
.mark-btn {
  flex-shrink: 0;
  width: 40px;
  height: 36px;
  background: #e2e8f0;
  color: #94a3b8;
  border: none;
  border-radius: 8px 8px 0 0;
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, color 0.15s;
  padding: 0;
  margin: 0;
}
.mark-btn.marked {
  background: #fef08a;
  color: #ca8a04;
  border-radius: 8px 0 0 0;
}
.mark-btn:active { opacity: 0.7; }
.mark-btn { touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
.skip-btn {
  flex-shrink: 0;
  height: 36px;
  background: #e2e8f0;
  color: #64748b;
  border: none;
  border-left: 1px solid #cbd5e1;
  border-radius: 0;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  padding: 0 10px;
  margin: 0;
  transition: background 0.15s, color 0.15s;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}
.skip-btn.skipped {
  background: #cbd5e1;
  color: #475569;
}
.skip-btn:active { opacity: 0.7; }
.review-btn {
  flex-shrink: 0;
  width: 38px;
  height: 36px;
  background: #e2e8f0;
  color: #94a3b8;
  border: none;
  border-left: 1px solid #cbd5e1;
  border-radius: 0;
  font-size: 16px;
  cursor: pointer;
  padding: 0;
  margin: 0;
  transition: background 0.15s, color 0.15s;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}
.review-btn.reviewed {
  background: #bbf7d0;
  color: #15803d;
}
.review-btn:active { opacity: 0.7; }
/* コメント欄（★の右横） */
.mark-comment-row {
  flex: 1;
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-left: none;
  border-radius: 0 8px 0 0;
  padding: 0 10px;
  height: 36px;
  display: flex;
  align-items: center;
}
.mark-comment-hidden { display: none; }
.mark-comment-input {
  width: 100%;
  border: none;
  background: transparent;
  font-size: 13px;
  color: #78350f;
  outline: none;
}
.mark-comment-input::placeholder { color: #d97706; opacity: 0.6; }
/* レースカード（印行の下） */
.race-entry .race-card {
  border-radius: 0 0 8px 8px;
  margin-bottom: 0;
}
.race-card-marked {
  border-left: 3px solid #ca8a04 !important;
  background: #fffbeb !important;
}
.race-card-marked:hover { background: #fef9c3 !important; }
.race-no { font-weight: bold; min-width: 32px; color: #1e3a5f; }
.race-post-time { font-size: 12px; color: #fff; background: #1e3a5f; padding: 2px 8px; border-radius: 4px; font-weight: bold; white-space: nowrap; }
.race-card-title-row {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 1 1 160px;
  min-width: 0;
}
.race-name { flex: 1; min-width: 0; }
.race-card-title-row .race-name {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.race-meta { color: #64748b; font-size: 12px; }
.race-list-ai-axis {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  flex: 0 0 auto;
  min-height: 22px;
  padding: 1px 5px;
  border: 1px solid;
  border-radius: 5px;
  font-size: 10px;
  font-weight: 800;
  line-height: 1;
  white-space: nowrap;
  margin-left: auto;
}
.race-list-ai-axis-label { font-size: 10px; }
.race-list-ai-axis strong {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: currentColor;
  color: #fff;
  font-size: 10px;
}
.race-list-ai-axis-no { font-size: 10px; }
.race-list-ai-axis.ai-axis-a { background: #ecfdf5; border-color: #10b981; color: #047857; }
.race-list-ai-axis.ai-axis-b { background: #fff7ed; border-color: #f97316; color: #c2410c; }
.race-card-finished .race-list-ai-axis { opacity: .72; }
@media (max-width: 520px) {
  .race-card { gap: 7px 8px; padding: 10px 12px; }
  .race-card-title-row { flex-basis: 150px; }
  .race-list-ai-axis-label, .race-list-ai-axis-no { font-size: 9px; }
}
.race-arrow { color: #94a3b8; font-size: 18px; }
/* 終了レース */
.race-card-finished {
  background: #f1f5f9;
  color: #94a3b8;
}
.race-card-finished:hover { background: #e8ecf0; }
.race-card-finished .race-no { color: #94a3b8; }
.race-card-finished .race-post-time { background: #94a3b8; }
.race-card-finished .race-meta { color: #b0bec5; }
.race-card-finished .lv-badge { opacity: 0.5; }
.race-pace-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 30px;
  height: 24px;
  padding: 0 7px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  border: 1px solid transparent;
  flex-shrink: 0;
}
.race-pace-ss { background: #e0f2fe; color: #0369a1; border-color: #7dd3fc; }
.race-pace-s  { background: #dbeafe; color: #1d4ed8; border-color: #93c5fd; }
.race-pace-f  { background: #f1f5f9; color: #334155; border-color: #cbd5e1; }
.race-pace-h  { background: #fed7aa; color: #c2410c; border-color: #fdba74; }
.race-pace-hh { background: #fee2e2; color: #b91c1c; border-color: #fca5a5; }
.race-finished-badge {
  font-size: 11px; font-weight: bold;
  color: #fff; background: #94a3b8;
  padding: 2px 7px; border-radius: 4px;
  white-space: nowrap;
}

/* ===== LVバッジ ===== */
.lv-badge {
  display: inline-block;
  font-size: 11px; font-weight: 700;
  padding: 2px 7px; border-radius: 4px;
  border: 2px solid;
  white-space: nowrap;
  min-width: 38px; text-align: center;
}
.lv-1 { border-color: #9ca3af; color: #6b7280; background: #fff; }
.lv-2 { border-color: #2980b9; color: #1a5e8a; background: #eaf4fb; }
.lv-3 { border-color: #eab308; color: #7a4f04; background: #fefce8; }
.lv-4 { border-color: #22c55e; color: #15803d; background: #f0fdf4; }
.lv-5 { border-color: #a855f7; color: #6b21a8; background: #faf5ff; }
.lv-6 { border-color: #ef4444; color: #991b1b; background: #fef2f2; }

.race-info-bar { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.badge { background: #e2e8f0; color: #334155; padding: 3px 10px; border-radius: 99px; font-size: 12px; }
.badge-time { background: #1e3a5f; color: #fff; font-weight: bold; }
.ai-axis-badge,
.ai-axis-horse-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border: 1px solid;
  color: #065f46;
  font-weight: 800;
  white-space: nowrap;
}
.ai-axis-badge {
  padding: 4px 8px;
  border-radius: 5px;
  box-shadow: 0 1px 2px rgba(6, 95, 70, .14);
}
.ai-axis-badge-kicker { font-size: 10px; letter-spacing: 0; opacity: .86; }
.ai-axis-badge strong {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 17px;
  height: 17px;
  border-radius: 50%;
  background: currentColor;
  color: #fff;
  font-size: 11px;
  line-height: 1;
}
.ai-axis-badge-horse { font-size: 11px; }
.ai-axis-horse-badge {
  margin-left: 6px;
  padding: 2px 5px 2px 3px;
  border-radius: 4px;
  font-size: 10px;
  line-height: 1.15;
  vertical-align: middle;
}
.ai-axis-horse-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 15px;
  height: 15px;
  border-radius: 3px;
  background: currentColor;
  color: #fff;
  font-size: 7px;
  font-weight: 900;
  letter-spacing: 0;
}
.ai-axis-badge.ai-axis-a,
.ai-axis-horse-badge.ai-axis-a { background: #ecfdf5; border-color: #10b981; color: #047857; }
.ai-axis-badge.ai-axis-b,
.ai-axis-horse-badge.ai-axis-b { background: #fff7ed; border-color: #f97316; color: #c2410c; }

/* ===== バイアス ===== */
.bias-box { background: #fef9c3; border-left: 4px solid #eab308; padding: 8px 14px; border-radius: 4px; margin-bottom: 12px; font-size: 13px; }
.nv-box { background: #f0fdf4; border-left: 4px solid #22c55e; border-radius: 4px; margin-bottom: 12px; overflow: hidden; }

/* ===== データ分析 ===== */
.analysis-form .anly-grid { display: grid; grid-template-columns: 1fr 1fr 1fr 1fr; gap: 12px; }
.analysis-form .anly-field { display: flex; flex-direction: column; gap: 4px; }
.analysis-form .anly-field.anly-wide { grid-column: span 4; }
.analysis-form .anly-field label { font-size: 12px; font-weight: 600; color: #444; }
.analysis-form .anly-field input[type=text], .analysis-form .anly-field input[type=number], .analysis-form .anly-field input[type=date] {
  padding: 6px 8px; border: 1px solid #cbd5e1; border-radius: 4px; font-size: 13px;
}
.chip-group { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { display: inline-flex; align-items: center; gap: 3px; padding: 4px 10px; background: #f1f5f9; border: 1px solid #cbd5e1; border-radius: 16px; font-size: 12px; cursor: pointer; user-select: none; }
.chip:has(input:checked) { background: #2563eb; color: #fff; border-color: #2563eb; }
.chip input { display: none; }
.agg-table, .result-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.agg-table th, .agg-table td, .result-table th, .result-table td { border: 1px solid #e2e8f0; padding: 6px 8px; text-align: center; }
.agg-table th, .result-table th { background: #f8fafc; font-weight: 600; }

.strategy-result-scroll {
  display: block;
  width: 100%;
  max-width: 100%;
  overflow-x: scroll;
  overflow-y: hidden;
  overscroll-behavior-x: contain;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 5px;
}

.strategy-result-table {
  width: max-content;
  min-width: 880px !important;
  table-layout: auto;
  white-space: nowrap;
}
.kaishu-good { color: #15803d; }
.kaishu-warn { color: #b45309; }
.kaishu-bad { color: #b91c1c; }
.hot-zone-race-panel {
  background: #fff7ed;
  border: 1px solid #fed7aa;
  border-left: 4px solid #f97316;
  border-radius: 6px;
  margin-bottom: 12px;
  overflow: hidden;
}
.hot-zone-race-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  background: #ffedd5;
}
.hot-zone-race-title {
  font-size: 14px;
  font-weight: 800;
  color: #9a3412;
}
.hot-zone-race-sub,
.hot-zone-race-foot {
  font-size: 11px;
  color: #9a3412;
  line-height: 1.45;
}
.hot-zone-notify-btn {
  white-space: nowrap;
  font-size: 12px;
  padding: 5px 10px;
}
.hot-zone-server-notify {
  flex: 0 0 auto;
  padding: 4px 7px;
  border: 1px solid #16a34a;
  border-radius: 4px;
  background: #dcfce7;
  color: #166534;
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
}
.hot-zone-selection {
  padding: 9px 10px 8px;
  background: #fff;
}
.hot-zone-selection-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin: 0 1px 7px;
  color: #7c2d12;
  font-size: 12px;
}
.hot-zone-selection-head strong { font-size: 13px; }
.hot-zone-selection-head span {
  color: #64748b;
  font-size: 10px;
  text-align: right;
}
.hot-zone-rule {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  margin: 5px 0;
  padding: 7px 8px;
  border: 1px solid #fed7aa;
  border-radius: 6px;
  background: #fffaf5;
  color: #1f2937;
  cursor: pointer;
}
.hot-zone-rule:hover { border-color: #fb923c; }
.hot-zone-rule.is-enabled {
  border-color: #22c55e;
  background: #f0fdf4;
}
.hot-zone-rule.is-ineligible {
  border-color: #e2e8f0;
  background: #f8fafc;
  color: #94a3b8;
  cursor: not-allowed;
}
.hot-zone-rule input[type="checkbox"] {
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: #16a34a;
}
.hot-zone-rule-copy {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 2px 7px;
  min-width: 0;
}
.hot-zone-rule-title {
  font-size: 12px;
  font-weight: 800;
  color: #7c2d12;
}
.hot-zone-rule.is-enabled .hot-zone-rule-title { color: #166534; }
.hot-zone-rule.is-ineligible .hot-zone-rule-title { color: #64748b; }
.hot-zone-rule-notify {
  font-size: 11px;
  font-weight: 800;
  color: #b91c1c;
}
.hot-zone-rule.is-enabled .hot-zone-rule-notify { color: #15803d; }
.hot-zone-rule.is-ineligible .hot-zone-rule-notify { color: #94a3b8; }
.hot-zone-rule-stats {
  flex-basis: 100%;
  color: #64748b;
  font-size: 10px;
  line-height: 1.25;
}
.hot-zone-rule-target {
  flex-basis: 100%;
  color: #0f766e;
  font-size: 10px;
  font-weight: 800;
  line-height: 1.25;
}
.hot-zone-rule.is-ineligible .hot-zone-rule-target { color: #64748b; }
.hot-zone-rule-state {
  padding: 2px 5px;
  border-radius: 4px;
  background: #dcfce7;
  color: #166534;
  font-size: 10px;
  font-weight: 800;
  white-space: nowrap;
}
.hot-zone-rule-state.is-muted {
  max-width: 108px;
  background: #e2e8f0;
  color: #64748b;
  overflow: hidden;
  text-overflow: ellipsis;
}
.hot-zone-reference {
  padding: 10px 12px 8px;
  background: #fffbeb;
  color: #78350f;
  font-size: 12px;
}
.hot-zone-reference > strong { display: block; margin-bottom: 6px; }
.hot-zone-reference-row {
  display: grid;
  grid-template-columns: minmax(72px, auto) minmax(0, 1fr);
  gap: 3px 8px;
  padding: 6px 0;
  border-top: 1px solid #fde68a;
}
.hot-zone-reference-row > span:first-child { font-weight: 800; }
.hot-zone-reference-row small {
  grid-column: 1 / -1;
  color: #92400e;
  font-size: 10px;
  line-height: 1.35;
}
@media (max-width: 520px) {
  .hot-zone-race-head { align-items: flex-start; }
  .hot-zone-selection-head { align-items: flex-start; }
  .hot-zone-rule {
    grid-template-columns: 20px minmax(0, 1fr);
    gap: 6px;
  }
  .hot-zone-rule-state {
    grid-column: 2;
    justify-self: start;
  }
  .hot-zone-rule-state.is-muted {
    max-width: none;
    text-align: left;
  }
}
.hot-zone-alert {
  margin: 8px 10px 0;
  padding: 8px 10px;
  border: 1px solid #16a34a;
  border-radius: 5px;
  background: #dcfce7;
  color: #14532d;
  font-size: 12px;
  line-height: 1.55;
}
.hot-zone-alert.hidden { display: none; }
.hot-zone-mobile-slip {
  margin: 8px 10px 0;
  padding: 10px;
  border: 2px solid #2563eb;
  border-radius: 8px;
  background: #eff6ff;
  color: #1e3a8a;
}
.hot-zone-mobile-slip.hidden { display: none; }
.hot-zone-slip-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}
.hot-zone-slip-title {
  font-size: 14px;
  font-weight: 800;
}
.hot-zone-slip-help {
  font-size: 11px;
  color: #475569;
  line-height: 1.45;
}
.hot-zone-slip-amount-wrap {
  display: flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
  font-size: 12px;
  font-weight: 700;
}
.hot-zone-slip-amount-wrap input {
  width: 78px;
  padding: 5px 6px;
  border: 1px solid #93c5fd;
  border-radius: 6px;
  text-align: right;
  font-size: 16px;
  font-weight: 800;
}
.hot-zone-slip-row {
  padding: 8px;
  margin-top: 6px;
  border: 1px solid #bfdbfe;
  border-radius: 7px;
  background: #fff;
}
.hot-zone-slip-main {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.hot-zone-slip-main strong {
  font-size: 22px;
  color: #1d4ed8;
  line-height: 1;
}
.hot-zone-slip-type {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  background: #2563eb;
  color: #fff;
  font-size: 12px;
  font-weight: 800;
}
.hot-zone-slip-pop {
  font-size: 11px;
  color: #475569;
}
.hot-zone-slip-sub {
  margin-top: 5px;
  font-size: 12px;
  font-weight: 700;
  color: #0f172a;
  line-height: 1.45;
}
.hot-zone-slip-data {
  margin-top: 3px;
  font-size: 10px;
  color: #64748b;
}
.hot-zone-slip-actions {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}
.hot-zone-slip-actions .btn {
  flex: 1;
  text-align: center;
}
.hot-zone-table-wrap {
  overflow-x: auto;
  padding: 8px 10px;
}
.hot-zone-race-table {
  width: 100%;
  min-width: 860px;
  border-collapse: collapse;
  font-size: 11px;
  background: #fff;
}
.hot-zone-race-table th,
.hot-zone-race-table td {
  border: 1px solid #fed7aa;
  padding: 5px 6px;
  text-align: center;
  vertical-align: middle;
}
.hot-zone-race-table th {
  background: #fff7ed;
  color: #7c2d12;
  font-weight: 700;
  white-space: nowrap;
}
.hot-zone-race-table .hz-current {
  text-align: left;
  min-width: 190px;
}
.hot-zone-race-table .hz-note {
  text-align: left;
  min-width: 170px;
}
.hz-row-full td { background: #ecfdf5; }
.hz-row-partial td { background: #fffbeb; }
.hz-row-missing td { color: #64748b; }
.hz-status {
  display: inline-block;
  padding: 1px 6px;
  border-radius: 999px;
  background: #f1f5f9;
  color: #475569;
  font-weight: 700;
  white-space: nowrap;
}
.hz-status-full {
  background: #16a34a;
  color: #fff;
}
.hz-status-partial {
  background: #f59e0b;
  color: #fff;
}
.hz-status-missing {
  background: #e2e8f0;
  color: #64748b;
}
.hz-status-scratch {
  background: #dc2626;
  color: #fff;
}
.hot-zone-empty {
  padding: 10px 12px;
  font-size: 12px;
  color: #9a3412;
}
.hot-zone-race-foot {
  padding: 0 12px 10px;
}
.result-table tr.rank-1 { background: #fef9c3; }
.result-table tr.rank-2 { background: #f0fdf4; }
.result-table tr.rank-3 { background: #eff6ff; }
.table-scroll { overflow-x: auto; }
.lap-summary { display: flex; flex-wrap: wrap; gap: 18px; margin-bottom: 12px; }
.summary-label { display: block; font-size: 11px; color: #64748b; margin-bottom: 2px; }
.lap-table { width: 100%; border-collapse: collapse; font-size: 12px; min-width: 980px; }
.lap-table th, .lap-table td { border: 1px solid #e2e8f0; padding: 7px 8px; text-align: center; vertical-align: middle; }
.lap-table th { background: #f8fafc; font-weight: 700; color: #334155; white-space: nowrap; }
.lap-table .lap-text { text-align: left; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 11px; white-space: nowrap; }
.pace-fast { color: #b91c1c; font-weight: 700; }
.pace-slow { color: #0369a1; font-weight: 700; }
@media (max-width: 768px) {
  .analysis-form .anly-grid { grid-template-columns: 1fr 1fr; }
  .analysis-form .anly-field.anly-wide { grid-column: span 2; }
  .agg-table, .result-table { font-size: 11px; }
  .agg-table th, .agg-table td, .result-table th, .result-table td { padding: 3px 4px; }
  .lap-table { font-size: 11px; min-width: 860px; }
  .lap-table th, .lap-table td { padding: 5px 6px; }
}
.nv-header { padding: 8px 14px; font-size: 13px; font-weight: 600; color: #166534; user-select: none; }
.bias-empty { background: #f1f5f9; border-left-color: #94a3b8; }
.bias-summary { margin-bottom: 12px; }
.bias-track { font-weight: bold; min-width: 40px; color: #92400e; }
.bias-edit-link { font-size: 12px; color: #2563eb; white-space: nowrap; margin-left: 8px; }
.bias-add-row { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }

/* ===== パドック比較 ===== */
.paddock-page { max-width: 920px; margin: 0 auto; }
.paddock-header { margin-bottom: 10px; }
.paddock-stage {
  background: #0f172a;
  border-radius: 8px;
  padding: 10px;
  margin-bottom: 12px;
  box-shadow: 0 2px 8px rgba(15, 23, 42, .18);
}
.paddock-topbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 8px;
  align-items: center;
}
.paddock-select {
  width: 100%;
  height: 36px;
  border: 1px solid #334155;
  border-radius: 6px;
  padding: 0 10px;
  background: #fff;
  color: #111827;
  font-size: 14px;
  font-weight: 700;
}
.paddock-horse-strip {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding: 8px 0;
  scrollbar-width: thin;
}
.paddock-horse-chip {
  flex: 0 0 auto;
  min-width: 110px;
  max-width: 180px;
  height: 38px;
  border: 1px solid #334155;
  border-radius: 6px;
  background: #1e293b;
  color: #cbd5e1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 0 8px;
  white-space: nowrap;
}
.paddock-horse-chip.chip-marked { border-color: #f59e0b; box-shadow: 0 0 0 1px #f59e0b inset; }
.paddock-horse-chip .chip-mark {
  display: inline-flex; align-items: center; justify-content: center;
  width: 22px; height: 22px; border-radius: 50%;
  background: #fbbf24; color: #1e293b; font-weight: 800; font-size: 13px;
  flex: 0 0 auto;
}
.paddock-horse-chip .chip-cnk {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 26px; height: 20px; padding: 0 5px; border-radius: 4px;
  background: #475569; color: #fff; font-size: 11px; font-weight: 700;
  flex: 0 0 auto;
}
.paddock-horse-chip .chip-cnk.cnk-1 { background: #dc2626; }
.paddock-horse-chip .chip-cnk.cnk-2 { background: #2563eb; }
.paddock-horse-chip .chip-cnk.cnk-3 { background: #16a34a; }
.paddock-horse-chip strong {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 5px;
  background: #475569;
  color: #fff;
  font-size: 13px;
}
.paddock-horse-chip span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
  font-weight: 700;
}
.paddock-horse-chip.is-active {
  background: #ecfeff;
  color: #0f172a;
  border-color: #22d3ee;
}
.paddock-horse-chip.is-active strong { background: #0891b2; }
.paddock-video-stack {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}
.paddock-player-panel {
  overflow: hidden;
  border: 1px solid #334155;
  border-radius: 8px;
  background: #111827;
}
.paddock-player-head {
  height: 34px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 10px;
  color: #e5e7eb;
  background: #1f2937;
}
.paddock-player-head strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
}
.paddock-side-label {
  flex: 0 0 auto;
  padding: 2px 7px;
  border-radius: 999px;
  background: #22c55e;
  color: #052e16;
  font-size: 11px;
  font-weight: 800;
}
.paddock-side-previous {
  background: #fbbf24;
  color: #451a03;
}
.paddock-player-frame {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #000;
  overflow: hidden;
}
.paddock-player-frame iframe,
.paddock-local-video {
  display: block;
  width: 100%;
  height: 100%;
}
.paddock-youtube-slot.is-hidden,
.paddock-local-video.is-hidden { display: none; }
.paddock-local-video {
  background: #000;
  object-fit: cover;
  object-position: center center;
}
.paddock-empty-layer {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 10px;
  padding: 18px;
  background: #020617;
  color: #94a3b8;
  font-weight: 800;
  letter-spacing: 0;
  text-align: center;
  z-index: 2;
}
.paddock-empty-layer.is-hidden { display: none; }
.paddock-embed-message {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  max-width: 360px;
  line-height: 1.55;
}
.paddock-embed-message strong {
  color: #f8fafc;
  font-size: 16px;
}
.paddock-embed-message span {
  color: #cbd5e1;
  font-size: 13px;
}
.paddock-youtube-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 32px;
  padding: 6px 12px;
  border-radius: 6px;
  background: #dc2626;
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}
.paddock-youtube-link:hover {
  color: #fff;
  text-decoration: none;
  opacity: .9;
}
.paddock-clip-meta {
  min-height: 26px;
  padding: 5px 10px;
  color: #cbd5e1;
  font-size: 12px;
  background: #0f172a;
  display: flex;
  align-items: center;
  gap: 8px;
  justify-content: space-between;
  overflow: hidden;
}
.paddock-clip-meta span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.paddock-settings {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 0;
  margin-bottom: 18px;
  overflow: hidden;
}
.paddock-settings summary {
  cursor: pointer;
  padding: 10px 12px;
  font-weight: 800;
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
}
.paddock-bulk-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 8px;
  padding: 10px 12px;
  border-bottom: 1px solid #e2e8f0;
}
.paddock-bulk-row input,
.paddock-edit-row input[type="text"] {
  width: 100%;
  min-width: 0;
  height: 34px;
  border: 1px solid #cbd5e1;
  border-radius: 5px;
  padding: 0 8px;
  font-size: 13px;
}
.paddock-upload-notice {
  display: none;
  margin: 10px 12px 0;
  padding: 9px 10px;
  border-radius: 6px;
  border: 1px solid #bfdbfe;
  background: #eff6ff;
  color: #1e40af;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.55;
}
.paddock-upload-notice.is-active,
.paddock-upload-notice.is-error {
  display: block;
}
.paddock-upload-notice.is-error {
  border-color: #fecaca;
  background: #fef2f2;
  color: #991b1b;
}
.paddock-file-input {
  display: grid;
  gap: 4px;
  padding: 7px 8px;
  border: 1px dashed #94a3b8;
  border-radius: 6px;
  background: #f8fafc;
  color: #334155;
  font-size: 12px;
  font-weight: 800;
}
.paddock-file-input input {
  width: 100%;
  min-width: 0;
  font-size: 12px;
}
.paddock-current-file {
  padding: 5px 8px;
  border-radius: 5px;
  background: #ecfdf5;
  color: #166534;
  font-size: 12px;
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.paddock-clear-file {
  display: flex;
  align-items: center;
  gap: 6px;
  min-height: 30px;
  padding: 5px 8px;
  border: 1px solid #fecaca;
  border-radius: 5px;
  background: #fef2f2;
  color: #991b1b;
  font-size: 12px;
  font-weight: 800;
}
.paddock-clear-file input {
  flex: 0 0 auto;
  width: auto;
  margin: 0;
}
.paddock-clear-file span {
  min-width: 0;
}
.paddock-edit-list {
  display: grid;
  gap: 8px;
  padding: 10px 12px;
}
.paddock-edit-row {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr) minmax(0, 1fr);
  gap: 10px;
  padding: 10px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #fff;
}
.paddock-edit-horse {
  min-width: 0;
  display: flex;
  align-items: flex-start;
  gap: 7px;
  color: #0f172a;
  font-weight: 800;
}
.paddock-edit-horse strong {
  flex: 0 0 auto;
  min-width: 26px;
  height: 26px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #1e3a5f;
  color: #fff;
}
.paddock-edit-horse span {
  min-width: 0;
  overflow-wrap: anywhere;
}
.paddock-edit-horse .paddock-edit-mark {
  flex: 0 0 auto;
  min-width: 26px;
  height: 26px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 5px;
  background: #f59e0b;
  color: #fff;
  font-size: 13px;
  font-weight: 900;
  line-height: 1;
  overflow-wrap: normal;
}
.paddock-edit-side {
  min-width: 0;
  display: grid;
  gap: 6px;
}
.paddock-edit-side-title {
  min-width: 0;
  color: #334155;
  font-size: 12px;
  font-weight: 800;
}
.paddock-edit-side-title small {
  display: block;
  color: #64748b;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.paddock-time-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}
.paddock-missing-key {
  min-height: 34px;
  display: flex;
  align-items: center;
  padding: 7px 9px;
  border-radius: 5px;
  background: #f1f5f9;
  color: #64748b;
  font-size: 12px;
  font-weight: 700;
}
.paddock-form-actions {
  display: flex;
  justify-content: flex-end;
  padding: 0 12px 12px;
}

@media (max-width: 700px) {
  .paddock-page { margin: -8px -10px 0; }
  .paddock-header {
    padding: 0 8px;
    margin-bottom: 6px;
  }
  .paddock-header h1 { font-size: 15px; }
  .paddock-stage {
    border-radius: 0;
    padding: 6px;
    margin-bottom: 8px;
  }
  .paddock-topbar {
    grid-template-columns: minmax(0, 1fr) 76px 50px;
    gap: 5px;
  }
  .paddock-select { height: 32px; font-size: 13px; padding: 0 7px; }
  .paddock-play-btn,
  .paddock-pause-btn {
    height: 32px;
    padding: 0;
    text-align: center;
    font-size: 12px;
  }
  .paddock-horse-strip { gap: 5px; padding: 6px 0; }
  .paddock-horse-chip {
    min-width: 58px;
    max-width: 92px;
    height: 32px;
    padding: 0 5px;
    gap: 4px;
  }
  .paddock-horse-chip strong {
    width: 22px;
    height: 22px;
    font-size: 12px;
  }
  .paddock-horse-chip span { font-size: 10px; }
  .paddock-video-stack { gap: 6px; }
  .paddock-player-head { height: 28px; padding: 0 7px; }
  .paddock-player-head strong { font-size: 12px; }
  .paddock-side-label { font-size: 10px; padding: 1px 6px; }
  .paddock-player-frame {
    aspect-ratio: auto;
    height: min(31svh, 205px);
    min-height: 154px;
  }
  .paddock-clip-meta {
    min-height: 22px;
    padding: 3px 7px;
    font-size: 10px;
    gap: 5px;
  }
  .paddock-youtube-link {
    min-height: 28px;
    padding: 4px 8px;
    font-size: 10px;
  }
  .paddock-embed-message strong { font-size: 14px; }
  .paddock-embed-message span { font-size: 11px; }
  .paddock-settings {
    margin: 0 0 12px;
    border-radius: 0;
  }
  .paddock-bulk-row {
    grid-template-columns: 1fr;
    padding: 8px;
  }
  .paddock-edit-list { padding: 8px; }
  .paddock-edit-row {
    grid-template-columns: 1fr;
    gap: 8px;
    padding: 8px;
  }
  .paddock-edit-horse { align-items: center; }
}

/* バイアス・時計 インラインテーブル（出馬表内） */
.bias-inline-table {
  width: 100%; border-collapse: collapse;
}
.bias-inline-table th {
  font-size: 12px; font-weight: 700; color: #78350f;
  padding: 3px 8px; border-bottom: 1px solid #fde68a; text-align: left;
}
.bias-inline-table td {
  padding: 5px 8px; font-size: 13px; vertical-align: top;
}
.bit-bias { color: #1e3a5f; font-weight: 600; white-space: pre-wrap; }
.bit-clock { color: #7c3aed; font-weight: 600; white-space: pre-wrap; }

/* バイアス一覧・日付別サマリーテーブル */
.bias-summary-table {
  width: 100%; border-collapse: collapse;
  background: #fffbeb; border-radius: 8px; overflow: hidden;
  box-shadow: 0 1px 3px rgba(0,0,0,.07); margin-bottom: 6px;
}
.bias-summary-table th {
  padding: 7px 12px; font-size: 12px; font-weight: 700;
  background: #fef3c7; border-bottom: 2px solid #fde68a; text-align: left;
}
.bias-summary-table td {
  padding: 8px 12px; font-size: 13px; border-bottom: 1px solid #fef3c7;
  vertical-align: top;
}
.bst-bias { color: #1e3a5f; font-weight: 600; }
.bst-clock { color: #7c3aed; font-weight: 600; }

/* ===== 出馬表テーブル ===== */
.table-wrapper { overflow-x: auto; }
.race-table { width: 100%; border-collapse: collapse; background: #fff; border-radius: 8px; overflow: hidden; box-shadow: 0 1px 3px rgba(0,0,0,.08); }
.race-table th { background: #1e3a5f; color: #fff; padding: 8px 10px; text-align: left; font-size: 12px; white-space: nowrap; }
.race-table td { padding: 8px 10px; border-bottom: 1px solid #e2e8f0; font-size: 13px; vertical-align: middle; }
.race-table tr:last-child td { border-bottom: none; }
.race-table .horse-row:hover td { background: #f8faff; }
.center { text-align: center; }
.mono { font-family: monospace; }
.corner { font-family: monospace; color: #475569; }
.horse-name { font-weight: 600; }

/* 基準差カラー */
.diff-fast { color: #16a34a; font-weight: bold; }
.diff-slow { color: #dc2626; font-weight: bold; }

/* 脚質バッジ */
.style-badge { display: inline-block; padding: 2px 8px; border-radius: 4px; font-size: 11px; font-weight: bold; }
.style-逃げ { background: #fee2e2; color: #991b1b; }
.style-先行 { background: #fef3c7; color: #92400e; }
.style-差し { background: #d1fae5; color: #065f46; }
.style-追込 { background: #dbeafe; color: #1e40af; }
.style-自在 { background: #f3e8ff; color: #6b21a8; }

/* 過去5走行 */
.past-row td { background: #f8faff; padding: 4px 10px 8px; }
.past-results { display: flex; flex-wrap: wrap; gap: 8px; font-size: 12px; color: #475569; }
.past-label { font-weight: bold; color: #1e3a5f; }
.past-item { background: #e2e8f0; padding: 2px 8px; border-radius: 4px; }

/* メモ */
.memo-display { cursor: pointer; display: inline-block; color: #64748b; font-size: 12px; max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.memo-display:hover { color: #2563eb; }

/* ===== モーダル ===== */
.modal { position: fixed; inset: 0; z-index: 200; display: flex; align-items: center; justify-content: center; }
.modal.hidden { display: none; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,.4); }
.modal-box { position: relative; background: #fff; border-radius: 10px; padding: 24px; width: 90%; max-width: 420px; box-shadow: 0 8px 32px rgba(0,0,0,.2); }
.modal-box h3 { margin-bottom: 12px; font-size: 16px; }
.modal-box textarea { width: 100%; border: 1px solid #cbd5e1; border-radius: 6px; padding: 10px; font-size: 14px; resize: vertical; }
.modal-actions { display: flex; gap: 8px; margin-top: 12px; justify-content: flex-end; }

/* メモ クイック選択ボタン */
.memo-quick-btns { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
.memo-quick { padding: 5px 12px; border-radius: 20px; font-size: 13px; font-weight: bold; cursor: pointer; background: #fff; transition: opacity .15s; }
.memo-quick:hover { opacity: .75; }
.memo-quick-bad  { color: #dc2626; border: 2px solid #dc2626; }
.memo-quick-good { color: #2563eb; border: 2px solid #2563eb; }

/* 出馬表上のメモタグ色 */
.memo-tag-bad  { color: #dc2626; font-weight: bold; }
.memo-tag-good { color: #2563eb; font-weight: bold; }

/* ===== フォーム ===== */
.form-card { background: #fff; border-radius: 10px; padding: 24px; box-shadow: 0 1px 3px rgba(0,0,0,.08); }
.form-card h3 { font-size: 15px; font-weight: bold; margin: 20px 0 10px; color: #1e3a5f; border-bottom: 1px solid #e2e8f0; padding-bottom: 6px; }
.form-row { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: #475569; font-weight: 500; }
input[type=text], input[type=number], input[type=date], select, textarea {
  border: 1px solid #cbd5e1; border-radius: 6px; padding: 7px 10px; font-size: 14px;
  background: #fff; min-width: 120px;
}
input:focus, select:focus, textarea:focus { outline: 2px solid #2563eb; border-color: transparent; }
textarea { width: 100%; }

/* 過去フォーム */
.past-form-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: flex-end; margin-bottom: 10px; padding: 10px; background: #f8faff; border-radius: 6px; }
.past-num { font-weight: bold; color: #1e3a5f; min-width: 40px; font-size: 12px; }
.past-form-row input, .past-form-row select { min-width: 80px; font-size: 12px; padding: 5px 8px; }

/* ===== 空状態 ===== */
.empty-state { text-align: center; padding: 48px 24px; color: #64748b; }
.empty-state p { margin-bottom: 16px; }
.note { color: #64748b; font-size: 12px; margin-top: 10px; }

/* ===== 設定・取得画面 ===== */
.login-status { display: inline-block; padding: 6px 14px; border-radius: 6px; font-weight: bold; margin-bottom: 16px; font-size: 14px; }
.status-ok { background: #d1fae5; color: #065f46; }
.status-ng { background: #fee2e2; color: #991b1b; }
.fetch-log { background: #0f172a; color: #94a3b8; font-family: monospace; font-size: 12px; padding: 14px; border-radius: 8px; min-height: 120px; max-height: 320px; overflow-y: auto; line-height: 1.7; }

/* ===== 競馬新聞風レイアウト ===== */
.newspaper {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.np-horse-block {
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 1px 4px rgba(0,0,0,.1);
  overflow: hidden;
  border-left: 5px solid #1e3a5f;
}

.np-horse-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  background: #f8faff;
  border-bottom: 1px solid #e2e8f0;
  flex-wrap: wrap;
}

.np-umaban {
  font-size: 22px;
  font-weight: 900;
  color: #1e3a5f;
  min-width: 40px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}
.np-umaban-cninkl {
  font-size: 11px;
  font-weight: 700;
  color: #dc2626;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 2px;
  justify-content: center;
}
.ninkia-sign  { font-size: 16px; font-weight: 900; line-height: 1; -webkit-text-stroke: 0.5px currentColor; }
.ninkia-num   { font-size: 11px; font-weight: 700; line-height: 1; }
.ninkia-flat  { color: #64748b; }
.ninkia-under { color: #1d4ed8; }
.ninkia-over  { color: #dc2626; }
.ninkia-diff-wrap { display: inline-flex; align-items: center; justify-content: center; gap: 2px; vertical-align: middle; }
.value-check-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 1.5px solid #cbd5e1;
  background: #fff;
  color: #94a3b8;
  font-size: 12px;
  font-weight: 900;
  line-height: 1;
  cursor: pointer;
  padding: 0;
  transition: background .15s, color .15s, border-color .15s, box-shadow .15s;
}
.value-check-btn.value-check-active {
  box-shadow: 0 1px 2px rgba(15, 118, 110, .25);
}
.value-check-btn.value-check-ok {
  background: #16a34a;
  color: #fff;
  border-color: #16a34a;
}
.value-check-btn.value-check-ng {
  background: #f97316;
  color: #fff;
  border-color: #f97316;
}
.value-check-btn.value-check-unknown {
  background: #64748b;
  color: #fff;
  border-color: #64748b;
}
.value-check-btn:active { opacity: .75; }
.value-check-btn {
  flex-shrink: 0;
  vertical-align: middle;
}
.lt-mark-cycle-cell .value-check-btn {
  margin-left: 3px;
  width: 17px;
  height: 17px;
  font-size: 11px;
}
.mark-buttons .value-check-btn {
  align-self: center;
  margin-left: -2px;
  margin-right: 2px;
  width: 18px;
  height: 18px;
  font-size: 12px;
}

/* 一覧テーブルビュー */
#table-view { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.list-table { width:100%; border-collapse:collapse; font-size:13px; background:#fff;
  border-radius:8px; overflow:hidden; box-shadow:0 1px 4px rgba(0,0,0,.08); min-width:360px; }
.list-table th { background:#2c3e6b; color:#fff; padding:8px 6px; text-align:center;
  font-size:12px; white-space:nowrap; }
.list-table th.sortable { cursor:pointer; user-select:none; }
.list-table th.sortable:hover { background:#3d5490; }
.list-table th.sort-active { background:#1a2d5c; }
.list-table th .sort-arrow { font-size:10px; margin-left:2px; }
.list-table td { padding:8px 6px; border-bottom:1px solid #eef; vertical-align:middle; }
.list-table tr:hover td { background:#f5f8ff; }
.list-table .center { text-align:center; }
.lt-no   { width:36px; }
.lt-mark { width:36px; }
.lt-mark-cycle-cell { text-align:center; padding:4px !important; }
.lt-mark-cycle-btn {
  font-size:14px; font-weight:900;
  width:34px; height:34px; line-height:34px;
  border-radius:50%; border:2px solid #cbd5e1;
  background:#f8fafc; cursor:pointer;
  display:inline-block; text-align:center; padding:0;
  transition: background 0.15s;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
  touch-action: manipulation;
}
.lt-mark-cycle-btn:hover { opacity:0.8; }
.lt-mark-cycle-none  { background:#f1f5f9; color:#94a3b8; border-color:#cbd5e1; }
.lt-mark-cycle-honmei { background:#7f1d1d; color:#fff; border-color:#991b1b; }
.lt-mark-cycle-◎    { background:#e74c3c; color:#fff; border-color:#e74c3c; }
.lt-mark-cycle-○    { background:#3498db; color:#fff; border-color:#3498db; }
.lt-mark-cycle-▲    { background:#e67e22; color:#fff; border-color:#e67e22; }
.lt-mark-cycle-△    { background:#27ae60; color:#fff; border-color:#27ae60; }
.lt-mark-cycle-star { background:#facc15; color:#713f12; border-color:#eab308; }
.lt-mark-cycle-消    { background:#7f8c8d; color:#fff; border-color:#7f8c8d; }

/* 印ポップアップ（長押し） */
.mark-popup-overlay {
  position:fixed; inset:0; z-index:9998;
  background:rgba(0,0,0,0.15);
}
.mark-popup {
  position:absolute; z-index:9999;
  display:flex; gap:6px; padding:8px 10px;
  background:#fff; border-radius:12px;
  box-shadow:0 4px 20px rgba(0,0,0,0.25);
  border:1px solid #e2e8f0;
}
.mark-popup-btn {
  font-size:16px; font-weight:900;
  width:36px; height:36px; line-height:36px;
  border-radius:50%; border:2px solid #cbd5e1;
  cursor:pointer; text-align:center; padding:0;
  background:#f8fafc; transition:opacity 0.1s;
}
.mark-popup-btn:hover { opacity:0.75; }
.mark-popup-honmei { background:#7f1d1d; color:#fff; border-color:#991b1b; }
.mark-popup-◎ { background:#e74c3c; color:#fff; border-color:#e74c3c; }
.mark-popup-○ { background:#3498db; color:#fff; border-color:#3498db; }
.mark-popup-▲ { background:#e67e22; color:#fff; border-color:#e67e22; }
.mark-popup-△ { background:#27ae60; color:#fff; border-color:#27ae60; }
.mark-popup-star { background:#facc15; color:#713f12; border-color:#eab308; }
.mark-popup-消 { background:#7f8c8d; color:#fff; border-color:#7f8c8d; }
.mark-popup-none { background:#f1f5f9; color:#94a3b8; border-color:#cbd5e1; }

.lt-name { min-width:0; }
.lt-comment { min-width:80px; }
.lt-comment-cell { font-size:12px; color:#334155; max-width:220px; }
.lt-memo-text { white-space:nowrap; overflow:hidden; text-overflow:ellipsis; display:block; max-width:220px; }
.lt-comment-toggle {
  width: 28px;
  height: 28px;
  border: 1px solid #f59e0b;
  border-radius: 50%;
  background: #fffbeb;
  color: #d97706;
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
  font-weight: 800;
}
.lt-comment-toggle.is-open { background: #d97706; color: #fff; }
.lt-comment-detail-row[hidden] { display: none; }
.lt-comment-detail-row td { padding: 0 !important; background: #fffdf3; }
.lt-comment-detail {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  padding: 8px 10px;
  border-bottom: 1px solid #fde68a;
  color: #334155;
  font-size: 12px;
  line-height: 1.45;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.lt-comment-detail strong { flex: 0 0 auto; color: #92400e; }
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.lt-mobile-fuku { display:none; }
.lt-c-popularity-stats {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  margin-top: 2px;
  font-size: 9px;
  font-weight: 800;
  line-height: 1.15;
  white-space: nowrap;
}
.lt-c-win-rate {
  display: block;
  padding: 1px 3px;
  border-radius: 3px;
  background: #f3e8ff;
  color: #6b21a8;
}
.lt-c-win-rate-missing { background: #f1f5f9; color: #94a3b8; }
.lt-c-win-rate-all { background: #e0e7ff; color: #3730a3; }
.lt-c-expected-return { display: block; color: #475569; }
.lt-c-expected-return-all { color: #4338ca; }
.lt-c-expected-return-positive { color: #dc2626; }
.lt-cnk  { width:72px; }
.lt-agari { width:190px; }
.lt-ability { width:96px; }
.lt-odds { width:72px; }
.lt-fuku { width:72px; }
.lt-horse-name { font-weight:700; font-size:13px; }
.lt-detail-btn { margin-left: 6px; vertical-align: middle; font-size: 10px; padding: 1px 5px; }
.lt-horse-sub  { font-size:10px; color:#888; margin-top:1px; }
.jockey-weight {
  display: inline-flex;
  align-items: center;
  margin-left: 4px;
  padding: 0 4px;
  border-radius: 4px;
  background: #f1f5f9;
  color: #334155;
  font-size: 10px;
  font-weight: 700;
  line-height: 1.4;
  white-space: nowrap;
}
.np-sub .jockey-weight { margin-left: 0; font-size: 11px; }
.ability-debug-run .jockey-weight { font-size: 10px; }
.carried-weight-change {
  display: inline-flex;
  align-items: center;
  margin-left: 3px;
  padding: 0 4px;
  border: 1px solid;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 800;
  line-height: 1.4;
  white-space: nowrap;
  vertical-align: middle;
}
.carried-weight-change-up { background: #fee2e2; border-color: #fca5a5; color: #b91c1c; }
.carried-weight-change-down { background: #e0f2fe; border-color: #7dd3fc; color: #075985; }
.np-sub .carried-weight-change { margin-left: 3px; font-size: 10px; }

/* コース騎手成績バッジ */
.course-jockey-stats { margin-top:2px; display:flex; flex-direction:column; gap:2px; }
.cjs-badge {
  display:flex;
  flex-wrap:wrap;
  align-items:center;
  gap:3px;
  font-size:8px;
  line-height:1.4;
  padding:1px 4px;
  border-radius:3px;
  border-left:2px solid;
}
.cjs-label { font-weight:700; flex-shrink:0; }
.cjs-record { font-weight:600; flex-shrink:0; }
.cjs-rates { opacity:0.9; }
.cjs-1y { background:#dbeafe; color:#1e40af; border-color:#3b82f6; }
.cjs-3y { background:#dcfce7; color:#166534; border-color:#22c55e; }
.jockey-course-rating {
  display:inline-flex;
  align-items:center;
  gap:2px;
  padding:1px 4px;
  border:1px solid #cbd5e1;
  border-radius:4px;
  background:#f8fafc;
  color:#334155;
  font-size:9px;
  font-weight:800;
  line-height:1.25;
  white-space:nowrap;
}
.jockey-course-rating strong { font-size:10px; }
.jockey-course-rating em { font-style:normal; padding:0 2px; border-radius:3px; }
.jockey-course-rating small { color:#64748b; font-size:8px; font-weight:700; }
.jockey-course-rating-s { background:#fef2f2; border-color:#f87171; color:#b91c1c; }
.jockey-course-rating-s em { background:#dc2626; color:#fff; }
.jockey-course-rating-a { background:#fff7ed; border-color:#fb923c; color:#9a3412; }
.jockey-course-rating-a em { background:#f97316; color:#fff; }
.jockey-course-rating-b { background:#eff6ff; border-color:#60a5fa; color:#1d4ed8; }
.jockey-course-rating-b em { background:#2563eb; color:#fff; }
.jockey-course-rating-c { background:#f8fafc; border-color:#cbd5e1; color:#475569; }
.jockey-course-rating-c em { background:#64748b; color:#fff; }
.jockey-course-rating-d { background:#fefce8; border-color:#facc15; color:#854d0e; }
.jockey-course-rating-d em { background:#ca8a04; color:#fff; }
.jockey-course-rating-e { background:#f1f5f9; border-color:#cbd5e1; color:#64748b; }
.jockey-course-rating-e em { background:#94a3b8; color:#fff; }
.jk-course-rating-card {
  display:flex;
  flex-direction:column;
  justify-content:center;
  gap:3px;
  border-left:3px solid #64748b;
  background:#f8fafc;
}
.jk-course-rating-score { display:flex; align-items:baseline; gap:5px; color:#334155; line-height:1; }
.jk-course-rating-score strong { font-size:1.3rem; letter-spacing:0; }
.jk-course-rating-score em { padding:2px 5px; border-radius:4px; color:#fff; font-size:0.82rem; font-style:normal; font-weight:800; }
.jk-course-rating-score small { color:#64748b; font-size:0.68rem; font-weight:700; }
.jk-course-rating-detail { color:#64748b; font-size:0.67rem; font-weight:700; line-height:1.25; }
.jk-course-rating-card.jk-course-rating-s { border-left-color:#dc2626; background:#fef2f2; }
.jk-course-rating-s .jk-course-rating-score { color:#b91c1c; }
.jk-course-rating-s .jk-course-rating-score em { background:#dc2626; }
.jk-course-rating-card.jk-course-rating-a { border-left-color:#f97316; background:#fff7ed; }
.jk-course-rating-a .jk-course-rating-score { color:#9a3412; }
.jk-course-rating-a .jk-course-rating-score em { background:#f97316; }
.jk-course-rating-card.jk-course-rating-b { border-left-color:#2563eb; background:#eff6ff; }
.jk-course-rating-b .jk-course-rating-score { color:#1d4ed8; }
.jk-course-rating-b .jk-course-rating-score em { background:#2563eb; }
.jk-course-rating-card.jk-course-rating-c { border-left-color:#64748b; }
.jk-course-rating-c .jk-course-rating-score em { background:#64748b; }
.jk-course-rating-card.jk-course-rating-d { border-left-color:#ca8a04; background:#fefce8; }
.jk-course-rating-d .jk-course-rating-score { color:#854d0e; }
.jk-course-rating-d .jk-course-rating-score em { background:#ca8a04; }
.jk-course-rating-card.jk-course-rating-e { border-left-color:#94a3b8; }
.jk-course-rating-e .jk-course-rating-score em { background:#94a3b8; }
.jockey-course-rating {
  display:inline-flex;
  align-items:stretch;
  gap:0;
  min-height:20px;
  margin-left:4px;
  padding:0;
  overflow:hidden;
  vertical-align:middle;
}
.jockey-course-rating-label {
  display:flex;
  align-items:center;
  padding:0 4px;
  background:rgba(255,255,255,.62);
  color:inherit;
  font-size:8px;
  font-weight:800;
}
.jockey-course-rating strong {
  display:flex;
  align-items:center;
  justify-content:center;
  min-width:25px;
  padding:0 3px;
  font-size:10px;
  line-height:1;
}
.jockey-course-rating em {
  display:flex;
  align-items:center;
  justify-content:center;
  min-width:16px;
  padding:0 3px;
  border-radius:0;
  font-size:9px;
  font-weight:900;
}
.jockey-course-relative {
  display:flex;
  align-items:center;
  justify-content:center;
  min-width:31px;
  padding:0 3px;
  border-left:1px solid rgba(100,116,139,.22);
  color:#475569;
  font-size:8px;
  font-weight:900;
  line-height:1;
}
.jockey-course-relative-strong { background:#fee2e2; color:#b91c1c; }
.jockey-course-relative-up { background:#dcfce7; color:#047857; }
.jockey-course-relative-flat { background:#f1f5f9; color:#475569; }
.jockey-course-relative-down { background:#fff7ed; color:#c2410c; }
.jockey-course-relative-neutral { background:#f8fafc; color:#64748b; }
.jk-index-hero {
  margin:8px 0 10px;
  padding:10px;
  border:1px solid #cbd5e1;
  border-left:4px solid #64748b;
  background:#f8fafc;
}
.jk-index-hero-main { display:flex; align-items:center; justify-content:space-between; gap:10px; }
.jk-index-kicker { display:block; color:#64748b; font-size:0.67rem; font-weight:700; }
.jk-index-title { color:#0f172a; font-size:0.96rem; font-weight:850; }
.jk-index-score { display:flex; align-items:center; gap:5px; }
.jk-index-score strong { color:#0f172a; font-size:1.7rem; line-height:1; }
.jk-index-score em { padding:3px 7px; border-radius:4px; background:#64748b; color:#fff; font-size:0.9rem; font-style:normal; font-weight:900; }
.jk-index-meta { display:flex; flex-wrap:wrap; gap:4px 8px; margin-top:7px; color:#475569; font-size:0.7rem; font-weight:700; }
.jk-index-condition { color:#0f766e; }
.jk-index-relative { display:grid; grid-template-columns:auto 1fr auto; gap:3px 8px; align-items:center; margin-top:8px; padding:7px 8px; border:1px solid #cbd5e1; background:#fff; }
.jk-index-relative > span { color:#64748b; font-size:0.66rem; font-weight:800; }
.jk-index-relative > strong { color:#0f172a; font-size:0.86rem; line-height:1; }
.jk-index-relative > em { justify-self:end; padding:2px 5px; border-radius:4px; background:#f1f5f9; color:#475569; font-size:0.68rem; font-style:normal; font-weight:900; white-space:nowrap; }
.jk-index-relative > small { grid-column:1 / -1; color:#64748b; font-size:0.64rem; font-weight:700; }
.jk-index-relative-strong { border-color:#fca5a5; background:#fef2f2; }
.jk-index-relative-strong > em { background:#dc2626; color:#fff; }
.jk-index-relative-up { border-color:#86efac; background:#f0fdf4; }
.jk-index-relative-up > em { background:#059669; color:#fff; }
.jk-index-relative-flat > em { background:#64748b; color:#fff; }
.jk-index-relative-down { border-color:#fdba74; background:#fff7ed; }
.jk-index-relative-down > em { background:#c2410c; color:#fff; }
.jk-index-groups { display:grid; grid-template-columns:repeat(3, minmax(0, 1fr)); gap:5px; margin-top:9px; }
.jk-index-group { min-width:0; padding:6px; border:1px solid #dbe3ea; background:#fff; }
.jk-index-group span { display:block; overflow:hidden; color:#64748b; font-size:0.64rem; font-weight:800; text-overflow:ellipsis; white-space:nowrap; }
.jk-index-group strong { display:block; margin-top:2px; color:#0f172a; font-size:1rem; line-height:1; }
.jk-index-group small { display:block; min-height:1.8em; margin-top:3px; color:#64748b; font-size:0.58rem; font-weight:700; line-height:1.25; }
.jk-index-group.is-base { border-color:#93c5fd; background:#eff6ff; }
.jk-index-group.is-up { border-color:#86efac; background:#f0fdf4; }
.jk-index-group.is-up strong { color:#047857; }
.jk-index-group.is-down { border-color:#fdba74; background:#fff7ed; }
.jk-index-group.is-down strong { color:#c2410c; }
.jk-index-detail-label { margin-top:9px; color:#475569; font-size:0.66rem; font-weight:800; }
.jk-index-components { display:grid; grid-template-columns:repeat(3, minmax(0, 1fr)); gap:5px; margin-top:9px; }
.jk-index-component { min-width:0; padding:5px 6px; border:1px solid #dbe3ea; background:#fff; }
.jk-index-component span { display:block; overflow:hidden; color:#64748b; font-size:0.64rem; font-weight:700; text-overflow:ellipsis; white-space:nowrap; }
.jk-index-component strong { display:inline-block; margin-top:2px; color:#334155; font-size:0.86rem; line-height:1; }
.jk-index-component small { display:block; margin-top:2px; color:#94a3b8; font-size:0.61rem; font-weight:700; }
.jk-index-component.is-up strong { color:#047857; }
.jk-index-component.is-down strong { color:#c2410c; }
.jk-index-component.is-base { border-color:#bfdbfe; background:#eff6ff; }
.jk-index-rank-s { border-left-color:#dc2626; background:#fef2f2; }
.jk-index-rank-s .jk-index-score strong { color:#b91c1c; }
.jk-index-rank-s .jk-index-score em { background:#dc2626; }
.jk-index-rank-a { border-left-color:#f97316; background:#fff7ed; }
.jk-index-rank-a .jk-index-score strong { color:#9a3412; }
.jk-index-rank-a .jk-index-score em { background:#f97316; }
.jk-index-rank-b { border-left-color:#2563eb; background:#eff6ff; }
.jk-index-rank-b .jk-index-score strong { color:#1d4ed8; }
.jk-index-rank-b .jk-index-score em { background:#2563eb; }
.jk-index-rank-d { border-left-color:#ca8a04; background:#fefce8; }
.jk-index-rank-d .jk-index-score strong { color:#854d0e; }
.jk-index-rank-d .jk-index-score em { background:#ca8a04; }
.jk-index-rank-e { border-left-color:#94a3b8; }
.jk-index-rank-e .jk-index-score em { background:#94a3b8; }
.lt-cnk-val    { font-weight:700; font-size:13px; margin-right:2px; }
/* C人気カラー */
.cnk-1 { color:#e74c3c; font-weight:900; }
.cnk-2 { color:#e67e22; font-weight:900; }
.cnk-3 { color:#2980b9; font-weight:900; }
.mark-badge { display:inline-block; width:20px; height:20px; line-height:20px;
  text-align:center; border-radius:50%; font-weight:700; font-size:12px; }
.mark-badge-◎ { background:#e74c3c; color:#fff; }
.mark-badge-○ { background:#3498db; color:#fff; }
.mark-badge-▲ { background:#f39c12; color:#fff; }
.mark-badge-△ { background:#95a5a6; color:#fff; }
.mark-badge-消 { background:#7f8c8d; color:#fff; }
/* 馬券購入画面の印 */
.bp-mark { display:inline-block; width:20px; height:20px; line-height:20px;
  text-align:center; border-radius:50%; font-weight:900; font-size:12px; }
.bp-mark-◎ { background:#e74c3c; color:#fff; }
.bp-mark-○ { background:#3498db; color:#fff; }
.bp-mark-▲ { background:#f39c12; color:#fff; }
.bp-mark-△ { background:#95a5a6; color:#fff; }
.bp-mark-消 { background:#7f8c8d; color:#fff; }
.bp-mark-empty { color:#ccc; font-size:12px; }
.bp-pop { font-size:11px; color:#666; margin-left:2px; }
.bp-rentai-rate { display:inline-block; margin-top:2px; padding:1px 4px; border-radius:4px; background:#e0f2fe; color:#075985; font-size:10px; font-weight:700; line-height:1.25; white-space:nowrap; }
.bp-c-popularity-rate { margin-left:2px; background:#f3e8ff; color:#6b21a8; }
.bp-all-track-c-popularity-rate { margin-left:2px; background:#e0e7ff; color:#3730a3; }
.bp-real-popularity-rate { margin-left:2px; background:#e0f2fe; color:#075985; }
.bp-condition-base-rate { margin-left:2px; }
.bp-lv-base-rate { background:#ecfdf5; color:#047857; }
.bp-all-base-rate { background:#fffbeb; color:#92400e; }
.bp-rentai-missing { background:#f1f5f9; color:#94a3b8; }
.bp-expected-return { display:block; margin-top:1px; color:#475569; font-size:9px; font-weight:800; line-height:1.15; }
.bp-expected-return-positive { color:#dc2626; }
.bp-required-rentai { display:block; margin-top:2px; color:#9a3412; font-size:10px; font-weight:700; line-height:1.25; white-space:nowrap; }
.odds-rate-context { margin:0 0 6px; color:#475569; font-size:11px; font-weight:700; }
.odds-master-note { font-size:11px; color:#6b7280; max-width:160px; line-height:1.4; }
.horse-sex-age { font-size:10px; color:#6b7280; font-weight:400; margin-left:4px; white-space:nowrap; }
@media (max-width:480px) {
  .list-table { font-size:12px; }
  .list-table th { font-size:11px; padding:7px 4px; }
  .list-table td { padding:7px 4px; }
  .lt-horse-name { font-size:12px; }
  .lt-horse-sub  { font-size:10px; }
}

.np-name-block {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 140px;
}

.np-name {
  font-size: 16px;
  font-weight: 700;
}
.c-ninkibadge {
  font-size: 11px;
  font-weight: 700;
  background: #dc2626;
  color: #fff;
  padding: 1px 6px;
  border-radius: 4px;
  letter-spacing: 0.5px;
}

.np-sub {
  display: flex;
  align-items: center;
  gap: 8px;
}

.np-trainer-row,
.lt-trainer-row {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 3px;
  min-width: 0;
  color: #64748b;
  font-size: 10px;
  line-height: 1.2;
}
.np-trainer-row { margin-top: -1px; }
.trainer-label {
  color: #64748b;
  font-size: 9px;
  font-weight: 800;
  white-space: nowrap;
}
.trainer-link,
.trainer-name-unavailable {
  display: inline-flex;
  align-items: center;
  min-height: 18px;
  padding: 0 5px;
  border: 1px solid #99f6e4;
  border-radius: 3px;
  background: #ecfdf5;
  color: #0f766e;
  font-size: 10px;
  font-weight: 800;
  line-height: 16px;
  text-decoration: none;
  white-space: nowrap;
}
.trainer-link:hover,
.trainer-link:focus-visible {
  border-color: #0f766e;
  background: #ccfbf1;
  color: #115e59;
  outline: none;
}
.trainer-name-unavailable {
  border-color: #e2e8f0;
  background: #f8fafc;
  color: #94a3b8;
}

.jockey-corner-stats {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 1px 4px;
  padding: 1px 3px;
  border-left: 2px solid #2563eb;
  border-radius: 3px;
  background: #eff6ff;
  color: #334155;
  font-size: 9px;
  line-height: 1.25;
}
.jockey-corner-stats b { color: #1d4ed8; font-weight: 800; }
.jockey-corner-samples { color: #64748b; font-weight: 700; }
.jockey-corner-average { color: #0f766e; font-weight: 700; }
.jockey-corner-recovery { color: #9a3412; font-weight: 700; }

.jockey-ability-bt {
  display: flex;
  flex-direction: column;
  gap: 3px;
  max-width: min(720px, calc(100vw - 118px));
}
.jockey-ability-summary {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 2px 6px;
  padding: 3px 5px;
  border-left: 3px solid #0f766e;
  border-radius: 4px;
  background: #ecfdf5;
  color: #115e59;
  font-size: 10px;
  line-height: 1.35;
  white-space: nowrap;
}
.jockey-ability-summary b {
  color: #134e4a;
  font-weight: 900;
}
.jockey-ability-summary span:nth-child(2) {
  padding: 0 4px;
  border-radius: 3px;
  background: #ccfbf1;
  font-weight: 900;
}
.jockey-ability-summary span:nth-child(n+3) {
  color: #334155;
}

.np-jockey {
  font-size: 13px;
  color: #475569;
}

.np-result-block {
  flex: 1;
}

.np-result-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.np-label {
  font-size: 11px;
  color: #94a3b8;
  white-space: nowrap;
}

.np-val {
  font-size: 14px;
  font-weight: 600;
  color: #1e293b;
  white-space: nowrap;
  min-width: 36px;
}

.np-actions {
  margin-left: auto;
}

.np-agari-row { padding: 6px 10px 0; }
.agari-pos-wrap {
  display: flex;
  align-items: stretch;
  gap: 6px;
  flex-wrap: wrap;
}
.agari-pos-compact {
  justify-content: center;
  gap: 4px;
  flex-wrap: nowrap;
}
.agari-box {
  display: inline-flex;
  flex-direction: column;
  gap: 2px;
  max-width: 100%;
  padding: 4px 7px;
  border-radius: 5px;
  border: 1px solid #cbd5e1;
  background: #f8fafc;
  color: #334155;
  font-size: 11px;
  line-height: 1.25;
}
.agari-main {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 4px;
  white-space: nowrap;
}
.agari-main strong { font-size: 14px; }
.agari-label, .agari-rank {
  font-size: 10px;
  font-weight: 700;
}
.agari-subline {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 3px 6px;
  font-size: 10px;
}
.agari-warnings {
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
}
.agari-warning-tag {
  display: inline-block;
  padding: 1px 5px;
  border-radius: 10px;
  background: #fee2e2;
  color: #991b1b;
  font-size: 10px;
  font-weight: 700;
}
.agari-top-1 {
  background: #fef3c7;
  border-color: #f59e0b;
  color: #92400e;
}
.agari-top-2 {
  background: #f1f5f9;
  border-color: #94a3b8;
  color: #334155;
}
.agari-top-3 {
  background: #ffedd5;
  border-color: #fb923c;
  color: #9a3412;
}
.agari-has-warning {
  box-shadow: inset 3px 0 0 #ef4444;
}
.lt-agari .agari-box {
  padding: 2px 4px;
  min-width: 86px;
}
.lt-agari .agari-subline {
  font-size: 9px;
  gap: 2px 4px;
}
.lt-agari .agari-main strong { font-size: 12px; }
.ability-box {
  display: inline-flex;
  flex-direction: column;
  gap: 2px;
  max-width: 100%;
  padding: 4px 7px;
  border-radius: 5px;
  border: 1px solid #bfdbfe;
  background: #eff6ff;
  color: #1e3a8a;
  font-size: 11px;
  line-height: 1.25;
}
.ability-main {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 4px;
  white-space: nowrap;
}
.ability-main strong {
  font-size: 16px;
  color: #0f172a;
}
.ability-label,
.ability-rank {
  font-size: 10px;
  font-weight: 800;
}
.ability-rank {
  padding: 1px 5px;
  border-radius: 999px;
  background: #1d4ed8;
  color: #fff;
}
.ability-subline {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 3px 6px;
  font-size: 10px;
  color: #334155;
}
.ability-going-fallback {
  color: #b45309;
  font-weight: 800;
}
.ability-going-split {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 3px;
}
.ability-going {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 3px;
  min-width: 0;
  padding: 2px 4px;
  border: 1px solid #cbd5e1;
  border-radius: 3px;
  background: #fff;
  color: #475569;
  font-size: 9px;
  white-space: nowrap;
}
.ability-going strong {
  color: #0f172a;
  font-size: 12px;
}
.ability-going-rank {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 15px;
  padding: 0 3px;
  border-radius: 3px;
  background: #1d4ed8;
  color: #fff;
  font-size: 9px;
  font-style: normal;
  font-weight: 800;
  line-height: 15px;
}
.ability-going-rank-S,
.ability-going-rank-A { background: #b45309; }
.ability-going-rank-D,
.ability-going-rank-E,
.ability-going-rank-F,
.ability-going-rank-G,
.ability-going-rank-none { background: #64748b; }
.ability-going small {
  color: #64748b;
  font-size: 8px;
}
.ability-going-good { background: #ecfdf5; border-color: #a7f3d0; }
.ability-going-heavy { background: #eef2ff; border-color: #c7d2fe; }
.ability-going-good .ability-going-rank { background: #059669; }
.ability-going-good .ability-going-rank-S,
.ability-going-good .ability-going-rank-A { background: #047857; }
.ability-going-good .ability-going-rank-D,
.ability-going-good .ability-going-rank-E,
.ability-going-good .ability-going-rank-F,
.ability-going-good .ability-going-rank-G,
.ability-going-good .ability-going-rank-none { background: #a7f3d0; color: #065f46; }
.ability-going-heavy .ability-going-rank { background: #2563eb; }
.ability-going-heavy .ability-going-rank-S,
.ability-going-heavy .ability-going-rank-A { background: #4338ca; }
.ability-going-heavy .ability-going-rank-D,
.ability-going-heavy .ability-going-rank-E,
.ability-going-heavy .ability-going-rank-F,
.ability-going-heavy .ability-going-rank-G,
.ability-going-heavy .ability-going-rank-none { background: #bfdbfe; color: #1e3a8a; }
.ability-going.is-current {
  border-width: 2px;
  border-color: #0f766e;
  box-shadow: inset 0 0 0 1px rgba(15, 118, 110, .12);
}
.ability-rank-S,
.ability-rank-A {
  background: #fef3c7;
  border-color: #f59e0b;
  color: #92400e;
}
.ability-rank-S .ability-rank,
.ability-rank-A .ability-rank {
  background: #b45309;
}
.ability-rank-D,
.ability-rank-E,
.ability-rank-F,
.ability-rank-G {
  background: #f8fafc;
  border-color: #cbd5e1;
  color: #475569;
}
.ability-rank-F .ability-rank,
.ability-rank-G .ability-rank {
  background: #64748b;
}
.ability-has-warning {
  box-shadow: inset 3px 0 0 #ef4444;
}
.ability-warnings {
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
}
.ability-warning-tag {
  display: inline-block;
  padding: 1px 5px;
  border-radius: 10px;
  background: #fee2e2;
  color: #991b1b;
  font-size: 10px;
  font-weight: 700;
}
.ability-compact {
  min-width: 76px;
  padding: 2px 4px;
}
.ability-compact .ability-main strong {
  font-size: 13px;
}
.ability-compact .ability-subline {
  font-size: 9px;
  gap: 2px 4px;
}
.ability-compact .ability-going-split { gap: 2px; }
.ability-compact .ability-going {
  padding: 1px 3px;
  gap: 2px;
  font-size: 8px;
}
.ability-compact .ability-going strong { font-size: 10px; }
.ability-compact .ability-going-rank {
  min-width: 13px;
  padding: 0 2px;
  font-size: 8px;
  line-height: 13px;
}
.ability-compact .ability-going small { font-size: 7px; }

/* 保存済み競馬ブック調教から算出する、馬ごとの調教指数。 */
.training-index-row { padding: 6px 10px 0; }
.training-index-box {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 3px 8px;
  width: 100%;
  box-sizing: border-box;
  min-width: 0;
  padding: 5px 7px;
  border: 1px solid #cbd5e1;
  border-left: 4px solid #64748b;
  border-radius: 5px;
  background: #f8fafc;
  color: #334155;
  font-size: 11px;
  line-height: 1.25;
}
.training-index-main,
.training-index-summary {
  display: inline-flex;
  align-items: baseline;
  min-width: 0;
  gap: 4px;
}
.training-index-label { color: inherit; font-size: 10px; font-weight: 800; }
.training-index-main strong { color: #0f172a; font-size: 17px; line-height: 1; }
.training-index-main em {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 17px;
  padding: 1px 4px;
  border-radius: 3px;
  background: #64748b;
  color: #fff;
  font-size: 10px;
  font-style: normal;
  font-weight: 900;
  line-height: 15px;
}
.training-index-summary { color: #475569; font-size: 10px; font-weight: 700; }
.training-index-source { color: #64748b; font-weight: 600; }
.training-index-provisional {
  padding: 1px 4px;
  border-radius: 3px;
  background: #fef3c7;
  color: #92400e;
  font-size: 9px;
  font-weight: 800;
}
.training-index-details { margin-left: auto; min-width: 0; }
.training-index-details summary {
  cursor: pointer;
  color: inherit;
  font-size: 10px;
  font-weight: 800;
  white-space: nowrap;
}
.training-index-details[open] { flex-basis: 100%; margin-left: 0; }
.training-index-details > div {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 4px;
  margin-top: 4px;
}
.training-index-details span {
  min-width: 0;
  padding: 3px 4px;
  border: 1px solid rgba(148, 163, 184, .42);
  border-radius: 3px;
  background: rgba(255,255,255,.72);
  font-size: 9px;
  white-space: nowrap;
}
.training-index-details b { color: #0f172a; font-size: 10px; }
.training-index-details small { color: #64748b; font-size: 8px; }
.training-index-grade-S,
.training-index-grade-A { background: #ecfdf5; border-color: #86efac; border-left-color: #059669; color: #065f46; }
.training-index-grade-S .training-index-main em,
.training-index-grade-A .training-index-main em { background: #047857; }
.training-index-grade-B,
.training-index-grade-C { background: #eff6ff; border-color: #bfdbfe; border-left-color: #2563eb; color: #1e3a8a; }
.training-index-grade-B .training-index-main em,
.training-index-grade-C .training-index-main em { background: #2563eb; }
.training-index-grade-D,
.training-index-grade-E { background: #fff7ed; border-color: #fed7aa; border-left-color: #d97706; color: #9a3412; }
.training-index-grade-D .training-index-main em,
.training-index-grade-E .training-index-main em { background: #d97706; }
.training-index-grade-F,
.training-index-grade-G { background: #fef2f2; border-color: #fecaca; border-left-color: #dc2626; color: #991b1b; }
.training-index-grade-F .training-index-main em,
.training-index-grade-G .training-index-main em { background: #dc2626; }
.training-index-empty {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 3px 7px;
  border: 1px solid #dbe3ee;
  border-radius: 4px;
  background: #f8fafc;
  color: #64748b;
  font-size: 10px;
  font-weight: 700;
}
.training-index-pending { color: #1d4ed8; border-color: #bfdbfe; background: #eff6ff; }
.matchup-index-row { padding: 5px 10px 0; }
.matchup-index-box {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 3px 6px;
  width: 100%;
  box-sizing: border-box;
  padding: 4px 6px;
  border: 1px solid #cbd5e1;
  border-left: 4px solid #0f766e;
  border-radius: 5px;
  background: #f0fdfa;
  color: #134e4a;
  font-size: 10px;
  line-height: 1.2;
}
.matchup-index-label { font-size: 10px; font-weight: 900; white-space: nowrap; }
.matchup-index-metric {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 1px 4px;
  border: 1px solid #99f6e4;
  border-radius: 3px;
  background: #fff;
  color: #0f766e;
  font-weight: 800;
  white-space: nowrap;
}
.matchup-index-metric b { font-size: 9px; }
.matchup-index-metric strong { color: #0f172a; font-size: 14px; line-height: 1; }
.matchup-index-metric em {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 13px;
  border-radius: 3px;
  background: #0f766e;
  color: #fff;
  font-size: 8px;
  font-style: normal;
  line-height: 13px;
}
.matchup-index-high { background: #fef2f2; border-color: #fecaca; color: #b91c1c; }
.matchup-index-high em { background: #b91c1c; }
.matchup-index-positive { background: #fff7ed; border-color: #fed7aa; color: #c2410c; }
.matchup-index-positive em { background: #c2410c; }
.matchup-index-neutral { background: #f8fafc; border-color: #cbd5e1; color: #475569; }
.matchup-index-neutral em { background: #64748b; }
.matchup-index-low { background: #eff6ff; border-color: #bfdbfe; color: #1d4ed8; }
.matchup-index-low em { background: #2563eb; }
.matchup-index-negative { background: #e0f2fe; border-color: #7dd3fc; color: #0369a1; }
.matchup-index-negative em { background: #0284c7; }
.matchup-index-summary { color: #475569; font-size: 9px; font-weight: 700; white-space: nowrap; }
.matchup-index-details { margin-left: auto; min-width: 0; }
.matchup-index-details summary { cursor: pointer; color: #0f766e; font-size: 9px; font-weight: 800; white-space: nowrap; }
.matchup-index-details[open] { flex-basis: 100%; margin-left: 0; }
.matchup-index-details > div { display: flex; flex-wrap: wrap; gap: 3px 6px; margin-top: 3px; }
.matchup-index-details span { padding: 2px 4px; border-radius: 3px; background: rgba(255,255,255,.72); font-size: 9px; }
.matchup-index-empty {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 2px 6px;
  border: 1px solid #dbe3ee;
  border-radius: 4px;
  background: #f8fafc;
  color: #64748b;
  font-size: 9px;
  font-weight: 700;
}
.matchup-index-pending { color: #0f766e; border-color: #99f6e4; background: #f0fdfa; }
.lt-index-stack { display: flex; flex-direction: column; align-items: center; gap: 3px; }
.training-index-compact {
  display: inline-flex;
  align-items: baseline;
  gap: 3px;
  width: auto;
  min-width: 0;
  padding: 2px 4px;
  border-left-width: 3px;
  font-size: 9px;
}
.training-index-compact .training-index-label { font-size: 8px; }
.training-index-compact .training-index-main strong { font-size: 12px; }
.training-index-compact .training-index-main em { min-width: 13px; padding: 0 2px; font-size: 8px; line-height: 13px; }
.lt-ability .training-index-empty { min-height: 18px; padding: 1px 3px; font-size: 8px; }
.ability-debug {
  margin-top: 4px;
  border-top: 1px solid rgba(148, 163, 184, .45);
  padding-top: 4px;
}
.ability-debug summary {
  cursor: pointer;
  font-size: 10px;
  font-weight: 800;
  color: #1d4ed8;
}
.ability-debug-summary,
.ability-debug-runs {
  display: grid;
  gap: 3px;
  margin-top: 4px;
}
.ability-debug-summary {
  grid-template-columns: repeat(4, auto);
  justify-content: start;
  gap: 4px 8px;
  font-size: 10px;
}
.ability-debug-note {
  margin-top: 4px;
  font-size: 10px;
  color: #475569;
}
.ability-debug-run {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-wrap: wrap;
  padding: 3px 5px;
  border-radius: 4px;
  background: rgba(255, 255, 255, .72);
  color: #334155;
  font-size: 10px;
}
.ability-debug-run strong {
  color: #0f172a;
}
.ability-run-going {
  padding: 1px 4px;
  border-radius: 3px;
  font-size: 9px;
  font-weight: 800;
}
.ability-run-going-good { background: #d1fae5; color: #047857; }
.ability-run-going-heavy { background: #e0e7ff; color: #4338ca; }
.ability-single-index {
  padding: 1px 5px;
  border-radius: 4px;
  background: #dbeafe;
  color: #1e3a8a !important;
  white-space: nowrap;
}
.ability-single-raw {
  color: #475569;
}
.ability-time-index {
  padding: 1px 5px;
  border-radius: 4px;
  background: #f1f5f9;
  color: #334155;
  font-weight: 700;
  white-space: nowrap;
}
.ability-single-deduction {
  color: #991b1b;
  font-weight: 700;
}
.ability-env-deduction {
  padding: 1px 5px;
  border-radius: 4px;
  background: #fee2e2;
  border: 1px solid #fecaca;
  color: #991b1b;
  font-weight: 800;
  white-space: nowrap;
}
.ability-run-pace,
.ability-run-corner,
.ability-run-bias {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 1px 5px;
  border-radius: 4px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  color: #475569;
  white-space: nowrap;
}
.ability-run-empty {
  color: #94a3b8;
  font-weight: 700;
}
.ability-debug-run-muted {
  color: #94a3b8;
}
.ability-cross-box {
  margin: 6px 10px 0;
  padding: 7px 8px;
  border: 1px solid #bfdbfe;
  border-left: 4px solid #2563eb;
  border-radius: 6px;
  background: linear-gradient(180deg, #f8fbff 0%, #eff6ff 100%);
}
.ability-cross-head {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-wrap: wrap;
  margin-bottom: 5px;
  font-size: 11px;
  color: #334155;
}
.ability-cross-head span {
  display: inline-flex;
  align-items: center;
  padding: 1px 6px;
  border-radius: 999px;
  background: #1d4ed8;
  color: #fff;
  font-weight: 900;
}
.ability-cross-head strong {
  color: #0f172a;
}
.ability-cross-head em {
  font-style: normal;
  color: #64748b;
}
.ability-total-rank {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid #2563eb;
  background: #2563eb;
  color: #fff !important;
  box-shadow: 0 1px 2px rgba(37, 99, 235, .18);
}
.ability-total-S,
.ability-total-A {
  border-color: #f59e0b;
  background: #f59e0b;
  color: #fff !important;
}
.ability-total-D,
.ability-total-E,
.ability-total-F,
.ability-total-G {
  border-color: #cbd5e1;
  background: #64748b;
  color: #fff !important;
}
.ability-total-B,
.ability-total-C {
  border-color: #14b8a6;
  background: #14b8a6;
  color: #fff !important;
}
.ability-total-D,
.ability-total-E,
.ability-total-F,
.ability-total-G {
  color: #fff !important;
}
.ability-total-note {
  margin: -2px 0 5px;
  display: inline-flex;
  align-items: center;
  padding: 2px 6px;
  border-radius: 5px;
  background: #e0f2fe;
  color: #075985;
  font-size: 10px;
  font-weight: 700;
}
.ability-cross-items {
  display: flex;
  gap: 5px;
  overflow-x: auto;
  padding-bottom: 1px;
}
.ability-cross-chip {
  flex: 0 0 auto;
  display: grid;
  gap: 4px;
  min-width: 178px;
  padding: 6px;
  border-radius: 6px;
  background: #ffffff;
  border: 1px solid #bfdbfe;
  color: #334155;
  font-size: 10px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, .06);
}
.ability-cross-chip-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding-bottom: 3px;
  border-bottom: 1px solid #e2e8f0;
}
.ability-cross-chip-head b {
  color: #1e40af;
  font-size: 11px;
}
.ability-cross-chip-head span {
  padding: 1px 5px;
  border-radius: 999px;
  background: #e2e8f0;
  color: #475569;
  font-weight: 900;
}
.ability-cross-metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 3px;
}
.ability-cross-metric {
  display: inline-flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 4px;
  padding: 2px 5px;
  border-radius: 4px;
  background: #f8fafc;
  color: #475569;
  font-weight: 700;
}
.ability-cross-metric strong {
  color: #0f172a;
  font-size: 11px;
}
.metric-win,
.metric-rentai,
.metric-fuku {
  background: #ecfdf5;
  color: #047857;
}
.metric-tan,
.metric-fukukai {
  background: #fff7ed;
  color: #c2410c;
}
.pace-pos-box {
  display: inline-flex;
  flex-direction: column;
  justify-content: center;
  gap: 3px;
  min-width: 108px;
  padding: 4px 7px;
  border: 1px solid #cbd5e1;
  border-radius: 5px;
  background: #f8fafc;
  color: #334155;
  line-height: 1.2;
}
.pace-pos-lines {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.pace-pos-line {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  font-size: 11px;
  white-space: nowrap;
}
.pace-pos-line strong {
  font-size: 13px;
  font-weight: 800;
  color: #0f172a;
}
.pace-pos-label {
  display: inline-block;
  min-width: 16px;
  padding: 0 4px;
  border-radius: 4px;
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  text-align: center;
}
.pace-pos-style { background: #3b82f6; }
.pace-pos-lap { background: #f97316; }
.pace-pos-est {
  text-align: center;
  font-size: 10px;
  font-weight: 700;
  color: #475569;
  white-space: nowrap;
}
.pace-pos-compact {
  min-width: 72px;
  padding: 2px 4px;
  gap: 1px;
}
.pace-pos-compact .pace-pos-line {
  font-size: 9px;
  gap: 2px;
}
.pace-pos-compact .pace-pos-line strong {
  font-size: 11px;
}
.pace-pos-compact .pace-pos-label {
  min-width: 14px;
  padding: 0 3px;
  font-size: 8px;
}
.pace-pos-compact .pace-pos-est {
  font-size: 8px;
}

/* 過去5走テーブル */
.np-past {
  overflow-x: auto;
  padding: 0 4px 4px;
}

.past-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.past-table th {
  background: #334155;
  color: #cbd5e1;
  padding: 5px 8px;
  text-align: center;
  white-space: nowrap;
  font-weight: 500;
}

.past-table td {
  padding: 5px 8px;
  border-bottom: 1px solid #f1f5f9;
  white-space: nowrap;
  color: #334155;
}

.past-table tr:last-child td {
  border-bottom: none;
}

.past-table tr:hover td {
  background: #f8faff;
}

.past-pace-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 18px;
  padding: 0 4px;
  border-radius: 4px;
  font-size: 10px;
  line-height: 1;
  font-weight: 800;
  letter-spacing: 0;
  border: 1px solid transparent;
}
.past-pace-ss { background: #e0f2fe; color: #0369a1; border-color: #7dd3fc; }
.past-pace-s  { background: #dbeafe; color: #1d4ed8; border-color: #93c5fd; }
.past-pace-f  { background: #f1f5f9; color: #334155; border-color: #cbd5e1; }
.past-pace-h  { background: #fed7aa; color: #c2410c; border-color: #fdba74; }
.past-pace-hh { background: #fee2e2; color: #b91c1c; border-color: #fca5a5; }

/* メモ行 */
.np-memo-row {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 8px 14px;
  background: #fffbeb;
  border-top: 1px solid #fde68a;
  font-size: 13px;
}

.np-memo-label {
  color: #92400e;
  font-weight: 600;
  white-space: nowrap;
}

.memo-display {
  cursor: pointer;
  color: #78350f;
  flex: 1;
  white-space: pre-wrap;
  word-break: break-all;
}

.memo-display:hover {
  text-decoration: underline;
}

/* 過去走コメント */
.past-table tr.has-memo td { background: #fffbeb; }
.past-table tr.past-class-above td:not(.daily-adjusted-diff):not(.daily-clock-cell) {
  background: #fff1f2;
}
.past-table tr.past-class-below td:not(.daily-adjusted-diff):not(.daily-clock-cell) {
  background: #eff6ff;
}
.past-table tr.past-class-above td.daily-adjusted-diff,
.past-table tr.past-class-above td.daily-clock-cell {
  box-shadow: inset 0 0 0 999px rgba(254, 226, 226, .5);
}
.past-table tr.past-class-below td.daily-adjusted-diff,
.past-table tr.past-class-below td.daily-clock-cell {
  box-shadow: inset 0 0 0 999px rgba(219, 234, 254, .58);
}
/* 着順バッジ */
.rank-badge { display:inline-block; width:20px; height:20px; line-height:20px;
  text-align:center; border-radius:4px; font-weight:700; font-size:12px; color:#fff; }
.rank-1 { background:#d4a017; color:#fff; }   /* 金 */
.rank-2 { background:#2980b9; color:#fff; }   /* 青 */
.rank-3 { background:#c0392b; color:#fff; }   /* 赤 */
/* 4着以下は通常テキスト */
.rank-badge:not(.rank-1):not(.rank-2):not(.rank-3) { background:transparent; color:#333; font-weight:600; }

.past-horseno {
  display: inline-block;
  background: #e8eaf6;
  border: 1px solid #9fa8da;
  color: #283593;
  font-weight: 700;
  font-size: 12px;
  border-radius: 4px;
  padding: 1px 5px;
  min-width: 20px;
  text-align: center;
}
.past-table .past-horse-no-cell {
  width: 34px;
  min-width: 34px;
  padding-left: 3px;
  padding-right: 3px;
}
.past-table .past-finish-cell {
  width: 38px;
  min-width: 38px;
  padding-left: 3px;
  padding-right: 3px;
}
.past-table .past-training-index-cell {
  width: 38px;
  min-width: 38px;
  padding-left: 2px;
  padding-right: 2px;
}
.past-table .training-index-rank-only { margin: 0 auto; }
.training-index-rank-only {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  min-width: 26px;
  min-height: 21px;
  box-sizing: border-box;
  padding: 1px 2px;
  border-left-width: 3px;
  border-radius: 4px;
  line-height: 1;
}
.training-index-rank-only .training-index-main {
  width: 100%;
  justify-content: center;
}
.training-index-rank-only .training-index-main em {
  min-width: 16px;
  padding: 0 2px;
  font-size: 10px;
  line-height: 16px;
}
.past-training-empty {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  min-width: 26px;
  min-height: 21px;
  box-sizing: border-box;
  border: 1px solid #dbe3ee;
  border-left: 3px solid #94a3b8;
  border-radius: 4px;
  background: #f8fafc;
  color: #94a3b8;
  font-size: 10px;
  font-weight: 900;
}
.past-memo-tag {
  display: inline-block;
  background: #fef3c7;
  border: 1px solid #fbbf24;
  color: #92400e;
  border-radius: 4px;
  padding: 2px 6px;
  font-size: 11px;
  white-space: pre-wrap;
  word-break: break-all;
}
.past-memo-inline {
  font-size: 11px;
  color: #92400e;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: block;
  max-width: 160px;
}
.past-memo-cell { max-width: 160px; }
.no-memo { color: #cbd5e1; }

/* 競馬ブック情報 */
.kb-info-box {
  padding: 7px 14px;
  background: #eff6ff;
  border-bottom: 1px solid #bfdbfe;
  font-size: 12px;
  line-height: 1.5;
}
.kb-training, .kb-danwa { margin: 4px 0; color: #1e3a5f; }
.kb-label { color: #1d4ed8; font-weight: 700; font-size: 11px; margin-right: 4px; }
.training-rank-note {
  color: #64748b;
  font-size: 10px;
  font-weight: 600;
}
.training-content { font-size: 12px; line-height: 1.8; color: #1e3a5f; }
.training-line {
  word-break: keep-all;
  overflow-wrap: anywhere;
}
.training-latest {
  font-weight: 700;
}
.training-time {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  white-space: nowrap;
  vertical-align: baseline;
}
.training-ranked {
  color: #0f172a;
}
.training-rank-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 26px;
  height: 16px;
  padding: 0 4px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 800;
  line-height: 1;
  border: 1px solid transparent;
}
.training-rank-badge.rank-1 {
  background: #fee2e2;
  border-color: #fca5a5;
  color: #b91c1c;
}
.training-rank-badge.rank-2 {
  background: #ffedd5;
  border-color: #fdba74;
  color: #c2410c;
}
.training-rank-badge.rank-3 {
  background: #dbeafe;
  border-color: #93c5fd;
  color: #1d4ed8;
}
.training-rank-badge.rank-other {
  background: #f1f5f9;
  border-color: #cbd5e1;
  color: #475569;
}

/* 馬個体メモ */
.master-note-box {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 7px 14px;
  background: #f0fdf4;
  border-bottom: 1px solid #bbf7d0;
  font-size: 13px;
}
.master-note-label {
  color: #166534;
  font-weight: 600;
  white-space: nowrap;
}
.master-note-display {
  cursor: pointer;
  color: #15803d;
  flex: 1;
  white-space: pre-wrap;
  word-break: break-all;
}
.master-note-display:hover { text-decoration: underline; }

/* バイアスセル */
.past-bias-tag {
  display: inline-block;
  background: #fef9c3;
  border: 1px solid #fde047;
  color: #713f12;
  border-radius: 4px;
  padding: 2px 5px;
  font-size: 11px;
  white-space: nowrap;
  overflow: hidden;
  max-width: 90px;
}
.past-table .past-bias-cell {
  width: 132px;
  min-width: 132px;
  max-width: 132px;
  white-space: normal;
}
.past-table .past-bias-tag.past-bias-full {
  max-width: 100%;
  white-space: normal;
  overflow: visible;
  overflow-wrap: anywhere;
  line-height: 1.35;
}
.past-clock-tag {
  display: inline-block;
  background: #e0f2fe;
  border: 1px solid #7dd3fc;
  color: #0c4a6e;
  border-radius: 4px;
  padding: 2px 5px;
  font-size: 11px;
  white-space: nowrap;
  overflow: hidden;
  max-width: 90px;
}
.past-clock-cell { max-width: 100px; }
.daily-clock-cell { min-width: 60px; max-width: 72px; }
.daily-adjusted-diff {
  min-width: 58px;
  font-weight: 800;
}
.past-table td.daily-adjusted-diff-positive-light { background-color: #dff3ff !important; color: #075985 !important; }
.past-table td.daily-adjusted-diff-positive-mid { background-color: #93c5fd !important; color: #1e3a8a !important; }
.past-table td.daily-adjusted-diff-positive-strong { background-color: #2563eb !important; color: #ffffff !important; }
.past-table td.daily-adjusted-diff-negative-light { background-color: #fee2e2 !important; color: #b91c1c !important; }
.past-table td.daily-adjusted-diff-negative-mid { background-color: #fca5a5 !important; color: #991b1b !important; }
.past-table td.daily-adjusted-diff-negative-strong { background-color: #dc2626 !important; color: #ffffff !important; }
.daily-clock-tag {
  display: inline-block;
  border: 1px solid transparent;
  border-radius: 4px;
  padding: 2px 5px;
  font-size: 11px;
  font-weight: 800;
  line-height: 1.25;
  white-space: nowrap;
}
.daily-clock-neutral { background: #ffffff; color: #334155; border-color: #cbd5e1; }
.daily-clock-slow-light { background: #dff3ff; color: #075985; border-color: #7dd3fc; }
.daily-clock-slow-strong { background: #2563eb; color: #ffffff; border-color: #1d4ed8; }
.daily-clock-fast-light { background: #fef3a8; color: #713f12; border-color: #fde047; }
.daily-clock-fast-mid { background: #fb923c; color: #7c2d12; border-color: #ea580c; }
.daily-clock-fast-strong { background: #ef4444; color: #ffffff; border-color: #dc2626; }
.daily-clock-cell.daily-clock-neutral,
.daily-clock-cell.daily-clock-slow-light,
.daily-clock-cell.daily-clock-slow-strong,
.daily-clock-cell.daily-clock-fast-light,
.daily-clock-cell.daily-clock-fast-mid,
.daily-clock-cell.daily-clock-fast-strong { background-clip: padding-box; }
.daily-clock-cell.daily-clock-slow-light { background-color: #f0faff; }
.daily-clock-cell.daily-clock-slow-strong { background-color: #dbeafe; }
.daily-clock-cell.daily-clock-fast-light { background-color: #fefce8; }
.daily-clock-cell.daily-clock-fast-mid { background-color: #ffedd5; }
.daily-clock-cell.daily-clock-fast-strong { background-color: #fee2e2; }
.past-table tr.has-memo td.daily-clock-cell.daily-clock-slow-light,
.past-table tr:hover td.daily-clock-cell.daily-clock-slow-light { background-color: #f0faff; }
.past-table tr.has-memo td.daily-clock-cell.daily-clock-slow-strong,
.past-table tr:hover td.daily-clock-cell.daily-clock-slow-strong { background-color: #dbeafe; }
.past-table tr.has-memo td.daily-clock-cell.daily-clock-fast-light,
.past-table tr:hover td.daily-clock-cell.daily-clock-fast-light { background-color: #fefce8; }
.past-table tr.has-memo td.daily-clock-cell.daily-clock-fast-mid,
.past-table tr:hover td.daily-clock-cell.daily-clock-fast-mid { background-color: #ffedd5; }
.past-table tr.has-memo td.daily-clock-cell.daily-clock-fast-strong,
.past-table tr:hover td.daily-clock-cell.daily-clock-fast-strong { background-color: #fee2e2; }

/* 過去走人気バッジ */
/* 着順バッジ */
.finish-rank {
  display: inline-block;
  min-width: 28px;
  text-align: center;
  font-weight: 700;
  font-size: 12px;
  padding: 1px 4px;
  border-radius: 4px;
  background: #f1f5f9;
  color: #334155;
}
.finish-rank.rank-1 { background: #fbbf24; color: #78350f; }
.finish-rank.rank-2 { background: #cbd5e1; color: #1e293b; }
.finish-rank.rank-3 { background: #d97706; color: #fff; }

.past-ninkia {
  display: inline-block;
  min-width: 18px;
  text-align: center;
  font-weight: 700;
  font-size: 12px;
  color: #1e3a5f;
}

/* 次走相手バッジ */
.rivals-badge {
  display: inline-block;
  background: #dbeafe;
  color: #1e40af;
  border-radius: 99px;
  padding: 1px 8px;
  font-size: 11px;
  font-weight: bold;
}

/* ===== 印・オッズ ===== */
.np-mark-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 14px;
  background: #f8faff;
  border-bottom: 1px solid #e2e8f0;
}
.mark-buttons { display: flex; gap: 6px; }
.mark-btn {
  border: 1.5px solid #cbd5e1;
  background: #fff;
  border-radius: 50%;
  width: 32px; height: 32px;
  font-size: 13px; font-weight: bold;
  cursor: pointer; line-height: 1;
  transition: all .15s;
}
.mark-btn:hover { opacity: .75; }
.mark-btn.mark-clear { border-radius: 6px; width: auto; padding: 0 8px; font-size: 11px; color: #94a3b8; }
.mark-active-honmei { background: #7f1d1d !important; color: #fff !important; border-color: #991b1b !important; }
.mark-active-◎ { background: #dc2626 !important; color: #fff !important; border-color: #dc2626 !important; }
.mark-active-○ { background: #2563eb !important; color: #fff !important; border-color: #2563eb !important; }
.mark-active-▲ { background: #16a34a !important; color: #fff !important; border-color: #16a34a !important; }
.mark-active-△ { background: #ca8a04 !important; color: #fff !important; border-color: #ca8a04 !important; }
.mark-active-star { background: #facc15 !important; color: #713f12 !important; border-color: #eab308 !important; }
.mark-active-消 { background: #64748b !important; color: #fff !important; border-color: #64748b !important; }

/* 馬ブロックの背景色（印別） */
.np-horse-block.mark-honmei { border-left-color: #7f1d1d; background: linear-gradient(to right, #fee2e2 0%, transparent 60px); }
.np-horse-block.mark-◎ { border-left-color: #dc2626; background: linear-gradient(to right, #fee2e2 0%, transparent 60px); }
.np-horse-block.mark-○ { border-left-color: #2563eb; background: linear-gradient(to right, #dbeafe 0%, transparent 60px); }
.np-horse-block.mark-▲ { border-left-color: #16a34a; background: linear-gradient(to right, #dcfce7 0%, transparent 60px); }
.np-horse-block.mark-△ { border-left-color: #ca8a04; background: linear-gradient(to right, #fef9c3 0%, transparent 60px); }
.np-horse-block.mark-star { border-left-color: #eab308; background: linear-gradient(to right, #fef3c7 0%, transparent 60px); }
.np-horse-block.mark-消 { opacity: .6; }

/* AI推奨軸は印の背景と競合させず、外枠とカード上部で明確に識別する。 */
.np-horse-block.ai-axis-runner { position: relative; }
.np-horse-block.ai-axis-runner.ai-axis-a { box-shadow: 0 0 0 2px #34d399, 0 2px 7px rgba(5, 150, 105, .16); }
.np-horse-block.ai-axis-runner.ai-axis-b { box-shadow: 0 0 0 2px #fb923c, 0 2px 7px rgba(234, 88, 12, .16); }
.np-horse-block.ai-axis-runner.ai-axis-a .np-horse-header { border-top: 3px solid #10b981; }
.np-horse-block.ai-axis-runner.ai-axis-b .np-horse-header { border-top: 3px solid #f97316; }
.list-table tr.ai-axis-runner.ai-axis-a td { background: #f0fdf4; }
.list-table tr.ai-axis-runner.ai-axis-b td { background: #fff7ed; }

/* オッズ・人気 */
.odds-display { font-size: 13px; color: #1e3a5f; }
.btn-odds { background: #7c3aed; color: #fff; }
.btn-bet  { background: #059669; color: #fff; }
.btn-nav  { background: #0369a1; color: #fff; }
.btn-nav:hover { background: #0284c7; }
.btn-nav-disabled { background: #cbd5e1; color: #94a3b8; cursor: default; pointer-events: none; }
.btn-spat4 { background: #d97706; color: #fff; }

/* ===== 馬券ページ ===== */
.bet-type-tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 14px; }
.bet-tab { padding: 7px 14px; border-radius: 6px; border: 2px solid #cbd5e1; background: #fff; cursor: pointer; font-size: 13px; font-weight: bold; color: #475569; }
.bet-tab.active { background: #1e3a5f; color: #fff; border-color: #1e3a5f; }
.bet-tab:hover:not(.active) { background: #f1f5f9; }

.bet-main { display: flex; gap: 14px; align-items: flex-start; }

/* 馬リスト */
.bet-horse-list { width: 240px; flex-shrink: 0; background: #fff; border-radius: 8px; box-shadow: 0 1px 3px rgba(0,0,0,.1); overflow: hidden; }
.bet-horse-row { display: flex; align-items: center; gap: 6px; padding: 8px 10px; border-bottom: 1px solid #f1f5f9; cursor: pointer; transition: background .1s; }
.bet-horse-row:hover { background: #f8fafc; }
.bet-horse-row.selected-1 { background: #dbeafe; border-left: 4px solid #2563eb; }
.bet-horse-row.selected-2 { background: #dcfce7; border-left: 4px solid #16a34a; }
.bet-horse-row.selected-3 { background: #fef9c3; border-left: 4px solid #ca8a04; }
.bet-horse-no { font-weight: bold; min-width: 22px; color: #1e3a5f; font-size: 14px; }
.bet-horse-name { flex: 1; font-size: 12px; }
.air-axis-toggle {
  flex: 0 0 auto;
  min-width: 25px;
  height: 22px;
  padding: 0 5px;
  border: 1px solid #94a3b8;
  border-radius: 4px;
  background: #fff;
  color: #475569;
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
}
.air-axis-toggle:hover { border-color: #7c3aed; color: #6d28d9; }
.air-axis-toggle.is-axis {
  border-color: #7c3aed;
  background: #7c3aed;
  color: #fff;
}
.bet-horse-style { font-size: 10px; }
.bet-horse-odds { font-size: 11px; color: #64748b; white-space: nowrap; }
.bet-select-indicator { font-size: 10px; font-weight: bold; color: #2563eb; min-width: 28px; text-align: right; }

/* オッズパネル */
.bet-odds-panel { flex: 1; background: #fff; border-radius: 8px; box-shadow: 0 1px 3px rgba(0,0,0,.1); padding: 12px; min-height: 200px; }
.bet-odds-header { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; font-weight: bold; font-size: 14px; }
.btn-reload { background: #e2e8f0; color: #334155; }
.odds-hint { color: #94a3b8; font-size: 13px; padding: 20px 0; text-align: center; }
.odds-loading { color: #64748b; font-size: 13px; padding: 10px 0; text-align: center; }
.odds-jiku-label { font-size: 13px; margin-bottom: 8px; color: #1e3a5f; }
.odds-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.odds-table th { background: #f1f5f9; padding: 6px 8px; text-align: left; color: #475569; font-size: 12px; }
.odds-table td { padding: 5px 8px; border-bottom: 1px solid #f1f5f9; }
.odds-table tr:hover td { background: #f8fafc; }
.odds-row-selected td { background: #dbeafe !important; font-weight: bold; }
.odds-val { color: #dc2626; font-weight: bold; font-size: 14px; }
.btn-add-slip { background: #1e3a5f; color: #fff; }
.btn-detail-horse { background: #0f766e; color: #fff !important; text-decoration: none; display: inline-block; }

/* 買い目スリップ */
.bet-slip { margin-top: 20px; background: #fff; border-radius: 8px; box-shadow: 0 1px 3px rgba(0,0,0,.1); padding: 14px; }
.bet-slip-header { display: flex; align-items: center; gap: 10px; font-weight: bold; font-size: 14px; margin-bottom: 12px; }
.air-axis-count {
  margin-left: auto;
  padding: 2px 7px;
  border: 1px solid #c4b5fd;
  border-radius: 4px;
  background: #f5f3ff;
  color: #5b21b6;
  font-size: 11px;
  white-space: nowrap;
}
.air-axis-section {
  border-top: 3px solid #7c3aed;
  padding-top: 14px;
}
.air-axis-kpi-row { margin-bottom: 14px; }

.air-axis-scope-note {
    display: flex;
    align-items: baseline;
    gap: 10px;
    margin: 0 0 14px;
    padding: 9px 12px;
    border: 1px solid #c4b5fd;
    border-radius: 6px;
    background: #faf7ff;
    color: #5b21b6;
    font-size: 13px;
}

.air-axis-scope-note strong { font-size: 15px; }

@media (max-width: 560px) {
    .air-axis-scope-note { align-items: flex-start; flex-direction: column; gap: 2px; }
}
.air-axis-table-wrap { overflow-x: auto; }
.air-axis-detail-list {
  border: 1px solid #ddd6fe;
  border-radius: 8px;
  background: #fafaff;
}
.air-axis-detail-list summary {
  padding: 11px 13px;
  cursor: pointer;
  color: #5b21b6;
  font-weight: 800;
}
.air-axis-detail-list[open] summary { border-bottom: 1px solid #ddd6fe; }
.air-axis-detail-list .air-axis-table-wrap { padding: 10px; }
/* 券種グループ */
.slip-group { margin-bottom: 12px; border: 1px solid #e2e8f0; border-radius: 8px; overflow: hidden; }
.slip-group-header { display: flex; align-items: center; gap: 10px; padding: 7px 10px;
  background: #1e3a5f; flex-wrap: wrap; }
.slip-group-type { color: #fff; font-size: 13px; font-weight: 800; white-space: nowrap; }
.slip-group-total { color: #93c5fd; font-size: 12px; white-space: nowrap; }
.slip-synth { margin-left: auto; font-size: 12px; color: #fde68a; white-space: nowrap; }
.slip-synth strong { font-size: 15px; color: #fbbf24; }
/* 買い目行 */
.slip-item { display: flex; align-items: center; gap: 8px; padding: 7px 10px;
  border-bottom: 1px solid #f1f5f9; flex-wrap: wrap; background: #fff; }
.slip-item:last-child { border-bottom: none; }
.slip-combo { flex: 1; font-size: 13px; min-width: 80px; font-weight: 600; }
.slip-odds-sm { font-size: 12px; color: #dc2626; font-weight: bold; white-space: nowrap; }
.slip-odds { font-size: 12px; color: #dc2626; font-weight: bold; white-space: nowrap; }
.slip-amount { width: 72px; border: 1px solid #cbd5e1; border-radius: 4px; padding: 3px 6px; font-size: 13px; text-align: right; }
.btn-remove { background: #fee2e2; color: #dc2626; }
.slip-total { text-align: right; font-weight: bold; margin-top: 8px; color: #1e3a5f; font-size: 14px; }
.popularity-badge { display: inline-block; background: #dc2626; color: #fff; font-size: 11px; font-weight: bold; padding: 1px 6px; border-radius: 4px; margin-right: 4px; }

/* ===== スマホ対応 ===== */
@media (max-width: 600px) {
  /* ページ全体の横スクロール禁止 */
  body { max-width: 100vw; }
  .container { overflow-x: hidden; }
  * { min-width: 0; }

  /* ナビ */
  .navbar { padding: 0 8px; height: auto; flex-wrap: wrap; gap: 4px; padding: 6px 8px; }
  .nav-links { display: flex; flex-wrap: wrap; gap: 4px; }
  .nav-links a { margin-left: 0; font-size: 11px; padding: 2px 4px; }

  /* コンテナ */
  .container { padding: 6px; max-width: 100vw; }

  /* ページヘッダー */
  .page-header { flex-direction: column; align-items: flex-start; gap: 6px; }
  .page-header h1 { font-size: 14px; }
  .header-actions { display: flex; flex-wrap: wrap; gap: 5px; }
  .header-actions .btn { font-size: 11px; padding: 5px 8px; }

  /* レース情報バー */
  .race-info-bar { gap: 4px; }
  .badge { font-size: 10px; padding: 2px 6px; }

  /* 一覧表示: 横スクロールせず右端のコメントまで確認できる簡易レイアウト */
  #table-view { overflow-x: hidden; }
  .list-table {
    width: 100%;
    min-width: 0;
    table-layout: fixed;
    font-size: 10px;
  }
  .list-table th,
  .list-table td { padding: 3px 1px; overflow: hidden; }
  .list-table th { font-size: 9px; line-height: 1.15; white-space: normal; }
  .lt-no { width: 20px; }
  .lt-mark { width: 25px; }
  .lt-name { width: 54px; }
  .lt-cnk { width: 70px; }
  .lt-agari { width: 65px; }
  .lt-ability { width: 67px; }
  .lt-odds { width: 48px; }
  .lt-comment { width: 28px; min-width: 0; }
  .lt-fuku { display: none; }
  .lt-mobile-fuku {
    display: block;
    margin-top: 2px;
    color: #64748b;
    font-size: 8px;
    font-weight: 700;
    line-height: 1.15;
    white-space: nowrap;
  }
  .lt-cnk .lt-cnk-val { font-size: 14px; }
  .lt-cnk .ninkia-diff-wrap { font-size: 10px; }
  .lt-c-popularity-stats { margin-top: 1px; font-size: 8px; }
  .lt-c-win-rate { padding: 1px 2px; }
  .lt-mark-cycle-cell { padding: 3px 1px !important; }
  .lt-mark-cycle-btn { width: 23px; height: 23px; line-height: 19px; font-size: 10px; }
  .lt-mark-cycle-cell .value-check-btn { display: block; margin: 2px auto 0; }
  .lt-horse-name { font-size: 10px; line-height: 1.25; overflow-wrap: anywhere; }
  .lt-detail-btn { display: none; }
  .horse-sex-age { display: block; margin-left: 0; font-size: 8px; }
  .lt-horse-sub { max-height: 2.4em; overflow: hidden; font-size: 8px; line-height: 1.2; }
  .lt-agari .agari-pos-wrap { display: block; }
  .lt-agari .agari-box { width: 100%; min-width: 0; padding: 2px; }
  .lt-agari .agari-main {
    display: grid;
    grid-template-areas: "label label" "score rank";
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 0 1px;
    justify-items: center;
    white-space: normal;
  }
  .lt-agari .agari-label { grid-area: label; font-size: 7px; }
  .lt-agari .agari-main strong { grid-area: score; }
  .lt-agari .agari-rank { grid-area: rank; align-self: center; font-size: 7px; }
  .lt-agari .agari-rank { padding: 0 2px; }
  .lt-agari .agari-main strong { font-size: 10px; }
  .lt-agari .agari-subline { display: grid; gap: 1px; font-size: 7px; line-height: 1.1; }
  .lt-agari .pace-pos-box { width: 100%; min-width: 0; margin-top: 2px; padding: 1px; }
  .lt-agari .pace-pos-lines { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1px; }
  .lt-agari .pace-pos-line { gap: 1px; font-size: 7px; overflow: hidden; }
  .lt-agari .pace-pos-line strong { font-size: 8px; }
  .lt-agari .pace-pos-label { min-width: 11px; padding: 0 1px; font-size: 7px; }
  .lt-agari .pace-pos-est { font-size: 7px; }
  .lt-ability .ability-compact { width: 100%; min-width: 0; padding: 2px; }
  .lt-ability .ability-main { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0; white-space: normal; }
  .lt-ability .ability-label,
  .lt-ability .ability-rank { font-size: 7px; }
  .lt-ability .ability-rank { padding: 0 2px; }
  .lt-ability .ability-main strong { font-size: 11px; }
  .lt-ability .ability-subline { display: grid; gap: 1px; font-size: 7px; line-height: 1.1; }
  .lt-ability .ability-going-split { display: grid; grid-template-columns: minmax(0, 1fr); gap: 1px; }
  .lt-ability .ability-going {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto auto;
    align-items: center;
    min-width: 0;
    padding: 1px;
    gap: 1px;
    font-size: 7px;
    line-height: 1.05;
    white-space: nowrap;
  }
  .lt-ability .ability-going strong { font-size: 9px; }
  .lt-ability .ability-going-rank { min-width: 10px; padding: 0 1px; font-size: 7px; line-height: 10px; }
  .lt-ability .ability-going small { font-size: 6px; }
  .lt-comment-cell { max-width: none; font-size: 9px; line-height: 1.2; }
  .lt-comment-toggle { width: 22px; height: 22px; font-size: 11px; }
  .lt-comment-detail { gap: 5px; padding: 6px 8px; font-size: 10px; line-height: 1.35; }
  .lt-memo-text {
    display: -webkit-box;
    max-width: none;
    overflow: hidden;
    white-space: normal;
    text-overflow: clip;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
  }

  /* バイアス */
  .bias-box { font-size: 11px; padding: 7px 10px; }
  .hot-zone-race-head { align-items: flex-start; flex-direction: column; }
  .hot-zone-race-title { font-size: 13px; }
  .hot-zone-race-sub, .hot-zone-race-foot { font-size: 10px; }
  .hot-zone-table-wrap { padding: 6px; }
  .hot-zone-race-table { font-size: 10px; min-width: 760px; }
  .hot-zone-race-table th, .hot-zone-race-table td { padding: 4px; }
  .hot-zone-slip-head { align-items: flex-start; flex-direction: column; }
  .hot-zone-slip-amount-wrap input { width: 96px; }
  .hot-zone-slip-main strong { font-size: 24px; }

  /* 馬ブロック */
  .np-horse-block { border-radius: 5px; border-left-width: 4px; }

  /* 印・オッズ行 */
  .np-mark-row { flex-wrap: wrap; gap: 4px; padding: 5px 8px; }
  .mark-buttons { gap: 4px; }
  .mark-btn { width: 26px; height: 26px; font-size: 11px; }
  .odds-display { font-size: 11px; }
  .popularity-badge { font-size: 10px; padding: 1px 4px; }

  /* 馬個体メモ */
  .master-note-box { padding: 5px 8px; font-size: 11px; }
  .master-note-label { font-size: 10px; }

  /* 馬ヘッダー：2行構成に */
  .np-horse-header {
    display: grid;
    grid-template-columns: 28px 1fr auto;
    grid-template-rows: auto auto;
    gap: 4px 8px;
    padding: 7px 8px;
    align-items: start;
  }
  .np-umaban { font-size: 18px; min-width: unset; grid-row: 1 / 3; align-self: center; }
  .np-name-block { min-width: unset; grid-column: 2; grid-row: 1; }
  .np-name { font-size: 13px; }
  .np-sub { gap: 4px; }
  .np-jockey { font-size: 11px; }
  .np-trainer-row { gap: 2px; font-size: 9px; }
  .trainer-label { font-size: 8px; }
  .trainer-link,
  .trainer-name-unavailable { min-height: 16px; padding: 0 4px; font-size: 9px; line-height: 14px; }
  .np-name-block .jockey-corner-stats,
  .np-name-block .jockey-corner-stats b,
  .np-name-block .jockey-corner-stats span {
    font-size: 8px !important;
    line-height: 1.2;
  }
  .np-name-block .jockey-corner-stats {
    gap: 0 3px;
    padding: 1px 2px;
  }
  .np-name-block .jockey-course-rating { min-height:18px; margin-left:3px; }
  .np-name-block .jockey-course-rating-label { padding:0 3px; font-size:7px; }
  .np-name-block .jockey-course-rating strong { min-width:22px; font-size:9px; }
  .np-name-block .jockey-course-rating em { min-width:14px; padding:0 2px; font-size:8px; }
  .np-name-block .jockey-course-relative { min-width:28px; padding:0 2px; font-size:7px; }
  .jk-index-components { grid-template-columns:repeat(2, minmax(0, 1fr)); }
  .jk-index-score strong { font-size:1.45rem; }
  .jockey-ability-bt { max-width: calc(100vw - 78px); gap: 2px; }
  .jockey-ability-summary { gap: 1px 4px; padding: 2px 4px; font-size: 9px; }
  .style-badge { font-size: 10px; padding: 1px 5px; }
  .np-result-block { grid-column: 2 / 4; grid-row: 2; width: 100%; }
  .np-result-row { display: grid; grid-template-columns: auto auto auto auto auto auto auto auto; gap: 2px 4px; font-size: 10px; }
  .np-label { font-size: 9px; }
  .np-val { font-size: 11px; min-width: unset; }
  .np-actions { grid-column: 3; grid-row: 1; }
  .btn-xs { font-size: 10px; padding: 2px 6px; }
  .training-index-row { padding: 5px 8px 0; }
  .matchup-index-row { padding: 4px 8px 0; }
  .matchup-index-box { gap: 2px 4px; padding: 3px 5px; }
  .matchup-index-metric strong { font-size: 13px; }
  .matchup-index-summary { font-size: 8px; }
  .training-index-box { gap: 2px 6px; padding: 4px 5px; }
  .training-index-main strong { font-size: 15px; }
  .training-index-summary { gap: 2px 5px; font-size: 9px; }
  .training-index-source { display: none; }
  .training-index-details > div { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .training-index-details span { overflow: hidden; text-overflow: ellipsis; }

  /* 日付の西暦を非表示 */
  .date-year { display: none; }

  /* 過去5走：テーブルのみ横スクロール */
  .np-past {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    width: 100%;
    max-width: calc(100vw - 16px);
  }
  .past-table { font-size: 9px; }
  .past-table th, .past-table td { padding: 2px 3px; white-space: nowrap; }
  .past-table .past-date-cell { min-width: 36px; padding-left: 2px; padding-right: 2px; text-align: center; }
  .past-table .past-track-cell { min-width: 28px; padding-left: 2px; padding-right: 2px; text-align: center; }
  .past-table .past-distance-cell { min-width: 28px; padding-left: 2px; padding-right: 2px; }
  .past-table .past-going-cell { min-width: 18px; padding-left: 2px; padding-right: 2px; }
  .past-table .past-adjusted-diff-cell { min-width: 47px; padding-left: 2px; padding-right: 2px; }
  .past-table .past-corner-cell { min-width: 42px; padding-left: 2px; padding-right: 2px; }
  .past-table .past-horse-no-cell { width: 26px; min-width: 26px; padding-left: 1px; padding-right: 1px; }
  .past-table .past-finish-cell { width: 30px; min-width: 30px; padding-left: 1px; padding-right: 1px; }
  .past-table .past-training-index-cell { width: 34px; min-width: 34px; padding-left: 1px; padding-right: 1px; }
  .training-index-rank-only,
  .past-training-empty { width: 20px; min-width: 20px; min-height: 17px; }
  .training-index-rank-only .training-index-main em { min-width: 13px; font-size: 8px; line-height: 13px; }
  .past-table .past-bias-cell {
    width: 88px;
    min-width: 88px;
    max-width: 88px;
    padding-left: 2px;
    padding-right: 2px;
    white-space: normal;
  }
  .past-table .past-bias-tag { max-width: 54px; padding: 1px 2px; font-size: 9px; }
  .past-table .past-bias-tag.past-bias-full {
    display: block;
    max-width: 100%;
    white-space: normal;
    overflow: visible;
    overflow-wrap: anywhere;
    line-height: 1.35;
  }
  .past-table .daily-clock-cell { min-width: 46px; max-width: 48px; padding-left: 1px; padding-right: 1px; }
  .past-table .daily-clock-tag { padding: 1px 2px; font-size: 9px; }
  .past-table .past-horseno { min-width: 18px; padding: 1px 3px; font-size: 10px; }
  .past-table .finish-rank { min-width: 24px; padding: 1px 2px; font-size: 10px; }

  /* レースコメント */
  .np-memo-row { padding: 6px 8px; font-size: 11px; }
  .np-memo-label { font-size: 10px; }

  /* フォーム系 */
  .race-table th, .race-table td { padding: 5px 5px; font-size: 11px; }
  .form-row { flex-direction: column; }
  .past-form-row { flex-direction: column; }
  .modal-box { padding: 14px; width: 95%; }

  /* 馬券ページ */
  .bet-main { flex-direction: column; }
  .bet-horse-list { width: 100%; }
}

/* ── 展開予想パネル ─────────────────────────────────────────── */
.pace-panel {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  margin-bottom: 12px;
  overflow: hidden;
}
.pace-panel-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
  flex-wrap: wrap;
}
.pace-panel-header .pace-desc {
  flex-basis: 100%;   /* 説明文は必ず2行目 */
  order: 10;
  margin-top: -4px;
}
.pace-title { font-weight: 700; font-size: 14px; color: #1e293b; }
.pace-verdict {
  font-weight: 800;
  font-size: 15px;
  padding: 2px 10px;
  border-radius: 20px;
}
.pace-high  { background: #fee2e2; color: #dc2626; }
.pace-mid   { background: #fef3c7; color: #d97706; }
.pace-slow  { background: #dcfce7; color: #16a34a; }
.pace-desc  { font-size: 12px; color: #64748b; flex: 1; }
.pace-toggle-btn {
  margin-left: auto;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 14px;
  color: #94a3b8;
  padding: 2px 6px;
}

/* 分布バー */
.pace-bar-wrap {
  display: flex;
  height: 28px;
  margin: 12px 14px 8px;
  border-radius: 6px;
  overflow: hidden;
  border: 1px solid #e2e8f0;
}
.pace-bar-seg {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  color: #fff;
  min-width: 28px;
  transition: width 0.3s;
}
.pace-seg-nige    { background: #ef4444; }
.pace-seg-senkou  { background: #f97316; }
.pace-seg-sashi   { background: #3b82f6; }
.pace-seg-oikomi  { background: #8b5cf6; }

/* 脚質グリッド */
.pace-horse-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  padding: 0 14px 10px;
}
.pace-group { }
.pace-group-label {
  font-size: 11px;
  font-weight: 700;
  color: #fff;
  padding: 2px 8px;
  border-radius: 4px 4px 0 0;
}
.pace-group-nige   .pace-group-label { background: #ef4444; }
.pace-group-senkou .pace-group-label { background: #f97316; }
.pace-group-sashi  .pace-group-label { background: #3b82f6; }
.pace-group-oikomi .pace-group-label { background: #8b5cf6; }
.pace-group-count { font-weight: 400; font-size: 10px; }
.pace-group-horses {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-top: none;
  border-radius: 0 0 4px 4px;
  padding: 6px;
  min-height: 40px;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  align-content: flex-start;
}
.pace-chip {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 11px;
  padding: 2px 6px;
  border-radius: 12px;
  font-weight: 600;
  white-space: nowrap;
}
.pace-chip-top  { background: #fef3c7; color: #92400e; border: 1px solid #fcd34d; }
.pace-chip-mid  { background: #dbeafe; color: #1e40af; border: 1px solid #93c5fd; }
.pace-chip-low  { background: #f1f5f9; color: #475569; border: 1px solid #cbd5e1; }
.pace-chip-pop  { font-size: 10px; font-weight: 800; }
.pace-empty     { color: #94a3b8; font-size: 12px; }

/* サマリー */
.pace-summary {
  font-size: 12px;
  color: #475569;
  padding: 6px 14px 12px;
  border-top: 1px solid #f1f5f9;
}
.pace-summary strong { color: #1e293b; }

/* ── レースラップ予想 ───────────────────────────────────────── */
.lap-predict-panel {
  background: #fff;
  border: 1px solid #dbeafe;
  border-left: 4px solid #2563eb;
  border-radius: 8px;
  margin: -4px 0 12px;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(15, 23, 42, .05);
}
.lap-predict-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 12px;
  background: #eff6ff;
  border-bottom: 1px solid #dbeafe;
  flex-wrap: wrap;
}
.lap-predict-title {
  font-size: 13px;
  font-weight: 800;
  color: #1e293b;
}
.lap-predict-badge {
  min-width: 34px;
  text-align: center;
  font-size: 13px;
  font-weight: 900;
  line-height: 1;
  padding: 5px 8px;
  border-radius: 6px;
  color: #fff;
}
.lap-predict-ss { background: #16a34a; }
.lap-predict-s { background: #22c55e; }
.lap-predict-f { background: #64748b; }
.lap-predict-h { background: #f97316; }
.lap-predict-hh { background: #dc2626; }
.lap-predict-label {
  font-size: 13px;
  font-weight: 700;
  color: #334155;
}
.lap-predict-confidence {
  margin-left: auto;
  font-size: 11px;
  font-weight: 700;
  color: #475569;
  background: #fff;
  border: 1px solid #bfdbfe;
  border-radius: 999px;
  padding: 2px 8px;
}
.lap-predict-body { padding: 10px 12px; }
.lap-predict-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 7px;
}
.lap-predict-metric {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  padding: 6px 8px;
}
.lap-predict-metric span {
  display: block;
  font-size: 10px;
  color: #64748b;
  font-weight: 700;
}
.lap-predict-metric strong {
  display: block;
  margin-top: 2px;
  font-size: 15px;
  color: #0f172a;
}
.lap-predict-note {
  margin-top: 8px;
  font-size: 12px;
  line-height: 1.5;
  color: #334155;
}
.lap-predict-base {
  display: block;
  margin-top: 2px;
  color: #64748b;
  font-size: 11px;
}
.lap-predict-contrib-title {
  margin-top: 8px;
  font-size: 11px;
  font-weight: 800;
  color: #334155;
}
.lap-predict-contribs {
  margin-top: 5px;
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}
.lap-predict-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  max-width: 100%;
  font-size: 11px;
  font-weight: 700;
  color: #334155;
  background: #f8fafc;
  border: 1px solid #cbd5e1;
  border-radius: 999px;
  padding: 2px 7px;
}
.lap-predict-chip b {
  background: #334155;
  color: #fff;
  border-radius: 4px;
  padding: 0 4px;
  font-size: 10px;
}
.lap-predict-chip em {
  background: #7c3aed;
  color: #fff;
  border-radius: 4px;
  padding: 0 4px;
  font-size: 10px;
  font-style: normal;
}
.lap-predict-chip small {
  color: #64748b;
  font-size: 10px;
}
.lap-predict-chip-no-data {
  opacity: .68;
  border-style: dashed;
}

@media (max-width: 600px) {
  /* ヘッダー：1行に収める */
  .pace-panel-header {
    display: grid;
    grid-template-columns: auto 1fr auto auto;
    grid-template-rows: auto auto;
    align-items: center;
    gap: 4px 8px;
    padding: 8px 10px;
  }
  .pace-title   { grid-column: 1; grid-row: 1; font-size: 12px; }
  .pace-verdict { grid-column: 2; grid-row: 1; font-size: 12px; padding: 1px 7px; }
  .pace-toggle-btn { grid-column: 4; grid-row: 1; }
  .pace-panel-header .pace-desc {
    grid-column: 1 / -1; grid-row: 2;
    font-size: 11px; order: unset; margin-top: 0;
    flex-basis: unset;
  }

  /* 2軸エリア：縦積みシンプル化 */
  .pace-axis-wrap { padding: 8px 10px; gap: 6px; }
  .pace-axis-item {
    display: grid;
    grid-template-columns: 1fr auto;
    grid-template-rows: auto auto;
    gap: 3px 6px;
    align-items: center;
  }
  .pace-axis-label {
    grid-column: 1 / -1; grid-row: 1;
    font-size: 10px; min-width: unset;
  }
  .pace-axis-bar-outer {
    grid-column: 1; grid-row: 2;
    flex: unset; width: 100%; max-width: 100%; min-width: unset;
    height: 18px;
  }
  .pace-axis-bar-text { font-size: 9px; left: 6px; }
  .pace-axis-badge { grid-column: 2; grid-row: 2; font-size: 10px; padding: 1px 6px; white-space: nowrap; }
  .pace-axis-advantage { font-size: 12px; padding: 5px 8px; }

  /* 分布バー */
  .pace-bar-wrap { margin: 6px 10px; height: 22px; }
  .pace-bar-seg { font-size: 10px; min-width: 20px; }

  /* 馬グリッド：2列固定 */
  .pace-horse-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 5px;
    padding: 0 10px 8px;
  }
  .pace-group-label { font-size: 10px; padding: 2px 6px; }
  .pace-group-horses { padding: 4px; min-height: 28px; gap: 3px; }

  /* チップ */
  .pace-chip { font-size: 10px; padding: 2px 4px; gap: 2px; border-radius: 8px; }
  .pace-chip-umaban { font-size: 9px; padding: 0 3px; }
  .pace-chip-cnk    { font-size: 9px; padding: 0 3px; }
  .pace-chip-pos    { font-size: 8px; }

  .pace-summary { font-size: 10px; padding: 4px 10px 8px; }

  .lap-predict-panel { margin-bottom: 10px; }
  .lap-predict-header { padding: 7px 9px; gap: 5px; }
  .lap-predict-title { font-size: 11px; }
  .lap-predict-badge { min-width: 28px; font-size: 11px; padding: 4px 6px; }
  .lap-predict-label { font-size: 11px; }
  .lap-predict-confidence { font-size: 9px; padding: 1px 6px; }
  .lap-predict-body { padding: 7px 8px; }
  .lap-predict-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 5px; }
  .lap-predict-metric { padding: 4px 6px; }
  .lap-predict-metric span { font-size: 9px; }
  .lap-predict-metric strong { font-size: 12px; }
  .lap-predict-note { font-size: 10px; margin-top: 6px; }
  .lap-predict-base { font-size: 9px; }
  .lap-predict-contrib-title { font-size: 9px; margin-top: 6px; }
  .lap-predict-chip { font-size: 9px; padding: 1px 5px; gap: 3px; }
  .lap-predict-chip b, .lap-predict-chip em, .lap-predict-chip small { font-size: 8px; }
}

/* 展開予想：平均位置バッジ */
.pace-chip-pos {
  font-size: 9px;
  font-weight: 700;
  color: #64748b;
  background: rgba(255,255,255,0.7);
  border-radius: 8px;
  padding: 0 3px;
  margin-left: 2px;
}

/* 馬番ブロック内 人気バッジ */
.np-umaban-pop {
  font-size: 11px;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 10px;
  margin-top: 2px;
  text-align: center;
  background: #e2e8f0;
  color: #475569;
}
.np-umaban-pop.pop-1 { background: #fef08a; color: #854d0e; }
.np-umaban-pop.pop-2 { background: #fed7aa; color: #9a3412; }
.np-umaban-pop.pop-3 { background: #fca5a5; color: #991b1b; }
.np-umaban-pop.pop-4 { background: #bbf7d0; color: #166534; }
.np-umaban-pop.pop-5 { background: #bfdbfe; color: #1e40af; }

/* 展開予想チップ：馬番・C人気 */
.pace-chip-umaban {
  font-size: 10px;
  font-weight: 800;
  background: #334155;
  color: #fff;
  border-radius: 4px;
  padding: 0 4px;
  margin-right: 1px;
}
.pace-chip-cnk {
  font-size: 10px;
  font-weight: 700;
  background: #7c3aed;
  color: #fff;
  border-radius: 4px;
  padding: 0 4px;
  margin-right: 2px;
}

/* 展開予想：2軸バー */
.pace-axis-wrap {
  padding: 10px 14px 4px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.pace-axis-item {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.pace-axis-label {
  font-size: 11px;
  color: #64748b;
  font-weight: 600;
  min-width: 160px;
}
.pace-axis-bar-outer {
  position: relative;
  flex: 1;
  min-width: 120px;
  max-width: 300px;
  height: 20px;
  background: #e2e8f0;
  border-radius: 10px;
  overflow: hidden;
}
.pace-axis-bar-inner {
  height: 100%;
  border-radius: 10px;
  transition: width 0.4s;
}
.pace-axis-front { background: linear-gradient(90deg, #ef4444, #f97316); }
.pace-axis-cnk   { background: linear-gradient(90deg, #7c3aed, #6366f1); }
.pace-axis-bar-text {
  position: absolute;
  left: 8px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 10px;
  font-weight: 700;
  color: #fff;
  white-space: nowrap;
  text-shadow: 0 1px 2px rgba(0,0,0,0.4);
}
.pace-axis-badge {
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 10px;
  white-space: nowrap;
}
.pace-axis-advantage {
  font-size: 13px;
  color: #1e293b;
  font-weight: 600;
  padding: 6px 10px;
  background: #f8fafc;
  border-radius: 6px;
  border-left: 3px solid #7c3aed;
  width: 100%;
}

/* ── 展開予想：2軸サマリー（absolute不使用・スマホ対応）── */
.pace-stats-grid {
  padding: 10px 14px 6px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.pace-stat-row {
  display: grid;
  grid-template-columns: auto auto 1fr auto;
  align-items: center;
  gap: 6px;
}
.pace-stat-label {
  font-size: 11px;
  font-weight: 600;
  color: #64748b;
  white-space: nowrap;
}
.pace-stat-badge {
  font-size: 11px;
  font-weight: 700;
  padding: 1px 8px;
  border-radius: 10px;
  white-space: nowrap;
}
.pace-stat-bar-wrap {
  background: #e2e8f0;
  border-radius: 4px;
  height: 10px;
  overflow: hidden;
  min-width: 40px;
}
.pace-stat-bar {
  height: 100%;
  border-radius: 4px;
  transition: width 0.4s;
}
.pace-stat-val {
  font-size: 11px;
  color: #475569;
  white-space: nowrap;
}
.pace-advantage-row {
  font-size: 13px;
  font-weight: 600;
  color: #1e293b;
  padding: 6px 10px;
  background: #f8fafc;
  border-radius: 6px;
  border-left: 3px solid #7c3aed;
}

@media (max-width: 600px) {
  .pace-stats-grid { padding: 8px 10px 4px; gap: 6px; }
  .pace-stat-row {
    grid-template-columns: 1fr auto;
    grid-template-rows: auto auto;
    gap: 3px 6px;
  }
  .pace-stat-label { grid-column: 1; grid-row: 1; font-size: 10px; }
  .pace-stat-badge { grid-column: 2; grid-row: 1; font-size: 10px; padding: 1px 6px; }
  .pace-stat-bar-wrap { grid-column: 1; grid-row: 2; min-width: unset; height: 8px; }
  .pace-stat-val { grid-column: 2; grid-row: 2; font-size: 10px; }
  .pace-advantage-row { font-size: 12px; padding: 5px 8px; }

  /* 馬グリッド */
  .pace-horse-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 5px;
    padding: 0 10px 8px;
  }
}

/* rivals_top3 バッジ */
.rivals-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 10px;
  min-width: 20px;
  text-align: center;
}
.rivals-high { background: #dcfce7; color: #15803d; }
.rivals-mid  { background: #fef9c3; color: #854d0e; }
.rivals-low  { background: #f1f5f9; color: #64748b; }

/* 今回メンバーとの直接対戦 */
.direct-match-row td {
  padding: 0 6px 7px;
  background: #f8fafc;
}
.direct-match-box {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 6px 8px;
  border-left: 3px solid #94a3b8;
  background: #fff;
}
.direct-match-head {
  flex: 0 0 auto;
  font-size: 11px;
  font-weight: 800;
  color: #475569;
  line-height: 24px;
}
.direct-match-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  align-items: center;
}
.direct-match-chip {
  border: 1px solid transparent;
  border-radius: 12px;
  padding: 2px 7px;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.4;
  cursor: pointer;
  background: #f1f5f9;
}
.direct-match-win {
  color: #15803d;
  background: #dcfce7;
  border-color: #86efac;
}
.direct-match-loss {
  color: #b91c1c;
  background: #fee2e2;
  border-color: #fecaca;
}
.direct-match-even {
  color: #475569;
  background: #f1f5f9;
  border-color: #cbd5e1;
}
.direct-match-no {
  margin-right: 3px;
}
.direct-match-detail {
  flex-basis: 100%;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  padding: 7px 8px;
  background: #ffffff;
  font-size: 11px;
  color: #334155;
}
.dm-detail-name {
  font-weight: 800;
  margin-bottom: 5px;
}
.dm-detail-grid {
  display: grid;
  grid-template-columns: auto 1fr auto 1fr auto 1fr;
  gap: 3px 8px;
  align-items: center;
}
.dm-detail-grid span {
  color: #64748b;
}
.dm-detail-comment {
  margin-top: 5px;
  font-weight: 700;
  color: #1e293b;
}

@media (max-width: 600px) {
  .direct-match-row td { padding: 0 4px 6px; }
  .direct-match-box { gap: 6px; padding: 6px; }
  .direct-match-chip { font-size: 12px; padding: 2px 6px; }
  .dm-detail-grid { grid-template-columns: auto 1fr auto 1fr; }
}

/* ===== 競馬ブック 厩舎別調教分析 ===== */
.stable-source-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  overflow: hidden;
  margin-bottom: 12px;
  border: 1px solid #bfdbfe;
  border-radius: 7px;
  background: #bfdbfe;
}
.stable-source-summary > div { padding: 10px 12px; background: #eff6ff; }
.stable-source-summary strong { display: block; color: #1d4ed8; font-size: 18px; }
.stable-source-summary span { display: block; color: #475569; font-size: 11px; margin-top: 2px; }
.stable-source-summary p { grid-column: 1 / -1; padding: 8px 12px; background: #fff; color: #475569; font-size: 11px; line-height: 1.55; }
.stable-trainer-picker { display: flex; align-items: center; gap: 8px; margin: 0 0 12px; padding: 10px 12px; background: #fff; border: 1px solid #dbeafe; border-radius: 7px; }
.stable-trainer-picker label { flex: 0 0 auto; color: #334155; font-size: 12px; font-weight: 800; }
.stable-trainer-picker select { min-width: 0; flex: 1 1 auto; padding: 7px 8px; border: 1px solid #94a3b8; border-radius: 5px; background: #fff; color: #0f172a; font-size: 14px; }
.stable-overview { margin-bottom: 12px; border: 1px solid #cbd5e1; border-left: 4px solid #0f766e; background: #fff; border-radius: 7px; overflow: hidden; }
.stable-overview-head { padding: 12px 14px 10px; border-bottom: 1px solid #e2e8f0; }
.stable-overview h2, .stable-analysis-section h2, .stable-insight h2 { margin: 0; color: #0f172a; font-size: 17px; }
.stable-overview p { margin: 5px 0 0; color: #64748b; font-size: 11px; line-height: 1.45; }
.stable-metrics { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); }
.stable-metrics > div { padding: 10px 8px; border-right: 1px solid #e2e8f0; text-align: center; }
.stable-metrics > div:last-child { border-right: none; }
.stable-metrics span { display: block; color: #64748b; font-size: 11px; }
.stable-metrics strong { display: block; margin-top: 4px; color: #0f172a; font-size: 17px; white-space: nowrap; }
.stable-metrics small { display: block; margin-top: 3px; color: #64748b; font-size: 10px; line-height: 1.35; }
.stable-metric-good { color: #dc2626 !important; }
.stable-insights-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-bottom: 14px; }
.stable-insight { padding: 13px; border: 1px solid #e2e8f0; border-radius: 7px; background: #fff; }
.stable-insight-good { border-top: 3px solid #059669; }
.stable-insight-watch { border-top: 3px solid #d97706; }
.stable-insight p { margin: 6px 0 9px; color: #64748b; font-size: 11px; line-height: 1.5; }
.stable-insight ul { display: flex; flex-direction: column; gap: 6px; list-style: none; }
.stable-insight li { display: flex; flex-direction: column; gap: 2px; padding: 7px 8px; border-left: 3px solid #cbd5e1; background: #f8fafc; }
.stable-insight-good li { border-left-color: #10b981; }
.stable-insight-watch li { border-left-color: #f59e0b; }
.stable-insight li strong { color: #1e293b; font-size: 13px; }
.stable-insight li span { color: #475569; font-size: 11px; line-height: 1.4; }
.stable-insight li small { display: block; margin-top: 3px; color: #64748b; font-size: 10px; line-height: 1.4; }
.stable-insight-good b { color: #047857; }
.stable-insight-watch b { color: #b45309; }
.stable-tabs { display: flex; gap: 7px; overflow-x: auto; margin: 0 0 12px; padding-bottom: 2px; }
.stable-tabs a { flex: 0 0 auto; padding: 7px 13px; border: 1px solid #bfdbfe; border-radius: 5px; background: #eff6ff; color: #1d4ed8; font-size: 12px; font-weight: 800; }
.stable-tabs a:hover { text-decoration: none; background: #dbeafe; }
.stable-analysis-section { margin-bottom: 16px; scroll-margin-top: 60px; }
.stable-analysis-section > h2 { margin-bottom: 8px; padding-bottom: 5px; border-bottom: 2px solid #1e3a5f; }
.stable-analysis-table-wrap { margin-bottom: 9px; border: 1px solid #e2e8f0; border-radius: 7px; background: #fff; overflow: hidden; }
.stable-analysis-table-wrap h3 { padding: 9px 11px; background: #f8fafc; color: #334155; font-size: 13px; }
.stable-scroll-table { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.stable-analysis-table { min-width: 920px; white-space: nowrap; }
.stable-analysis-table td:first-child { text-align: left; }
.stable-analysis-table th small, .stable-analysis-table td small { display: block; margin-top: 2px; color: #64748b; font-size: 9px; font-weight: 500; line-height: 1.25; }
.stable-analysis-table td > strong { display: block; }
.stable-empty { padding: 10px 11px; font-size: 12px; }
.stable-lift-good { color: #15803d; }
.stable-lift-bad { color: #b91c1c; }
.stable-confidence { display: inline-flex; justify-content: center; min-width: 30px; padding: 2px 5px; border-radius: 4px; font-size: 10px; font-weight: 800; }
.stable-confidence-high { background: #dcfce7; color: #166534; }
.stable-confidence-medium { background: #fef3c7; color: #92400e; }
.stable-confidence-reference { background: #e2e8f0; color: #475569; }
@media (max-width: 620px) {
  .stable-source-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stable-source-summary > div { padding: 8px; }
  .stable-source-summary strong { font-size: 15px; }
  .stable-source-summary span { font-size: 10px; }
  .stable-trainer-picker { flex-wrap: wrap; }
  .stable-trainer-picker select { flex-basis: calc(100% - 60px); }
  .stable-metrics { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .stable-metrics > div { padding: 8px 3px; }
  .stable-metrics strong { font-size: 14px; }
  .stable-metrics span { font-size: 10px; }
  .stable-metrics small { font-size: 9px; }
  .stable-insights-grid { grid-template-columns: 1fr; gap: 8px; }
}
