/* 基本色・フォント */
.wx {
  --brand: #16a34a;
  --blue: #0ea5e9;
  --bg: #f7f9fb;
  --text: #1f2937;
  --muted: #64748b;
  --card: #fff;
}

.wx {
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
}

/* テーブル系の共通変数 */
:root {
  --hour-head-h: 32px;      /* 1時間毎：日/時ヘッダ */
  --tenday-head-h: 34px;    /* 10日：日ヘッダ */
  --tenday-wx-row-h: 44px;  /* 10日：天気行 */
  --hour-wx-row-h: 36px;    /* 1時間毎：天気行 */
}

.wx .wx-container {
  max-width: 80rem;
  margin-inline: auto;
  padding-inline: 12px;
}

/* ヘッダー */
.wx .wx-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(255,255,255,.9);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid #e5e7eb;
}
.wx .wx-header__inner {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-block: 8px;
}
.wx .wx-logo {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  background: var(--brand);
}
.wx .wx-header__title {
  font-weight: 700;
}

/* セクション/見出し */
.wx .wx-section {
  padding-block: 14px;
}
.wx .wx-h1 {
  font-size: 20px;
  font-weight: 700;
  margin: 0 0 4px;
}
.wx .wx-h2 {
  font-size: 18px;
  font-weight: 700;
  margin: 0 0 8px;
}
.wx .wx-muted {
  color: var(--muted);
}
.wx .wx-small {
  font-size: 12px;
  color: #64748b;
}

/* カード */
.wx .wx-card {
  background: var(--card);
  border-radius: 16px;
  box-shadow: 0 2px 8px rgba(16,24,40,.06);
  padding: 12px;
  border: 1px solid #eef2f7;
}

/* グリッド */
.wx .wx-grid-2 {
  display: grid;
  gap: 12px;
}
@media (min-width:768px) {
  .wx .wx-grid-2 {
    grid-template-columns: 1fr 1fr;
  }
}

.wx .wx-grid-3 {
  display: grid;
  gap: 12px;
}
@media (min-width:768px) {
  .wx .wx-grid-3 {
    grid-template-columns: 1fr 1fr 1fr;
  }
}

.wx .wx-grid-5 {
  display: grid;
  gap: 8px;
  grid-template-columns: 1fr 1fr;
}
@media (min-width:900px) {
  .wx .wx-grid-5 {
    grid-template-columns: repeat(5,1fr);
  }
}

/* 他競馬場リンク（上部 共通スタイル） */
.wx .wx-venues-strip {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 4px 2px 10px;
  scroll-snap-type: x proximity;
  -webkit-overflow-scrolling: touch;
  -webkit-mask-image: linear-gradient(
    to right,
    black 0,
    black calc(100% - 12px),
    transparent 100%
  );
  mask-image: linear-gradient(
    to right,
    black 0,
    black calc(100% - 12px),
    transparent 100%
  );
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.wx .wx-venues-strip::-webkit-scrollbar {
  display: none;
}

/* 各競馬場のチップ */
.wx .wx-venuechip {
  flex: 0 0 auto;
  scroll-snap-align: start;
  display: inline-flex;          /* アイコン＋テキストを横並び1列に */
  align-items: center;
  gap: 6px;
  /* min-width: 120px;*/
  padding: 8px 8px;
  border-radius: 999px;
  border: 1px solid #e5e7eb;
  background: #ffffff;
  color: #0f172a !important;
  text-decoration: none !important;
  box-shadow: 0 1px 4px rgba(15,23,42,.06);
  font-size: 13px;
  line-height: 1;
  transition:
    background-color .15s ease,
    border-color .15s ease,
    box-shadow .15s ease,
    transform .15s ease;
}

/* チップ内の天気アイコンを横に並べる用 */
.wx .wx-venuechip img {
  width: 20px;
  height: 20px;
  object-fit: contain;
  flex: 0 0 auto;
}

.wx .wx-venuechip .name {
  display: inline-block;
  font-weight: 600;
  white-space: nowrap;
}

/* ホバー / フォーカスで少し浮かせる */
.wx .wx-venuechip:hover,
.wx .wx-venuechip:focus-visible {
  background: #f0fdf4;
  border-color: #bbf7d0;
  box-shadow: 0 4px 12px rgba(15,23,42,.08);
  transform: translateY(-1px);
  outline: none;
}

.wx .wx-venuechip.is-current {
  background: #16a34a;          /* 緑ベタ */
  border-color: #16a34a;
  color: #ffffff !important;
  cursor: default;
  box-shadow: 0 0 0 1px rgba(22,163,74,.35);
  transform: none;
}

/* ホバー時も変化させない */
.wx .wx-venuechip.is-current:hover,
.wx .wx-venuechip.is-current:focus-visible {
  background: #16a34a;
  border-color: #16a34a;
  box-shadow: 0 0 0 1px rgba(22,163,74,.35);
  transform: none;
}

/* PC 幅でも同じ見た目になるように（念のため） */
@media (min-width:1024px) {
  .wx .wx-venuechip.is-current {
    box-shadow: 0 0 0 1px rgba(22,163,74,.35);
  }
}


/* 下部 他競馬場カード */
.wx-card.wx-venue {
  display: flex;
  align-items: center;
  gap: .5rem;
}
.wx-miniicon {
  width: 18px;
  height: 18px;
  object-fit: contain;
}

/* 下部 他競馬場カードの色付け */

.wx .wx-venue.is-current {
  background: #ecfdf5;          /* 薄い緑 */
  border-color: #16a34a;
  cursor: default;
}

.wx .wx-venue.is-current .wx-muted {
  color: #166534;
  font-weight: 600;
}


/* タブ（ピル） */
.wx .wx-tabs--pills {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}
.wx .wx-pillbtn {
  padding: .35rem .75rem;
  border: 1px solid #e5e7eb;
  border-radius: 999px;
  background: #fff;
  font-size: 14px;
  color: #334155;
}
.wx .wx-pillbtn.is-active {
  background: #f0fdf4;
  border-color: #16a34a;
  color: #166534;
}

/* アンケートタブ：色切替 */
.wx #sec-survey .wx-tabs--pills .wx-pillbtn.is-active[data-survey="hot"] {
  background: #fee2e2;
  border-color: #fca5a5;
  color: #7f1d1d;
}
.wx #sec-survey .wx-tabs--pills .wx-pillbtn.is-active[data-survey="cold"] {
  background: #e0f2fe;
  border-color: #7dd3fc;
  color: #0c4a6e;
}

