  *, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

  :root {
    /* ========================================
       カラー設定
       シミュレーター全体の配色をここで一括管理
    ======================================== */
    --color-surface: #ffffff;            /* カード背景 */
    --color-principal: #2c5f8a;          /* 元本（チャート青） */
    --color-interest-chart: #d4853a;     /* 利息（チャートオレンジ） */
    --color-repay: #d4853a;              /* 返済額スライダー色 */
    --color-interest: #3a8a5c;           /* 金利スライダー色 */
    --color-borrow: #2c5f8a;             /* 借入額スライダー色 */
    --color-text: #2a2520;               /* メインテキスト */
    --color-text-sub: #7a7068;           /* サブテキスト */
    --color-border: #e8e0d8;             /* ボーダー */
    --color-danger: #c0392b;             /* 返済不可の警告色 */
    --color-saving: #2c7a5c;             /* アドバイス結果テキスト色 */
    --color-saving-bg: #eef7f2;          /* アドバイス結果背景色 */
    --color-track-bg: #e0d8d0;           /* スライダー未選択部分 */

    /* レイアウト */
    --radius: 16px;
    --shadow: 0 2px 16px rgba(42,37,32,.06), 0 1px 4px rgba(42,37,32,.04);

    /* フォント */
    --font-ja: 'Noto Sans JP', sans-serif;   /* 日本語テキスト */
    --font-num: 'DM Sans', sans-serif;        /* 数値表示用 */
  }

  /* ========================================
     シミュレーター外枠
     max-width を変更すればカード幅を調整できる
  ======================================== */

h2.simulator__title{
    font-size: 1.6rem;
    font-weight: bold;
    text-align: center;
    /* margin-top: 10px; */


}

