/* 目的別ランキングページ */
.fx-hero-sub__line {
  display: inline;
}

@media screen and (min-width: 768px) {
  /* 子タブのヒーロー見出しは、長い目的別コピーも1行で表示する */
  body[data-topic-ranking] .c-mv05__title {
    width: 440px;
    flex: 0 0 440px;
  }

  body[data-topic-ranking] .c-mv05__image {
    width: 390px;
    flex: 0 0 390px;
  }

  body[data-topic-ranking] .c-mv05__title__subLabel {
    white-space: nowrap;
  }
}

.fx-topic-ranking-section {
  margin-top: 8px;
}

.fx-popular-intro {
  margin: -8px 0 20px;
  color: #44545c;
  font-size: 1.5rem;
  line-height: 1.9;
}

.fx-topic-ranking-lead {
  margin: -8px auto 24px;
  max-width: 920px;
  color: #44545c;
  font-size: 1.5rem;
  line-height: 1.9;
}

.fx-quick-table {
  margin: 0 0 30px;
  padding: 20px;
  border: 1px solid #d9e3e8;
  border-radius: 8px;
  background: #f7fafb;
}

.fx-quick-table__title {
  margin: 0 0 8px;
  color: #164b63;
  font-size: 2rem;
  line-height: 1.45;
}

.fx-quick-table__lead {
  margin: 0 0 16px;
  color: #44545c;
  font-size: 1.3rem;
  line-height: 1.7;
}

.fx-quick-table__scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  background: #fff;
}

.fx-quick-table__table {
  width: 100%;
  min-width: 1040px;
  border-collapse: collapse;
  table-layout: fixed;
  color: #333;
  font-size: 1.3rem;
  line-height: 1.55;
}

.fx-quick-table__table th,
.fx-quick-table__table td {
  padding: 11px 12px;
  border: 1px solid #d9e3e8;
  vertical-align: middle;
  word-break: break-word;
}

.fx-quick-table__table th {
  background: #e7f1f6;
  color: #164b63;
  font-weight: 700;
  text-align: center;
}

.fx-quick-table__table tbody tr:nth-child(even) {
  background: #fbfcfd;
}

.fx-quick-table__company {
  display: block;
  color: #164b63;
  font-weight: 700;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}

.fx-quick-table__company small {
  display: block;
  margin-top: 3px;
  color: #66757c;
  font-size: 1.1rem;
  font-weight: 400;
  text-decoration: none;
}

.fx-quick-table__official {
  display: inline-block;
  color: #5ba4d6;
  font-weight: 700;
  line-height: 1.45;
  text-decoration: underline;
  white-space: nowrap;
}

.fx-quick-table__official:hover,
.fx-quick-table__official:focus {
  color: #2f7fb9;
  text-decoration: none;
}

.fx-quick-table__status {
  display: inline-block;
  color: #80652f;
  font-weight: 700;
}

.fx-quick-table__status.is-approved,
.fx-quick-table__status.is-available {
  color: #08785b;
}

.fx-topic-ranking-status {
  margin: 24px 0;
  padding: 20px;
  border: 1px solid #d9e3e8;
  border-radius: 8px;
  background: #f7fafb;
  color: #44545c;
  text-align: center;
}

.fx-topic-ranking-section .c-rankinglist {
  min-height: 120px;
}

/* おすすめ紹介ページでは順位を示す配色や表示を使わない */
.fx-topic-ranking-section .c-ranking:nth-of-type(n) .c-ranking__inner {
  background: #fff;
}

.fx-topic-ranking-section .c-ranking__evaluation--recommendation {
  margin-top: 20px;
}

.fx-topic-ranking-section .c-ranking3__notes {
  margin-top: 28px;
}

/* 比較表は絞り込みUIを表示せず、固定方法の注意文とリセットだけを横並びにする */
.fx-all-company-comparison .c-filter-note {
  align-items: flex-start;
  gap: 10px;
}

.fx-all-company-comparison .c-filter-note__text {
  flex: 1 1 auto;
  min-width: 0;
}

.fx-all-company-comparison .c-filter-note__reset {
  flex: 0 0 auto;
  padding: 8px 20px;
  border: 2px solid #666;
  border-radius: 20px;
  background: #666;
  color: #fff;
  font-size: 1.4rem;
  font-weight: 700;
  line-height: 1.4;
  white-space: nowrap;
  cursor: pointer;
  transition: all 0.3s;
}

.fx-all-company-comparison .c-filter-note__reset:hover,
.fx-all-company-comparison .c-filter-note__reset:focus {
  border-color: #555;
  background: #555;
  color: #fff;
}

@media screen and (max-width: 767px) {
  .fx-all-company-comparison .c-filter-note {
    gap: 8px;
  }

  .fx-all-company-comparison .c-filter-note__reset {
    padding: 6px 15px;
    font-size: 1.2rem;
  }
}

/* 公式にスキャルピングを認めている会社をカード上部で明示 */
.fx-topic-ranking-section .fx-scalping-approval-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 0 0 8px;
  padding: 4px 10px;
  border: 2px solid #d7193f;
  border-radius: 4px;
  background: #fff7f8;
  color: #b31735;
  font-size: 1.25rem;
  font-weight: 700;
  line-height: 1.35;
  letter-spacing: 0.02em;
  box-shadow: none;
  cursor: default;
}