/* ========= 共通テーブル基礎 ========= */
.wx table.wx-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  table-layout: auto;
}
.wx table.wx-table th,
.wx table.wx-table td {
  border-bottom: 1px solid #eef2f7;
  border-right: 1px solid #eef2f7;
  padding: 6px 6px;
  text-align: center;
  vertical-align: middle;
  white-space: nowrap;
  line-height: 1.15;
}
.wx table.wx-table tr > *:last-child {
  border-right: none;
}
.wx .wx-col-date {
  font-weight: 700;
  color: #111827;
  text-align: left;
}
.wx .wx-col-date small {
  display: inline;       /* 改行させない */
  margin-left: 6px;
  color: #64748b;
  font-weight: 500;
  line-height: 1;
  white-space: nowrap;
}
.wx .wx-col-hour {
  min-width: 40px;
}
.wx .wx-wxicon {
  width: 22px;
  height: 22px;
}
@media (min-width:480px) {
  .wx .wx-wxicon {
    width: 24px;
    height: 24px;
  }
}

/* ===== 1時間毎：分割テーブル（圧縮） ===== */
.wx .wx-hourly-wrap {
  display: flex;
  align-items: stretch;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  background: #fff;
  overflow: hidden;
}
.wx .wx-hourly-left {
  flex: 0 0 auto;
  background: #f8fafc;
  border-right: 1px solid #e5e7eb;
}
.wx .wx-table-left--hourly {
  min-width: 44px;
  table-layout: fixed;
}
.wx .wx-table-left--hourly th,
.wx .wx-table-left--hourly td {
  border-right: none;
  padding: 4px 6px;
  text-align: left;
  font-weight: 700;
  color: #475569;
  font-size: 12px;
}
.wx .wx-hourly-right {
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  contain: content;       /* 再レイアウト抑制 */
}
.wx .wx-table-right--hourly {
  min-width: 560px;
}
.wx .wx-table-right--hourly thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: transparent;
}
.wx .wx-table-right--hourly th,
.wx .wx-table-right--hourly td {
  padding: 4px 5px;
  font-size: 12px;
}

/* 交互背景（列単位） */
.wx .wx-day-a {
  background: #ffffff !important;
}
.wx .wx-day-b {
  background: #f8fafc !important;
}
/* 「日」行の縦罫線は右側テーブルでは消す */
.wx .wx-table-right--hourly thead tr:first-child > th {
  border-right: none !important;
}

/* 1時間毎：日・時ヘッダ行高を左右で揃える */
.wx .wx-table-left--hourly thead th,
.wx .wx-table-right--hourly thead th {
  height: var(--hour-head-h);
}

/* 1時間毎：天気行（1行目）の高さを左右で揃える */
.wx .wx-table-left--hourly tbody tr:nth-child(1) > *,
.wx .wx-table-right--hourly tbody tr:nth-child(1) > * {
  height: var(--hour-wx-row-h);
  vertical-align: middle;
}

/* ===== 10日：分割テーブル ===== */
.wx .wx-tenday-wrap {
  display: flex;
  align-items: stretch;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  background: #fff;
  overflow: hidden;
}
.wx .wx-tenday-left {
  flex: 0 0 auto;
  background: #f8fafc;
  border-right: 1px solid #e5e7eb;
}
.wx .wx-table-left--tenday {
  min-width: 64px;
  table-layout: fixed;
}
.wx .wx-table-left--tenday th,
.wx .wx-table-left--tenday td {
  border-right: none;
  padding: 8px 10px;
  text-align: left;
  font-weight: 700;
  color: #475569;
}
.wx .wx-tenday-right {
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  contain: content;
}
.wx .wx-table-right--tenday thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: transparent;
}
.wx .wx-table-right--tenday th,
.wx .wx-table-right--tenday td {
  padding: 8px 8px;
}

/* 10日表ヘッダの高さを左右で揃える */
.wx .wx-table-left--tenday thead th,
.wx .wx-table-right--tenday thead th {
  height: var(--tenday-head-h);
}

/* 10日テーブル：天気行（1行目）の高さを左右で揃える */
.wx .wx-table-left--tenday tbody tr:nth-child(1) > *,
.wx .wx-table-right--tenday tbody tr:nth-child(1) > * {
  height: var(--tenday-wx-row-h);
  vertical-align: middle;
}

.wx .wx-wxicon--tenday {
  width: 28px;
  height: 28px;
}

/* 10日表の強調色 */
.wx .wx-hot {
  color: #ef4444;
  font-weight: 700;
}
.wx .wx-cold {
  color: #2563eb;
  font-weight: 700;
}