section.p-simulator{
    padding: 16px 8px;
    /* background-color: #35CCFF; */
}

  .simulator {
    /* font-family: var(--font-ja); */
    color: var(--color-text);
    line-height: 1.6;
    background: var(--color-surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    max-width: 480px;
    width: 100%;
    margin: 0 auto;
    overflow: hidden;
    border: solid 1px #eee;
  }

  /* ヘッダー */
  .simulator__header {
    background: linear-gradient(135deg, #2c5f8a 0%, #1e4060 100%);
    color: #fff;
    padding: 24px 28px 20px;
  }
  .simulator__title { font-size: 18px; font-weight: 700; letter-spacing: .04em; }
  .simulator__subtitle { font-size: 12px; opacity: .7; margin-top: 2px; }

  /* ========================================
     ドーナツチャート
  ======================================== */
  /* チャートサイズ（CSSサイズ。Canvas解像度はJSで制御） */
  .chart-container { position: relative; width: 220px; height: 220px; flex-shrink: 0; }
  .chart-container canvas { width: 220px; height: 220px; }

  /* チャート中央テキスト */
  .chart-center {
    position: absolute; top: 50%; left: 50%;
    transform: translate(-50%,-50%);
    text-align: center; pointer-events: none;
    width: 130px;  /* ドーナツ内径に収まる幅 */
  }
  .chart-center__label { font-size: 12px; color: var(--color-text-sub); letter-spacing: .06em; white-space: nowrap; }
  .chart-center__count { font-family: var(--font-num); font-size: 24px; font-weight: 700; color: var(--color-text); line-height: 1.2; white-space: nowrap; }
  .chart-center__count-unit { font-family: var(--font-ja); font-size: 14px; font-weight: 600; margin-left: 2px; }
  .chart-center__divider { width: 40px; height: 1px; background: var(--color-border); margin: 8px auto; }
  /* 金額+円を1行に固定 */
  .chart-center__total-row { white-space: nowrap; line-height: 1.2; }
  .chart-center__total { font-family: var(--font-num); font-size: 20px; font-weight: 700; color: var(--color-text); }
  .chart-center__total-unit { font-family: var(--font-ja); font-size: 12px; font-weight: 600; margin-left: 1px; }
  .chart-center__total-label { font-size: 14px; color: #333; letter-spacing: .06em; margin-top: 2px; white-space: nowrap; }
  /* 返済不可時 */
  .chart-center--warning .chart-center__count { font-size: 16px; color: var(--color-danger); font-family: var(--font-ja); font-weight: 700; }


  /* ========================================
   チャート横の情報テーブル
======================================== */
.chart-section {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 16px 24px 8px;
}

.chart-info {
  flex-shrink: 0;
}

.chart-info__table {
  border-collapse: collapse;
  font-size: 13px;
}

.chart-info__table th {
  text-align: left;
  font-weight: 600;
  font-size: 16px;
  color: var(--color-text-sub);
  padding: 6px 0;
  border-bottom: 1px solid var(--color-border);
  white-space: nowrap;
}

.chart-info__table td {
  text-align: right;
  font-family: var(--font-num);
  font-weight: 700;
  font-size: 16px;
  padding: 6px 0 6px 0px;
  border-bottom: 1px solid var(--color-border);
  white-space: nowrap;
  color: var(--color-text);
}

/* 借入額の行は青 */
.chart-info__table tr:nth-child(2) td {
  color: var(--color-principal);
}
.chart-info__table tr:nth-child(2) th {
  color: var(--color-principal);
}


/* 利息の行はオレンジ */
.chart-info__table tr:last-child td {
  color: var(--color-interest-chart);
}
.chart-info__table tr:last-child th {
  color: var(--color-interest-chart);
}


  /* 凡例（元本 / 利息） */
  .chart-legend { 
    display: flex; 
    justify-content: 
    center; gap: 24px; 
    /* padding-bottom: 24px;  */
}
  .chart-legend__item { display: flex; align-items: center; gap: 6px; font-size: 20px; font-weight: 600; color: var(--color-text-sub); }
  .chart-legend__dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
  .chart-legend__dot--principal { background: var(--color-principal); }
  .chart-legend__dot--interest  { background: var(--color-interest-chart); }

  /* ========================================
     スライダー共通
  ======================================== */
  .sliders { padding: 0 28px 28px; display: flex; flex-direction: column; gap: 24px; }
  .slider-group { display: flex; flex-direction: column; gap: 8px; }
  .slider-group__header { display: flex; justify-content: space-between; align-items: baseline; }
  .slider-group__label { font-size: 14px; font-weight: 600; display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
  .slider-group__label-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
  .slider-group__value { font-family: var(--font-num); font-size: 22px; font-weight: 700; line-height: 1; white-space: nowrap; text-align: right; }
  .slider-group__value-unit { font-family: var(--font-ja); font-size: 14px; font-weight: 600; margin-left: 3px; color: var(--color-text-sub); }

  /* range input カスタム */
  input[type="range"] { -webkit-appearance: none; appearance: none; width: 100%; height: 6px; border-radius: 3px; outline: none; cursor: pointer; border: none; background: transparent; }
  input[type="range"]::-webkit-slider-runnable-track { height: 6px; border-radius: 3px; }
  input[type="range"]::-moz-range-track { height: 6px; border-radius: 3px; border: none; }
  input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; width: 24px; height: 24px; border-radius: 50%; border: 3px solid #fff; box-shadow: 0 1px 6px rgba(0,0,0,.18); margin-top: -9px; cursor: pointer; transition: transform .15s ease; }
  input[type="range"]::-moz-range-thumb { width: 24px; height: 24px; border-radius: 50%; border: 3px solid #fff; box-shadow: 0 1px 6px rgba(0,0,0,.18); cursor: pointer; }
  input[type="range"]:active::-webkit-slider-thumb { transform: scale(1.15); }

  /* 各スライダーのつまみ色 */
  .slider--borrow input[type="range"]::-webkit-slider-thumb { background: var(--color-borrow); }
  .slider--borrow input[type="range"]::-moz-range-thumb { background: var(--color-borrow); }
  .slider--repay input[type="range"]::-webkit-slider-thumb { background: var(--color-repay); }
  .slider--repay input[type="range"]::-moz-range-thumb { background: var(--color-repay); }
  /* .slider--interest input[type="range"]::-webkit-slider-thumb { background: var(--color-interest); }
  .slider--interest input[type="range"]::-moz-range-thumb { background: var(--color-interest); } */
  .slider--interest input[type="range"]::-webkit-slider-thumb { background: #333; }
  .slider--interest input[type="range"]::-moz-range-thumb { background: #333; }

  /* スライダー下の最小/最大ラベル */
  .slider-group__range { display: flex; justify-content: space-between; font-size: 12px; color: var(--color-text-sub); font-family: var(--font-num); margin-top: -2px; }


  /* 金利スライダー無効化のスタイル */
.slider--interest.is-disabled {
  opacity: 0.45;
  pointer-events: none;
}
.slider--interest.is-disabled input[type="range"] {
  cursor: default;
}

  /* ========================================
     利息アドバイス
  ======================================== */
  .repay-advice {
    margin-top: 8px;
    text-align: center;
  }

  /* CTAボタン */
  .repay-advice__btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    border: none;
    border-radius: 50px;
    background: var(--color-repay);
    color: #fff;
    font-family: var(--font-ja);
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(121, 76, 33, 0.3);
    transition: transform .15s ease, box-shadow .15s ease;
    line-height: 1.4;
    letter-spacing: .02em;
  }
  .repay-advice__btn:hover {
    transform: translateY(-1px);
    /* box-shadow: 0 6px 16px rgba(44, 122, 92, 0.4); */
  }
  .repay-advice__btn:active {
    transform: translateY(0) scale(0.97);
    /* box-shadow: 0 2px 8px rgba(44, 122, 92, 0.3); */
  }
  /* Material Icon サイズ */
  .repay-advice__btn-icon {
    font-size: 20px;
    flex-shrink: 0;
  }
  /* ボタン非表示（上限到達時など） */
  .repay-advice__btn--hidden {
    display: none;
  }

  /* 結果表示エリア（フェードインアニメーション付き） */
  .repay-advice__result {
    margin-top: 10px;
    padding: 14px 16px;
    border-radius: 10px;
    background: #F8EDE2;
    font-size: 16px;
    line-height: 1.6;
    color: #C56204;
    text-align: center;
    opacity: 0;
    transform: translateY(6px);
    transition: opacity .4s ease, transform .4s ease;
    pointer-events: none;
    max-height: 0;
    padding-top: 0;
    padding-bottom: 0;
    overflow: hidden;
  }
  .repay-advice__result--visible {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
    max-height: 200px;
    padding: 14px 0;
  }
  .repay-advice__result-amount {
    font-family: var(--font-num);
    font-weight: 700;
    font-size: 20px;
  }
  .repay-advice__result-sub {
    font-size: 14px;
    color: var(--color-text-sub);
    margin-top: 4px;
  }

  /* フッター */
  .simulator__footer { padding: 16px 28px; border-top: 1px solid var(--color-border); font-size: 11px; color: var(--color-text-sub); line-height: 1.7; }


@media screen and (min-width: 768px) {
    /* 背景画像 */
    .cyber-bg-network {
      width: 100%;
      background-color: #ffffff;
      
      /* SVGを使って「点と線」のパターンを作成 */
      background-image: url("data:image/svg+xml,%3Csvg width='100' height='100' viewBox='0 0 100 100' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M10 10L90 90M90 10L10 90' stroke='rgba(0,0,0,0.04)' stroke-width='0.5'/%3E%3Ccircle cx='10' cy='10' r='1.5' fill='rgba(0,0,0,0.1)'/%3E%3Ccircle cx='90' cy='90' r='1.5' fill='rgba(0,0,0,0.1)'/%3E%3Ccircle cx='50' cy='50' r='1' fill='rgba(0,0,0,0.05)'/%3E%3C/svg%3E");
      
      background-size: 150px 150px; /* パターンの大きさ */
      display: flex;
      align-items: center;
      justify-content: center;   
  }

}
/* カスタマイズ
線の濃さ: rgba(0, 0, 0, 0.03) の 0.03（3%）を上げると線がはっきりし、下げるとより目立たなくなる.
ノードの密度: background-size の数値を大きくすると、ドットの間隔が広がり、よりゆったりした印象になる. */


div.simulator{
    background: rgba(255,255,255,0.8);
    padding: 20px 0;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
}



 @media (max-width: 768px) {
    .simulator__header { padding: 20px; }
    .sliders { padding: 0 20px 24px; }
    .simulator__footer { padding: 14px 20px; }
    /* .chart-section { padding: 28px 16px 20px; } */
    .chart-container { width: 130px; height: 130px; }
    .chart-container canvas { width: 130px; height: 130px; }
    .chart-center { width: 78px; }
    .chart-center__count { font-size: 18px; }
    .chart-center__count-unit { font-size: 12px; }
    .chart-center__total { font-size: 16px; }
    .chart-center__total-unit { font-size: 10px; }
    /* .chart-center__label { font-size: 10px; } */
    .chart-center__total-label { font-size: 12px; }
    .chart-center__divider { margin: 4px auto; width: 26px; }
    .slider-group__value { font-size: 20px; }
    .repay-advice__btn { font-size: 13px; padding: 11px 20px; }
    .repay-advice__result-amount { font-size: 18px; }

    .chart-section{
      gap: 4px;
    }

    /* .chart-center__total { font-size: 13px; }
    .chart-center__total-unit { font-size: 9px; }
    .chart-center__total-label { font-size: 9px; } */
  }


   /* @media (max-width: 360px) {
    
    
    .chart-center__count { font-size: 18px; }
    .chart-center__count-unit { font-size: 10px; }
    .chart-center__total { font-size: 13px; }
    .chart-center__total-unit { font-size: 9px; }
    
    .chart-center__label { font-size: 9px; }
  } */