/* =====================================================
   スペック計算ツール専用スタイル
===================================================== */

/* グラフラッパー */
.chart-wrap {
  position: relative;
  width: 100%;
}

.chart-wrap canvas,
.chart-wrap img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100% !important;
  height: 100% !important;
  display: block;
}

/* スペック計算ツール専用テーブルレイアウト */
.spec-table td,
.spec-table th,
.spec-table--compare td,
.spec-table--compare th {
  min-width: 120px;
  text-align: center;
}

.spec-table--compare-wrap {
  width: 100%;
  overflow-x: auto;
}

/* ヘッダー色・1列目色（スペック計算ツール専用） */
.spec-table th,
.spec-table--compare th {
  background-color: #8bb3d9;
  color: #fff;
  text-align: center;
  vertical-align: middle !important;
}

.spec-table td:first-child,
.spec-table--compare td:first-child {
  background-color: #ECF2F9;
  color: #355B95;
  text-align: center;
}

/* スペック計算ツール専用：スペック値だけピンク */
.spec-result-number {
  color: #e96b8a;
  font-weight: bold;
}

/* 差分強調（スペック計算ツール用） */
.diff-plus {
  color: #e96b8a;
  font-weight: bold;
}

.diff-minus {
  color: #5b8ecb;
  font-weight: bold;
}

.diff-zero {
  color: #888;
  font-weight: bold;
}

/* スマホ時のみ改行用 */
.sp-br {
  display: none;
}

/* スペック計算ツール専用：ヘッダー行 */
.spec-table__header {
  background-color: #ECF2F9 !important;
  color: #355B95;
  text-align: center;
  font-weight: bold;
}

/* レスポンシブ対応 */
@media (max-width: 767px) {
  .spec-table--compare {
    font-size: 14px;
  }

  .spec-table--compare td,
  .spec-table--compare th,
  .spec-table td,
  .spec-table th {
    min-width: 70px;
    padding: 0.4em 0.2em;
    font-size: 12px;
    white-space: nowrap;
  }

  .spec-table td,
  .spec-table th {
    min-width: 70px;
  }

  .sp-br {
    display: inline;
  }
}

@media (min-width: 768px) {
  .spec-table,
  .spec-table--compare{
    min-width: 540px;
  }
}

/* グラフ＋ラベル横並び用 */
.chart-row-wrap {
  display: flex;
  flex-direction: row;
  align-items: stretch;
  justify-content: center;
  width: 100%;
  gap: 0.5em;
  margin: 0 auto 1.5rem;
}

.chart-labels {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  height: auto;
  font-size: 1.1em;
  font-weight: bold;
  color: #444;
  text-align: right;
  min-width: 9em;
  margin-right: 0.5em;
  user-select: none;
  padding-bottom: 18px;
  padding-top: 12px;
}

.chart-labels>div {
  height: calc(100% / 6);
  font-size: 0.875em;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: end;
}

/* グラフcanvasラッパー */
.chart-canvas-wrap {
  position: relative;
  width: 100%;
  height: 220px;
}

/* PC時はstatic（デフォルト） */
.chart-canvas-wrap canvas,
.chart-canvas-wrap img {
  position: static;
  width: 100% !important;
  height: 100% !important;
  display: block;
}

@media (max-width: 767px) {
  .chart-row-wrap {
    align-items: stretch;
    gap: 0.2em;
  }

  .chart-labels>div {
    font-size: 12px;
    width: 78px;
    letter-spacing: 0.05em;
  }
  .chart-labels{
    min-width: 0;
    margin-right: 0;
  }

  .chart-canvas-wrap {
    position: relative;
    width: calc(100% - 78px);
    height: 220px;
  }
  .chart-canvas-wrap canvas,
  .chart-canvas-wrap img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100% !important;
    height: 100% !important;
    display: block;
  }
}

/* 棒グラフ横の数値（HTML配置用） */
.bar-values-html {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 2;
}
.bar-value-html {
  position: absolute;
  right: 0;
  display: flex;
  align-items: center;
  font-weight: bold;
  font-size: 0.875em;
  color: #333;
  letter-spacing: 0.08em;
  background: none;
  pointer-events: none;
  user-select: none;
  opacity: 0;
  transform: translateY(0);
  transition: opacity 0.3s, transform 0.3s;
}
.bar-value-html.visible {
  opacity: 1;
  transform: none;
}
@media (max-width: 767px) {
  .bar-value-html {
    font-size: 0.8em;
  }
}

/* 指標 */
.index-box{
  display: inline-block;
  padding: 4px 8px;
  border: solid 1px #8bb3d9;
  border-radius: 4px;
  background: linear-gradient(
    to right,
      #8bb3d9,
      #b3a4d6
  );
  font-weight: bold !important;
  color:#fff;
}