/* 10日カードを内容幅にフィットさせる（10日タブ時のみ） */
@media (min-width:900px) {
  .wx #wx-forecast-card.is-narrow {
    display: inline-block;
    width: auto;
    max-width: 100%;
  }
  .wx #wx-forecast-card.is-narrow .wx-tenday-wrap {
    display: inline-flex;
    max-width: 100%;
  }
  .wx #wx-forecast-card.is-narrow .wx-tenday-right {
    flex: 0 0 auto;
    max-width: 100%;
    overflow: auto;
  }
  .wx #wx-forecast-card.is-narrow .wx-table-right--tenday.wx-table {
    width: max-content !important;
    table-layout: auto;
    display: inline-table;
  }
  .wx #wx-forecast-card.is-narrow .wx-tenday-left {
    flex: 0 0 auto;
  }
}

/* 風向アイコン（風が向かう方位で回転） */
.wx .wx-warr-td {
  display: flex;
  gap: 4px;
  justify-content: center;
  align-items: center;
}
.wx .wx-warr {
  display: inline-block;
  width: 12px;
  height: 12px;
  transform: rotate(var(--deg,0deg));
}
.wx .wx-warr::before {
  content: "";
  display: block;
  width: 0;
  height: 0;
  border: 6px solid transparent;
  border-bottom-color: var(--blue);
  transform: translateY(-2px);
}

/* ▼ + 風速 をスマホだけ縦積みにして横幅を圧縮 */
@media (max-width:767.98px) {
  .wx .wx-warr-td {
    flex-direction: column;
    gap: 2px;
  }
  .wx .wx-warr-td span:last-child {
    font-size: 11px;
    line-height: 1.1;
  }
  /* 4行目「風」の行高を2行分に合わせて左右で揃える */
  .wx .wx-table-left--hourly tbody tr:nth-child(4) > *,
  .wx .wx-table-right--hourly tbody tr:nth-child(4) > * {
    height: 40px;
    vertical-align: middle;
  }
}

/* 風 × コース */
.wx .wx-track {
  position: relative;
  aspect-ratio: 16/9;
  border: 1px solid #bbf7d0;
  border-radius: 12px;
  overflow: hidden;
  background: #fff;
}
.wx .wx-track__img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #fff;
}
.wx .wx-track__overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: flex-start;
  justify-content: flex-start;
  padding: 12px;
  z-index: 3; /* 見出しチップ等 */
}
.wx .wx-wind-now {
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: flex-start;
}
.wx .wx-chip {
  font-size: 12px;
  color: #334155;
  background: rgba(255,255,255,.85);
  border-radius: 6px;
  padding: 2px 6px;
  border: 1px solid #e5e7eb;
}

/* トラック上に載せる風場のキャンバス */
.wx .wx-windfield {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 2;
}
.wx .wx-windcanvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  filter: drop-shadow(0 0 1px rgba(0,0,0,.15));
  mix-blend-mode: normal;
  image-rendering: optimizeQuality;
}

/* レジェンド（右上） */
.wx .wx-windlegend {
  position: absolute;
  right: 8px;
  top: 8px;
  z-index: 3;
  background: rgba(255,255,255,.85);
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 6px 8px;
  font-size: 12px;
  color: #334155;
}
.wx .wx-windlegend .row {
  display: flex;
  align-items: center;
  gap: 6px;
}
/* 風速バー */
.wx .wx-windlegend .chip {
  width: 24px;
  height: 2px;
  background: linear-gradient(to right,rgba(125,211,252,.18),rgba(2,132,199,.98));
  box-shadow: 0 0 0 1px rgba(2,132,199,.25) inset;
}

/* 画像とバーを縦に（カード幅＝画像幅に揃う） */
.wx .wx-trackgroup {
  display: block;
}

/* バーは画像の直下・カード幅にフィット */
.wx .wx-windbar {
  position: static;
  width: 100%;
  margin-top: 10px;
  padding: 10px 12px;
  background: rgba(241,245,249,.92);
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  backdrop-filter: blur(4px);
  box-sizing: border-box;
}

.wx .wx-range {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 12px;
  border-radius: 999px;
  background:
    linear-gradient(to right,rgba(59,130,246,.15),rgba(59,130,246,.15)) padding-box,
    #e5e7eb border-box;
  border: 1px solid #dbe1e8;
  outline: none;
  position: relative;
}

/* つまみ */
.wx .wx-range::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #fff;
  border: 1px solid #cbd5e1;
  box-shadow: 0 2px 8px rgba(0,0,0,.15),0 0 0 4px rgba(59,130,246,.20);
  margin-top: -6px;
}
.wx .wx-range::-moz-range-thumb {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #fff;
  border: 1px solid #cbd5e1;
  box-shadow: 0 2px 8px rgba(0,0,0,.15),0 0 0 4px rgba(59,130,246,.20);
}

/* OSMクレジット（画像の右下に常時表示） */
.wx .wx-osm-attrib {
  position: absolute;
  right: 8px;
  bottom: 8px;
  z-index: 4;
  background: rgba(255,255,255,.85);
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  padding: 2px 6px;
  font-size: 12px;
  line-height: 1.2;
  color: #334155;
}
.wx .wx-osm-attrib a {
  color: inherit;
  text-decoration: underline;
}

/* OSMクレジット：モバイルでは少し縮小 */
@media (max-width:767.98px) {
  .wx .wx-osm-attrib {
    font-size: 10px;
    padding: 1px 4px;
    border-radius: 5px;
  }
}

/* PC：風×コースカードの幅調整+文字サイズ微調整 */
@media (min-width:1024px) {
  .wx #sec-windcourse .wx-card {
    width: 100%;
    margin-inline: 0;
  }
  .wx #sec-windcourse .wx-trackgroup {
    max-width: 100%;
    margin-inline: 0;
  }

  /* 時刻チップ＆レジェンドを少し大きく */
  .wx #sec-windcourse .wx-chip,
  .wx #sec-windcourse .wx-windlegend {
    font-size: 14px;
  }
}

