/* 資産シミュレーター専用スタイル（サイトのCSS変数を継承し、ダークモードにも追随） */
:root {
  --sim-track-off: #dbe3ec;
  --sim-line-main: #1a3658;
  --sim-line-low: #9db4cc;
  --sim-line-high: #b3861c;
  --sim-goal: #bc5138;
}
[data-theme="dark"] {
  --sim-track-off: #26313f;
  --sim-line-main: #8fc1f0;
  --sim-line-low: #54687f;
  --sim-line-high: #d3ab3e;
  --sim-goal: #e08a7a;
}

.sim-page { max-width: 1120px; margin: 22px auto 34px; }
.sim-head h1 { font-size: 1.6rem; line-height: 1.45; color: var(--navy); margin: 0 0 10px; }
[data-theme="dark"] .sim-head h1 { color: #edf2f8; }
.sim-intro { color: var(--muted); font-size: .96rem; margin-bottom: 18px; }
.sim-intro p { margin: 0; }

.sim-grid { display: grid; grid-template-columns: 370px 1fr; gap: 16px; margin-bottom: 16px; }
@media (max-width: 900px) { .sim-grid { grid-template-columns: 1fr; } }

.sim-panel {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 20px 20px 16px; margin-bottom: 16px;
}
.sim-grid .sim-panel { margin-bottom: 0; }
.sim-panel h2 { font-size: 1.05rem; color: var(--navy); margin: 0 0 14px; }
[data-theme="dark"] .sim-panel h2 { color: #edf2f8; }

/* ===== スライダー ===== */
.sim-ctrl { margin-bottom: 18px; }
.sim-ctrl-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 2px; }
.sim-ctrl-head label { font-size: .92rem; font-weight: 700; }
.sim-val { font-size: 1.02rem; font-weight: 700; color: var(--navy-2); background: var(--gold-soft); border-radius: 8px; padding: 1px 10px; }
[data-theme="dark"] .sim-val { color: var(--gold); }
.sim-ctrl input[type="range"] {
  -webkit-appearance: none; appearance: none;
  width: 100%; height: 28px; background: transparent; cursor: pointer; margin: 0;
  --fill: 50%;
}
.sim-ctrl input[type="range"]::-webkit-slider-runnable-track {
  height: 6px; border-radius: 999px;
  background: linear-gradient(90deg, var(--navy-2) 0%, var(--gold) var(--fill), var(--sim-track-off) var(--fill));
}
.sim-ctrl input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 22px; height: 22px; border-radius: 50%; margin-top: -8px;
  background: #fff; border: 2px solid var(--navy-2);
  box-shadow: 0 1px 5px rgba(16, 36, 62, .35);
}
.sim-ctrl input[type="range"]::-moz-range-track { height: 6px; border-radius: 999px; background: var(--sim-track-off); }
.sim-ctrl input[type="range"]::-moz-range-progress { height: 6px; border-radius: 999px; background: linear-gradient(90deg, var(--navy-2), var(--gold)); }
.sim-ctrl input[type="range"]::-moz-range-thumb {
  width: 18px; height: 18px; border-radius: 50%;
  background: #fff; border: 2px solid var(--navy-2);
  box-shadow: 0 1px 5px rgba(16, 36, 62, .35);
}
.sim-ctrl-foot { display: flex; justify-content: space-between; align-items: center; font-size: .76rem; color: var(--faint); }
.sim-num input {
  width: 84px; padding: 4px 8px; font-size: .88rem; text-align: right;
  border: 1px solid var(--line); border-radius: 8px;
  background: var(--card); color: var(--ink);
}
.sim-presets { display: flex; gap: 8px; margin-top: 8px; }
.sim-preset {
  font-size: .8rem; padding: 5px 12px; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--line); background: var(--bg); color: var(--ink);
}
.sim-preset:hover { border-color: var(--gold); }
.sim-details { border-top: 1px dashed var(--line); padding-top: 10px; }
.sim-details summary { cursor: pointer; font-size: .88rem; font-weight: 700; color: var(--muted); margin-bottom: 12px; }

