/* ==========================================================
   特典ツール（①人生設計シート ②家計診断）共通スタイル
   LP（lp.css）の色・書体をそのまま使います
   ========================================================== */
/* ==========================================================
   特典ごとのテーマ色（①人生設計シート＝緑／②家計診断＝オレンジ）
   ========================================================== */
.theme-sheet { --t-main: #2f7d5b; --t-dark: #215a41; --t-soft: #e8f4ed; --t-hero: #e3f1e8; --t-page: #f5faf7; }
.theme-kakei { --t-main: #d9682a; --t-dark: #a94d1b; --t-soft: #fff1e6; --t-hero: #ffeedf; --t-page: #fffaf6; }
.tool-page { background: var(--t-page); }
.tool-page .hero-badge { background: var(--t-main); }
.tool-page a:focus-visible, .tool-page button:focus-visible { outline-color: var(--t-main); }

.tool-hero { padding: 40px 0 28px; text-align: center; background: var(--t-hero); }
.tool-hero h1 { font-size: clamp(24px, 6vw, 34px); color: var(--t-main); margin: 0 0 6px; line-height: 1.5; }
.tool-sub { color: var(--t-main); font-weight: 700; margin: 0 0 16px; line-height: 1.7; }
.tool-lead { text-align: left; margin: 0 0 14px; }
.tool-save { display: inline-block; font-size: 13px; color: #4a6b5a; background: var(--white); border-radius: 999px; padding: 6px 16px; margin: 0; line-height: 1.6; }

/* 進み具合 */
.tool-progress { position: sticky; top: 0; z-index: 20; background: rgba(255,255,255,.96); border-bottom: 1px solid var(--border); backdrop-filter: blur(6px); }
.tool-progress .narrow { display: flex; gap: 6px; padding-top: 8px; padding-bottom: 8px; }
.tool-progress a, .tool-progress [data-k] {
  flex: 1; text-align: center; text-decoration: none; color: #8a99a3; font-size: 12px; font-weight: 700; line-height: 1.4;
  padding: 6px 4px; border-radius: 10px; background: #eef3f6; transition: background .2s, color .2s;
}
.tool-progress a span, .tool-progress [data-k] > span { display: block; font-size: 11px; font-weight: 500; }
.tool-progress .on { background: var(--t-main); color: var(--white); }

.tool-body { padding-top: 24px; padding-bottom: 56px; }
.tool-step, .tool-panel { background: var(--white); border-radius: var(--radius); padding: 24px 20px; margin: 0 0 24px; box-shadow: 0 4px 16px rgba(0,0,0,.06); scroll-margin-top: 70px; }
.step-head { display: flex; gap: 12px; align-items: flex-start; margin: 0 0 8px; padding: 0 0 16px; border-bottom: 2px dashed var(--border); }
.step-badge { flex: none; background: var(--t-main); color: var(--white); font-size: 12px; font-weight: 700; border-radius: 999px; padding: 4px 12px; margin-top: 4px; }
.step-head h2 { font-size: 20px; color: var(--t-main); margin: 0; line-height: 1.5; }
.step-head p { margin: 2px 0 0; font-size: 14px; color: #6a7984; line-height: 1.7; }

.q { padding: 20px 0 4px; }
.q + .q { border-top: 1px solid var(--border); }
.q h3 { font-size: 16px; margin: 0 0 12px; color: var(--text); line-height: 1.6; }
.q-note { font-size: 13px; color: #6a7984; margin: -6px 0 12px; line-height: 1.7; }
.q-field { margin: 0 0 14px; }
.q-field label { display: block; font-size: 14px; font-weight: 700; margin: 0 0 6px; line-height: 1.6; }
.q-field textarea, .q-field input[type=text], .q-field input[type=number], .q-field select {
  width: 100%; font: inherit; font-size: 16px; color: var(--text); background: #fbfcfd;
  border: 2px solid var(--border); border-radius: 12px; padding: 10px 14px; line-height: 1.7;
}
.q-field textarea:focus, .q-field input:focus, .q-field select:focus { outline: none; border-color: var(--t-main); background: var(--white); }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
@media (max-width: 560px) { .grid2 { grid-template-columns: 1fr; } }
.num { position: relative; }
.num input { padding-right: 52px !important; }
.num span { position: absolute; right: 14px; top: 50%; transform: translateY(-50%); font-size: 13px; color: #6a7984; pointer-events: none; }

/* チェック項目（タップしやすいチップ） */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips.single { flex-direction: column; }
.chip { position: relative; cursor: pointer; }
.chip input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.chip span { display: block; border: 2px solid var(--border); border-radius: 999px; padding: 6px 14px; font-size: 14px; line-height: 1.6; background: var(--white); transition: all .15s; }
.chips.single .chip span { border-radius: 12px; padding: 8px 14px 8px 38px; position: relative; }
.chips.single .chip span::before { content: ""; position: absolute; left: 12px; top: 50%; width: 16px; height: 16px; margin-top: -8px; border: 2px solid #b9c7cf; border-radius: 4px; background: var(--white); }
.chip input:checked + span { background: var(--t-main); border-color: var(--t-main); color: var(--white); }
.chips.single .chip input:checked + span { background: var(--t-soft); color: var(--text); }
.chips.single .chip input:checked + span::before { background: var(--t-main); border-color: var(--t-main); box-shadow: inset 0 0 0 3px var(--white); }
.chip input:focus-visible + span { outline: 3px solid var(--orange); outline-offset: 2px; }

/* シナリオ */
.scenario { border-radius: 14px; padding: 16px; margin: 0 0 14px; }
.scenario h4 { margin: 0; font-size: 15px; }
.scenario p { margin: 2px 0 10px; font-size: 13px; }
.scenario.worst { background: #fdf0ef; } .scenario.worst h4, .scenario.worst p { color: #b34a40; }
.scenario.ideal { background: #edf7ef; } .scenario.ideal h4, .scenario.ideal p { color: #2f7d4a; }
.slider input[type=range] { width: 100%; accent-color: var(--t-main); }
.slider-scale { display: flex; justify-content: space-between; font-size: 12px; color: #8a99a3; }
.slider-scale output { font-size: 15px; font-weight: 700; color: var(--t-main); }

/* ボタン */
.tool-actions { text-align: center; margin: 24px 0 0; }
.tool-actions.row { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.t-btn { font: inherit; font-weight: 700; cursor: pointer; border-radius: 999px; padding: 15px 28px; font-size: 16px; border: 2px solid transparent; }
.t-btn.primary { background: var(--t-main); color: var(--white); width: min(100%, 360px); box-shadow: 0 5px 0 var(--t-dark); }
.t-btn.primary:active { transform: translateY(4px); box-shadow: 0 1px 0 var(--t-dark); }
.t-btn.line { background: var(--line); color: var(--white); box-shadow: 0 5px 0 var(--line-dark); }
.t-btn.ghost { background: var(--white); color: var(--t-main); border-color: var(--border); }
.t-btn.small { font-size: 13px; padding: 8px 16px; }
.form-error { color: #c0392b; font-weight: 700; font-size: 14px; text-align: center; margin: 12px 0 0; }

/* 結果（①） */
.result-head { text-align: center; margin: 0 0 18px; }
.result-head h2 { font-size: 22px; color: var(--t-main); margin: 0 0 4px; }
.result-head p { margin: 0; font-size: 14px; }
.result-card { background: var(--white); border-radius: var(--radius); padding: 20px; box-shadow: 0 4px 16px rgba(0,0,0,.06); margin: 0 0 20px; }
.result-title { text-align: center; font-size: 17px; margin: 0 0 16px; }
.r-block { border-radius: 14px; padding: 16px; margin: 0 0 14px; }
.r-block h4 { margin: 0 0 8px; font-size: 16px; }
.r-block.blue { background: var(--t-soft); } .r-block.green { background: #edf7ef; } .r-block.yellow { background: #fff8e6; }
.r-label { font-size: 12px; color: #6a7984; margin: 10px 0 4px; font-weight: 700; }
.r-label.red { color: #b34a40; } .r-label.green { color: #2f7d4a; }
.r-tags { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.r-tags li { background: var(--white); border-radius: 999px; padding: 2px 12px; font-size: 13px; }
.r-rank { list-style: none; padding: 0; margin: 0; }
.r-rank li { display: flex; gap: 10px; align-items: center; padding: 4px 0; font-weight: 700; }
.r-rank span { flex: none; width: 24px; height: 24px; border-radius: 50%; background: var(--t-main); color: var(--white); font-size: 12px; display: flex; align-items: center; justify-content: center; }
.r-text { margin: 0; font-size: 14px; line-height: 1.8; }
.r-two { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 560px) { .r-two { grid-template-columns: 1fr; } }
.r-empty { text-align: center; color: #6a7984; margin: 0; }

/* 送る・相談 */
.share, .consult { border-radius: var(--radius); padding: 20px; margin: 0 0 20px; text-align: center; }
.share { background: #eaf8ef; }
.share h3, .consult h3 { margin: 0 0 6px; font-size: 17px; }
.share p, .consult p { font-size: 14px; margin: 0 0 14px; line-height: 1.8; }
.share-btns { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.share-status { font-size: 13px; color: #2f7d4a; margin: 12px 0 0 !important; min-height: 1em; }
.consult { background: var(--white); border: 2px solid var(--line); }
.consult ul { list-style: none; padding: 0; margin: 0 0 16px; display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; }
.consult li { background: var(--t-soft); border-radius: 999px; padding: 2px 12px; font-size: 13px; }

/* 家計診断（②） */
.panel-title { font-size: 17px; margin: 0 0 14px; color: var(--t-main); }
.k-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 0 0 18px; }
.k-stats.three { grid-template-columns: repeat(3, 1fr); }
.k-stat { background: #f3f7f9; border-radius: 14px; padding: 14px 10px; text-align: center; }
.k-stat p { margin: 0; font-size: 13px; color: #6a7984; }
.k-stat strong { display: block; font-size: clamp(20px, 5vw, 26px); color: var(--t-main); line-height: 1.4; }
.k-tag { display: inline-block; font-size: 12px; font-weight: 700; border-radius: 999px; padding: 1px 10px; margin-top: 4px; }
.k-tag.good { background: #dff3e5; color: #2f7d4a; } .k-tag.warning { background: #fff1cc; color: #9a6b00; } .k-tag.danger { background: #fde2df; color: #b34a40; }
@media (max-width: 420px) { .k-stats.three { grid-template-columns: 1fr; } }
.donut-wrap { display: grid; grid-template-columns: 180px 1fr; gap: 18px; align-items: center; }
#donut { width: 180px; height: 180px; transform: rotate(0deg); }
.donut-label { font-size: 3px; fill: #6a7984; font-family: var(--font); }
.donut-num { font-size: 5px; font-weight: 700; fill: var(--t-main); font-family: var(--font); }
.donut-legend { list-style: none; padding: 0; margin: 0; font-size: 13px; }
.donut-legend li { display: flex; align-items: center; gap: 8px; padding: 2px 0; line-height: 1.6; }
.donut-legend i { flex: none; width: 10px; height: 10px; border-radius: 3px; }
.donut-legend span { margin-left: auto; color: #6a7984; white-space: nowrap; }
.donut-legend .muted { color: #8a99a3; }
@media (max-width: 520px) { .donut-wrap { grid-template-columns: 1fr; justify-items: center; } .donut-legend { width: 100%; } }

.diag-list { display: grid; gap: 10px; padding-top: 16px; }
.diag { display: grid; grid-template-columns: 30px 1fr auto; gap: 12px; align-items: center; border-radius: 14px; padding: 14px; }
.diag.good { background: #edf7ef; } .diag.warning { background: #fff8e6; } .diag.danger { background: #fdf0ef; }
.diag-ico { width: 30px; height: 30px; border-radius: 50%; display: flex; align-items: center; justify-content: center; color: var(--white); font-weight: 700; }
.diag.good .diag-ico { background: #3a9a5b; } .diag.warning .diag-ico { background: #d9a400; } .diag.danger .diag-ico { background: #d0584c; }
.diag h5 { margin: 0; font-size: 15px; } .diag p { margin: 0; font-size: 13px; line-height: 1.6; }
.diag-bar { position: relative; height: 6px; background: rgba(0,0,0,.07); border-radius: 3px; margin-top: 6px; }
.diag-bar span { display: block; height: 100%; border-radius: 3px; background: currentColor; opacity: .55; }
.diag.good .diag-bar { color: #3a9a5b; } .diag.warning .diag-bar { color: #d9a400; } .diag.danger .diag-bar { color: #d0584c; }
.diag-bar i { position: absolute; top: -3px; width: 2px; height: 12px; background: var(--text); opacity: .5; }
.diag-num { text-align: right; } .diag-num strong { display: block; font-size: 18px; } .diag-num small { font-size: 11px; color: #6a7984; white-space: nowrap; }

.plan-list { display: grid; gap: 12px; padding-top: 16px; }
.plan-item { border: 2px solid var(--border); border-radius: 14px; padding: 16px; }
.plan-head { display: flex; gap: 10px; align-items: center; margin: 0 0 8px; }
.plan-head > span { flex: none; width: 28px; height: 28px; border-radius: 50%; background: var(--t-main); color: var(--white); font-weight: 700; font-size: 13px; display: flex; align-items: center; justify-content: center; }
.plan-item h5 { margin: 0; font-size: 15px; } .plan-head p { margin: 0; font-size: 13px; color: #2f7d4a; font-weight: 700; }
.plan-item ul { margin: 0; padding-left: 1.2em; font-size: 14px; }
.plan-item.none p { margin: 6px 0 0; font-size: 14px; }
.sim-box { margin-top: 16px; background: #edf7ef; border-radius: 14px; padding: 16px; }
.sim-box h4 { margin: 0 0 8px; color: #2f7d4a; }
.sim-box dl { margin: 0; }
.sim-box dl > div { display: flex; justify-content: space-between; padding: 4px 0; border-bottom: 1px dashed rgba(0,0,0,.08); }
.sim-box dt { font-size: 14px; } .sim-box dd { margin: 0; font-weight: 700; }
.sim-box .g { color: #2f7d4a; } .sim-box .b { color: var(--t-main); } .sim-box .o { color: #c46a1f; }
.next-box { background: var(--t-soft); border-radius: 14px; padding: 16px 18px; margin: 0 0 20px; }
.next-box h4 { margin: 0 0 6px; color: var(--t-main); }
.next-box ul { margin: 0; padding-left: 1.2em; font-size: 14px; }

@media print {
  .tool-progress, .share, .consult, .tool-actions, .lp-header, .lp-footer { display: none !important; }
  .tool-page { background: #fff; }
}