/* 小さな表示 */
.wx .wx-loading,
.wx .wx-error {
  font-size: 13px;
  color: #475569;
}
.wx .wx-error {
  color: #b91c1c;
}

/* 傾向ブロック（pill） */
.wx .wx-subpills {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin: 4px 0 12px;
}
.wx .wx-subpill {
  padding: .25rem .6rem;
  border: 1px solid #e5e7eb;
  border-radius: 999px;
  background: #fff;
  font-size: 13px;
}
.wx .wx-subpill.is-active {
  background: #eef2ff;
  border-color: #c7d2fe;
  color: #3730a3;
}
/* 2行目：芝/ダートのときだけアクティブ色を差し替え */
.wx #wx-trend-surfaces .wx-subpill.is-active[data-surface="turf"] {
  background: #ecfdf5;
  border-color: #86efac;
  color: #166534;
}
.wx #wx-trend-surfaces .wx-subpill.is-active[data-surface="dirt"] {
  background: #fdf4e6;
  border-color: #d6a874;
  color: #7a4b12;
}

/* トレンド全体のトグル行 */
.wx .wx-trend-toggle-row {
  display: flex;
  flex-direction: column;
  margin: 4px 0 10px;
}
.wx .wx-trend-toggle-row > * {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

/* PC：トグルを横1行＋区切り線 */
@media (min-width:1024px) {
  .wx .wx-trend-toggle-row {
    flex-direction: row;
    align-items: center;
    gap: 24px;
  }
  .wx .wx-trend-toggle-row > * {
    flex-wrap: nowrap;
  }
  .wx .wx-trend-toggle-row > * + * {
    position: relative;
    padding-left: 18px;
  }
  .wx .wx-trend-toggle-row > * + *::before {
    content: "";
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 1px;
    height: 26px;
    background: #e5e7eb;
  }
}

/* SPだけ：芝/ダートボタンの横幅を広げる */
@media (max-width:767.98px) {
  .wx #wx-trend-surfaces .wx-subpill {
    min-width: 5.5em;
    text-align: center;
  }
}

/* ▼ SP詳細タブ（脚質 / 枠番 / 種牡馬） */
/* 詳細タブ行（脚質/枠番/種牡馬 ＋ 分析コラム） */
.wx .wx-trend-detail-tabs {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 4px 0 10px;
}

.wx .wx-trend-detail-tabs-left {
  display: flex;
  gap: 6px;
}

/* 分析コラムリンクは右端へ寄せる */
.wx .wx-trend-col-cta {
  margin-left: auto;
}

/* PC では詳細タブを非表示（レイアウトは従来通り3セクション表示） */
@media (min-width:768px) {
  .wx .wx-trend-detail-tabs {
    display: none;
  }
}


/* 傾向：カードレイアウト（共通） */
.wx .wx-trend-grid {
  display: grid;
  gap: 14px;
}

/* SP：横スワイプできるカルーセル */
@media (max-width:767.98px) {
  .wx .wx-trend-grid {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    padding: 4px 12px 8px;
    margin: 0 -12px;                 /* カードを左右いっぱいに広げる */
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;

    position: relative;

    /* 右端だけフェードさせるマスク */
    -webkit-mask-image: linear-gradient(
      to right,
      black 0,
      black calc(100% - 24px),
      transparent 100%
    );
    mask-image: linear-gradient(
      to right,
      black 0,
      black calc(100% - 24px),
      transparent 100%
    );
  }


  .wx .wx-trend-grid::-webkit-scrollbar {
    display: none;
  }

  /* 1ページぶんのスライド（端に次のカードがチラ見え） */
  .wx .wx-trend-sec {
    flex: 0 0 88%;                   /* 100% より少し狭くして隣を見切れさせる */
    scroll-snap-align: center;
    transition: transform .22s ease, opacity .22s ease;
    transform: scale(.96);
    opacity: .7;
  }
  .wx .wx-trend-sec.is-active {
    transform: scale(1);
    opacity: 1;
  }
}


/* タブレット?PC：従来のグリッドレイアウト */
@media (min-width:768px) {
  .wx .wx-trend-grid {
    display: grid;
    grid-template-columns: 1fr;
  }
}

/* 小さめノートPC(900?1023px)は2カラム */
@media (min-width:900px) and (max-width:1023.98px) {
  .wx .wx-trend-grid {
    grid-template-columns: repeat(2,1fr);
  }
}
/* PCフル幅は3カラム */
@media (min-width:1024px) {
  .wx .wx-trend-grid {
    grid-template-columns: repeat(3,1fr);
  }
}

/* PCでは脚質・枠・種牡馬のタイトル位置を揃える */
.wx .wx-trend-sec + .wx-trend-sec {
  margin-top: 12px;
}
@media (min-width:1024px) {
  .wx .wx-trend-sec + .wx-trend-sec {
    margin-top: 0;
  }
}

/* スマホだけ：各セクションの頭に同じ余白を付ける（脚質も枠番・種牡馬と揃える） */
@media (max-width:767.98px) {
  .wx .wx-trend-sec {
    margin-top: 12px;
  }
}


.wx .wx-trend-title {
  font-size: 14px;
  color: #475569;
  margin: 2px 0 6px;
}

/* カード本体（傾向） */
.wx .wx-card--trend {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border-radius: 12px;
  background: #fff !important;
  color: inherit;
}

