/* ============================================================
 * KawadaSalon — Salon Concierge CSS
 * 2026-05-22 v1.0
 * Forest Green Theme / max 1100px Responsive
 * ============================================================ */

/* ---------- Reset / Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: "Hiragino Sans", "Noto Sans JP", -apple-system, BlinkMacSystemFont, "Yu Gothic", sans-serif;
  background: var(--ks-bg);
  color: var(--ks-text);
  font-size: 15px;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
button, input, select, textarea { font-family: inherit; }
a { color: var(--ks-primary); text-decoration: none; transition: color .15s; }
a:hover { color: var(--ks-primary-dark); }

/* ---------- Color Tokens ---------- */
:root {
  /* Forest Green primary */
  --ks-primary: #1a5d3a;
  --ks-primary-dark: #143b25;
  --ks-primary-mid: #2d8659;
  --ks-primary-light: #e8f5ee;
  /* Accent gold-beige (signage / picks) */
  --ks-accent: #c8a77a;
  --ks-accent-dark: #a8895e;
  /* Neutral */
  --ks-bg: #fafaf7;
  --ks-surface: #ffffff;
  --ks-surface-tint: #f7faf8;
  --ks-text: #1f2a23;
  --ks-text-mid: #4a5a51;
  --ks-text-mute: #6b7a72;
  --ks-text-faint: #98a89e;
  --ks-border: #d3e4d8;
  --ks-border-soft: #e6efe9;
  /* Semantic */
  --ks-rank-1-bg: #fef3c7;
  --ks-rank-1-fg: #92400e;
  --ks-rank-2-bg: #dbeafe;
  --ks-rank-2-fg: #1e40af;
  --ks-rank-3-bg: #d1fae5;
  --ks-rank-3-fg: #065f46;
  --ks-warn-bg: #fef3c7;
  --ks-danger-bg: #fee2e2;
  --ks-danger-fg: #991b1b;
  --ks-success-bg: #d1fae5;
  /* Typography */
  --ks-font-serif: "Cormorant Garamond", "Hiragino Mincho ProN", "Yu Mincho", serif;
  --ks-font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  /* Layout */
  --ks-max-width: 1100px;
  --ks-radius: 6px;
  --ks-radius-lg: 10px;
}

/* ---------- Layout Wrappers ---------- */
.ks-wrap { max-width: var(--ks-max-width); margin: 0 auto; padding: 0 20px; }

/* ---------- Header ---------- */
.ks-site-header {
  background: linear-gradient(180deg, var(--ks-primary-dark) 0%, var(--ks-primary) 100%);
  color: #fff;
  border-bottom: 1px solid rgba(0,0,0,0.1);
}
.ks-site-header__inner {
  max-width: var(--ks-max-width);
  margin: 0 auto;
  padding: 22px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}
.ks-brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: #fff; }
.ks-brand:hover { color: #fff; }
.ks-brand__mark {
  width: 38px; height: 38px;
  border: 1.5px solid var(--ks-accent);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--ks-font-serif);
  font-size: 18px;
  font-weight: 500;
  color: var(--ks-accent);
  background: rgba(255,255,255,0.05);
}
.ks-brand__name {
  font-family: var(--ks-font-serif);
  font-size: 24px;
  letter-spacing: 3px;
  font-weight: 500;
  line-height: 1;
}
.ks-brand__tag {
  display: block;
  font-family: -apple-system, "Hiragino Sans", sans-serif;
  font-size: 9px;
  letter-spacing: 4px;
  opacity: 0.7;
  margin-top: 4px;
}

.ks-site-nav { display: flex; align-items: center; gap: 22px; }
.ks-site-nav a {
  color: rgba(255,255,255,0.78);
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 1px;
  padding: 4px 0;
  border-bottom: 1px solid transparent;
  position: relative;
}
.ks-site-nav a:hover { color: #fff; }
.ks-site-nav a.is-active {
  color: #fff;
  border-bottom-color: var(--ks-accent);
}
.ks-site-nav .badge {
  position: absolute;
  top: -4px; right: -16px;
  min-width: 16px; height: 16px;
  background: var(--ks-accent);
  color: var(--ks-primary-dark);
  font-size: 10px;
  font-weight: 700;
  border-radius: 8px;
  display: inline-flex; align-items: center; justify-content: center;
  padding: 0 4px;
}

/* Mobile menu toggle */
.ks-nav-toggle {
  display: none;
  background: none;
  border: 1px solid rgba(255,255,255,0.4);
  color: #fff;
  padding: 6px 10px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
}

/* ---------- Date Bar ---------- */
.ks-datebar {
  background: var(--ks-surface);
  border-bottom: 0.5px solid var(--ks-border);
}
.ks-datebar__inner {
  max-width: var(--ks-max-width);
  margin: 0 auto;
  padding: 18px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}
.ks-date {
  font-family: var(--ks-font-serif);
  font-size: 26px;
  color: var(--ks-primary);
  font-weight: 500;
  line-height: 1.1;
}
.ks-date small {
  display: block;
  font-size: 10px;
  color: var(--ks-text-mute);
  letter-spacing: 2px;
  font-family: -apple-system, sans-serif;
  margin-top: 4px;
  font-weight: normal;
}
.ks-datebar__actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

.ks-pill {
  background: var(--ks-primary-light);
  color: var(--ks-primary);
  padding: 5px 14px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.5px;
}
.ks-pill--gold {
  background: #fbf2e0;
  color: #8a6a31;
  border: 0.5px solid var(--ks-accent);
}
.ks-btn-icon {
  background: var(--ks-surface);
  border: 1px solid var(--ks-border);
  padding: 8px 14px;
  border-radius: 4px;
  font-size: 13px;
  color: var(--ks-primary);
  cursor: pointer;
  text-decoration: none;
}
.ks-btn-icon:hover { background: var(--ks-primary-light); border-color: var(--ks-primary-mid); }
.ks-btn-icon[disabled], .ks-btn-icon.is-disabled { opacity: 0.4; cursor: not-allowed; }
.ks-date-input {
  background: var(--ks-surface);
  border: 1px solid var(--ks-border);
  padding: 5px 12px;
  border-radius: 4px;
  font-size: 12px;
  color: var(--ks-primary);
  font-family: inherit;
}

/* ---------- Venue Tabs ---------- */
.ks-venue-tabs {
  background: var(--ks-surface);
  border-bottom: 0.5px solid var(--ks-border);
}
.ks-venue-tabs__inner {
  max-width: var(--ks-max-width);
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  gap: 0;
  overflow-x: auto;
}
.ks-venue-tab {
  padding: 16px 24px;
  font-size: 14px;
  color: var(--ks-text-mute);
  border-bottom: 2px solid transparent;
  cursor: pointer;
  background: none;
  border-left: none;
  border-right: none;
  border-top: none;
  white-space: nowrap;
  letter-spacing: 1px;
}
.ks-venue-tab:hover { color: var(--ks-primary); }
.ks-venue-tab.is-active {
  color: var(--ks-primary);
  font-weight: 500;
  border-bottom-color: var(--ks-accent);
}
.ks-venue-tab__count {
  font-size: 10px;
  color: var(--ks-text-faint);
  margin-left: 6px;
}

/* ---------- Section ---------- */
.ks-section { padding: 36px 0 24px; }
.ks-section__head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 22px; gap: 12px; flex-wrap: wrap; padding-left: 14px; border-left: 4px solid var(--ks-accent); }
.ks-section__title {
  font-family: var(--ks-font-serif);
  font-size: 28px;
  color: var(--ks-primary-dark);
  margin: 0;
  font-weight: 500;
  letter-spacing: 1.5px;
}
.ks-section__lead {
  font-size: 12px;
  color: var(--ks-text-faint);
  letter-spacing: 3px;
  margin: 4px 0 0;
  text-transform: uppercase;
}
.ks-section__hint { font-size: 13px; color: var(--ks-text-mute); }