/* ===== 結果 ===== */
.sim-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.sim-stat { background: var(--bg); border-radius: 10px; padding: 10px 14px; display: flex; flex-direction: column; gap: 1px; }
.sim-stat-main { grid-column: 1 / -1; border-top: 3px solid var(--gold); }
.sim-stat-label { font-size: .74rem; color: var(--faint); letter-spacing: .04em; }
.sim-stat-value { font-size: 1.18rem; font-weight: 700; color: var(--navy); }
[data-theme="dark"] .sim-stat-value { color: #edf2f8; }
.sim-stat-main .sim-stat-value { font-size: 1.8rem; }
.sim-stat-sub { font-size: .8rem; color: var(--muted); }
.sim-notes { margin: 14px 0 0; padding-left: 1.3em; font-size: .9rem; color: var(--muted); }
.sim-notes li { margin-bottom: 5px; }
.sim-share {
  margin-top: 12px; font-size: .85rem; font-weight: 700; cursor: pointer;
  padding: 8px 16px; border-radius: 999px;
  background: var(--navy); color: #fff; border: 1px solid var(--navy);
}
[data-theme="dark"] .sim-share { border-color: #3a5a86; }
.sim-share:hover { opacity: .88; }

/* ===== グラフ ===== */
#chart-wrap { position: relative; }
#sim-chart { width: 100%; height: auto; display: block; }
#sim-chart .grid { stroke: var(--line); stroke-width: 1; }
#sim-chart .ylab, #sim-chart .xlab { fill: var(--faint); font-size: 11px; }
#sim-chart .area { }
#sim-chart .grad-a { stop-color: var(--sim-line-main); stop-opacity: .30; }
#sim-chart .grad-b { stop-color: var(--sim-line-main); stop-opacity: 0; }
#sim-chart .end-dot { fill: var(--sim-line-main); }
#sim-chart .end-lab { fill: var(--sim-line-main); font-size: 12.5px; font-weight: 700; }
#sim-chart .ln-base { stroke: var(--sim-line-main); stroke-width: 2.6; fill: none; }
#sim-chart .ln-high { stroke: var(--sim-line-high); stroke-width: 1.6; fill: none; }
#sim-chart .ln-low { stroke: var(--sim-line-low); stroke-width: 1.6; fill: none; }
#sim-chart .ln-principal { stroke: var(--faint); stroke-width: 1.4; fill: none; stroke-dasharray: 5 4; }
#sim-chart .goal-line { stroke: var(--sim-goal); stroke-width: 1.4; stroke-dasharray: 6 4; }
#sim-chart .goal-lab { fill: var(--sim-goal); font-size: 11px; font-weight: 700; }
#sim-chart .hover-line { stroke: var(--gold); stroke-width: 1; opacity: .65; }
#chart-tip {
  position: absolute; z-index: 5; pointer-events: none;
  background: var(--card); border: 1px solid var(--line); border-radius: 8px;
  padding: 8px 10px; font-size: .78rem; line-height: 1.55; color: var(--ink);
  box-shadow: 0 4px 14px rgba(16, 36, 62, .18); width: 118px;
}
.sim-legend { display: flex; flex-wrap: wrap; gap: 6px 18px; list-style: none; margin: 10px 0 0; padding: 0; font-size: .82rem; color: var(--muted); }
.sim-legend .lg { display: inline-block; width: 22px; height: 0; border-top: 3px solid; vertical-align: middle; margin-right: 6px; }
.lg-base { border-color: var(--sim-line-main); }
.lg-high { border-color: var(--sim-line-high); }
.lg-low { border-color: var(--sim-line-low); }
.lg-principal { border-color: var(--faint); border-top-style: dashed; }

/* ===== 年次表 ===== */
.sim-table-wrap { overflow: auto; max-height: 380px; border: 1px solid var(--line); border-radius: 8px; }
.sim-table { border-collapse: collapse; width: 100%; font-size: .9rem; }
.sim-table th, .sim-table td { padding: 7px 12px; text-align: right; border-bottom: 1px solid var(--line); white-space: nowrap; }
.sim-table th { background: var(--bg); color: var(--navy); font-weight: 700; position: sticky; top: 0; text-align: right; }
[data-theme="dark"] .sim-table th { color: #edf2f8; }
.sim-table th:first-child, .sim-table td:first-child { text-align: left; }

.sim-assume { font-size: .82rem; color: var(--faint); margin: 4px 2px 0; }

/* ===== 見やすさ改善（2026-10-27 追加） ===== */
.sim-hint { font-size: .78rem; color: var(--faint); margin: 0 0 2px; }
.sim-ico { width: 15px; height: 15px; vertical-align: -2px; margin-right: 5px; color: var(--gold); }
.sim-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.sim-chip {
  font-size: .78rem; padding: 4px 11px; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--line); background: var(--bg); color: var(--ink);
}
.sim-chip:hover { border-color: var(--gold); }
.sim-val, .sim-stat-value, .sim-table td, .sim-num input { font-variant-numeric: tabular-nums; }

/* 最終資産額は帯と同じ紺のグラデーションで主役にする */
.sim-stat-main {
  background: linear-gradient(135deg, var(--navy) 0%, var(--navy-2) 100%);
  border-top: none;
}
.sim-stat-main .sim-stat-label { color: #a9bdd3; }
.sim-stat-main .sim-stat-value { color: #fff; }
.sim-stat-main .sim-stat-sub { color: #cfdcec; }

/* 気づきはカード形式に */
.sim-notes { list-style: none; padding-left: 0; }
.sim-notes li {
  background: var(--bg); border-left: 3px solid var(--gold); border-radius: 8px;
  padding: 8px 12px; margin-bottom: 7px; color: var(--ink); font-size: .88rem;
}

/* 目標までの進捗バー */
.sim-goalbar { margin-top: 14px; }
.sim-goalbar-head { display: flex; justify-content: space-between; font-size: .8rem; color: var(--muted); margin-bottom: 5px; }
.sim-goalbar-head span:last-child { font-weight: 700; color: var(--ink); }
.sim-goalbar-track { height: 10px; border-radius: 999px; background: var(--sim-track-off); overflow: hidden; }
.sim-goalbar-fill {
  height: 100%; border-radius: 999px; width: 0;
  background: linear-gradient(90deg, var(--navy-2), var(--gold));
  transition: width .35s ease;
}

/* 年次表：ゼブラとマーカー */
.sim-table tr:nth-child(even) td { background: rgba(127, 147, 170, .07); }
.sim-tag {
  display: inline-block; font-size: .66rem; font-weight: 700; color: #fff; background: var(--gold);
  border-radius: 999px; padding: 1px 7px; margin-left: 6px; white-space: nowrap; vertical-align: 1px;
}
.sim-tag-goal { background: var(--sim-goal); }