/* 横棒メーター（勝/連/複） */
.wx .wx-trend--meter {
  display: block;
  padding: 12px;
}
.wx .wx-m-head {
  font-weight: 700;
  color: #111827;
  margin-bottom: 8px;
}
.wx .wx-m-body {
  display: flex;
  gap: 12px;
  align-items: center;
}
.wx .wx-meter {
  flex: 1;
  display: grid;
  gap: 6px;
}
.wx .wx-meter-row {
  display: flex;
  align-items: center;
  gap: 8px;
}
.wx .wx-meter-track {
  flex: 1;
  height: 22px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  background: #fff;
  overflow: hidden;
}
.wx .wx-meter-fill {
  height: 100%;
}

/* 色（勝=濃緑、連=中緑、複=淡緑） */
.wx .fill-win { background:#16a34a; }
.wx .fill-place2 { background:#22c55e; }
.wx .fill-place3 { background:#86efac; }

/* 右側の数値欄 */
.wx .wx-meter-vals {
  min-width: 110px;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 6px;
}
.wx .wx-meter-vals div {
  display: flex;
  justify-content: space-between;
  gap: 8px;
}
.wx .wx-meter-vals dt {
  color: #475569;
}
.wx .wx-meter-vals dd {
  margin: 0;
  font-variant-numeric: tabular-nums;
}

/* 1?3位を色分けして強調（はっきり金銀銅にする） */
.wx .wx-meter-vals dd.is-rank-1 {
  font-weight: 700;
  color: #eab308;
}
.wx .wx-meter-vals dd.is-rank-2 {
  font-weight: 700;
  color: #9ca3af;
}
.wx .wx-meter-vals dd.is-rank-3 {
  font-weight: 700;
  color: #b45309;
}

/* 枠色ドット（見出し左の●） */
.wx .wx-frame-dot {
  display: inline-block;
  width: .9em;
  height: .9em;
  border-radius: 999px;
  margin-right: 6px;
  vertical-align: -1px;
  border: 1px solid rgba(0,0,0,.18);
}

/* JRA枠色（●の色） */
.wx .wx-fc-1 { background:#ffffff; }
.wx .wx-fc-2 { background:#111111; }
.wx .wx-fc-3 { background:#ef4444; }
.wx .wx-fc-4 { background:#2563eb; }
.wx .wx-fc-5 { background:#facc15; }
.wx .wx-fc-6 { background:#16a34a; }
.wx .wx-fc-7 { background:#f97316; }
.wx .wx-fc-8 { background:#ec4899; }

/* 種牡馬順位：行内の丸バッジ */
.wx .wx-rankbadge {
  display: inline-grid;
  place-items: center;
  width: 1.35em;
  height: 1.35em;
  margin-right: 6px;
  border-radius: 999px;
  background: #e5edff;
  color: #1d4ed8;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}
.wx .wx-rankbadge::before {
  content: attr(data-n); /* 1?5 を表示 */
}

/* 種牡馬ランキング用の注釈 */
.wx .wx-trend-sire-note {
  margin-top: 4px;
  font-size: 12px;
  color: #64748b;
  text-align: right;
}

/* ===== 種牡馬データなし時のプロモカード ===== */
.wx .wx-sire-promo {
  position: relative;
  padding: 0;
  border-radius: 12px;
  overflow: hidden;
}
.wx .wx-sire-promo__linkarea {
  position: relative;
  display: block;
  text-decoration: none;
  color: inherit;
}
.wx .wx-sire-promo__bg {
  display: block;
  width: 100%;
  height: auto;
}
/* blur の上にテキストをオーバーレイ */
.wx .wx-sire-promo__overlay {
  position: absolute;
  inset: 0;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: flex-start;
  gap: 4px;
  max-width: 260px;
  background: linear-gradient(
    to right,
    rgba(15,23,42,.80),
    rgba(15,23,42,.45),
    transparent
  );
  color: #f9fafb;
}
.wx .wx-sire-promo__kicker {
  margin: 0;
  font-size: 11px;
  letter-spacing: .03em;
  opacity: .9;
}
.wx .wx-sire-promo__title {
  margin: 0;
  font-size: 14px;
  font-weight: 700;
}
.wx .wx-sire-promo__text {
  margin: 2px 0 0;
  font-size: 12px;
  line-height: 1.6;
}
/* ボタン風ラベル */
.wx .wx-sire-promo__btn {
  margin-top: 6px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: 999px;
  background: #16a34a;
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  box-shadow: 0 2px 6px rgba(22,163,74,.4);
}
.wx .wx-sire-promo__btn::after {
  content: "＞";
  font-size: 13px;
}
/* ホバー時 */
.wx .wx-sire-promo__linkarea:hover .wx-sire-promo__btn {
  background: #22c55e;
  box-shadow: 0 4px 10px rgba(22,163,74,.5);
}
.wx .wx-sire-promo__linkarea:hover .wx-sire-promo__bg {
  transform: scale(1.02);
  transition: transform .18s ease-out;
}

/* 傾向データの注記（TARGET frontier JV） */
.wx .wx-trend-footnote {
  margin-top: 8px;
  text-align: right;
  font-size: 12px;
  color: #64748b;
}
.wx .wx-trend-footnote__main {
  margin: 0;
}
.wx .wx-trend-footnote__link {
  margin: 4px 0 0;
  display: none;
}
/* PCレイアウトのみリンクをボタン風に表示 */
@media (min-width:1024px) {
  .wx .wx-trend-footnote__link {
    display: block;
  }
  .wx .wx-trend-footnote__link a {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 999px;
    border: 1px solid #bbf7d0;
    background: #f0fdf4;
    color: #166534;
    font-weight: 700;
    text-decoration: none;
    box-shadow: 0 1px 3px rgba(16,24,40,.15);
    transition:
      background-color .15s ease,
      border-color .15s ease,
      box-shadow .15s ease,
      transform .15s ease;
  }
  .wx .wx-trend-footnote__link a::after {
    content: "＞";
    font-size: 14px;
  }
  .wx .wx-trend-footnote__link a:hover {
    background: #dcfce7;
    border-color: #22c55e;
    box-shadow: 0 4px 10px rgba(16,24,40,.18);
    transform: translateY(-1px);
  }
}

/* PCレイアウト：上部の他競馬場リンク
   - チップは横幅いっぱいを均等に分配
   - 並び順：函館 → 札幌 → 福島 → 新潟 → 東京 → 中山 → 中京 → 京都 → 阪神 → 小倉
   - スマホはベースCSSのスクロールレイアウトのまま */
@media (min-width:1024px) {
  .wx .wx-venues-strip {
    overflow-x: visible;
    overflow-y: visible;
    scroll-snap-type: none;
    -webkit-overflow-scrolling: auto;
    -webkit-mask-image: none;
    mask-image: none;

    display: flex;
    gap: 8px;
    justify-content: space-between;  /* 幅いっぱいを9等分っぽく見せる */
  }

  .wx .wx-venuechip {
    flex: 1 1 0;          /* ★ここでPCだけ均等幅にする */
    min-width: 0;
    justify-content: center;
    padding: 6px 8px;
    box-shadow: none;     /* 影は抑えめ */
    font-size: 13px;
  }

  .wx .wx-venuechip .name {
    font-size: 13px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  /* 並び順指定（PCだけ有効） */
  .wx .wx-venuechip[data-venue="sapporo"]   { order: 1; }
  .wx .wx-venuechip[data-venue="hakodate"]  { order: 2; }
  .wx .wx-venuechip[data-venue="fukushima"] { order: 3; }
  .wx .wx-venuechip[data-venue="niigata"]   { order: 4; }
  .wx .wx-venuechip[data-venue="tokyo"]     { order: 5; }
  .wx .wx-venuechip[data-venue="nakayama"]  { order: 6; }
  .wx .wx-venuechip[data-venue="chukyo"]    { order: 7; }
  .wx .wx-venuechip[data-venue="kyoto"]     { order: 8; }
  .wx .wx-venuechip[data-venue="hanshin"]   { order: 9; }
  .wx .wx-venuechip[data-venue="kokura"]    { order:10; }
}


/* アンケート：フッタ注記 */
.wx-survey-note {
  margin-top: 8px;
  text-align: right;
}

@media (max-width:767.98px) {

  /* 年号だけ非表示 */
  #sec-survey ol.wx-list-none > li:first-child > div > div:first-child .wx-muted {
    display: none;
  }

  #sec-survey ol.wx-list-none > li:first-child .wx-race-label,
  #sec-survey ol.wx-list-none > li:first-child .wx-horse-label {
    display: none;
  }

  #sec-survey ol.wx-list-none > li:first-child > div > div:nth-child(2) {
    color: transparent;  /* 高さだけ残す */
  }

  #sec-survey ol.wx-list-none > li:first-child > div > div:nth-child(2)::before {
    content: "[ レースへ ]をタップして\Aアプリで1位をチェック！";
    display: inline-block;
    color: #111827;
    font-weight: 700;
    white-space: pre-line;  /* 改行だけ維持 */
    line-height: 1.25;      /* 行間を少し詰める */
  }
}



/* ランキング1?3位のカード背景色（名レース＋フード共通） */
#sec-survey ol.wx-list-none > li:nth-child(1) {
  background: #fef9e7;
  border-color: #facc15;
}
#sec-survey ol.wx-list-none > li:nth-child(2) {
  background: #f5f5f6;
  border-color: #d4d4d8;
}
#sec-survey ol.wx-list-none > li:nth-child(3) {
  background: #fff1e5;
  border-color: #fdba74;
}

/* 「レースへ」ボタンの挙動説明チップ */
.wx .wx-appnote {
  margin-top: 8px;
  margin-bottom: 4px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: 999px;
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  color: #166534;
  font-size: 12px;
  line-height: 1.6;
}
/* 左側のスマホアイコン */
.wx .wx-appnote__icon {
  position: relative;
  width: 14px;
  height: 20px;
  border-radius: 3px;
  border: 1.4px solid #166534;
  box-sizing: border-box;
}
.wx .wx-appnote__icon::before {
  content: "";
  position: absolute;
  left: 3px;
  right: 3px;
  top: 3px;
  height: 1px;
  background: #166534;
  opacity: 0.4;
}
.wx .wx-appnote__icon::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 3px;
  transform: translateX(-50%);
  width: 6px;
  height: 2px;
  border-radius: 999px;
  background: #166534;
  opacity: 0.8;
}
.wx .wx-appnote__text {
  white-space: normal;
}
/* PC では「レースへ」補足を非表示 */
@media (min-width:1024px) {
  .wx .wx-appnote {
    display: none;
  }
}

/* 名レースランキングへのショートカット（スマホ専用） */
.wx .wx-survey-cta-wrap {
  display: none;  /* デフォルト非表示（PC含む） */
}
/* スマホ・タブレットのみ表示 */
@media (max-width:1023.98px) {
  .wx .wx-survey-cta-wrap {
    display: block;
  }
}

/* 細いピル型リンク（ニュートラルグレー） */
.wx .wx-survey-cta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 999px;
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  text-decoration: none;
  color: #111827;
  box-shadow: 0 1px 3px rgba(15,23,42,.06);
}
.wx .wx-survey-cta-label {
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.wx .wx-survey-cta-arrow {
  font-size: 12px;
  color: #6b7280;
  white-space: nowrap;
}
.wx .wx-survey-cta:active {
  background: #f3f4f6;
  box-shadow: 0 0 0 rgba(0,0,0,0);
}

/* 名レースランキング内のレイアウト（PC） */
@media (min-width:1024px) {
  /* アンカー位置補正 */
  #anchor-survey-races {
    scroll-margin-top: 72px;
  }

  /* 一覧自体の3カラム化など */
  #sec-survey ol.wx-list-none > li {
    display: grid !important;
    grid-template-columns: 34px minmax(0,1fr) auto;
    align-items: center;
    gap: 12px;
    padding: 8px 10px !important;
  }
  #sec-survey .wx-rankchip {
    display: inline-grid;
    place-items: center;
    width: 26px;
    height: 26px;
    border-radius: 999px;
    background: #e5edff;
    color: #1d4ed8;
    font-weight: 700;
  }
  #sec-survey ol.wx-list-none > li > div {
    display: grid;
    grid-template-columns: auto auto 1fr;
    column-gap: 1.5rem;
    align-items: flex-start;
    min-width: 0;
  }
  #sec-survey ol.wx-list-none > li > div > div {
    white-space: nowrap;
  }
  #sec-survey ol.wx-list-none > li > div > div:nth-child(1) {
    min-width: 10em;
  }
  #sec-survey ol.wx-list-none > li > div > div:nth-child(2) {
    min-width: 11em;
  }
  #sec-survey ol.wx-list-none > li > div > div:nth-child(3) {
    overflow: hidden;
    text-overflow: ellipsis;
  }
  #sec-survey ol.wx-list-none > li .wx-small {
    font-size: 13px;
  }
  /* PCでは「レースへ」ボタンは表示しない */
  #sec-survey ol.wx-list-none > li > a.wx-pillbtn {
    display: none !important;
  }
}

