/*
 * はたらくお金の計算室
 * モノトーン＋深い青1色。角丸・影なし、細い罫線と余白で組む。
 */
:root {
  --ink: #111111;
  --text: #313131;
  --muted: #6b7076;
  --line: #d5d7d9;
  --line-strong: #111111;
  --paper: #ffffff;
  --gray: #f2f5f7;
  --blue: #2c4dad;
  --blue-weak: #e9eef9;
  --warn: #b3261e;
  --font: "Noto Sans JP", "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Yu Gothic", sans-serif;
  --en: "Inter", "Helvetica Neue", Arial, sans-serif;
  font-family: var(--font);
  color: var(--text);
  background: var(--paper);
  line-height: 1.9;
  letter-spacing: .06em;
  -webkit-text-size-adjust: 100%;
  -webkit-font-smoothing: antialiased;
}
* { box-sizing: border-box; }
body { margin: 0; }
a { color: var(--ink); text-underline-offset: 4px; text-decoration-thickness: 1px; }
a:hover { color: var(--blue); }
img { max-width: 100%; }
.wrap { max-width: 760px; margin: 0 auto; padding: 0 24px; }
.wrap.wide { max-width: 1040px; }

/* ---------- ヘッダー・フッター ---------- */
.site-header { background: var(--paper); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 10; }
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; height: 64px; max-width: 1040px; }
.logo { display: inline-flex; align-items: center; gap: 10px; font-weight: 700; font-size: 15px; text-decoration: none; color: var(--ink); white-space: nowrap; letter-spacing: .08em; }
.logo-mark { width: 14px; height: 14px; border-radius: 50%; background: var(--blue); flex: none; }
.logo-mark:empty::before { content: none; }
.global-nav { display: flex; gap: 28px; }
.global-nav a { color: var(--text); text-decoration: none; font-size: 13px; padding: 4px 0; white-space: nowrap; border-bottom: 1px solid transparent; }
.global-nav a:hover, .global-nav a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--ink); }
.site-footer { background: var(--ink); color: #c9ccd0; margin-top: 120px; font-size: 12.5px; }
.footer-inner { padding: 40px 24px; display: flex; gap: 28px; flex-wrap: wrap; align-items: center; max-width: 1040px; }
.footer-inner a { color: #fff; text-decoration: none; }
.footer-inner a:hover { text-decoration: underline; color: #fff; }
.footer-inner .copy { margin-left: auto; font-family: var(--en); letter-spacing: .04em; }

/* ---------- 共通の見出し ---------- */
.eyebrow { display: block; font-family: var(--en); font-size: 11px; font-weight: 600; letter-spacing: .22em; text-transform: uppercase; color: var(--blue); margin: 0 0 10px; }
.breadcrumb { font-size: 11.5px; color: var(--muted); margin: 28px 0 0; letter-spacing: .04em; }
.breadcrumb a { color: var(--muted); text-decoration: none; }
.breadcrumb a:hover { color: var(--ink); }
.page-head { margin: 36px 0 40px; }
h1 { font-size: 30px; line-height: 1.5; color: var(--ink); margin: 0 0 16px; letter-spacing: .08em; font-weight: 700; }
h2 { font-size: 20px; line-height: 1.6; color: var(--ink); margin: 80px 0 20px; padding-top: 22px; border-top: 1px solid var(--line-strong); letter-spacing: .08em; }
h3 { font-size: 16px; color: var(--ink); margin: 36px 0 10px; letter-spacing: .06em; }
.lead { color: var(--text); margin: 0; font-size: 14.5px; }
.updated { font-size: 11.5px; color: var(--muted); margin: 14px 0 0; }
article p, article li { font-size: 15px; }
article ol, article ul { padding-left: 1.3em; }

/* ---------- 計算パネル ---------- */
.card { background: var(--paper); border: 1px solid var(--line); }
.calc { background: var(--gray); border: 0; padding: 12px 0 32px; }
.calc form { padding: 0 32px; }
.calc fieldset { border: 0; padding: 28px 0 8px; margin: 0; border-bottom: 1px solid var(--line); }
.calc fieldset:last-of-type { border-bottom: 0; }
.calc legend { display: block; width: 100%; float: left; font-weight: 700; font-size: 16px; color: var(--ink); padding: 0; margin-bottom: 18px; letter-spacing: .08em; }
.calc legend + * { clear: both; }
.step { display: block; font-family: var(--en); font-size: 10.5px; font-weight: 600; letter-spacing: .22em; color: var(--blue); margin-bottom: 2px; }
.field { margin-bottom: 20px; }
.field label, .field .label { display: block; font-size: 13px; font-weight: 700; color: var(--ink); margin-bottom: 8px; }
.field .hint { font-size: 12px; color: var(--muted); margin: 8px 0 0; line-height: 1.7; letter-spacing: .03em; }
.field.sub { padding-left: 18px; border-left: 1px solid var(--line-strong); }
input[type="number"], select {
  width: 100%; font: inherit; font-size: 17px; letter-spacing: .04em; padding: 12px 14px; border: 1px solid var(--line); border-radius: 0; background: var(--paper); color: var(--ink);
  font-variant-numeric: tabular-nums; transition: border-color .15s;
  -webkit-appearance: none; appearance: none;
}
select { background-image: linear-gradient(45deg, transparent 50%, var(--ink) 50%), linear-gradient(135deg, var(--ink) 50%, transparent 50%); background-position: calc(100% - 20px) 52%, calc(100% - 15px) 52%; background-size: 5px 5px; background-repeat: no-repeat; }
input[type="number"]:focus, select:focus { outline: none; border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
input::placeholder { color: #b5b9bd; }
.unit-row { display: flex; align-items: center; gap: 10px; }
.unit-row input { flex: 1; min-width: 0; }
.unit-row span { font-size: 13px; color: var(--text); white-space: nowrap; }
.seg { display: flex; flex-wrap: wrap; gap: 0; }
.seg label { display: inline-flex; align-items: center; gap: 8px; border: 1px solid var(--line); margin: 0 -1px -1px 0; padding: 11px 18px; font-weight: 500; font-size: 13.5px; cursor: pointer; background: var(--paper); color: var(--text); }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg label:hover { background: #fafbfc; color: var(--ink); }
.seg label:has(input:checked), .seg label:has(input:checked):hover { background: var(--ink); border-color: var(--ink); color: #fff; position: relative; z-index: 1; }
.seg label:has(input[type="checkbox"])::before { content: ""; width: 12px; height: 12px; border: 1px solid currentColor; flex: none; }
.seg label:has(input[type="checkbox"]:checked)::before { background: currentColor; box-shadow: inset 0 0 0 2px var(--ink); }
.seg label:has(input:focus-visible) { outline: 2px solid var(--blue); outline-offset: 2px; }
details.more { margin: 0 0 20px; }
details.more summary { cursor: pointer; font-size: 13px; color: var(--ink); text-decoration: underline; text-underline-offset: 4px; }

/* ---------- 結果 ---------- */
.result { margin: 12px 32px 0; padding: 28px 28px 24px; background: var(--paper); border-top: 3px solid var(--ink); }
.result:has(.note:only-child) { border-top-color: var(--line); padding: 20px 28px; }
.result > :first-child { margin-top: 0; }
.result > :last-child { margin-bottom: 0; }
.result-total { font-size: 12.5px; color: var(--text); font-weight: 700; margin: 0; letter-spacing: .1em; }
.result-total strong { display: block; font-family: var(--en); font-size: 46px; line-height: 1.2; color: var(--ink); letter-spacing: .01em; font-weight: 700; margin-top: 6px; font-variant-numeric: tabular-nums; }
.result table { width: 100%; border-collapse: collapse; font-size: 13px; margin-top: 20px; font-variant-numeric: tabular-nums; }
.result th, .result td { padding: 10px 0; border-bottom: 1px solid var(--line); text-align: right; }
.result th { font-size: 11px; color: var(--muted); font-weight: 500; letter-spacing: .1em; }
.result th:first-child, .result td:first-child { text-align: left; }
.result p { font-size: 14px; }
.result .meta { font-size: 11.5px; color: var(--muted); margin: 14px 0 0; }
.errors { color: var(--warn); font-size: 13.5px; border-left: 2px solid var(--warn); padding: 2px 0 2px 14px; }
.shortfall { border: 1px solid var(--ink); padding: 18px 20px; margin-top: 22px; }
.shortfall strong { color: var(--warn); font-size: 20px; font-variant-numeric: tabular-nums; }
.calc > .note { padding: 0 32px; margin: 18px 0 0; }

.cta { margin: 20px 32px 0; display: grid; gap: 0; }
.cta a { position: relative; display: block; text-decoration: none; background: var(--paper); border: 1px solid var(--line); margin-top: -1px; padding: 16px 64px 16px 20px; color: var(--ink); transition: background .15s, color .15s; }
.cta a::after { content: ""; position: absolute; right: 22px; top: 50%; width: 24px; height: 1px; background: currentColor; transition: width .2s; }
.cta a:hover { background: var(--ink); color: #fff; }
.cta a:hover::after { width: 32px; }
.cta a:hover small, .cta a:hover .pr { color: #c9ccd0; border-color: #555; }
.cta a b { font-size: 14px; }
.cta a small { display: block; color: var(--muted); font-size: 12px; margin-top: 2px; }
.pr { font-family: var(--en); font-size: 9.5px; letter-spacing: .14em; color: var(--muted); border: 1px solid var(--line); padding: 1px 5px; margin-right: 8px; vertical-align: 2px; }

.ad-slot { margin: 40px 0; }

/* ---------- 解説 ---------- */
.table-wrap { overflow-x: auto; }
table.info { width: 100%; border-collapse: collapse; font-size: 13.5px; }
table.info th, table.info td { border-bottom: 1px solid var(--line); padding: 12px 14px 12px 0; text-align: left; vertical-align: top; }
table.info thead th { border-bottom: 1px solid var(--ink); font-size: 11.5px; color: var(--muted); font-weight: 500; letter-spacing: .1em; }
.formula { background: var(--gray); padding: 18px 22px; font-weight: 700; color: var(--ink); letter-spacing: .06em; }
.note { font-size: 12px; color: var(--muted); letter-spacing: .03em; }
.faq dt { font-weight: 700; color: var(--ink); margin-top: 28px; padding-left: 2em; text-indent: -2em; }
.faq dt::before { content: "Q"; font-family: var(--en); color: var(--blue); display: inline-block; width: 2em; text-indent: 0; }
.faq dd { margin: 8px 0 0; padding-left: 2em; }

/* ---------- トップ・一覧 ---------- */
.hero { position: relative; padding: 96px 0 72px; }
.hero::before { content: ""; position: absolute; z-index: -1; top: 0; right: -24px; width: 46%; height: 100%; background: var(--gray); clip-path: polygon(38% 0, 100% 0, 100% 100%, 0 100%); }
.hero h1 { font-size: 44px; line-height: 1.35; letter-spacing: .1em; margin: 0 0 24px; }
.hero .lead { font-size: 15px; max-width: 30em; }
.hero-meta { display: flex; gap: 28px; flex-wrap: wrap; margin: 36px 0 0; padding: 0; list-style: none; font-size: 12px; color: var(--text); }
.hero-meta li { position: relative; padding-left: 16px; }
.hero-meta li::before { content: ""; position: absolute; left: 0; top: .85em; width: 8px; height: 1px; background: var(--ink); }
.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin: 88px 0 0; padding-bottom: 18px; border-bottom: 1px solid var(--ink); }
.section-head h2 { margin: 0; padding: 0; border: 0; font-size: 22px; }
.section-head .more-link { font-size: 12px; white-space: nowrap; text-decoration: none; border-bottom: 1px solid var(--ink); padding-bottom: 2px; }
.tool-list { list-style: none; padding: 0; margin: 0; }
.tool-row { display: grid; grid-template-columns: 56px 1fr 40px; align-items: center; gap: 8px 20px; padding: 26px 4px; border-bottom: 1px solid var(--line); text-decoration: none; color: var(--ink); transition: background .2s, padding .2s; }
a.tool-row:hover { background: var(--gray); padding-left: 16px; color: var(--ink); }
.tool-row .num { font-family: var(--en); font-size: 12px; font-weight: 600; letter-spacing: .16em; color: var(--blue); }
.tool-row b { display: block; font-size: 17px; letter-spacing: .08em; }
.tool-row .desc { display: block; font-size: 12.5px; color: var(--muted); margin-top: 4px; letter-spacing: .04em; }
.tool-row .arrow { justify-self: end; width: 28px; height: 1px; background: var(--ink); position: relative; transition: width .2s; }
.tool-row .arrow::after { content: ""; position: absolute; right: 0; top: -3px; width: 7px; height: 7px; border-top: 1px solid var(--ink); border-right: 1px solid var(--ink); transform: rotate(45deg); transform-origin: 100% 0; top: 0; }
a.tool-row:hover .arrow { width: 40px; }
.tool-row.soon { color: #9a9ea3; }
.tool-row.soon .num { color: #9a9ea3; }
.tool-row .soon-label { justify-self: end; font-family: var(--en); font-size: 10px; letter-spacing: .16em; color: #9a9ea3; white-space: nowrap; }

@media (max-width: 640px) {
  :root { letter-spacing: .04em; }
  .wrap { padding: 0 18px; }
  h1 { font-size: 23px; }
  h2 { font-size: 18px; margin-top: 64px; }
  .hero { padding: 56px 0 48px; }
  .hero::before { width: 60%; right: -18px; }
  .hero h1 { font-size: 30px; }
  .header-inner { height: 56px; }
  .global-nav { gap: 12px; }
  .header-inner { gap: 10px; }
  .global-nav a { font-size: 11.5px; letter-spacing: .02em; }
  .logo { gap: 8px; }
  .logo-text { font-size: 13px; letter-spacing: .04em; }
  .calc form { padding: 0 18px; }
  .result, .cta { margin-left: 18px; margin-right: 18px; }
  .result { padding: 22px 20px 20px; }
  .calc > .note { padding: 0 18px; }
  .result-total strong { font-size: 38px; }
  .seg label { padding: 10px 14px; }
  .tool-row { grid-template-columns: 40px 1fr 28px; gap: 6px 12px; padding: 22px 0; }
  .footer-inner .copy { margin-left: 0; width: 100%; }
}
@media (max-width: 340px) {
  .logo-text { display: none; }
}

/* =========================================================
 * 読みやすさの調整（情報の強弱・階層）
 * ======================================================= */
:root { letter-spacing: .04em; }
.page-head { margin-bottom: 28px; }
.page-head h1 { font-size: 32px; margin-bottom: 14px; }
.lead { font-size: 16px; line-height: 1.85; color: var(--ink); letter-spacing: .03em; }

/* 要点ボックス：最初に答えを渡す */
.keypoints { margin: 0 0 36px; padding: 22px 26px 18px; border: 1px solid var(--ink); background: var(--paper); }
.keypoints-title { margin: 0 0 8px; font-size: 13px; font-weight: 700; color: var(--blue); letter-spacing: .14em; }
.keypoints ol { margin: 0; padding: 0; list-style: none; counter-reset: kp; }
.keypoints li { counter-increment: kp; position: relative; padding: 9px 0 9px 34px; font-size: 15.5px; line-height: 1.7; color: var(--ink); border-top: 1px solid var(--line); letter-spacing: .03em; }
.keypoints li:first-child { border-top: 0; }
.keypoints li::before { content: counter(kp); position: absolute; left: 0; top: 9px; font-family: var(--en); font-weight: 700; font-size: 15px; color: var(--blue); }

/* 強調：太字＋マーカーで、拾い読みしても要点が残るように */
strong, article b, .keypoints strong { font-weight: 700; color: var(--ink); background: linear-gradient(transparent 60%, #d9e2f8 60%); padding: 0 1px; }
.result strong, .shortfall strong, .result-total strong { background: none; padding: 0; }

/* 計算パネル内の階層 */
.calc legend { font-size: 18px; }
.field label, .field .label { font-size: 14px; }
.field .hint { font-size: 12.5px; color: #585d63; }
.opt { display: inline-block; font-size: 10.5px; font-weight: 500; color: var(--muted); border: 1px solid #b9bdc1; padding: 0 7px; margin-left: 8px; letter-spacing: .1em; vertical-align: 3px; line-height: 1.7; }
.result-total { font-size: 13px; }

/* 目次 */
.toc { background: var(--gray); padding: 24px 28px; margin: 8px 0 0; }
.toc-title { margin: 0 0 10px; font-size: 13px; font-weight: 700; color: var(--ink); letter-spacing: .14em; }
.toc ol { margin: 0; padding: 0; list-style: none; counter-reset: toc; columns: 2; column-gap: 32px; }
.toc li { counter-increment: toc; break-inside: avoid; padding: 5px 0 5px 30px; position: relative; font-size: 14px; line-height: 1.6; }
.toc li::before { content: counter(toc, decimal-leading-zero); position: absolute; left: 0; top: 7px; font-family: var(--en); font-size: 11px; font-weight: 600; color: var(--blue); letter-spacing: .08em; }
.toc a { text-decoration: none; color: var(--ink); }
.toc a:hover { text-decoration: underline; color: var(--blue); }

/* 解説記事：番号付きの大見出し、記号付きの小見出し、本文は詰め気味に */
article { counter-reset: sec; }
article p, article li { font-size: 15.5px; line-height: 1.95; letter-spacing: .03em; }
article h2 { counter-increment: sec; font-size: 23px; line-height: 1.55; margin: 88px 0 22px; padding-top: 26px; border-top: 2px solid var(--ink); scroll-margin-top: 84px; }
article h2::before { content: counter(sec, decimal-leading-zero); display: block; font-family: var(--en); font-size: 12px; font-weight: 600; color: var(--blue); letter-spacing: .2em; margin-bottom: 4px; }
article h3 { font-size: 17.5px; margin: 40px 0 12px; padding-left: 16px; position: relative; scroll-margin-top: 84px; }
article h3::before { content: ""; position: absolute; left: 0; top: .55em; width: 7px; height: 7px; background: var(--blue); }
.formula { font-size: 16px; line-height: 1.8; }
table.info td:first-child { color: var(--ink); font-weight: 500; }
table.info td:last-child { font-variant-numeric: tabular-nums; }
.faq dt { font-size: 16px; }
.faq dd { font-size: 15px; color: var(--text); }

/* 画面下の結果バー */
.sticky-result { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; display: flex; align-items: center; gap: 14px; width: 100%; padding: 12px 20px calc(12px + env(safe-area-inset-bottom)); border: 0; background: var(--ink); color: #fff; font: inherit; text-align: left; cursor: pointer; }
.sticky-result[hidden] { display: none; }
.sticky-label { font-size: 12px; color: #c9ccd0; }
.sticky-value { font-family: var(--en); font-size: 22px; font-weight: 700; letter-spacing: .01em; }
.sticky-go { margin-left: auto; font-size: 12px; border-bottom: 1px solid #fff; padding-bottom: 1px; }

@media (max-width: 640px) {
  .page-head h1 { font-size: 24px; }
  .lead { font-size: 15px; }
  .keypoints { padding: 18px 18px 14px; margin-bottom: 28px; }
  .keypoints li { font-size: 14.5px; padding-left: 28px; }
  .toc { padding: 20px; }
  .toc ol { columns: 1; }
  article h2 { font-size: 20px; margin-top: 68px; }
  article h3 { font-size: 16.5px; }
  article p, article li { font-size: 15px; }
}

/* 結果内の小見出しとスケジュール */
.result-sub { margin: 28px 0 0; padding-top: 18px; border-top: 1px solid var(--ink); font-size: 13px; font-weight: 700; color: var(--ink); letter-spacing: .1em; }
.result-sub + table { margin-top: 8px; }
.timeline { list-style: none; margin: 12px 0 0; padding: 0; }
.timeline li { position: relative; display: grid; grid-template-columns: 11.5em 1fr; gap: 12px; padding: 9px 0 9px 18px; font-size: 13px; border-bottom: 1px solid var(--line); }
.timeline li::before { content: ""; position: absolute; left: 0; top: 16px; width: 7px; height: 7px; border-radius: 50%; background: var(--blue); }
.timeline li:last-child { border-bottom: 0; }
.tl-date { font-variant-numeric: tabular-nums; color: var(--ink); font-weight: 500; white-space: nowrap; }
.tl-label b { background: none; padding: 0; }
input[type="date"] { width: 100%; font: inherit; font-size: 16px; padding: 11px 14px; border: 1px solid var(--line); border-radius: 0; background: var(--paper); color: var(--ink); -webkit-appearance: none; appearance: none; min-height: 48px; }
input[type="date"]:focus { outline: none; border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.seg.vertical { flex-direction: column; }
.seg.vertical label { margin: 0 0 -1px 0; }
@media (max-width: 640px) {
  .timeline li { grid-template-columns: 1fr; gap: 2px; }
}

/* リンク先が未設定（href="#"）のPR枠は表示しない。ASPのリンクに差し替えると自動で表示される */
.cta a[href="#"] { display: none !important; }
.cta:not(:has(a:not([href="#"]))) { display: none !important; }

/* 出典リスト */
.sources { list-style: none; padding: 0; margin: 0; }
.sources li { position: relative; padding: 10px 0 10px 18px; border-bottom: 1px solid var(--line); font-size: 14px; line-height: 1.7; }
.sources li::before { content: ""; position: absolute; left: 0; top: 1.2em; width: 8px; height: 1px; background: var(--ink); }
.sources a { color: var(--ink); }