.fx-topic-ranking-section .fx-scalping-approval-badge::before {
  display: none;
}

.fx-topic-ranking-section .fx-scalping-approval-badge::after {
  display: none;
}

.fx-topic-ranking-section .fx-scalping-approval-badge.is-conditional {
  border-color: #b98212;
  background: #fffaf0;
  color: #8a5a00;
}

.fx-topic-ranking-section .fx-scalping-approval-badge.is-conditional::after {
  display: inline;
  content: '条件を確認';
  color: #80652f;
}

@media screen and (min-width: 768px) {
  /* スキャルピング公認バッジが右上の「FX取引」帯に重ならないようにする */
  .fx-topic-ranking-section .c-ranking.is-scalping-approved .c-ranking__title {
    padding-right: 135px;
  }

  .fx-topic-ranking-section .c-ranking.is-scalping-approved .fx-scalping-approval-badge {
    flex-wrap: wrap;
    max-width: 100%;
    box-sizing: border-box;
    white-space: normal;
  }

  .fx-topic-ranking-section .c-ranking__evaluation__score__item {
    min-width: calc(16.666% - 9px);
  }

  /* 基本情報テーブルも特徴・確認ポイントと同じカード内幅に揃える */
  .fx-topic-ranking-section .c-ranking__bottom {
    margin-left: 0;
  }
}

@media screen and (max-width: 767px) {
  /* おすすめポイントが左側の画像に回り込まないようにする */
  .fx-topic-ranking-section .c-ranking__evaluation--recommendation {
    clear: both;
    margin-top: 32px;
  }

  /* モバイルでは会社名・商品名の幅を確保し、バッジだけ右上の帯を避ける */
  .fx-topic-ranking-section .c-ranking.is-scalping-approved .c-ranking__title {
    padding-right: 0;
  }

  .fx-topic-ranking-section .c-ranking.is-scalping-approved .fx-scalping-approval-badge {
    display: flex;
    flex-wrap: wrap;
    width: auto;
    max-width: calc(100% - 125px);
    box-sizing: border-box;
    white-space: normal;
    overflow-wrap: anywhere;
  }

  .fx-hero-sub__line {
    display: block;
    white-space: nowrap;
  }

  .fx-quick-table {
    margin: 0 0 22px;
    padding: 14px;
  }

  .fx-quick-table__title {
    font-size: 1.7rem;
  }

  .fx-quick-table__lead {
    font-size: 1.2rem;
  }

  .fx-quick-table__table {
    min-width: 900px;
    font-size: 1.2rem;
  }

  .fx-quick-table__table th,
  .fx-quick-table__table td {
    padding: 9px 10px;
  }

  .fx-quick-table__company small {
    font-size: 1rem;
  }

  .fx-popular-intro {
    margin: -4px 0 16px;
    font-size: 1.3rem;
    line-height: 1.75;
  }

  .fx-topic-ranking-lead {
    margin-top: -4px;
    font-size: 1.3rem;
    line-height: 1.75;
  }

  .fx-topic-ranking-section .fx-scalping-approval-badge {
    margin-bottom: 6px;
    padding: 3px 8px;
    font-size: 1.15rem;
  }

  .fx-topic-ranking-section .fx-scalping-approval-badge::after {
    font-size: 0.9rem;
  }

}

/* 目的別ランキングカードのCVボタン */
@media screen and (min-width: 768px) {
  .fx-topic-ranking-section .c-ranking__inner {
    overflow: visible;
  }

  .fx-topic-ranking-section .c-ranking__cv {
    position: absolute;
    top: 30px;
    right: 30px;
    width: 240px;
  }

  .fx-topic-ranking-section .c-ranking__cv .c-ranking__btn {
    position: relative;
    top: auto;
    right: auto;
    bottom: auto;
    left: auto;
    width: 100%;
  }

  .fx-topic-ranking-section .c-ranking__cv .c-ranking__btnText {
    margin: 0;
    font-size: 1.2rem;
    letter-spacing: -0.05em;
  }

  .fx-topic-ranking-section .c-ranking__cvBtn {
    margin-top: 10px;
  }

  .fx-topic-ranking-section .c-ranking__cvText {
    margin-top: 5px;
    color: #cc1938;
    font-size: 1.6rem;
    font-weight: 700;
    text-align: center;
  }
}

@media screen and (max-width: 767px) {
  .fx-topic-ranking-section .c-ranking__cv {
    position: relative;
    top: auto;
    right: auto;
    width: 100%;
    margin-top: 20px;
  }

  .fx-topic-ranking-section .c-ranking__cv .c-ranking__btn {
    position: relative;
    top: auto;
    right: auto;
    bottom: auto;
    left: auto;
    width: 100%;
  }

  .fx-topic-ranking-section .c-ranking__cv .c-ranking__btnText {
    margin: 0;
    font-size: 1.4rem;
  }

  .fx-topic-ranking-section .c-ranking__cvBtn {
    position: relative;
    margin-top: 10px;
  }

  .fx-topic-ranking-section .c-ranking__cvText {
    margin-top: 5px;
    color: #cc1938;
    font-size: 1.6rem;
    font-weight: 700;
    text-align: center;
  }
}