/* ページ全体のスクロール */
html {
  scroll-behavior: smooth;
}
/* モバイル?共通のずれ補正 */
#anchor-survey-races {
  scroll-margin-top: 64px;
}

/* ===== PCだけ見やすく詰める・幅を絞る・一覧性UP ===== */
@media (min-width:1024px) {
  /* 全体幅：1280px相当 → 1024px相当へ */
  .wx .wx-container {
    max-width: 64rem;
  }

  /* カードの密度を少し上げる（PCのみ） */
  .wx .wx-card {
    padding: 10px;
    border-radius: 14px;
  }

  /* テーブルの可読性強化 */
  .wx .wx-table-right--hourly th,
  .wx .wx-table-right--hourly td {
    font-size: 13px;
  }
  .wx .wx-table-right--tenday th,
  .wx .wx-table-right--tenday td {
    font-size: 14px;
  }
  .wx .wx-wxicon {
    width: 26px;
    height: 26px;
  }
  .wx .wx-wxicon--tenday {
    width: 30px;
    height: 30px;
  }

  /* 行高などの共通変数をPCで上書き（少しだけ余裕を持たせる） */
  :root {
    --hour-head-h: 34px;
    --hour-wx-row-h: 38px;
    --tenday-head-h: 36px;
    --tenday-wx-row-h: 46px;
  }

  /* 傾向カード：PCは3カラムで一覧性UP */
  .wx .wx-card--trend {
    padding: 10px;
  }
  .wx .wx-m-body {
    gap: 10px;
  }
  .wx .wx-meter-vals {
    min-width: 100px;
  }
}

