/* 基礎代謝量計算ツール専用CSS */

/* テーブルスタイリング（BMIツールと統一） */
.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列目色（BMIツールと統一） */
.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-table__header {
    background-color: #ECF2F9 !important;
    color: #355B95;
    text-align: center;
    font-weight: bold;
}

/* テーブル最小幅（BMIツールと統一） */
@media (min-width: 768px) {
    .spec-table,
    .spec-table--compare {
        min-width: 560px;
        max-width: 688px;
        width: 100% !important;
    }
}

/* 活動レベル選択のスタイリング */
.activity-level-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 8px;
}

.activity-level-option {
    display: flex;
    align-items: flex-start;
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    background: #fff;
}

.activity-level-option:hover {
    border-color: #8bb3d9;
    background-color: #f8f9ff;
}

.activity-level-option input[type="radio"] {
    margin-right: 12px;
    margin-top: 2px;
    flex-shrink: 0;
}

.activity-level-option input[type="radio"]:checked + .activity-content {
    color: #333;
}

.activity-level-option:has(input[type="radio"]:checked) {
    border-color: #8bb3d9;
    background-color: #f0f6ff;
    box-shadow: 0 2px 8px rgba(139, 179, 217, 0.2);
}

.activity-content {
    flex-grow: 1;
}

.activity-title {
    font-weight: 600;
    font-size: 14px;
    color: #333;
    margin-bottom: 4px;
}

.activity-desc {
    font-size: 12px;
    color: #666;
    line-height: 1.4;
}

/* メインの結果部分 */
.accent-number{color:#E94B3C;}

/* 差分表示の色分け */
.diff-plus {
    color: #e96b8a;
    font-weight: 600;
}

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

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

/* テーブルの追加スタイリング */
.spec-table--compare th,
.spec-table--compare td {
    text-align: center;
    vertical-align: middle;
}

.spec-table--compare th {
    background-color: #8bb3d9;
    font-size: 12px;
    padding: 8px 4px;
    color: #fff;
}

.spec-table--compare td {
    font-size: 13px;
    padding: 6px 4px;
}

.spec-table--compare td small,
.spec-table--compare th small {
    letter-spacing: -0.01em;
}

.table-bmr{color:#E94B3C;}
.table-aee{color:#1C82E7;}

/* グラフコンテナの調整 */
.chart-row-wrap {
    margin: 20px 0;
    display: flex;
    align-items: stretch;
    justify-content: center;
    width: 100%;
    gap: 0.5em;
    margin: 1rem auto 1.5rem;
}

.chart-canvas-wrap {
    position: relative;
    flex-grow: 1;
    width: 100%;
    height: 220px;
}

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

/* グラフラベルのスタイリング (User Reverted State) */
.chart-labels {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: auto;
    font-weight: bold;
    color: #444;
    text-align: right;
    margin-right: 0.5em;
    user-select: none;
    min-width: 14em;
    padding-bottom: 10px;
    padding-top: 53px;
    font-size: 0.85rem;
}

.chart-labels > div {
    height: auto;
    font-size: 13px;
    letter-spacing: 0.05em;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    justify-content: end;
}

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

.sp-legend{
  display: none;
}

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

    .spec-table--compare td,
    .spec-table--compare th,
    .spec-table td,
    .spec-table th {
        min-width: calc((100vw / 390) * 55);
        padding: 0.4em 0;
        font-size: calc((100vw / 390) * 9);
        white-space: nowrap;
    }

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

    .sp-br {
        display: inline;
    }

    .activity-level-group {
        gap: 6px;
    }

    .activity-level-option {
        padding: 10px;
    }

    .activity-title {
        font-size: 13px;
    }

    .activity-desc {
        font-size: 11px;
    }

    .chart-row-wrap {
        align-items: stretch;
        gap: 0.2em;
        margin-bottom: 0;
    }

    .sp-legend{
      margin-top: 1rem;
      margin-bottom: 1.5rem;
      display: block;
    }
    /* SP用HTML凡例 */
    .sp-legend .legend-item {
      font-size: 11px;
      margin-bottom: 4px;
    }

    .sp-legend .legend-color-box {
      width: 14px;
      height: 10px;
      margin-right: 4px;
      flex-shrink: 0;
    }

    .sp-legend .legend-text {
      line-height: 1.1;
      font-weight: 500;
    }

    .chart-labels > div {
        font-size: 10px;
        width: 78px;
        letter-spacing: 0.05em;
        height: calc(100% / 3);
    }

    .chart-labels > div span{
      display: contents;
    }

    .chart-labels {
        min-width: 0;
        margin-right: 0;
        padding-bottom: 12px;
        padding-top: 0px;
    }

    .chart-canvas-wrap {
        position: relative;
        width: calc(100% - 78px);
        height: 200px; /* SP時の高さを200pxに設定 */
    }

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

/* フォームセクションの区切り */
.section-divider {
    margin: 24px 0;
    border: none;
    border-top: 1px solid #e0e0e0;
}


/* 基本情報テーブルの改善 */
.spec-table .spec-table__header {
    background-color: #f0f6ff;
    font-weight: 600;
}


/* 高解像度対応 */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .activity-level-option {
        border-width: 1px;
    }

    .activity-level-option:has(input[type="radio"]:checked) {
        border-width: 2px;
    }
}

/* HTML Bar Value Labels (New) */
.bar-values-html {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    overflow: hidden;
}

.bar-value-html {
    position: absolute;
    transform: translate(-50%, -50%);
    font-weight: bold;
    font-size: 13px;
    color: #333;
    white-space: nowrap;
    opacity: 0;
    transition: opacity 0.4s ease-in-out;
}

.bar-value-html.visible {
    opacity: 1;
}

.bar-value-bmr {
    color: #E94B3C;
}

.bar-value-aee {
    color: #1C82E7;
}

.bar-value-html small {
    letter-spacing: -0.01em;
    font-size: 0.85em;
}

@media (max-width: 767px) {
    .bar-value-html {
        font-size: 11px;
    }
}

/* 指標 */
.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;
}



/* 早見表 */
@media (max-width: 767px) {
	.bmr-table *{
    font-size: calc(12 * (100vw / 410))
  }
}