/* ---------- Featured Race Cards ---------- */
.ks-pick-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 14px;
}
.ks-pick-card {
  background: var(--ks-surface);
  border: 0.5px solid var(--ks-border);
  border-left: 4px solid var(--ks-accent);
  border-radius: var(--ks-radius);
  padding: 20px 24px;
  transition: box-shadow .15s;
}
.ks-pick-card:hover { box-shadow: 0 2px 8px rgba(20,59,37,0.08); }
.ks-pick-card__head {
  display: flex; justify-content: space-between; align-items: baseline;
  margin-bottom: 10px;
}
.ks-pick-card__place {
  color: var(--ks-primary);
  font-weight: 600;
  font-size: 15px;
  letter-spacing: 1px;
}
.ks-pick-card__cls { color: var(--ks-text-mute); font-size: 13px; }
.ks-pick-card__axis { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.ks-pick-card__axis-label {
  background: var(--ks-accent);
  color: #fff;
  font-size: 12px;
  padding: 3px 9px;
  border-radius: 2px;
  font-weight: 600;
  letter-spacing: 1px;
}
.ks-pick-card__horse-name { font-size: 18px; font-weight: 600; color: var(--ks-text); }
.ks-pick-card__stats { font-size: 14px; font-weight: 500; color: var(--ks-text-mid); margin-bottom: 10px; }
.ks-pick-card__himo { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.ks-pick-card__himo-label {
  background: var(--ks-primary-light);
  color: var(--ks-primary);
  font-size: 12px;
  padding: 3px 8px;
  border-radius: 2px;
  font-weight: 600;
  letter-spacing: 1px;
}

/* ---------- Number Badge (with waku color) ---------- */
.ks-num {
  display: inline-flex;
  width: 26px; height: 26px;
  border-radius: 50%;
  font-size: 14px;
  align-items: center; justify-content: center;
  font-weight: 700;
  font-family: -apple-system, sans-serif;
  flex-shrink: 0;
}
.ks-num--sm { width: 23px; height: 23px; font-size: 13px; }
.waku-1 { background: #ffffff; color: #000000; border: 1px solid #b8b8b8; }
.waku-2 { background: #000000; color: #ffffff; }
.waku-3 { background: #e74c3c; color: #ffffff; }
.waku-4 { background: #2c5aa0; color: #ffffff; }
.waku-5 { background: #f1c40f; color: #000000; }
.waku-6 { background: #2d8659; color: #ffffff; }
.waku-7 { background: #e67e22; color: #ffffff; }
.waku-8 { background: #d586a3; color: #ffffff; }

/* ---------- Attention Table (本日の注目馬) ---------- */
.ks-table-wrap {
  background: var(--ks-surface);
  border: 0.5px solid var(--ks-border);
  border-radius: var(--ks-radius);
  overflow: hidden;
  overflow-x: auto;
}
.ks-table { width: 100%; border-collapse: collapse; font-size: 15px; font-weight: 600; min-width: 600px; }
.ks-table thead {
  background: var(--ks-primary-dark);
  color: #fff;
}
.ks-table th {
  padding: 11px 10px;
  text-align: left;
  font-weight: 600;
  font-size: 13px;
  letter-spacing: 1.2px;
  text-transform: uppercase;
}
.ks-table th.is-center { text-align: center; }
.ks-table td {
  padding: 11px 10px;
  border-bottom: 0.5px solid var(--ks-border-soft);
  vertical-align: middle;
  letter-spacing: 0.3px;
}
.ks-table tr:last-child td { border-bottom: none; }
.ks-table tbody tr:hover { background: var(--ks-surface-tint); }
.ks-table .is-center { text-align: center; }
.ks-table .is-right { text-align: right; }
/* グローバル: テーブルを問わず is-right は右寄せ (推定オッズ等で必要) */
td.is-right,
th.is-right { text-align: right; }
/* サロン表/パト表 で推定オッズなど数値セルが center に強制されないよう
   :not(.is-name):not(.ks-furi-cell) の中央寄せルールを上書き */
.ks-entries-table--salon td.is-right,
.ks-entries-table--salon th.is-right,
.ks-entries-table--patrol td.is-right,
.ks-entries-table--patrol th.is-right { text-align: right !important; padding-right: 10px; }

/* ---------- Mark Badges (印アイコン: 円形+グラデで「アイコン」感を出す) ---------- */
.ks-mark {
  display: inline-block;
  width: 26px; height: 26px;
  border-radius: 50%;            /* 円形でパトマーク (角丸四角) と差別化 */
  font-family: var(--ks-font-serif);
  font-size: 14px;
  font-weight: 700;
  line-height: 26px;
  text-align: center;
  color: #fff;
  letter-spacing: 0;
  border: 1.5px solid rgba(255,255,255,0.85);
  box-shadow:
    inset 0 1.5px 0 rgba(255,255,255,0.35),
    inset 0 -1.5px 0 rgba(0,0,0,0.22),
    0 1.5px 3px rgba(0,0,0,0.22);
  vertical-align: middle;
  text-shadow: 0 1px 1px rgba(0,0,0,0.35);
}
/* 鉄 = 深紫 (重厚) */
.ks-mark--tetsu {
  background: radial-gradient(circle at 30% 30%, #8b54a8 0%, #6b3a8a 55%, #4d2766 100%);
}
/* 妙 = 橙金 (注目) */
.ks-mark--myo {
  background: radial-gradient(circle at 30% 30%, #f0a558 0%, #d97f30 55%, #a85910 100%);
}
/* 消 = 鈍灰 (沈める) */
.ks-mark--kesi {
  background: radial-gradient(circle at 30% 30%, #b0b0b0 0%, #8a8a8a 55%, #5e5e5e 100%);
}
.ks-mark--empty {
  background: transparent;
  border: none;
  box-shadow: none;
  text-shadow: none;
}

/* ---------- Patrol Stars ---------- */
/* パト★ — v18: 視認性UP (大きく / 黄金グラデ / 影付き) */
.ks-patrol {
  display: inline-block;
  color: #c8a14a;
  letter-spacing: 2px;
  font-size: 18px;
  font-weight: 700;
  text-shadow: 0 1px 2px rgba(0,0,0,0.25), 0 0 4px rgba(200,167,74,0.55);
  line-height: 1;
}
.ks-patrol--3 {
  color: #b8852f;
  text-shadow: 0 1px 2px rgba(0,0,0,0.35), 0 0 6px rgba(232, 198, 90, 0.8);
  font-size: 19px;
}

/* ---------- Race Accordion ---------- */
.ks-races { display: flex; flex-direction: column; gap: 8px; }
.ks-race {
  background: var(--ks-surface);
  border: 0.5px solid var(--ks-border);
  border-radius: var(--ks-radius);
  overflow: hidden;
  transition: border-color .15s;
}
.ks-race__head {
  padding: 18px 22px;
  display: flex;
  align-items: center;
  gap: 14px;
  cursor: pointer;
  border-left: 3px solid transparent;
  background: var(--ks-surface);
  transition: background .12s;
  user-select: none;
}
.ks-race__head:hover { background: var(--ks-surface-tint); }
.ks-race__head:focus-visible { outline: 2px solid var(--ks-primary-mid); outline-offset: -2px; }
.ks-race.is-locked .ks-race__head {
  background: #f7f2e3;
  border-left-color: var(--ks-accent);
}
.ks-race.is-locked .ks-race__head:hover { background: #f0e9d3; }
.ks-race.is-open .ks-race__head { border-left-color: var(--ks-primary-mid); background: var(--ks-primary-light); }
.ks-race.is-open .ks-race__chevron { transform: rotate(90deg); }
.ks-race__chevron {
  color: var(--ks-text-faint);
  font-size: 14px;
  transition: transform .2s;
  width: 14px; text-align: center;
}
.ks-race__rnum {
  font-family: var(--ks-font-serif);
  font-size: 22px;
  color: var(--ks-primary);
  font-weight: 500;
  min-width: 44px;
  letter-spacing: 1px;
}
.ks-race__meta { flex: 1; min-width: 0; }
.ks-race__name {
  font-size: 16px;
  color: var(--ks-text);
  font-weight: 600;
  letter-spacing: 0.5px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ks-race__sub { font-size: 13px; color: var(--ks-text-mute); margin-top: 3px; }
.ks-race__time {
  font-family: var(--ks-font-serif);
  font-size: 16px;
  color: var(--ks-primary);
  min-width: 60px;
  text-align: right;
  letter-spacing: 1px;
}
.ks-race__lock-badge {
  background: var(--ks-accent);
  color: #fff;
  padding: 5px 12px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.5px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-left: 8px;
  white-space: nowrap;
}

/* ---------- Entry Table (出馬表 詳細) ---------- */
.ks-entries {
  padding: 20px;
  border-top: 0.5px solid var(--ks-border-soft);
  background: var(--ks-surface-tint);
  display: none;
  flex-direction: column;
  gap: 20px;
}
.ks-race.is-open .ks-entries { display: flex; }

/* 2テーブル構成 (サロン出馬表 / パトロールチェック) のブロック */
.ks-block {
  background: var(--ks-surface);
  border: 0.5px solid var(--ks-border);
  border-radius: var(--ks-radius);
  overflow: hidden;
}
.ks-block__title {
  background: var(--ks-primary-dark);
  color: #fff;
  padding: 12px 18px;
  font-size: 15px;
  letter-spacing: 2px;
  font-weight: 500;
  font-family: var(--ks-font-serif);
}
.ks-block__scroll { overflow-x: auto; }

/* 6列のサロン出馬表 / パトロールチェック */
.ks-entries-table--salon,
.ks-entries-table--patrol {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  min-width: 0;
  table-layout: auto;
}
.ks-entries-table--salon thead,
.ks-entries-table--patrol thead {
  background: var(--ks-primary-light);
  color: var(--ks-primary-dark);
}
.ks-entries-table--salon th,
.ks-entries-table--patrol th {
  padding: 10px 6px;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.5px;
  text-align: center;
  white-space: nowrap;
  border-bottom: 0.5px solid var(--ks-border);
  line-height: 1.3;
}
.ks-entries-table--salon td,
.ks-entries-table--patrol td {
  padding: 10px 6px;
  border-bottom: 0.5px solid var(--ks-border-soft);
  text-align: center;
  vertical-align: middle;
  white-space: nowrap;
  background: #fff;
}
.ks-entries-table--salon tr:last-child td,
.ks-entries-table--patrol tr:last-child td { border-bottom: none; }
.ks-entries-table--salon tbody tr:hover td,
.ks-entries-table--patrol tbody tr:hover td { background: var(--ks-surface-tint); }
.ks-entries-table--salon td.is-name,
.ks-entries-table--patrol td.is-name {
  text-align: left;
  padding-left: 12px;
  font-weight: 500;
  font-size: 13px;
  min-width: 130px;
}

/* パトロールチェック 不利印セル: 折り返し許可で隣セル食い込み防止 + 左揃え */
.ks-furi-cell {
  font-size: 14px;
  font-weight: 600;
  color: var(--ks-text-mid);
  min-width: 42px;
  font-family: -apple-system, "Hiragino Sans", sans-serif;
  white-space: normal;
  word-break: break-word;
  line-height: 1.5;
  text-align: left;
  padding-left: 8px;
}
.ks-furi-cell.has-furi {
  background: #fdf2d8 !important;
  color: #7a5a1c;
  font-weight: 500;
}

/* テーブル行: 不利印セル以外は nowrap、馬名は省略表示 */
.ks-entries-table--salon td:not(.is-name):not(.ks-furi-cell),
.ks-entries-table--patrol td:not(.is-name):not(.ks-furi-cell) {
  white-space: nowrap;
}
.ks-entries-table--salon td.is-name,
.ks-entries-table--patrol td.is-name {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ks-entries__meta {
  padding: 10px 16px;
  display: flex;
  gap: 10px;
  font-size: 13px;
  color: var(--ks-text-mute);
  flex-wrap: wrap;
  background: var(--ks-primary-light);
  border-bottom: 0.5px solid var(--ks-border-soft);
}
.ks-chip {
  background: var(--ks-surface);
  color: var(--ks-primary);
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 10px;
  border: 0.5px solid var(--ks-border);
  font-weight: 500;
}
.ks-entries__scroll { overflow-x: auto; }
.ks-entries-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 11px;
  min-width: 980px;
}
.ks-entries-table thead {
  background: var(--ks-primary-dark);
  color: #fff;
}
.ks-entries-table th {
  padding: 8px 4px;
  font-weight: 500;
  font-size: 10px;
  letter-spacing: 0.5px;
  text-align: center;
  white-space: nowrap;
}
.ks-entries-table td {
  padding: 6px 4px;
  border-bottom: 0.5px solid var(--ks-border-soft);
  text-align: center;
  vertical-align: middle;
  white-space: nowrap;
}
.ks-entries-table tr:last-child td { border-bottom: none; }
.ks-entries-table tbody tr:hover { background: var(--ks-surface-tint); }
.ks-entries-table td.is-name { text-align: left; font-weight: 500; padding-left: 8px; }
.ks-entries-table td.is-left { text-align: left; padding-left: 8px; }

/* 順位ハイライト */
.ks-rank-1 { background: var(--ks-rank-1-bg) !important; color: var(--ks-rank-1-fg); font-weight: 600; }
.ks-rank-2 { background: var(--ks-rank-2-bg) !important; color: var(--ks-rank-2-fg); }
.ks-rank-3 { background: var(--ks-rank-3-bg) !important; color: var(--ks-rank-3-fg); }
/* 間隔の警告色 */
.ks-interval-yel { background: var(--ks-warn-bg); }
.ks-interval-red { background: var(--ks-danger-bg); color: var(--ks-danger-fg); font-weight: 600; }
.ks-interval-grn { background: var(--ks-success-bg); }

/* 単位 (位/% 等) を小さく */
.ks-rank-suffix { font-size: 9px; color: var(--ks-text-mute); margin-left: 2px; }
.ks-rank-1 .ks-rank-suffix, .ks-rank-2 .ks-rank-suffix, .ks-rank-3 .ks-rank-suffix { color: inherit; opacity: 0.7; }

/* ---------- Locked Body (出馬表ロックの中身) ---------- */
.ks-locked-body {
  padding: 28px 20px;
  background: #faf8f1;
  text-align: center;
  border-top: 0.5px solid var(--ks-border-soft);
  display: none;
}
.ks-race.is-open.is-locked .ks-locked-body { display: block; }
.ks-locked-body__icon { font-size: 28px; color: var(--ks-accent-dark); margin-bottom: 6px; }
.ks-locked-body__msg { font-size: 13px; color: var(--ks-text); margin-bottom: 4px; font-weight: 500; }
.ks-locked-body__sub { font-size: 11px; color: var(--ks-text-mute); margin-bottom: 14px; }
.ks-locked-body .ks-btn { background: var(--ks-primary); color: #fff; padding: 9px 28px; border-radius: 4px; font-size: 13px; display: inline-block; font-weight: 500; letter-spacing: 1px; }
.ks-locked-body .ks-btn:hover { background: var(--ks-primary-dark); color: #fff; }

/* ---------- Settings Form (kawada_settings.php) ---------- */
.ks-settings-form { display: flex; flex-direction: column; gap: 20px; max-width: 760px; }
.ks-settings-group {
  background: var(--ks-surface);
  border: 0.5px solid var(--ks-border);
  border-radius: var(--ks-radius-lg);
  overflow: hidden;
}
.ks-settings-group__head {
  background: var(--ks-primary-dark);
  color: #fff;
  padding: 14px 22px;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}
.ks-settings-group__title {
  font-family: var(--ks-font-serif);
  font-size: 18px;
  font-weight: 500;
  letter-spacing: 1.5px;
  margin: 0;
  color: #fff;
}
.ks-settings-group__sub {
  font-size: 10px;
  letter-spacing: 3px;
  color: var(--ks-accent);
  text-transform: uppercase;
}
.ks-settings-group__body {
  padding: 20px 22px;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 18px 28px;
}
.ks-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.ks-field__label {
  font-size: 14px;
  font-weight: 500;
  color: var(--ks-text);
  display: flex;
  align-items: center;
  gap: 8px;
}
.ks-field__fixed {
  background: var(--ks-text-faint);
  color: #fff;
  font-size: 9px;
  padding: 1px 6px;
  border-radius: 999px;
  letter-spacing: 1px;
  font-weight: normal;
}
.ks-field__control {
  display: flex;
  align-items: center;
  gap: 12px;
}
.ks-field__control input[type=range] {
  flex: 1;
  accent-color: var(--ks-primary);
  cursor: pointer;
}
.ks-field__control input[type=range]:disabled { cursor: not-allowed; opacity: 0.5; }
.ks-field__value {
  font-family: var(--ks-font-mono);
  font-size: 16px;
  font-weight: 600;
  color: var(--ks-primary-dark);
  min-width: 50px;
  text-align: right;
  background: var(--ks-primary-light);
  padding: 4px 10px;
  border-radius: 4px;
}
.ks-field__range {
  font-size: 11px;
  color: var(--ks-text-faint);
  font-family: var(--ks-font-mono);
  min-width: 76px;
  text-align: right;
}
.ks-field__hint {
  font-size: 12px;
  line-height: 1.6;
  color: var(--ks-text-mute);
  line-height: 1.5;
  padding-left: 4px;
}
.ks-settings-actions {
  display: flex;
  gap: 10px;
  padding: 8px 0;
}
.ks-btn-primary, .ks-btn-secondary {
  font-family: inherit;
  font-size: 13px;
  padding: 10px 22px;
  border-radius: var(--ks-radius);
  cursor: pointer;
  letter-spacing: 1px;
  border: none;
  font-weight: 500;
}
.ks-btn-primary {
  background: var(--ks-primary);
  color: #fff;
}
.ks-btn-primary:hover { background: var(--ks-primary-dark); }
.ks-btn-secondary {
  background: var(--ks-surface);
  color: var(--ks-text-mid);
  border: 0.5px solid var(--ks-border);
}
.ks-btn-secondary:hover { background: var(--ks-surface-tint); color: var(--ks-text); }


/* ---------- Footer ---------- */
.ks-site-footer {
  background: var(--ks-primary-dark);
  color: rgba(255,255,255,0.7);
  padding: 28px 20px;
  margin-top: 48px;
  font-size: 12px;
}
.ks-site-footer__inner {
  max-width: var(--ks-max-width);
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
}
.ks-site-footer__nav { display: flex; gap: 18px; flex-wrap: wrap; }
.ks-site-footer__nav a { color: rgba(255,255,255,0.7); font-size: 12px; letter-spacing: 1px; }
.ks-site-footer__nav a:hover { color: var(--ks-accent); }
.ks-site-footer__brand {
  font-family: var(--ks-font-serif);
  letter-spacing: 3px;
  font-size: 14px;
  color: rgba(255,255,255,0.9);
}
.ks-site-footer__copy { font-size: 10px; opacity: 0.6; letter-spacing: 1px; }

/* ---------- Flash Message ---------- */
.ks-flash {
  max-width: var(--ks-max-width);
  margin: 16px auto 0;
  padding: 10px 16px;
  border-radius: var(--ks-radius);
  font-size: 13px;
}
.ks-flash--success { background: var(--ks-success-bg); color: #065f46; border: 0.5px solid #6ee7b7; }
.ks-flash--error { background: var(--ks-danger-bg); color: var(--ks-danger-fg); border: 0.5px solid #fca5a5; }
.ks-flash--info { background: var(--ks-primary-light); color: var(--ks-primary); border: 0.5px solid var(--ks-primary-mid); }

/* ---------- Empty State ---------- */
.ks-empty {
  padding: 60px 20px;
  text-align: center;
  color: var(--ks-text-mute);
  background: var(--ks-surface);
  border: 0.5px dashed var(--ks-border);
  border-radius: var(--ks-radius-lg);
  font-size: 13px;
}
.ks-empty__title { font-size: 16px; color: var(--ks-text); margin-bottom: 6px; }

/* ---------- Utility ---------- */
.ks-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;
}
.ks-mono { font-family: var(--ks-font-mono); }
.ks-serif { font-family: var(--ks-font-serif); }
.ks-mt-0 { margin-top: 0; }
.ks-mt-12 { margin-top: 12px; }
.ks-mt-20 { margin-top: 20px; }

/* ---------- PC: 出馬表テーブルのカラム固定幅 ---------- */
/* 馬名肥大化を防ぐため、PC 時 table-layout: fixed + 各カラム幅を明示 */
@media (min-width: 721px) {
  /* 馬名を固定幅にして、騎手・調教師・1〜3走前を auto で残りスペース活用 */
  .ks-entries-table--salon { table-layout: fixed; width: 100%; }
  .ks-entries-table--salon th:nth-child(1),
  .ks-entries-table--salon td:nth-child(1)  { width: 44px; }                       /* 印 */
  .ks-entries-table--salon th:nth-child(2),
  .ks-entries-table--salon td:nth-child(2)  { width: 48px; }                       /* 馬番 */
  .ks-entries-table--salon th:nth-child(3),
  .ks-entries-table--salon td:nth-child(3)  { width: 160px; }                      /* 馬名 */
  .ks-entries-table--salon th:nth-child(4),
  .ks-entries-table--salon td:nth-child(4)  { width: 52px; }                       /* 性齢 */
  .ks-entries-table--salon th:nth-child(5),
  .ks-entries-table--salon td:nth-child(5)  { width: 56px; }                       /* 斤量 */
  .ks-entries-table--salon th:nth-child(6),
  .ks-entries-table--salon td:nth-child(6)  { width: auto; min-width: 48px; max-width: 88px; }   /* 騎手 (少し狭く) */
  .ks-entries-table--salon th:nth-child(7),
  .ks-entries-table--salon td:nth-child(7)  { width: auto; min-width: 48px; max-width: 88px; }   /* 調教師 (少し狭く) */
  .ks-entries-table--salon th:nth-child(8),
  .ks-entries-table--salon td:nth-child(8)  { width: 56px; }                       /* 間隔 */
  .ks-entries-table--salon th:nth-child(9),
  .ks-entries-table--salon td:nth-child(9)  { width: 90px; }                       /* 能力偏差値 */
  .ks-entries-table--salon th:nth-child(10),
  .ks-entries-table--salon td:nth-child(10) { width: 96px; }                       /* 推定回収率 */
  .ks-entries-table--salon th:nth-child(11),
  .ks-entries-table--salon td:nth-child(11) { width: 78px; }                       /* 推定オッズ */
  .ks-entries-table--salon th:nth-child(12),
  .ks-entries-table--salon td:nth-child(12) { width: 92px; }                       /* パト (★3対応で拡張) */

  /* サロン出馬表 & パトロールチェック PC: 全列で同じフォントサイズ・ウェイトに統一 */
  .ks-entries-table--salon tbody td,
  .ks-entries-table--patrol tbody td {
    font-size: 15px;
    font-weight: 600;
    letter-spacing: 0.3px;
    line-height: 1.4;
  }
  .ks-entries-table--salon tbody td.is-name,
  .ks-entries-table--patrol tbody td.is-name {
    font-size: 15px;
    font-weight: 600;
  }
  /* 不利印セル (.ks-furi-cell) も table-cell に揃える */
  .ks-entries-table--patrol tbody td.ks-furi-cell {
    font-size: 15px;
    font-weight: 600;
  }

  .ks-entries-table--patrol { table-layout: fixed; width: 100%; }
  .ks-entries-table--patrol th:nth-child(1),
  .ks-entries-table--patrol td:nth-child(1) { width: 44px; }                       /* 印 */
  .ks-entries-table--patrol th:nth-child(2),
  .ks-entries-table--patrol td:nth-child(2) { width: 48px; }                       /* 馬番 */
  .ks-entries-table--patrol th:nth-child(3),
  .ks-entries-table--patrol td:nth-child(3) { width: 172px; }                      /* 馬名 (+32px 拡張) */
  .ks-entries-table--patrol th:nth-child(4),
  .ks-entries-table--patrol td:nth-child(4) { width: 84px; }                       /* 能力偏差値 */
  .ks-entries-table--patrol th:nth-child(5),
  .ks-entries-table--patrol td:nth-child(5) { width: 90px; }                       /* 推定回収率 */
  .ks-entries-table--patrol th:nth-child(6),
  .ks-entries-table--patrol td:nth-child(6) { width: 76px; }                       /* 推定オッズ */
  .ks-entries-table--patrol th:nth-child(7),
  .ks-entries-table--patrol td:nth-child(7),
  .ks-entries-table--patrol th:nth-child(8),
  .ks-entries-table--patrol td:nth-child(8),
  .ks-entries-table--patrol th:nth-child(9),
  .ks-entries-table--patrol td:nth-child(9) { width: auto; min-width: 96px; }    /* 1〜3走前 (-14px) */

  /* PC 専用セル (騎手・調教師) の見た目統一 */
  .ks-entries-table--salon td.ks-pc-only {
    text-align: left;
    padding-left: 10px;
    font-size: 13px;
    color: var(--ks-text-mid);
  }
}

/* ---------- PC 専用カラム (騎手・調教師など) ---------- */
.ks-pc-only { display: table-cell; }
@media (max-width: 720px) {
  .ks-pc-only { display: none !important; }
}

/* ---------- Responsive ---------- */
@media (max-width: 720px) {
  .ks-settings-group__body { grid-template-columns: 1fr; }
  .ks-site-header__inner { padding: 14px 16px; }
  .ks-brand__name { font-size: 18px; letter-spacing: 2px; }
  .ks-brand__tag { font-size: 8px; letter-spacing: 2px; }
  .ks-nav-toggle { display: block; }
  .ks-site-nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0; right: 0;
    background: var(--ks-primary-dark);
    flex-direction: column;
    gap: 0;
    padding: 8px 16px;
    z-index: 10;
  }
  .ks-site-nav.is-open { display: flex; }
  .ks-site-nav a { padding: 12px 0; border-bottom: 0.5px solid rgba(255,255,255,0.1); }
  .ks-site-nav a.is-active { border-bottom-color: var(--ks-accent); }
  .ks-site-header { position: relative; }

  .ks-datebar__inner { padding: 12px 16px; }
  .ks-date { font-size: 18px; }
  .ks-venue-tabs__inner { padding: 0 16px; }
  .ks-venue-tab { padding: 12px 16px; font-size: 12px; }
  .ks-section { padding: 24px 0 20px; }
  .ks-section__title { font-size: 22px; }

  .ks-pick-grid { grid-template-columns: 1fr; }

  .ks-race__head { padding: 12px; gap: 10px; }
  .ks-race__rnum { font-size: 17px; min-width: 36px; }
  .ks-race__name { font-size: 13px; }
  .ks-race__time { font-size: 14px; min-width: 50px; }
  .ks-race__lock-badge { padding: 4px 8px; font-size: 10px; }

  .ks-site-footer__inner { flex-direction: column; align-items: flex-start; }
}

@media (max-width: 480px) {
  .ks-brand__mark { width: 32px; height: 32px; font-size: 15px; }
  .ks-pick-card { padding: 14px; }
  .ks-section__title { font-size: 17px; }

  /* スマホ: 6列テーブルを詰めすぎず + 印列を狭く */
  .ks-entries { padding: 12px; gap: 14px; }
  .ks-block__title { padding: 9px 12px; font-size: 12px; letter-spacing: 1.2px; }
  .ks-entries-table--salon th,
  .ks-entries-table--patrol th { font-size: 11px; padding: 7px 2px; }
  .ks-entries-table--salon td,
  .ks-entries-table--patrol td { padding: 8px 3px; font-size: 12px; }
  /* PC で全列フォントを上げているのでモバイルではリセット */
  .ks-entries-table--salon tbody td,
  .ks-entries-table--patrol tbody td {
    font-size: 12px;
    font-weight: 500;
    letter-spacing: 0;
  }
  .ks-entries-table--salon td.is-name,
  .ks-entries-table--patrol td.is-name { min-width: 110px; font-size: 13px; padding-left: 8px; font-weight: 600; }
  .ks-num.ks-num--sm { width: 22px; height: 22px; font-size: 11px; }
  .ks-mark { width: 22px; height: 22px; line-height: 19px; font-size: 12px; border-width: 1px; }
  /* 印列・馬番列を狭めてスペース確保 */
  .ks-entries-table--salon th:nth-child(1),
  .ks-entries-table--salon td:nth-child(1),
  .ks-entries-table--patrol th:nth-child(1),
  .ks-entries-table--patrol td:nth-child(1) { width: 30px; padding-left: 2px; padding-right: 2px; }
  .ks-entries-table--salon th:nth-child(2),
  .ks-entries-table--salon td:nth-child(2),
  .ks-entries-table--patrol th:nth-child(2),
  .ks-entries-table--patrol td:nth-child(2) { width: 34px; padding-left: 1px; padding-right: 1px; }

  /* 設定画面 */
  .ks-field__control { flex-wrap: wrap; }
  .ks-field__range { min-width: auto; flex: 0 0 100%; text-align: left; padding-left: 4px; }
  .ks-settings-group__head { flex-direction: column; align-items: flex-start; gap: 4px; padding: 10px 14px; }
  .ks-settings-group__body { padding: 14px; gap: 16px; grid-template-columns: 1fr; }
}


/* ============================================================
 * News / Help / Settings 2-col (2026-05-22 追加)
 * ============================================================ */

/* ---------- News 共通 ---------- */
.ks-news-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 18px;
  align-items: center;
}
.ks-news-toolbar__input,
.ks-news-toolbar__select {
  background: var(--ks-surface);
  border: 0.5px solid var(--ks-border);
  border-radius: var(--ks-radius);
  padding: 9px 14px;
  font-size: 13px;
  color: var(--ks-text);
  height: 38px;
}
.ks-news-toolbar__input { flex: 1; min-width: 200px; }
.ks-news-toolbar__input:focus,
.ks-news-toolbar__select:focus {
  outline: none;
  border-color: var(--ks-primary-mid);
  box-shadow: 0 0 0 2px rgba(45, 134, 89, 0.15);
}
.ks-news-toolbar__btn {
  background: var(--ks-primary);
  color: #fff;
  border: none;
  padding: 0 18px;
  height: 38px;
  border-radius: var(--ks-radius);
  font-size: 13px;
  letter-spacing: 1px;
  cursor: pointer;
  font-weight: 500;
  transition: background .12s;
}
.ks-news-toolbar__btn:hover { background: var(--ks-primary-dark); }
.ks-news-toolbar__clear {
  font-size: 11px;
  color: var(--ks-text-mute);
  text-decoration: underline;
  align-self: center;
  padding: 0 6px;
}

.ks-news-pinned-label {
  font-size: 11px;
  font-weight: 600;
  color: #b35a1c;
  letter-spacing: 1.5px;
  margin: 6px 0 8px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.ks-news-pinned-label::before {
  content: '';
  width: 6px;
  height: 6px;
  background: #c8753a;
  border-radius: 50%;
}

.ks-news-list { display: flex; flex-direction: column; gap: 10px; margin-bottom: 24px; }

.ks-news-item {
  background: var(--ks-surface);
  border: 0.5px solid var(--ks-border);
  border-radius: var(--ks-radius-lg);
  overflow: hidden;
  transition: border-color .12s;
}
.ks-news-item:hover { border-color: var(--ks-primary-mid); }
.ks-news-item.is-pinned { border-left: 3px solid var(--ks-accent); }

.ks-news-item__header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  cursor: pointer;
  user-select: none;
}
.ks-news-item__date {
  font-family: var(--ks-font-mono);
  font-size: 11px;
  color: var(--ks-text-mute);
  white-space: nowrap;
  letter-spacing: 0.3px;
}
.ks-news-item__tag {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 1px;
  padding: 3px 10px;
  border-radius: 999px;
  white-space: nowrap;
}
.ks-news-item__tag.important { background: var(--ks-danger-bg); color: var(--ks-danger-fg); }
.ks-news-item__tag.update    { background: var(--ks-primary-light); color: var(--ks-primary); }
.ks-news-item__tag.info      { background: #f4f1e8; color: var(--ks-accent-dark); }
.ks-news-item__title {
  flex: 1;
  font-size: 14px;
  font-weight: 500;
  color: var(--ks-text);
  line-height: 1.5;
}
.ks-news-item__permalink {
  font-size: 11px;
  color: var(--ks-text-faint);
  text-decoration: none;
  padding: 4px 8px;
}
.ks-news-item__permalink:hover { color: var(--ks-primary); background: var(--ks-surface-tint); border-radius: 4px; }
.ks-news-item__chevron {
  width: 14px;
  height: 14px;
  color: var(--ks-text-faint);
  transition: transform .15s;
  flex-shrink: 0;
}
.ks-news-item.is-open .ks-news-item__chevron { transform: rotate(90deg); }

.ks-news-item__body {
  display: none;
  padding: 0 22px 18px;
  border-top: 0.5px solid var(--ks-border-soft);
  margin-top: -1px;
  color: var(--ks-text-mid);
  font-size: 13px;
  line-height: 1.85;
}
.ks-news-item.is-open .ks-news-item__body { display: block; padding-top: 14px; }
.ks-news-item__body h1,
.ks-news-item__body h2,
.ks-news-item__body h3 {
  font-family: var(--ks-font-serif);
  color: var(--ks-primary-dark);
  margin: 16px 0 8px;
  font-weight: 500;
  letter-spacing: 0.5px;
}
.ks-news-item__body h2 { font-size: 17px; }
.ks-news-item__body h3 { font-size: 15px; }
.ks-news-item__body p { margin: 8px 0; }
.ks-news-item__body ul,
.ks-news-item__body ol { padding-left: 22px; margin: 8px 0; }
.ks-news-item__body a { color: var(--ks-primary); text-decoration: underline; }
.ks-news-item__body code {
  background: var(--ks-surface-tint);
  border: 0.5px solid var(--ks-border-soft);
  padding: 1px 6px;
  border-radius: 3px;
  font-size: 12px;
  font-family: var(--ks-font-mono);
}

.ks-news-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--ks-text-mute);
  text-decoration: none;
  margin-bottom: 12px;
  letter-spacing: 0.5px;
}
.ks-news-back:hover { color: var(--ks-primary); }

.ks-news-single {
  background: var(--ks-surface);
  border: 0.5px solid var(--ks-border);
  border-radius: var(--ks-radius-lg);
  padding: 24px 28px;
  margin-bottom: 18px;
}
.ks-news-single__meta {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
  padding-bottom: 14px;
  border-bottom: 0.5px solid var(--ks-border-soft);
}
.ks-news-single__title {
  font-family: var(--ks-font-serif);
  font-size: 22px;
  color: var(--ks-primary-dark);
  margin: 0;
  font-weight: 500;
  letter-spacing: 1px;
  line-height: 1.5;
}
.ks-news-single__body {
  color: var(--ks-text-mid);
  font-size: 14px;
  line-height: 1.95;
}
.ks-news-single__body h1,
.ks-news-single__body h2,
.ks-news-single__body h3 {
  font-family: var(--ks-font-serif);
  color: var(--ks-primary-dark);
  margin: 22px 0 10px;
  font-weight: 500;
  letter-spacing: 0.5px;
}
.ks-news-single__body h2 { font-size: 19px; }
.ks-news-single__body h3 { font-size: 16px; }
.ks-news-single__body p { margin: 10px 0; }
.ks-news-single__body ul,
.ks-news-single__body ol { padding-left: 24px; margin: 10px 0; }
.ks-news-single__body a { color: var(--ks-primary); text-decoration: underline; }

.ks-news-copy-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--ks-surface);
  color: var(--ks-text-mid);
  border: 0.5px solid var(--ks-border);
  padding: 7px 14px;
  border-radius: var(--ks-radius);
  cursor: pointer;
  font-size: 12px;
  letter-spacing: 0.5px;
}
.ks-news-copy-btn:hover { background: var(--ks-surface-tint); color: var(--ks-primary); }

/* ---------- Help 専用 ---------- */
.ks-help-toc {
  background: var(--ks-surface);
  border: 0.5px solid var(--ks-border);
  border-radius: var(--ks-radius-lg);
  padding: 18px 22px;
  margin-bottom: 24px;
}
.ks-help-toc__title {
  font-size: 11px;
  font-weight: 600;
  color: var(--ks-accent-dark);
  letter-spacing: 1.5px;
  margin-bottom: 10px;
}
.ks-help-toc__list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  list-style: none;
  padding: 0;
  margin: 0;
}
.ks-help-toc__list a {
  font-size: 12px;
  color: var(--ks-text-mid);
  text-decoration: none;
  padding: 4px 0;
  border-bottom: 1px dotted transparent;
}
.ks-help-toc__list a:hover {
  color: var(--ks-primary);
  border-bottom-color: var(--ks-primary-mid);
}

.ks-help-section {
  background: var(--ks-surface);
  border: 0.5px solid var(--ks-border);
  border-radius: var(--ks-radius-lg);
  padding: 26px 30px;
  margin-bottom: 18px;
  scroll-margin-top: 24px;
}
.ks-help-section__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 0.5px solid var(--ks-border-soft);
  gap: 14px;
  flex-wrap: wrap;
}
.ks-help-section__title {
  font-family: var(--ks-font-serif);
  font-size: 20px;
  color: var(--ks-primary-dark);
  font-weight: 500;
  letter-spacing: 1px;
  margin: 0;
}
.ks-help-section__tag {
  font-size: 10px;
  letter-spacing: 2px;
  color: var(--ks-accent);
  font-weight: 600;
}
.ks-help-section__body {
  color: var(--ks-text-mid);
  font-size: 14px;
  line-height: 1.9;
}
.ks-help-section__body h3 {
  font-family: var(--ks-font-serif);
  font-size: 15px;
  color: var(--ks-primary-dark);
  margin: 18px 0 6px;
  letter-spacing: 0.5px;
  font-weight: 500;
}
.ks-help-section__body p { margin: 8px 0; }
.ks-help-section__body ul,
.ks-help-section__body ol { padding-left: 22px; margin: 8px 0; }
.ks-help-section__body li { margin: 4px 0; }
.ks-help-section__body code {
  background: var(--ks-surface-tint);
  border: 0.5px solid var(--ks-border-soft);
  padding: 1px 6px;
  border-radius: 3px;
  font-size: 12px;
  font-family: var(--ks-font-mono);
}
.ks-help-section__body .ks-help-key {
  display: inline-block;
  background: var(--ks-primary-light);
  color: var(--ks-primary-dark);
  border: 0.5px solid var(--ks-primary-mid);
  padding: 1px 8px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 600;
  margin: 0 2px;
}
.ks-help-section__body .ks-help-note {
  background: var(--ks-surface-tint);
  border-left: 3px solid var(--ks-accent);
  padding: 10px 14px;
  margin: 12px 0;
  font-size: 13px;
  color: var(--ks-text-mid);
  border-radius: 0 var(--ks-radius) var(--ks-radius) 0;
}

/* ---------- Settings PC: 2 カラム化 ---------- */
@media (min-width: 721px) {
  .ks-settings-form {
    max-width: var(--ks-max-width);
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 18px 20px;
    align-items: start;
  }
  .ks-settings-form .ks-settings-group__body {
    grid-template-columns: 1fr;
    gap: 18px;
  }
  .ks-settings-actions {
    grid-column: 1 / -1;
    position: sticky;
    bottom: 0;
    background: linear-gradient(180deg, rgba(250,250,247,0) 0%, var(--ks-bg) 30%, var(--ks-bg) 100%);
    padding: 16px 0 12px;
    margin-top: 4px;
    display: flex;
    gap: 12px;
    justify-content: flex-start;
    z-index: 4;
  }
}
.ks-field__control input[type=range] { min-width: 160px; }

/* ---------- News/Help モバイル調整 ---------- */
@media (max-width: 720px) {
  .ks-news-toolbar { flex-direction: column; align-items: stretch; }
  .ks-news-toolbar__input,
  .ks-news-toolbar__select,
  .ks-news-toolbar__btn { width: 100%; }
  .ks-news-item__header { flex-wrap: wrap; padding: 12px 14px; }
  .ks-news-item__date { font-size: 10px; }
  .ks-news-item__title { font-size: 13px; flex-basis: 100%; }
  .ks-news-item__permalink { font-size: 10px; padding: 2px 4px; }
  .ks-news-single { padding: 18px 18px; }
  .ks-news-single__title { font-size: 18px; }
  .ks-help-toc { padding: 14px 16px; }
  .ks-help-section { padding: 20px 18px; }
  .ks-help-section__title { font-size: 18px; }
}


/* ============================================================
 * 設定ページ v10 (2026-05-22)
 *   - 能力偏差値: 1〜15 目盛スライダー (内部値非表示)
 *   - 推定回収率: 5段階バー + 各レベル係数テーブル
 *   - 印 (鉄/妙/消): 範囲入力 + パトラジオの 4軸フィルター
 * ============================================================ */

/* ---------- 単段組グループ (フォーム横並びを縦に) ---------- */
.ks-settings-group__body--single {
  grid-template-columns: 1fr;
  gap: 18px;
}

/* ---------- 能力偏差値: 1-15 目盛スライダーの両端ラベル ---------- */
.ks-field__edge {
  font-family: var(--ks-font-mono);
  font-size: 12px;
  color: var(--ks-text-faint);
  min-width: 18px;
  text-align: center;
}

/* ---------- 推定回収率: 的中率重視 ↔ 回収率重視 5段階バー ---------- */
.ks-balance-bar {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 6px 4px 0;
}
.ks-balance-bar__label {
  font-size: 13px;
  font-weight: 500;
  color: var(--ks-primary-dark);
  white-space: nowrap;
  letter-spacing: 1px;
}
.ks-balance-bar__label--left  { color: #1f6f4a; }
.ks-balance-bar__label--right { color: #b54838; }
.ks-balance-bar__range {
  flex: 1;
  accent-color: var(--ks-primary);
  cursor: pointer;
  min-width: 200px;
}
.ks-balance-bar__ticks {
  display: flex;
  justify-content: space-between;
  padding: 4px 96px 0;     /* スライダー両端の label 幅相当オフセット */
  font-family: var(--ks-font-mono);
  font-size: 12px;
  color: var(--ks-text-faint);
  letter-spacing: 1px;
}
.ks-balance-bar__tick {
  width: 22px;
  text-align: center;
  transition: color .12s, font-weight .12s;
}
.ks-balance-bar__tick.is-active {
  color: var(--ks-primary-dark);
  font-weight: 700;
}

/* ---------- 推定回収率: 各レベルの係数テーブル ---------- */
.ks-rec-levels {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 10px;
  margin-top: 8px;
}
.ks-rec-level {
  background: var(--ks-surface-tint);
  border: 0.5px solid var(--ks-border);
  border-radius: var(--ks-radius);
  padding: 10px 8px;
  opacity: 0.55;
  transition: opacity .12s, border-color .12s, background .12s, transform .12s;
}
.ks-rec-level.is-active {
  opacity: 1;
  border-color: var(--ks-primary);
  background: var(--ks-primary-light);
  transform: translateY(-1px);
  box-shadow: 0 2px 6px rgba(45, 134, 89, 0.12);
}
.ks-rec-level__head {
  font-family: var(--ks-font-serif);
  font-size: 13px;
  font-weight: 600;
  color: var(--ks-primary-dark);
  margin-bottom: 8px;
  text-align: center;
  letter-spacing: 1px;
}
.ks-rec-level__tables {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.ks-rec-level__table {
  width: 100%;
  border-collapse: collapse;
  font-size: 11px;
  font-family: var(--ks-font-mono);
}
.ks-rec-level__table th,
.ks-rec-level__table td {
  padding: 3px 4px;
  border-bottom: 0.5px solid var(--ks-border-soft);
  text-align: center;
}
.ks-rec-level__table th {
  background: rgba(255, 255, 255, 0.5);
  color: var(--ks-text-mid);
  font-weight: 500;
  font-size: 10px;
  letter-spacing: 0.5px;
}
.ks-rec-level__table td:last-child {
  font-weight: 600;
  color: var(--ks-primary-dark);
}

/* ---------- 印カスタマイズ: 範囲入力 ---------- */
.ks-mark-range {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}
.ks-mark-range__label {
  font-size: 13px;
  font-weight: 500;
  color: var(--ks-text);
  min-width: 130px;
}
.ks-mark-range__inputs {
  display: flex;
  align-items: center;
  gap: 8px;
}
.ks-mark-range__input {
  width: 96px;
  padding: 7px 10px;
  font-family: var(--ks-font-mono);
  font-size: 14px;
  text-align: right;
  border: 0.5px solid var(--ks-border);
  border-radius: var(--ks-radius);
  background: #fff;
  color: var(--ks-text);
}
.ks-mark-range__input:focus {
  outline: none;
  border-color: var(--ks-primary-mid);
  box-shadow: 0 0 0 2px rgba(45, 134, 89, 0.15);
}
.ks-mark-range__sep {
  color: var(--ks-text-faint);
  font-size: 14px;
}
.ks-mark-range--pat { align-items: flex-start; }

/* ---------- 印カスタマイズ: パトフィルター (ラジオ) ---------- */
.ks-pat-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  align-items: center;
}
.ks-pat-filter__opt {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 13px;
  color: var(--ks-text);
  cursor: pointer;
  padding: 4px 8px;
  border-radius: var(--ks-radius);
  transition: background .12s;
}
.ks-pat-filter__opt:hover { background: var(--ks-surface-tint); }
.ks-pat-filter__opt input[type=radio] {
  accent-color: var(--ks-primary);
  cursor: pointer;
}

/* ---------- 印グループのバッジ装飾 ---------- */
.ks-settings-group__title .ks-mark {
  margin-right: 8px;
  vertical-align: middle;
}

/* ---------- レスポンシブ ---------- */
@media (max-width: 720px) {
  .ks-rec-levels {
    grid-template-columns: repeat(2, 1fr);
  }
  .ks-balance-bar__ticks {
    padding: 4px 70px 0;
  }
  .ks-mark-range {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
  }
  .ks-mark-range__label { min-width: 0; }
  .ks-mark-range__input { width: 88px; }
}
@media (max-width: 480px) {
  .ks-rec-levels {
    grid-template-columns: 1fr;
  }
  .ks-balance-bar {
    flex-wrap: wrap;
    gap: 6px 8px;
    align-items: center;
  }
  /* 上行: 「的中率重視」← ←─→ →「回収率重視」を両端配置 */
  .ks-balance-bar__label--left {
    flex: 0 0 auto;
    order: 1;
    text-align: left;
    position: relative;
  }
  .ks-balance-bar__label--left::after {
    content: " ←─";
    margin-left: 6px;
    color: var(--ks-text-faint, #888);
    font-weight: 400;
    letter-spacing: 0;
    font-size: 11px;
  }
  .ks-balance-bar__label--right {
    flex: 0 0 auto;
    order: 2;
    margin-left: auto;
    text-align: right;
    position: relative;
  }
  .ks-balance-bar__label--right::before {
    content: "─→ ";
    margin-right: 6px;
    color: var(--ks-text-faint, #888);
    font-weight: 400;
    letter-spacing: 0;
    font-size: 11px;
  }
  /* 下行: スライダー + ticks */
  .ks-balance-bar__range {
    flex: 1 0 100%;
    order: 3;
  }
  .ks-balance-bar__ticks {
    padding: 4px 4px 0;
    order: 4;
    flex: 1 0 100%;
  }
}


/* ============================================================
 * v11 追加 (2026-05-22)
 *   - サロン出馬表: 推定回収率の色分け / 能力偏差値 1-3 位ハイライト
 *   - パトロールチェック: 10 種マークのカラーバッジ
 *   - 設定ページ: グループ補足注釈
 * ============================================================ */

/* ---------- 推定回収率 セル色分け ---------- */
.ks-recovery--warm {
  color: #c0392b !important;   /* 90〜99: 赤文字 */
  font-weight: 700;
}
.ks-recovery--hot {
  color: #ffffff !important;   /* 100以上: 白文字 + 赤背景 (v18 強調) */
  background: #c0392b !important;
  font-weight: 700;
}
/* 行全体のホバー時も背景を維持 */
.ks-entries-table--salon tbody tr:hover td.ks-recovery--hot {
  background: #a02d22 !important;
}

/* ---------- 能力偏差値 1-3 位 ハイライト (能力偏差値セルのみ) ---------- */
.ks-entries-table--salon tbody tr.ks-row-rank-1 td:nth-child(9) { background: #fde7e7 !important; }  /* 薄赤 */
.ks-entries-table--salon tbody tr.ks-row-rank-2 td:nth-child(9) { background: #e3f0fb !important; }  /* 薄青 */
.ks-entries-table--salon tbody tr.ks-row-rank-3 td:nth-child(9) { background: #fdf6c8 !important; }  /* 薄黄 */
/* ホバー時はやや濃く (能力偏差値セルのみ) */
.ks-entries-table--salon tbody tr.ks-row-rank-1:hover td:nth-child(9) { background: #fad5d5 !important; }
.ks-entries-table--salon tbody tr.ks-row-rank-2:hover td:nth-child(9) { background: #cfe3f5 !important; }
.ks-entries-table--salon tbody tr.ks-row-rank-3:hover td:nth-child(9) { background: #fbeea5 !important; }

/* ---------- パトロールマーク (10種) ---------- */
.ks-pat-marks {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 2px;
  justify-content: flex-start;
  align-items: center;
  /* width:100% は意図的に外す:
     .ks-pat-cell__row の flex 子要素として「着順 → マーク」を同列に並べるため。 */
}
.ks-pat-mark {
  display: inline-block;
  min-width: 23px;
  height: 23px;
  line-height: 23px;
  padding: 0 4px;
  border-radius: 3px;
  font-size: 13px;
  font-weight: 700;
  font-family: -apple-system, "Hiragino Sans", sans-serif;
  text-align: center;
  letter-spacing: 0;
  color: #fff;                       /* 余〜接: 濃色背景 × 白抜き */
  vertical-align: middle;
}
/* 余/群/気/砂/非/角/展/疾/接 — それぞれ識別しやすい濃色 */
.ks-pat-mark--yoryoku    { background: #5a4a8c; }   /* 余 紫 */
.ks-pat-mark--bagun      { background: #b03a3a; }   /* 群 赤 */
.ks-pat-mark--kishou     { background: #d97f30; }   /* 気 橙 */
.ks-pat-mark--sunakaburi { background: #8b6914; }   /* 砂 茶 */
.ks-pat-mark--hisumu     { background: #2c6e8a; }   /* 非 青 */
.ks-pat-mark--kakuloss   { background: #16846b; }   /* 角 緑 */
.ks-pat-mark--tenkai     { background: #3b4a8a; }   /* 展 紺 */
.ks-pat-mark--shippei    { background: #8b1c4d; }   /* 疾 マゼンタ */
.ks-pat-mark--sesshoku   { background: #5a3119; }   /* 接 焦茶 */
/* 恵 — ネガティブ要因のため灰色背景×黒文字で差別化 */
.ks-pat-mark--megure {
  background: #d0d0d0;
  color: #2a2a2a;
}

/* パトロールセル: 既存 has-furi 黄背景はマーク化で不要なので無効化 */
.ks-entries-table--patrol td.ks-furi-cell.has-furi {
  background: transparent !important;
  color: inherit;
  font-weight: inherit;
}

/* 印 (鉄/妙/消) のアイコン化は上部 .ks-mark の本定義に統合済み */

/* ---------- 設定ページ: グループ補足注釈 ---------- */
.ks-settings-group__note {
  margin: 0 0 6px;
  padding: 8px 12px;
  background: var(--ks-surface-tint);
  border-left: 3px solid var(--ks-primary-mid);
  border-radius: var(--ks-radius);
  font-size: 12px;
  line-height: 1.6;
  color: var(--ks-text-mid);
}
.ks-settings-group__note strong { color: var(--ks-primary-dark); font-weight: 600; }


/* ============================================================
 * v12 追加 (2026-05-22)
 *   - レース帯: クラス + レース名称の併記
 *   - パトロールチェック: マーク左に「1〜3走前 日付/コース」表示
 * ============================================================ */

/* ---------- レース帯: クラス pill + レース名 ---------- */
.ks-race__name {
  display: flex;
  align-items: baseline;
  gap: 10px;
  flex-wrap: wrap;
}
.ks-race__class {
  display: inline-block;
  background: var(--ks-primary);
  color: #fff;
  font-family: var(--ks-font-serif);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 1.2px;
  padding: 3px 10px;
  border-radius: 3px;
  white-space: nowrap;
  flex-shrink: 0;
}
/* G1/G2/G3 は強調色 (赤帯) */
.ks-race__class:where([data-grade="G1"], [data-grade="G2"], [data-grade="G3"]) {
  background: #b03a3a;
}
.ks-race__title {
  font-family: var(--ks-font-serif);
  font-size: 16px;
  font-weight: 600;
  color: var(--ks-text);
  letter-spacing: 0.5px;
}

/* ---------- パトセル: メタ (日付/コース) + マーク群 ---------- */
.ks-pat-cell {
  display: flex;
  flex-direction: column;
  gap: 4px;
  align-items: flex-start;
}
.ks-pat-cell__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px;
  font-family: var(--ks-font-mono);
  font-size: 12px;
  font-weight: 500;
  color: var(--ks-text-mute);
  letter-spacing: 0;
  line-height: 1.3;
}
.ks-pat-cell__date {
  color: var(--ks-text-mid);
  font-weight: 600;
}
.ks-pat-cell__course {
  color: var(--ks-text-mute);
  background: var(--ks-surface-tint);
  padding: 1px 6px;
  border-radius: 2px;
}
/* has-furi の濃色背景はマーク化で不要 → 念のため上書き済みだが、
   メタも黄背景にならないようさらに保証 */
.ks-entries-table--patrol td.ks-furi-cell.has-furi .ks-pat-cell__meta {
  background: transparent;
}

/* モバイル: メタは1行で詰めて表示 */
@media (max-width: 720px) {
  .ks-pat-cell__meta { font-size: 11px; gap: 4px; }
  .ks-pat-cell__course { padding: 0 4px; }
}


/* ============================================================
 * v13 追加 (2026-05-22)
 *   - オリジナル注目馬テーブル: 行クリックで該当レースへジャンプ
 * ============================================================ */

.ks-table--attention tbody tr.ks-attn-row {
  cursor: pointer;
  transition: background .12s, box-shadow .12s;
}
.ks-table--attention tbody tr.ks-attn-row:hover {
  background: var(--ks-primary-light) !important;
  box-shadow: inset 3px 0 0 var(--ks-primary);
}
.ks-table--attention tbody tr.ks-attn-row:focus {
  outline: none;
  background: var(--ks-primary-light) !important;
  box-shadow: inset 3px 0 0 var(--ks-primary), 0 0 0 2px rgba(45, 134, 89, 0.2);
}
.ks-table--attention tbody tr.ks-attn-row::after {
  /* ホバー時の右側「→」アイコン用余白 */
  content: '';
}
.ks-table--attention tbody tr.ks-attn-row td:last-child {
  position: relative;
}
.ks-table--attention tbody tr.ks-attn-row:hover td:last-child::after {
  content: '›';
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--ks-primary);
  font-size: 18px;
  font-weight: 700;
  line-height: 1;
}

/* 回収率セル色付けはサロン表と同じクラスを流用 */
.ks-table--attention tbody td.ks-recovery--warm {
  color: #c0392b !important;
  font-weight: 700;
}
.ks-table--attention tbody td.ks-recovery--hot {
  color: #ffffff !important;
  background: #c0392b !important;
  font-weight: 700;
}
.ks-table--attention tbody tr.ks-attn-row:hover td.ks-recovery--hot {
  background: #a02d22 !important;
}


/* ============================================================
 * v14 追加 (2026-05-22)
 *   - パトロールチェック: 着順バッジ + bottom row レイアウト
 *   - サロン出馬表: 性齢/斤量/間隔列の見た目
 * ============================================================ */

/* 着順バッジ */
.ks-pat-cell__row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  row-gap: 4px;
}
.ks-pat-cell__finish {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 32px;
  height: 22px;
  padding: 0 6px;
  border-radius: 11px;
  font-family: var(--ks-font-mono);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0;
  background: transparent;
  color: var(--ks-text);
  border: 1px solid var(--ks-border);
  white-space: nowrap;
}
/* 着順バッジ 2026-05-22 v17:
   1着=薄赤 / 2着=薄青 / 3着=薄黄 / 4着以下=枠のみ */
.ks-pat-cell__finish--1      { background: #fde7e7; color: #8a1c1c; border-color: #f1b3b3; }
.ks-pat-cell__finish--podium { background: transparent; color: var(--ks-text); border: 1px solid var(--ks-border); }
/* podium 内訳 (PHP 側はまだ podium 分岐なので、追加クラスで個別指定) */
.ks-pat-cell__finish--2      { background: #e3f0fb; color: #1f4d80; border-color: #b2d2ee; }
.ks-pat-cell__finish--3      { background: #fdf6c8; color: #6a4400; border-color: #ead681; }
.ks-pat-cell__finish--mid    { background: transparent; color: var(--ks-text-mid); border: 1px solid var(--ks-border); }
.ks-pat-cell__finish--low    { background: transparent; color: var(--ks-text-mid); border: 1px solid var(--ks-border); }

/* サロン出馬表: 性齢 / 斤量 / 間隔 (中央寄せ + 等幅) */
.ks-entries-table--salon td.ks-pc-only.is-center {
  text-align: center;
  padding-left: 4px;
  padding-right: 4px;
  font-size: 14px;
  color: var(--ks-text-mid);
}

/* 間隔 15週以上 (長期休養明け) は灰色背景でフラグ */
.ks-entries-table--salon td.ks-interval--long {
  background: #d4d4d4 !important;
  color: #4a4a4a !important;
  font-weight: 700;
}
.ks-entries-table--salon tbody tr:hover td.ks-interval--long {
  background: #bdbdbd !important;
}


/* ============================================================
 * v15 デザイン最適化 (2026-05-22)
 *   - 川田の勝負レース カードを Stat-Card 化 (推定回収率を巨大数字に)
 *   - レース帯のタップ affordance 強化
 *   - 注目馬テーブル: → を常時表示
 *   - サロン表/パト表: モバイル sticky 馬名列 + 横スクロール影
 *   - パトマーク 余/非ｽﾑ/砂被 を警告色強調
 *   - 場所タブ pill 化 / 発走時刻バッジ化
 * ============================================================ */


/* ---------- 川田の勝負レース カード: 能力・回収率 両方を表示 ---------- */
.ks-pick-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 16px 22px 14px;
  border-left-width: 5px;
  transition: box-shadow .15s, transform .15s, border-left-color .15s;
}
.ks-pick-card:hover {
  box-shadow: 0 6px 20px rgba(20,59,37,0.14);
  transform: translateY(-2px);
  border-left-color: var(--ks-primary);
}
.ks-pick-card__axis {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.ks-pick-card__horse-name {
  flex: 1;
  min-width: 0;
  font-size: 17px;
  font-weight: 600;
  line-height: 1.25;
  white-space: normal;
  word-break: keep-all;
  overflow-wrap: anywhere;
}

/* 2 メトリクス並列 */
.ks-pick-card__stats2 {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.ks-pick-card__stat {
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 5px 10px;
  border-radius: 7px;
  background: var(--ks-surface-tint);
  border: 1px solid var(--ks-border);
}
.ks-pick-card__stat-label {
  font-size: 10px;
  color: var(--ks-text-mute);
  letter-spacing: 1px;
  font-weight: 500;
}
.ks-pick-card__stat-val {
  font-family: var(--ks-font-serif);
  font-size: 20px;
  font-weight: 700;
  color: var(--ks-text);
  letter-spacing: 0.3px;
  line-height: 1;
}
.ks-pick-card__stat--rec.ks-pick-card__rec--warm {
  background: #fff3e0;
  border-color: #f0c08a;
}
.ks-pick-card__stat--rec.ks-pick-card__rec--warm .ks-pick-card__stat-val { color: #c0392b; }
.ks-pick-card__stat--rec.ks-pick-card__rec--hot {
  background: #fff8c2;
  border-color: #e8c84a;
}
.ks-pick-card__stat--rec.ks-pick-card__rec--hot .ks-pick-card__stat-val { color: #c0392b; }

/* 古い classes を無効化 (DOM 残置で衝突防止) */
.ks-pick-card__substats,
.ks-pick-card__stats,
.ks-pick-card__main,
.ks-pick-card__rec { display: none !important; }

.ks-pick-card__arrow {
  position: absolute;
  right: 14px;
  bottom: 10px;
  color: var(--ks-text-faint);
  font-size: 22px;
  font-weight: 700;
  line-height: 1;
  transition: color .15s, transform .15s;
}
.ks-pick-card:hover .ks-pick-card__arrow {
  color: var(--ks-primary);
  transform: translateX(3px);
}

/* ヒモ多数時 (最大7頭) の折り返し対応 — 現状でも flex-wrap 効くがマージン調整 */
.ks-pick-card__himo {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-wrap: wrap;
  padding-right: 24px;     /* arrow の領域確保 */
}
.ks-pick-card__himo-label { flex-shrink: 0; }


/* ---------- レース帯 タップ affordance ---------- */
.ks-race__chevron {
  font-size: 16px;
  color: var(--ks-primary);
  width: 18px;
  font-weight: 700;
  transition: transform .15s;
}
.ks-race.is-open .ks-race__chevron { transform: rotate(0); }
.ks-race__head { min-height: 64px; }
.ks-race__time {
  background: var(--ks-primary-light);
  color: var(--ks-primary-dark);
  padding: 6px 12px;
  border-radius: 8px;
  border: 1px solid rgba(45, 134, 89, 0.18);
  font-weight: 600;
}
.ks-race.is-open .ks-race__time {
  background: var(--ks-primary);
  color: #fff;
  border-color: var(--ks-primary);
}

/* ---------- 場所タブ pill 化 ---------- */
.ks-venue-tabs__inner { gap: 8px; padding: 8px 20px; }
.ks-venue-tab {
  border-radius: 999px;
  padding: 8px 18px;
  background: var(--ks-surface);
  border: 1px solid var(--ks-border);
  letter-spacing: 0.5px;
  transition: background .12s, color .12s, border-color .12s;
}
.ks-venue-tab:hover {
  background: var(--ks-surface-tint);
  border-color: var(--ks-primary-mid);
}
.ks-venue-tab.is-active {
  background: var(--ks-primary);
  color: #fff;
  border-color: var(--ks-primary);
  font-weight: 600;
}
.ks-venue-tab.is-active .ks-venue-tab__count { color: rgba(255,255,255,0.85); }


/* ---------- 注目馬テーブル → を常時表示 ---------- */
.ks-table--attention tbody tr.ks-attn-row td:last-child {
  position: relative;
  padding-right: 28px;
}
.ks-table--attention tbody tr.ks-attn-row td:last-child::after {
  content: '›';
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--ks-text-faint);
  font-size: 20px;
  font-weight: 700;
  line-height: 1;
  transition: color .12s, transform .12s;
}
.ks-table--attention tbody tr.ks-attn-row:hover td:last-child::after {
  color: var(--ks-primary);
  transform: translateY(-50%) translateX(3px);
}


/* ---------- パトマーク 余/非ｽﾑ/砂被 を YHS=警告 として赤系に ---------- */
.ks-pat-mark--yoryoku    { background: #c0392b; }   /* 余 (YHS) 警告赤 */
.ks-pat-mark--hisumu     { background: #a83432; }   /* 非ｽﾑ (YHS) 警告赤 */
.ks-pat-mark--sunakaburi { background: #8b2c2c; }   /* 砂被 (YHS) 警告焦茶赤 */


/* ---------- ks-block__scroll に右端フェード影 (横スクロール可能のヒント) ---------- */
.ks-block__scroll {
  position: relative;
}
.ks-block__scroll::after {
  content: '';
  position: absolute;
  top: 0; right: 0; bottom: 0;
  width: 24px;
  pointer-events: none;
  background: linear-gradient(to right, rgba(255,255,255,0), rgba(255,255,255,0.85));
  opacity: 0;
  transition: opacity .15s;
}
.ks-block__scroll.is-scrollable::after { opacity: 1; }


/* ---------- 行コントラスト: zebra (PC のみ; モバイルはノイズになるので無効) ---------- */
@media (min-width: 721px) {
  .ks-entries-table--salon tbody tr:nth-child(even) td,
  .ks-entries-table--patrol tbody tr:nth-child(even) td {
    background: #fafaf7;
  }
  .ks-entries-table--salon tbody tr:nth-child(even):hover td,
  .ks-entries-table--patrol tbody tr:nth-child(even):hover td {
    background: var(--ks-surface-tint);
  }
}
/* 能力上位ハイライト・回収率ホット背景は zebra より優先 (既存 !important で担保) */


/* ============================================================
 * v16 モバイル全面再構築 (2026-05-22)
 *   - 勝負レースカード: badge を絶対配置で右上に
 *   - 出馬表/パト表: sticky 解除 (細幅×多列で破綻するため)
 *   - パト表: 横スクロール許可 + 1走前のみ常時表示、2-3走前は折り畳み
 *   - レース帯のレイアウト調整
 * ============================================================ */

/* ---------- 勝負レースカード モバイル: 縦積み + バッジ右上絶対配置 ---------- */
@media (max-width: 720px) {
  .ks-pick-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }
  .ks-pick-card {
    position: relative;
    padding: 14px 16px 14px 14px;
    border-left-width: 4px;
  }
  .ks-pick-card__head {
    padding-right: 80px;        /* 右上バッジぶんスペース確保 */
  }
  .ks-pick-card__main {
    display: block;             /* flex を解除して縦並びに */
    padding-right: 80px;
  }
  .ks-pick-card__axis {
    width: 100%;
    margin-bottom: 0;
  }
  .ks-pick-card__horse-name {
    font-size: 16px;
    font-weight: 600;
  }
  /* バッジを右上に絶対配置: 馬名と被らず、視覚的に主役を維持 */
  .ks-pick-card__rec {
    position: absolute;
    top: 12px;
    right: 12px;
    padding: 4px 10px;
    min-width: 64px;
  }
  .ks-pick-card__rec-num { font-size: 22px; }
  .ks-pick-card__rec-unit { font-size: 12px; }
  .ks-pick-card__arrow {
    right: 12px;
    bottom: 10px;
    font-size: 22px;
  }
  .ks-pick-card__himo {
    margin-top: 6px;
    padding-right: 24px;        /* arrow 用スペース */
  }
}


/* ---------- レース帯 モバイル: タップ領域 + 時刻バッジ ---------- */
@media (max-width: 720px) {
  .ks-race__head {
    min-height: 56px;
    padding: 12px 14px;
    gap: 10px;
  }
  .ks-race__chevron {
    font-size: 18px;
    width: 14px;
    flex-shrink: 0;
  }
  .ks-race__rnum {
    font-size: 19px;
    min-width: 34px;
    flex-shrink: 0;
  }
  .ks-race__meta {
    min-width: 0;
  }
  .ks-race__name {
    gap: 6px;
    flex-wrap: nowrap;
    overflow: hidden;
  }
  .ks-race__class {
    font-size: 11px;
    padding: 2px 7px;
    flex-shrink: 0;
  }
  .ks-race__title {
    font-size: 15px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
  }
  .ks-race__sub {
    font-size: 12px;
    margin-top: 2px;
  }
  .ks-race__time {
    padding: 5px 10px;
    font-size: 14px;
    min-width: 56px;
    flex-shrink: 0;
  }
}


/* ---------- 場所タブ モバイル: 縮小 ---------- */
@media (max-width: 720px) {
  .ks-venue-tabs__inner {
    padding: 8px 12px;
    overflow-x: auto;
    flex-wrap: nowrap;
    -webkit-overflow-scrolling: touch;
  }
  .ks-venue-tab {
    padding: 6px 14px;
    font-size: 12px;
    flex-shrink: 0;
  }
}


/* ---------- 出馬表/パトロール モバイル: コンパクト化 ---------- */
@media (max-width: 720px) {
  /* 全セル詰めて表示 */
  .ks-entries-table--salon th,
  .ks-entries-table--patrol th {
    padding: 8px 4px;
    font-size: 11px;
    letter-spacing: 0;
    line-height: 1.2;
  }
  .ks-entries-table--salon td,
  .ks-entries-table--patrol td {
    padding: 7px 4px;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.35;
  }
  .ks-entries-table--salon tbody td,
  .ks-entries-table--patrol tbody td {
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0;
  }
  .ks-entries-table--salon td.is-name,
  .ks-entries-table--patrol td.is-name {
    font-size: 13px;
    font-weight: 600;
    padding-left: 6px;
    min-width: 88px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  /* 印 / 馬番 を小さく */
  .ks-mark {
    width: 22px;
    height: 22px;
    line-height: 19px;
    font-size: 12px;
    border-width: 1px;
  }
  .ks-num.ks-num--sm {
    width: 22px;
    height: 22px;
    font-size: 11px;
  }
  /* セル幅: 印 / 馬番 を超コンパクトに */
  .ks-entries-table--salon th:nth-child(1),
  .ks-entries-table--salon td:nth-child(1),
  .ks-entries-table--patrol th:nth-child(1),
  .ks-entries-table--patrol td:nth-child(1) {
    width: 32px;
    padding-left: 2px;
    padding-right: 2px;
  }
  .ks-entries-table--salon th:nth-child(2),
  .ks-entries-table--salon td:nth-child(2),
  .ks-entries-table--patrol th:nth-child(2),
  .ks-entries-table--patrol td:nth-child(2) {
    width: 34px;
    padding-left: 1px;
    padding-right: 1px;
  }
}


/* ---------- パトマーク モバイル時の縮小 ---------- */
@media (max-width: 720px) {
  .ks-pat-mark {
    min-width: 20px;
    height: 20px;
    line-height: 20px;
    padding: 0 3px;
    font-size: 11px;
  }
  .ks-pat-marks { gap: 1px; }
  .ks-pat-cell__finish {
    min-width: 28px;
    height: 19px;
    padding: 0 5px;
    font-size: 11px;
  }
  .ks-pat-cell__meta {
    font-size: 10px;
    gap: 4px;
  }
  .ks-pat-cell__course {
    padding: 0 4px;
    font-size: 10px;
  }
}


/* ---------- 注目馬テーブル モバイル: 横スクロール想定で詰める ---------- */
@media (max-width: 720px) {
  .ks-table {
    font-size: 13px;
    font-weight: 600;
    min-width: 540px;        /* PC の min-width: 600px より気持ち縮める */
  }
  .ks-table th {
    padding: 8px 6px;
    font-size: 11px;
    letter-spacing: 0.5px;
  }
  .ks-table td {
    padding: 8px 6px;
    font-size: 13px;
  }
}


/* ---------- 出馬表ブロック モバイル: 余白詰め ---------- */
@media (max-width: 720px) {
  .ks-entries {
    padding: 10px;
    gap: 10px;
  }
  .ks-block__title {
    padding: 8px 12px;
    font-size: 13px;
    letter-spacing: 1px;
  }
}


/* ---------- セクション見出し モバイル ---------- */
@media (max-width: 720px) {
  .ks-section { padding: 20px 0 16px; }
  .ks-section__head {
    padding: 0 16px;
    flex-wrap: wrap;
    gap: 4px;
  }
  .ks-section__title { font-size: 20px; }
  .ks-section__lead { font-size: 11px; }
  .ks-section__hint { font-size: 11px; }
}


/* ---------- 日付バー モバイル: ボタン縮小 ---------- */
@media (max-width: 720px) {
  .ks-datebar__inner {
    padding: 10px 14px;
    flex-wrap: wrap;
    gap: 8px;
  }
  .ks-datebar__actions {
    flex-wrap: wrap;
    gap: 6px;
  }
  .ks-btn-icon {
    padding: 6px 10px;
    font-size: 12px;
  }
  .ks-date-input {
    font-size: 12px;
    padding: 5px 8px;
  }
}


/* ---------- ヘッダー モバイル: ブランド名圧縮 ---------- */
@media (max-width: 480px) {
  .ks-brand__name { font-size: 17px; letter-spacing: 1.5px; }
}


/* ============================================================
 * v17 追加 (2026-05-22)
 *   - プログラムツールバー: 並び順 / 次のレース / 目次トグル
 *   - 目次 TOC
 *   - 注目馬テーブル: 列幅最適化
 *   - モバイル 出馬表/パト表 列幅圧縮 + パト能力/回収/オッズ非表示
 * ============================================================ */

/* ---------- 共通 pill ボタン ---------- */
.ks-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--ks-surface);
  border: 1px solid var(--ks-border);
  border-radius: 999px;
  padding: 6px 14px;
  font-size: 13px;
  font-weight: 500;
  color: var(--ks-text);
  cursor: pointer;
  text-decoration: none;
  font-family: inherit;
  transition: background .12s, color .12s, border-color .12s;
}
.ks-pill:hover {
  background: var(--ks-surface-tint);
  border-color: var(--ks-primary-mid);
}
.ks-pill.is-active {
  background: var(--ks-primary);
  border-color: var(--ks-primary);
  color: #fff;
  font-weight: 600;
}
.ks-pill--accent {
  background: var(--ks-accent);
  border-color: var(--ks-accent);
  color: #fff;
  font-weight: 600;
}
.ks-pill--accent:hover {
  background: #b89967;
  border-color: #b89967;
  color: #fff;
}


/* ---------- プログラムツールバー ---------- */
.ks-program-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 16px;
  background: var(--ks-surface);
  border: 0.5px solid var(--ks-border);
  border-radius: var(--ks-radius);
  margin-bottom: 12px;
}
.ks-program-toolbar__group {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.ks-program-toolbar__label {
  font-size: 12px;
  color: var(--ks-text-mute);
  letter-spacing: 1px;
  margin-right: 4px;
}


/* ---------- 目次 (TOC) ---------- */
.ks-toc {
  background: var(--ks-surface);
  border: 0.5px solid var(--ks-border);
  border-radius: var(--ks-radius);
  margin-bottom: 16px;
  overflow: hidden;
  transition: max-height .25s ease, opacity .15s, margin .15s;
}
.ks-toc.is-collapsed {
  max-height: 0;
  border-width: 0;
  margin: 0;
  opacity: 0;
}
.ks-toc__inner {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 4px 8px;
  padding: 12px 16px;
}
.ks-toc__head {
  grid-column: 1 / -1;
  font-family: var(--ks-font-serif);
  font-size: 14px;
  font-weight: 600;
  color: var(--ks-primary-dark);
  letter-spacing: 1px;
  padding: 8px 0 4px;
  border-bottom: 0.5px solid var(--ks-border-soft);
  margin-bottom: 2px;
}
.ks-toc__head:first-child { padding-top: 0; }
.ks-toc__item {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 8px;
  border-radius: 4px;
  text-decoration: none;
  font-size: 13px;
  color: var(--ks-text);
  border: 1px solid transparent;
  transition: background .12s, border-color .12s;
}
.ks-toc__item:hover {
  background: var(--ks-primary-light);
  border-color: var(--ks-primary-mid);
}
.ks-toc__item.is-target {
  background: var(--ks-accent);
  color: #fff;
}
.ks-toc__time {
  font-family: var(--ks-font-mono);
  font-size: 13px;
  font-weight: 600;
  color: var(--ks-primary-dark);
  min-width: 42px;
}
.ks-toc__item.is-target .ks-toc__time { color: #fff; }
.ks-toc__venue {
  font-weight: 500;
  color: var(--ks-text);
}
.ks-toc__item.is-target .ks-toc__venue { color: #fff; }
.ks-toc__rnum {
  font-family: var(--ks-font-serif);
  color: var(--ks-primary);
  font-weight: 600;
}
.ks-toc__item.is-target .ks-toc__rnum { color: #fff; }
.ks-toc__cls {
  font-size: 10px;
  background: var(--ks-surface-tint);
  color: var(--ks-text-mid);
  padding: 1px 5px;
  border-radius: 3px;
  margin-left: auto;
  letter-spacing: 1px;
}
.ks-toc__item.is-target .ks-toc__cls {
  background: rgba(255,255,255,0.22);
  color: #fff;
}


/* ---------- 注目馬テーブル: 列幅最適化 (v17 fix) ----------
   table-layout: auto (デフォルト) を使い、各列に min-width / nowrap だけ与える。
   table-layout: fixed では全体幅が圧縮されて省略表記が多発するので使わない。 */
.ks-table--attention { table-layout: auto; width: 100%; min-width: 0; }
.ks-table--attention th,
.ks-table--attention td {
  white-space: nowrap;
  padding-left: 10px;
  padding-right: 10px;
}
.ks-table--attention th:nth-child(1),
.ks-table--attention td:nth-child(1) { min-width: 42px; }     /* 印 */
.ks-table--attention th:nth-child(2),
.ks-table--attention td:nth-child(2) { min-width: 70px; }     /* レース */
.ks-table--attention th:nth-child(3),
.ks-table--attention td:nth-child(3) { min-width: 48px; }     /* 馬番 */
.ks-table--attention th:nth-child(4),
.ks-table--attention td:nth-child(4) { min-width: 180px; }    /* 馬名 (省略しない) */
.ks-table--attention th:nth-child(5),
.ks-table--attention td:nth-child(5) { min-width: 52px; }     /* 性齢 */
.ks-table--attention th:nth-child(6),
.ks-table--attention td:nth-child(6) { min-width: 52px; }     /* 斤量 */
.ks-table--attention th:nth-child(7),
.ks-table--attention td:nth-child(7) { min-width: 94px; }     /* 能力偏差値 */
.ks-table--attention th:nth-child(8),
.ks-table--attention td:nth-child(8) { min-width: 94px; }     /* 推定回収率 */
.ks-table--attention th:nth-child(9),
.ks-table--attention td:nth-child(9) { min-width: 86px; }     /* 推定オッズ */
.ks-table--attention th:nth-child(10),
.ks-table--attention td:nth-child(10) { min-width: 64px; }    /* パト */


/* ---------- ソート可能ヘッダ (列名クリックでソート) ---------- */
.ks-th-sort {
  cursor: pointer;
  user-select: none;
  position: relative;
  padding-right: 16px !important;
}
.ks-th-sort::after {
  content: '↕';
  position: absolute;
  right: 4px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 10px;
  opacity: 0.4;
}
.ks-th-sort.is-asc::after  { content: '↑'; opacity: 1; color: var(--ks-accent); }
.ks-th-sort.is-desc::after { content: '↓'; opacity: 1; color: var(--ks-accent); }
.ks-th-sort:hover { background: rgba(255,255,255,0.06); }


/* ---------- 「次のレース」ジャンプ ハイライト ---------- */
.ks-race.is-next-target {
  outline: 3px solid var(--ks-accent);
  outline-offset: -2px;
  animation: ks-next-flash 1.2s ease;
}
@keyframes ks-next-flash {
  0%   { box-shadow: 0 0 0 0 rgba(200, 167, 122, 0.6); }
  100% { box-shadow: 0 0 0 16px rgba(200, 167, 122, 0); }
}


/* ============================================================
 * モバイル: パト表で 能力/回収/オッズ列を非表示
 * (サロン表と重複しているため)
 * ============================================================ */
@media (max-width: 720px) {
  .ks-entries-table--patrol th:nth-child(4),
  .ks-entries-table--patrol td:nth-child(4),
  .ks-entries-table--patrol th:nth-child(5),
  .ks-entries-table--patrol td:nth-child(5),
  .ks-entries-table--patrol th:nth-child(6),
  .ks-entries-table--patrol td:nth-child(6) {
    display: none;
  }
}


/* ============================================================
 * モバイル サロン表 列幅 強圧縮 (380px に収める)
 * ============================================================ */
@media (max-width: 720px) {
  .ks-entries-table--salon {
    table-layout: fixed;
    width: 100%;
  }
  /* 印=28 馬番=30 馬名=auto-shrink 能力=52 回収=58 オッズ=52 パト=30 */
  .ks-entries-table--salon th:nth-child(1),
  .ks-entries-table--salon td:nth-child(1) { width: 28px; }
  .ks-entries-table--salon th:nth-child(2),
  .ks-entries-table--salon td:nth-child(2) { width: 30px; }
  .ks-entries-table--salon th:nth-child(3),
  .ks-entries-table--salon td:nth-child(3) {
    width: auto;
    min-width: 70px;
    max-width: 100px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  /* 9-12 列の数値セル */
  .ks-entries-table--salon th:nth-child(9),
  .ks-entries-table--salon td:nth-child(9) { width: 48px; }   /* 能力偏差値 */
  .ks-entries-table--salon th:nth-child(10),
  .ks-entries-table--salon td:nth-child(10) { width: 56px; }  /* 推定回収率 */
  .ks-entries-table--salon th:nth-child(11),
  .ks-entries-table--salon td:nth-child(11) { width: 50px; }  /* 推定オッズ */
  .ks-entries-table--salon th:nth-child(12),
  .ks-entries-table--salon td:nth-child(12) { width: 32px; }  /* パト */

  .ks-entries-table--salon th,
  .ks-entries-table--salon td {
    padding: 6px 2px;
    font-size: 12px;
  }
  .ks-entries-table--salon tbody td {
    font-size: 12px;
    font-weight: 600;
  }
  .ks-entries-table--salon thead th {
    font-size: 10px;
    line-height: 1.1;
  }
}


/* ============================================================
 * モバイル パト表 列幅 (能力/回収/オッズ列を隠した 6 列で構成)
 *   印 馬番 馬名 1走前 2走前 3走前
 * ============================================================ */
@media (max-width: 720px) {
  .ks-entries-table--patrol {
    table-layout: fixed;
    width: 100%;
  }
  .ks-entries-table--patrol th:nth-child(1),
  .ks-entries-table--patrol td:nth-child(1) { width: 28px; }
  .ks-entries-table--patrol th:nth-child(2),
  .ks-entries-table--patrol td:nth-child(2) { width: 30px; }
  .ks-entries-table--patrol th:nth-child(3),
  .ks-entries-table--patrol td:nth-child(3) {
    width: auto;
    min-width: 64px;
    max-width: 92px;
  }
  .ks-entries-table--patrol th:nth-child(7),
  .ks-entries-table--patrol td:nth-child(7),
  .ks-entries-table--patrol th:nth-child(8),
  .ks-entries-table--patrol td:nth-child(8),
  .ks-entries-table--patrol th:nth-child(9),
  .ks-entries-table--patrol td:nth-child(9) { width: auto; }

  .ks-entries-table--patrol th,
  .ks-entries-table--patrol td {
    padding: 5px 3px;
    font-size: 11px;
  }
  .ks-entries-table--patrol tbody td {
    font-size: 11px;
    font-weight: 600;
  }
  .ks-entries-table--patrol thead th {
    font-size: 10px;
    line-height: 1.1;
  }
  /* パトセル詰める */
  .ks-pat-cell { gap: 1px; }
  .ks-pat-cell__meta {
    font-size: 9px;
    gap: 3px;
  }
  .ks-pat-cell__course {
    padding: 0 3px;
    font-size: 9px;
  }
  .ks-pat-mark {
    min-width: 18px;
    height: 18px;
    line-height: 18px;
    font-size: 10px;
    padding: 0 2px;
  }
  .ks-pat-cell__finish {
    min-width: 24px;
    height: 17px;
    padding: 0 4px;
    font-size: 10px;
  }
}


/* ---------- 注目馬テーブル モバイル: 横スクロール許容 + 必要列を狭く ---------- */
@media (max-width: 720px) {
  .ks-table--attention {
    min-width: 660px;     /* 馬名圧迫しないために最低横幅確保 */
  }
}


/* ---------- プログラムツールバー モバイル: 縦積み ---------- */
@media (max-width: 720px) {
  .ks-program-toolbar {
    flex-direction: column;
    align-items: stretch;
    padding: 10px 12px;
    gap: 8px;
  }
  .ks-program-toolbar__group {
    flex-wrap: wrap;
    gap: 5px;
  }
  .ks-pill {
    padding: 5px 10px;
    font-size: 12px;
  }
  .ks-toc__inner {
    grid-template-columns: 1fr 1fr;
    padding: 10px 12px;
  }
}


/* ============================================================
 * v13 (2026-05-25) 追記 — タイポ / 数値 / フォーカス / フィルタ
 *  / 凡例モーダル / モバイル下部ナビ / 空状態 / マイクロインタラクション
 * ============================================================ */

/* ---------- 1. タイポグラフィ強化 (Serif見出し) ---------- */
.ks-section__title,
.ks-pick-card__head .ks-pick-card__cls,
.ks-page-title,
.ks-mypage-section__title {
  font-family: var(--ks-font-serif);
  letter-spacing: 0.01em;
}
.ks-section__lead {
  font-family: var(--ks-font-serif);
  font-style: italic;
  letter-spacing: 0.18em;
  color: var(--ks-accent-dark);
  text-transform: uppercase;
}

/* ---------- 2. タブラー数字 (数値カラム整列) ---------- */
.ks-mono,
.ks-num,
.ks-entries-table .is-right,
.ks-toc__time,
.ks-pick-card__stat-val,
.ks-pat-cell__date,
.ks-pat-cell__finish,
.ks-mark,
.ks-num--sm,
.ks-row-rank-1 td.is-right,
.ks-row-rank-2 td.is-right,
.ks-row-rank-3 td.is-right {
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
}
.ks-entries-table,
.ks-table {
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
}

/* ---------- 3. 回収率「ホット / ウォーム」強度UP ---------- */
.ks-recovery--hot {
  background: linear-gradient(180deg, #fff7df 0%, #ffe599 100%);
  color: #8a3a00;
  font-weight: 800;
  border-radius: 4px;
  padding: 1px 6px;
  box-shadow: inset 0 0 0 1px rgba(212,160,32,0.25);
  position: relative;
}
.ks-recovery--warm {
  background: rgba(255, 222, 153, 0.42);
  color: #8a5a00;
  font-weight: 700;
  border-radius: 4px;
  padding: 1px 5px;
}
@media (prefers-reduced-motion: no-preference) {
  .ks-recovery--hot {
    animation: ksRecPulse 2.4s ease-in-out infinite;
  }
  @keyframes ksRecPulse {
    0%, 100% { box-shadow: inset 0 0 0 1px rgba(212,160,32,0.25); }
    50%      { box-shadow: inset 0 0 0 1px rgba(212,160,32,0.55), 0 0 6px rgba(212,160,32,0.3); }
  }
}
/* 川田PICKSカード上の Hot/Warm */
.ks-pick-card__stat--rec.ks-pick-card__rec--hot .ks-pick-card__stat-val {
  background: linear-gradient(180deg, #fff7df 0%, #ffe599 100%);
  color: #8a3a00;
  padding: 2px 8px;
  border-radius: 6px;
  font-weight: 800;
}
.ks-pick-card__stat--rec.ks-pick-card__rec--warm .ks-pick-card__stat-val {
  background: rgba(255, 222, 153, 0.5);
  color: #8a5a00;
  padding: 2px 8px;
  border-radius: 6px;
  font-weight: 700;
}

/* ---------- 4. アクセシビリティ: フォーカスリング統一 ---------- */
a:focus-visible,
button:focus-visible,
.ks-pill:focus-visible,
.ks-venue-tab:focus-visible,
.ks-pick-card:focus-visible,
.ks-toc__item:focus-visible,
.ks-race__head:focus-visible,
.ks-chip:focus-visible,
.ks-block__legend-btn:focus-visible,
.ks-modal__close:focus-visible,
.ks-tabbar__item:focus-visible {
  outline: 2px solid var(--ks-accent);
  outline-offset: 2px;
  border-radius: 6px;
}
/* フォーカスリング: 暗背景 (ヘッダー上) */
.ks-site-header a:focus-visible,
.ks-site-header button:focus-visible {
  outline-color: #f8e3b8;
}

/* コントラスト改善: --ks-text-faint を AAA 寄りに */
.ks-text-faint,
.ks-pick-card__stat-label,
.ks-pat-cell__date,
.ks-pat-cell__course,
.ks-pat-cell__meta,
.ks-toc__cls {
  color: #6b7a72;
}

/* ---------- 5. クイックフィルタ (チップ) ---------- */
.ks-program-filters {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  background: #ffffff;
  border: 1px solid var(--ks-border-soft);
  border-radius: var(--ks-radius-lg);
  margin: 0 0 12px;
}
.ks-program-filters__label {
  font-size: 11px;
  font-weight: 700;
  color: var(--ks-text-mid);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-right: 4px;
}
.ks-chip {
  display: inline-flex;
  align-items: center;
  padding: 5px 11px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  background: #f6faf7;
  color: var(--ks-text);
  border: 1px solid var(--ks-border-soft);
  cursor: pointer;
  transition: all .15s ease;
  font-variant-numeric: tabular-nums;
}
.ks-chip:hover { background: #eaf3ed; }
.ks-chip[aria-pressed="true"] {
  background: linear-gradient(180deg, #1a5d3a 0%, #143b25 100%);
  color: #ffffff;
  border-color: #143b25;
  box-shadow: inset 0 -2px 0 rgba(0,0,0,0.18);
}
.ks-chip--clear {
  background: transparent;
  color: var(--ks-text-mute);
  border-style: dashed;
}
.ks-chip--clear:hover { background: #f0f4f1; color: var(--ks-text); }

/* フィルタで除外されたレース行 */
.ks-race.is-filtered-out { display: none !important; }

/* ---------- 6. 凡例モーダル ---------- */
.ks-modal[hidden] { display: none !important; }
.ks-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.ks-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(20, 59, 37, 0.45);
  backdrop-filter: blur(2px);
}
.ks-modal__panel {
  position: relative;
  background: #ffffff;
  border-radius: 14px;
  max-width: 560px;
  width: 100%;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 50px rgba(0,0,0,0.25);
  overflow: hidden;
  animation: ksModalIn .18s ease-out;
}
@keyframes ksModalIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}
.ks-modal__head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--ks-border-soft);
}
.ks-modal__title {
  margin: 0;
  font-family: var(--ks-font-serif);
  font-size: 17px;
  font-weight: 600;
  color: var(--ks-primary);
  flex: 1;
}
.ks-modal__close {
  background: transparent;
  border: 0;
  font-size: 22px;
  color: var(--ks-text-mute);
  cursor: pointer;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}
.ks-modal__close:hover { background: var(--ks-surface-tint); }
.ks-modal__body {
  padding: 14px 18px 18px;
  overflow-y: auto;
}
.ks-legend-section { margin-bottom: 16px; }
.ks-legend-section__title {
  font-size: 11px;
  font-weight: 700;
  color: var(--ks-primary);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 6px;
}
.ks-legend-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 6px;
}
.ks-legend-list--grid {
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
}
.ks-legend-list li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 6px 8px;
  border-radius: 6px;
  background: var(--ks-surface-tint);
}
.ks-legend-list__txt {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 12px;
  line-height: 1.4;
}
.ks-legend-list__txt strong { color: var(--ks-text); }
.ks-legend-list__txt span   { color: var(--ks-text-mid); }
.ks-legend-note {
  margin: 8px 0 0;
  font-size: 11px;
  color: var(--ks-text-mute);
}
.ks-pat-mark--legend {
  background: var(--ks-accent);
  color: #fff;
}

/* 凡例ボタン (ブロック見出し) */
.ks-block__title {
  display: flex;
  align-items: center;
  gap: 8px;
}
.ks-block__legend-btn {
  margin-left: auto;
  padding: 3px 10px;
  font-size: 11px;
  background: var(--ks-surface-tint);
  color: var(--ks-primary);
  border: 1px solid var(--ks-border-soft);
  border-radius: 999px;
  cursor: pointer;
  transition: all .15s;
}
.ks-block__legend-btn:hover {
  background: var(--ks-primary-light);
  border-color: var(--ks-primary);
}

/* ---------- 7. 空状態 (Empty State) の上品化 ---------- */
.ks-empty {
  position: relative;
  background: #ffffff;
  border: 1px dashed var(--ks-border);
  border-radius: var(--ks-radius-lg);
  padding: 56px 32px;
  text-align: center;
  overflow: hidden;
}
.ks-empty::before {
  content: 'K';
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--ks-font-serif);
  font-size: 220px;
  font-weight: 600;
  color: rgba(26, 93, 58, 0.05);
  pointer-events: none;
  user-select: none;
}
.ks-empty__title {
  position: relative;
  font-family: var(--ks-font-serif);
  font-size: 18px;
  font-weight: 600;
  color: var(--ks-primary);
  margin-bottom: 6px;
}
.ks-empty > div:not(.ks-empty__title) {
  position: relative;
  color: var(--ks-text-mid);
  font-size: 13px;
}

/* ---------- 8. マイクロインタラクション ---------- */
.ks-pick-card,
.ks-attn-row,
.ks-toc__item,
.ks-venue-tab,
.ks-pill {
  transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
}
.ks-pick-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(26,93,58,0.10);
}
.ks-attn-row:hover { background: var(--ks-surface-tint); cursor: pointer; }
.ks-race {
  transition: box-shadow .2s ease;
}
.ks-race.is-open {
  box-shadow: 0 4px 12px rgba(26,93,58,0.06);
}
.ks-race__chevron {
  transition: transform .15s ease;
  display: inline-block;
}
.ks-race.is-open .ks-race__chevron {
  transform: rotate(0deg);
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ---------- 9. モバイル下部固定ナビバー ---------- */
.ks-tabbar {
  display: none;
}
@media (max-width: 720px) {
  .ks-tabbar {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 90;
    background: rgba(255,255,255,0.96);
    border-top: 1px solid var(--ks-border);
    backdrop-filter: blur(6px);
    padding-bottom: env(safe-area-inset-bottom, 0);
    box-shadow: 0 -2px 8px rgba(0,0,0,0.06);
  }
  .ks-tabbar__item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: 8px 6px;
    font-size: 10px;
    color: var(--ks-text-mid);
    text-decoration: none;
    background: transparent;
    border: 0;
    cursor: pointer;
    transition: color .15s;
  }
  .ks-tabbar__item.is-active { color: var(--ks-primary); }
  .ks-tabbar__icon {
    width: 22px;
    height: 22px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }
  .ks-tabbar__icon svg { width: 22px; height: 22px; stroke: currentColor; fill: none; stroke-width: 1.7; }
  body {
    padding-bottom: 64px;
  }
}

/* ---------- 10. レース行: 並び順切替時の差別化 ---------- */
.ks-row-rank-1 { background: rgba(255, 244, 199, 0.45); }
.ks-row-rank-2 { background: rgba(219, 234, 254, 0.40); }
.ks-row-rank-3 { background: rgba(209, 250, 229, 0.40); }


/* ============================================================
 * v13 — オンボーディングツアー
 * ============================================================ */
.ks-onb {
  position: fixed;
  inset: 0;
  z-index: 1050;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  animation: ksOnbIn .22s ease-out;
}
.ks-onb.is-closing {
  animation: ksOnbOut .15s ease-in forwards;
}
@keyframes ksOnbIn  { from { opacity: 0; } to { opacity: 1; } }
@keyframes ksOnbOut { from { opacity: 1; } to { opacity: 0; } }
.ks-onb__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(20,59,37,0.55);
  backdrop-filter: blur(3px);
}
.ks-onb__panel {
  position: relative;
  background: #ffffff;
  border-radius: 16px;
  max-width: 440px;
  width: 100%;
  padding: 22px 22px 18px;
  box-shadow: 0 24px 60px rgba(0,0,0,0.28);
  animation: ksOnbPanelIn .25s cubic-bezier(.2, .9, .3, 1.2);
}
@keyframes ksOnbPanelIn {
  from { transform: translateY(20px) scale(.96); opacity: 0; }
  to   { transform: translateY(0)    scale(1);   opacity: 1; }
}
.ks-onb__progress {
  display: flex;
  gap: 6px;
  margin-bottom: 16px;
}
.ks-onb__dot {
  flex: 1;
  height: 4px;
  border-radius: 999px;
  background: #e6efe9;
  transition: background .2s;
}
.ks-onb__dot.is-done    { background: #a8895e; }
.ks-onb__dot.is-current { background: #1a5d3a; }
.ks-onb__head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}
.ks-onb__title {
  margin: 0;
  font-family: var(--ks-font-serif);
  font-size: 19px;
  font-weight: 600;
  color: var(--ks-primary);
  flex: 1;
}
.ks-onb__close {
  background: transparent;
  border: 0;
  font-size: 22px;
  color: var(--ks-text-mute);
  cursor: pointer;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}
.ks-onb__close:hover { background: var(--ks-surface-tint); }
.ks-onb__body {
  margin: 0 0 16px;
  font-size: 13px;
  line-height: 1.7;
  color: var(--ks-text-mid);
}
.ks-onb__foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.ks-onb__skip {
  background: transparent;
  border: 0;
  font-size: 12px;
  color: var(--ks-text-mute);
  cursor: pointer;
  padding: 6px 10px;
  border-radius: 6px;
}
.ks-onb__skip:hover { color: var(--ks-text); background: var(--ks-surface-tint); }
.ks-onb__cta {
  background: linear-gradient(180deg, #1a5d3a 0%, #143b25 100%);
  color: #ffffff;
  border: 0;
  padding: 10px 22px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.05em;
  cursor: pointer;
  transition: transform .12s, box-shadow .12s;
}
.ks-onb__cta:hover { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(26,93,58,0.30); }
.ks-onb__cta:focus-visible { outline: 3px solid rgba(200,167,122,0.6); outline-offset: 2px; }


/* ============================================================
 * v13.1 — 法定ページ (terms / privacy) と status-card
 * ============================================================ */
.ks-legal__body {
  max-width: 720px;
  background: #ffffff;
  border: 1px solid var(--ks-border-soft);
  border-radius: 12px;
  padding: 22px 26px;
}
.ks-legal__section {
  margin-bottom: 18px;
}
.ks-legal__section:last-of-type { margin-bottom: 6px; }
.ks-legal__section h3 {
  font-family: var(--ks-font-serif);
  font-size: 14px;
  font-weight: 600;
  color: var(--ks-primary);
  margin: 0 0 6px;
  letter-spacing: 0.02em;
}
.ks-legal__section p,
.ks-legal__section li {
  font-size: 13px;
  color: var(--ks-text);
  line-height: 1.8;
}
.ks-legal__section ul { padding-left: 20px; margin: 4px 0; }
.ks-legal__date {
  text-align: right;
  font-size: 11px;
  color: var(--ks-text-mute);
  margin-top: 22px;
  letter-spacing: 0.05em;
}

/* 確認系ステータスカード */
.ks-status-card {
  max-width: 460px;
  margin: 0 auto;
  background: #ffffff;
  border: 1px solid var(--ks-border-soft);
  border-radius: 14px;
  padding: 36px 32px 28px;
  text-align: center;
  box-shadow: 0 6px 16px rgba(26,93,58,0.06);
}
.ks-status-card.is-success {
  color: #15803d;
  border-color: rgba(22,163,74,0.30);
}
.ks-status-card.is-error {
  color: #b91c1c;
  border-color: rgba(220,38,38,0.30);
}
.ks-status-card__icon {
  display: inline-flex;
  width: 56px;
  height: 56px;
  margin-bottom: 12px;
}
.ks-status-card__icon svg { width: 56px; height: 56px; }
.ks-status-card__title {
  font-family: var(--ks-font-serif);
  font-size: 20px;
  font-weight: 600;
  color: var(--ks-text);
  margin-bottom: 6px;
}
.ks-status-card__text {
  font-size: 13px;
  color: var(--ks-text-mid);
  line-height: 1.7;
  margin-bottom: 18px;
}
.ks-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 22px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-decoration: none;
  transition: transform .12s, box-shadow .12s;
}
.ks-btn--primary {
  background: linear-gradient(180deg, var(--ks-primary) 0%, var(--ks-primary-dark) 100%);
  color: #ffffff;
}
.ks-btn--primary:hover { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(26,93,58,0.30); color: #ffffff; }


/* v14.1: レース見出しに「競馬場名」prefix を追加 */
.ks-race__rnum {
  /* 既存の serif 22px / 色は維持しつつ、横並びに venue を追加 */
  display: inline-flex;
  align-items: baseline;
  white-space: nowrap;
  min-width: 0;                  /* 旧 min-width:44px を解除 */
  flex: 0 0 auto;
}
.ks-race__venue {
  display: inline-block;
  font-family: var(--ks-font-serif);
  font-size: 0.78em;             /* rnum 22px に対し ~17px */
  font-weight: 600;
  color: var(--ks-primary);
  letter-spacing: 0.04em;
  padding-right: 8px;
  margin-right: 8px;
  border-right: 1px solid var(--ks-border);
  line-height: 1;
}
.ks-race__venue:empty { display: none; }
@media (max-width: 720px) {
  .ks-race__venue {
    font-size: 0.72em;
    padding-right: 5px;
    margin-right: 5px;
  }
}


/* === KS-2026-05-25 U-1 出馬表 全開/全閉ツールバー === */
.ks-races__toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin: 12px 0 16px;
  padding: 10px 14px;
  background: #faf7f0;
  border: 1px solid #e6e0d0;
  border-radius: 6px;
}
.ks-races__btn {
  padding: 7px 14px;
  font-size: 13px;
  font-weight: 600;
  background: #fff;
  border: 1px solid #c4b58e;
  color: #5a4d2a;
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}
.ks-races__btn:hover {
  background: #c4b58e;
  color: #fff;
}
.ks-races__btn:focus {
  outline: 2px solid #b89762;
  outline-offset: 2px;
}
.ks-races__hint {
  font-size: 11.5px;
  color: #888;
  letter-spacing: 0.04em;
  margin-left: auto;
}
@media (max-width: 520px) {
  .ks-races__hint { display: none; }
  .ks-races__toolbar { padding: 8px 10px; }
  .ks-races__btn { padding: 6px 10px; font-size: 12.5px; }
}


/* === KS-2026-05-26 BALANCE LABELS === */
/* 推定回収率カスタマイズ: 的中率重視は左端、回収率重視は右端に配置 */
.ks-balance-bar__label--left  { text-align: left; }
.ks-balance-bar__label--right { text-align: right; }


/* === KS-2026-05-26 MOBILE TABLE FIX === */
/* スマホでサロン出馬表・パトロールチェックの列幅・余白を最適化 */
@media (max-width: 720px) {
  /* スクロール領域に明示的な hint */
  .ks-block__scroll {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
  }
  /* テーブル全体: 文字小 + パディング詰める */
  .ks-entries-table--salon,
  .ks-entries-table--patrol {
    font-size: 11px;
    min-width: 100%;
    width: max-content;       /* 列幅は内容に合わせる、無理な圧縮なし */
  }
  .ks-entries-table--salon th,
  .ks-entries-table--patrol th,
  .ks-entries-table--salon td,
  .ks-entries-table--patrol td {
    padding: 6px 5px !important;
    font-size: 11px;
    white-space: nowrap;
  }
  /* 馬名は折返し許可 */
  .ks-entries-table--salon td.is-name,
  .ks-entries-table--patrol td.is-name {
    white-space: normal;
    word-break: keep-all;
    min-width: 80px;
    max-width: 110px;
    font-size: 11.5px;
    font-weight: 500;
  }
  /* 印・馬番列をコンパクトに */
  .ks-entries-table--salon thead th:nth-child(1),
  .ks-entries-table--patrol thead th:nth-child(1) { min-width: 28px; }
  .ks-entries-table--salon thead th:nth-child(2),
  .ks-entries-table--patrol thead th:nth-child(2) { min-width: 32px; }

  /* 数字列は等幅 */
  .ks-entries-table--salon td.is-right,
  .ks-entries-table--patrol td.is-right { font-variant-numeric: tabular-nums; }

  /* sticky 「印・馬番・馬名」の3列を左固定 (横スクロール時もずっと見える) */
  .ks-entries-table--salon thead th:nth-child(1),
  .ks-entries-table--salon tbody td:nth-child(1),
  .ks-entries-table--patrol thead th:nth-child(1),
  .ks-entries-table--patrol tbody td:nth-child(1) {
    position: sticky; left: 0; z-index: 2;
    background: var(--ks-surface, #fff);
  }
  .ks-entries-table--salon thead th:nth-child(2),
  .ks-entries-table--salon tbody td:nth-child(2),
  .ks-entries-table--patrol thead th:nth-child(2),
  .ks-entries-table--patrol tbody td:nth-child(2) {
    position: sticky; left: 28px; z-index: 2;
    background: var(--ks-surface, #fff);
  }
  .ks-entries-table--salon thead th:nth-child(3),
  .ks-entries-table--salon tbody td:nth-child(3),
  .ks-entries-table--patrol thead th:nth-child(3),
  .ks-entries-table--patrol tbody td:nth-child(3) {
    position: sticky; left: 60px; z-index: 2;
    background: var(--ks-surface, #fff);
    box-shadow: 2px 0 4px -2px rgba(0,0,0,0.15);
  }
  /* thead の固定列も z-index アップ */
  .ks-entries-table--salon thead th:nth-child(-n+3),
  .ks-entries-table--patrol thead th:nth-child(-n+3) {
    z-index: 3;
  }
  /* パトロールチェックの furi-cell は最低限の幅確保 */
  .ks-entries-table--patrol td.ks-furi-cell {
    min-width: 80px;
    padding: 4px !important;
  }
}