/* コラムリンク（トグル行の右端） */
.wx .wx-trend-col-cta {
  margin-left: auto;
}

.wx .wx-col-link {
  border: none;
  background: transparent;
  color: #64748b;
  font-size: 12px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 4px;
}

.wx .wx-col-link__icon {
  font-size: 14px;
}

.wx .wx-col-link:hover,
.wx .wx-col-link:focus-visible {
  color: #111827;
  text-decoration: underline;
}


/* SPだけに出したい場合 */
@media (min-width:1024px) {
  .wx .wx-trend-col-cta {
    display: none;
  }
}

/* ▼ コラムモーダル：共通ベース設定（SP/PC共通） */
.wx-appfeature-modal {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: none;   /* 初期状態は非表示 */
}
.wx-appfeature-modal.is-open {
  display: block;  /* JSでこのクラスを付けたら表示 */
}

/* PC幅ではモーダル自体を使わない */
@media (min-width:1024px) {
  .wx-appfeature-modal {
    display: none !important;
  }
}


/* ▼ モーダル（SP想定） */
@media (max-width:1023.98px) {

  .wx-appfeature-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15,23,42,.45);
  }

  .wx-appfeature-dialog {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 90%;
    max-width: 360px;      /* 最大幅（ここで小さく制御） */
    max-height: 80%;
    background: #fff;
    border-radius: 16px;
    padding: 14px 14px 16px;
    box-shadow: 0 10px 40px rgba(15,23,42,.35);
    overflow-y: auto;
  }


  .wx-appfeature-close {
    position: absolute;
    right: 10px;
    top: 8px;
    background: transparent;
    border: none;
    font-size: 18px;
    line-height: 1;
    color: #64748b;
  }

  .wx-appfeature-list {
    margin: 10px 0 14px;
    display: grid;
    gap: 8px;
  }
  .wx-appfeature-item {
    padding: 8px 10px;
    border-radius: 10px;
    background: #f9fafb;
  }
  .wx-appfeature-item .badge {
    display: inline-block;
    font-size: 11px;
    padding: 2px 6px;
    border-radius: 999px;
    background: #dcfce7;
    color: #166534;
    margin-bottom: 3px;
  }
  .wx-appfeature-item .title {
    font-weight: 700;
    font-size: 14px;
    margin-bottom: 2px;
  }
  .wx-appfeature-item .desc {
    font-size: 12px;
    color: #64748b;
  }

  .wx-appfeature-btn {
    display: block;
    margin-top: 4px;
    text-align: center;
    padding: 10px 12px;
    border-radius: 999px;
    background: #16a34a;
    color: #fff;
    font-weight: 700;
    text-decoration: none;
    box-shadow: 0 4px 12px rgba(22,163,74,.45);
  }
}

/* 1行目：タブ + コラムボタンを横並びにする */
.wx .wx-trend-row-top {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 4px 0 12px;
}

/* 左側のタブは広く、右端にコラムボタン */
.wx .wx-trend-row-top .wx-tabs--pills {
  flex: 1 1 auto;
  margin-bottom: 0; /* 既存の余白を打ち消し */
}

/* 小カテゴリ（晴れ/曇り など）はラベル風にして控えめに */
.wx #wx-trend-filters .wx-subpill {
  border: 1px solid #e2e8f0;
  border-radius: 999px;
  background: #ffffff;
  padding: 2px 8px;
  font-size: 12px;
  color: #64748b;
}

.wx #wx-trend-filters .wx-subpill.is-active {
  background: #eef2ff;
  border-color: #c7d2fe;
  color: #3730a3;
}


/* 詳細タブ（脚質 / 枠番 / 種牡馬）は線だけのタブ風 */
.wx .wx-detailpill {
  border: none;
  border-bottom: 2px solid transparent;
  border-radius: 0;
  background: transparent;
  padding: 4px 6px;
  font-size: 13px;
  color: #6b7280;
}
.wx .wx-detailpill.is-active {
  border-bottom-color: #16a34a;
  font-weight: 600;
  color: #111827;
}

/* 傾向トグル行：ラベル付きのサブ行 */
.wx .wx-trend-group-label {
  font-size: 11px;
  color: #94a3b8;
  margin-right: 4px;
  white-space: nowrap;
}

/* ラベル付きサブ行（コース／条件） */
.wx .wx-trend-subrow {
  display: flex;
  align-items: center;
  gap: 6px;
}

/* 分析軸→コース、コース→条件の間隔を同じにする（SP/タブレットだけ） */
@media (max-width:1023.98px) {
  .wx .wx-trend-toggle-row .wx-trend-subrow {
    margin: 0 0 12px;
  }
  .wx .wx-trend-toggle-row .wx-trend-subrow:last-of-type {
    margin-bottom: 0;
  }

  /* サブピルの上下マージンはsubrow側で持つ */
  .wx .wx-trend-subrow .wx-subpills {
    margin: 0;
  }
}


/* 1行目（分析軸）の中で、タブ部分を広く取る */
.wx .wx-trend-row-top {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 4px 0 12px;
}
.wx .wx-trend-row-top .wx-tabs--pills {
  flex: 1 1 auto;
  margin-bottom: 0;
}

/* ▼ 傾向データ：スワイプヒント（SPのみ） */
.wx .wx-trend-swipehint {
  display: none;
}

@media (max-width:767.98px) {
  .wx .wx-trend-swipehint {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin: 4px 0 8px;
    font-size: 11px;
    color: #9ca3af;
  }
  .wx .wx-trend-swipehint-icon {
    font-size: 14px;
  }
}

/* ▼ 傾向データ：スワイプ用ページドット（SPのみ） */
.wx .wx-trend-swipedots {
  display: none;
}

@media (max-width:767.98px) {
  .wx .wx-trend-swipedots {
    display: flex;
    justify-content: center;
    gap: 6px;
    margin: 8px 0 0;
  }
  .wx .wx-trend-swipedots-dot {
    width: 6px;
    height: 6px;
    border-radius: 999px;
    background: #e5e7eb;
    transition: all .15s ease;
  }
  .wx .wx-trend-swipedots-dot.is-active {
    width: 14px;
    background: #16a34a;
  }
}

/* =========================
   天気トップ index 専用調整
   ========================= */

/* カード全体 */
.wx-index-venues .wx-index-venue {
  padding: 10px 12px;
}

/* カード内レイアウト（アイコン＋テキスト横並び） */
.wx-index-venue__inner {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* アイコンを少し大きく、固定幅で配置 */
.wx-index-venue__icon {
  flex: 0 0 40px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.wx-index-venue__icon .wx-miniicon {
  width: 40px;
  height: 40px;
  display: block;
}

/* テキスト側 */
.wx-index-venue__body {
  flex: 1 1 auto;
}

/* 競馬場名はやや大きめ＋太字 */
.wx-index-venue__name {
  font-size: 15px;
  font-weight: 700;
  line-height: 1.4;
  margin-bottom: 2px;
}

/* 地名は小さめ・控えめ */
.wx-index-venue__meta {
  font-size: 12px;
  line-height: 1.4;
}

/* 「天気予報を見る」を小さめリンク扱いに */
.wx-index-venue__link {
  margin-top: 6px;
  font-size: 12px;
  line-height: 1.3;
  color: #0055cc;
  text-decoration: underline;
}

/* ホバー時だけ少し強調（PC） */
@media (hover: hover) {
  .wx-index-venue:hover .wx-index-venue__link {
    color: #003a8c;
  }
}

/* SP 幅ではカード同士の間隔を少し詰める */
@media screen and (max-width: 739px) {
  .wx-index-venues .wx-index-venue {
    padding: 10px;
  }
}

