/* くらしの手続き計算 — 共通スタイル */
:root {
  --brand: #0b5cad;
  --brand-dark: #08457f;
  --brand-soft: #e8f1fb;
  --accent: #ff7a00;
  --accent-dark: #e06a00;
  --accent-soft: #fff3e6;
  --bg: #f4f6f9;
  --surface: #ffffff;
  --text: #1d2733;
  --muted: #5b6676;
  --border: #dde3ea;
  --line: #eef1f5;
  --warn-bg: #fff8e6;
  --warn-line: #f2c46b;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(16, 32, 64, .06), 0 4px 16px rgba(16, 32, 64, .06);
  font-family: "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Noto Sans JP", "Yu Gothic UI", "Meiryo", system-ui, sans-serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 16px; }
body { margin: 0; background: var(--bg); color: var(--text); line-height: 1.8; font-size: 16px; }
a { color: var(--brand); }
a:hover { color: var(--brand-dark); }
img, svg { max-width: 100%; }
.wrap { max-width: 1080px; margin: 0 auto; padding: 0 16px; }
.skip { position: absolute; left: -999px; }
.skip:focus { left: 8px; top: 8px; background: #fff; padding: 8px; z-index: 100; }
[hidden] { display: none !important; }

/* ヘッダー */
.site-header { background: var(--surface); border-bottom: 1px solid var(--border); }
.header-inner { display: flex; align-items: center; justify-content: space-between; min-height: 60px; gap: 12px; }
.logo { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text); }
.logo-mark { width: 34px; height: 34px; flex: none; }
.logo-text { display: flex; flex-direction: column; font-weight: 800; font-size: 1.12rem; line-height: 1.25; letter-spacing: .02em; }
.logo-sub { font-size: .68rem; font-weight: 600; color: var(--muted); letter-spacing: 0; }
.ad-note { font-size: .72rem; color: var(--muted); white-space: nowrap; }
.gnav { background: var(--brand); }
.gnav-inner { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; }
.gnav-inner::-webkit-scrollbar { display: none; }
.gnav a { color: #fff; text-decoration: none; font-size: .88rem; font-weight: 600; padding: 10px 12px; white-space: nowrap; }
.gnav a:hover { background: rgba(255, 255, 255, .14); color: #fff; }

/* パンくず */
.breadcrumb { font-size: .78rem; color: var(--muted); padding: 10px 0 0; }
.breadcrumb ol { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 4px; }
.breadcrumb li:not(:last-child)::after { content: "›"; margin-left: 4px; }
.breadcrumb a { color: var(--muted); }

/* 2カラム（PC） */
.layout { display: grid; gap: 28px; padding: 8px 0 40px; }
@media (min-width: 960px) { .layout { grid-template-columns: minmax(0, 1fr) 300px; } }
.main-col { min-width: 0; }

/* ヒーロー */
.hero { background: linear-gradient(135deg, var(--brand) 0%, #1673c9 100%); color: #fff; border-radius: var(--radius); padding: 22px 20px; margin: 12px 0 20px; position: relative; overflow: hidden; }
.hero h1 { font-size: 1.55rem; line-height: 1.4; margin: 6px 0 8px; }
.hero p { margin: 0; font-size: .92rem; opacity: .95; }
.hero .badges { display: flex; flex-wrap: wrap; gap: 6px; }
.badge { display: inline-block; font-size: .72rem; font-weight: 700; padding: 2px 10px; border-radius: 999px; background: #fff; color: var(--brand); }
.badge.orange { background: var(--accent); color: #fff; }
.hero .points { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 12px; font-size: .82rem; }
.hero .points span::before { content: "✓"; margin-right: 4px; font-weight: 800; }
.hero-illust { position: absolute; right: -6px; bottom: -10px; width: 120px; opacity: .22; }
@media (min-width: 720px) { .hero { padding: 28px 32px; } .hero h1 { font-size: 1.9rem; } .hero-illust { opacity: .9; width: 150px; right: 24px; bottom: 12px; } .hero .hero-body { max-width: calc(100% - 170px); } }

/* カード・見出し */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; margin-bottom: 16px; box-shadow: var(--shadow); }
h2.sec { font-size: 1.25rem; margin: 36px 0 14px; padding: 4px 0 4px 12px; border-left: 5px solid var(--brand); line-height: 1.5; }
.small { font-size: .84rem; color: var(--muted); }

/* フォーム（質問形式） */
.calc { padding: 0; overflow: hidden; }
.calc-head { background: var(--brand-soft); padding: 12px 20px; font-weight: 800; color: var(--brand-dark); }
.q { padding: 18px 20px; border-top: 1px solid var(--line); }
.calc-head + .q { border-top: 0; }
.q-label { display: flex; align-items: center; gap: 10px; font-weight: 700; margin-bottom: 10px; }
.q-num { flex: none; width: 28px; height: 28px; border-radius: 50%; background: var(--brand); color: #fff; font-size: .78rem; display: grid; place-items: center; font-weight: 800; }
.q-hint { font-size: .8rem; color: var(--muted); margin: 6px 0 0; }
.tiles { display: grid; gap: 8px; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); }
.tiles.cols-2 { grid-template-columns: repeat(2, 1fr); }
.tiles label { display: flex; align-items: center; gap: 8px; border: 2px solid var(--border); background: var(--surface); border-radius: 10px; padding: 10px 12px; cursor: pointer; font-size: .92rem; line-height: 1.4; min-height: 48px; }
.tiles label:hover { border-color: #b8c7d8; }
.tiles input { accent-color: var(--brand); width: 18px; height: 18px; flex: none; margin: 0; }
.tiles label:has(input:checked) { border-color: var(--brand); background: var(--brand-soft); font-weight: 700; }
.tiles .sub { display: block; font-size: .72rem; color: var(--muted); font-weight: 400; }
.field { display: flex; align-items: center; gap: 8px; }
.field input, .field select, select.full { font: inherit; font-size: 1.05rem; padding: 10px 12px; border: 2px solid var(--border); border-radius: 10px; background: var(--surface); color: var(--text); width: 100%; max-width: 280px; }
select.full { max-width: 100%; }
.field input:focus, .field select:focus, select.full:focus { outline: none; border-color: var(--brand); }
.field .unit { font-weight: 700; color: var(--muted); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.chips button { font: inherit; font-size: .8rem; border: 1px solid var(--border); background: var(--bg); border-radius: 999px; padding: 4px 12px; cursor: pointer; color: var(--text); }
.chips button:hover { border-color: var(--brand); color: var(--brand); }
.checks { display: grid; gap: 8px; }
.checks label { display: flex; gap: 10px; align-items: flex-start; border: 2px solid var(--border); border-radius: 10px; padding: 10px 12px; cursor: pointer; font-size: .92rem; }
.checks input { accent-color: var(--brand); width: 18px; height: 18px; margin-top: 3px; flex: none; }
.checks label:has(input:checked) { border-color: var(--brand); background: var(--brand-soft); }
details.more { border-top: 1px solid var(--line); }
details.more > summary { padding: 14px 20px; cursor: pointer; font-weight: 700; color: var(--brand); list-style: none; }
details.more > summary::-webkit-details-marker { display: none; }
details.more > summary::before { content: "＋ "; }
details.more[open] > summary::before { content: "－ "; }

/* 結果 */
.result { border: 2px solid var(--brand); padding: 0; overflow: hidden; }
.result-head { background: var(--brand); color: #fff; padding: 14px 20px; }
.result-head .label { font-size: .85rem; opacity: .9; }
.result-head .amount { font-size: 2.3rem; font-weight: 800; line-height: 1.2; letter-spacing: .01em; }
.result-head .amount small { font-size: 1rem; margin-left: 2px; }
.result-head .formula { font-size: .85rem; opacity: .95; }
.result-body { padding: 16px 20px 20px; }
.stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
@media (min-width: 600px) { .stats { grid-template-columns: repeat(4, 1fr); } }
.stat { background: var(--bg); border-radius: 10px; padding: 10px 12px; }
.stat .k { font-size: .75rem; color: var(--muted); }
.stat .v { font-size: 1.12rem; font-weight: 800; }
.callout { background: var(--accent-soft); border: 1px solid #ffd2a6; border-radius: 10px; padding: 12px 14px; margin-top: 14px; font-size: .9rem; }
.callout strong { color: var(--accent-dark); }
.notice { background: var(--warn-bg); border: 1px solid var(--warn-line); border-radius: 10px; padding: 12px 14px; font-size: .86rem; margin: 14px 0; }

/* 流れ（ステップ図） */
.flow { list-style: none; margin: 14px 0 0; padding: 0; counter-reset: flow; }
.flow li { position: relative; padding: 0 0 14px 40px; font-size: .9rem; }
.flow li::before { counter-increment: flow; content: counter(flow); position: absolute; left: 0; top: 0; width: 26px; height: 26px; border-radius: 50%; background: var(--brand-soft); color: var(--brand); font-weight: 800; font-size: .8rem; display: grid; place-items: center; }
.flow li:not(:last-child)::after { content: ""; position: absolute; left: 12px; top: 28px; bottom: 2px; width: 2px; background: var(--brand-soft); }
.flow li b { display: block; }
.flow .tag { font-size: .72rem; font-weight: 700; color: var(--accent-dark); margin-left: 6px; }

/* おすすめ（広告） */
.offer { display: grid; gap: 6px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); padding: 16px; margin-bottom: 12px; box-shadow: var(--shadow); }
.offer .cat { font-size: .75rem; font-weight: 700; color: var(--muted); }
.offer .title { font-weight: 800; font-size: 1.05rem; }
.offer .desc { font-size: .9rem; }
.pr { display: inline-block; font-size: .66rem; font-weight: 700; color: var(--muted); border: 1px solid var(--border); border-radius: 4px; padding: 0 5px; margin-left: 6px; vertical-align: 1px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; font: inherit; font-weight: 800; text-decoration: none; border: 0; border-radius: 999px; padding: 12px 22px; cursor: pointer; }
.btn-accent { background: var(--accent); color: #fff; box-shadow: 0 2px 0 var(--accent-dark); }
.btn-accent:hover { background: var(--accent-dark); color: #fff; }
.btn-ghost { background: var(--surface); color: var(--brand); border: 2px solid var(--brand); }
.btn.disabled { background: var(--line); color: var(--muted); box-shadow: none; pointer-events: none; }
.offer .btn { justify-self: start; margin-top: 4px; }

/* 下部固定バー（スマホ） */
.sticky-bar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 50; background: var(--surface); border-top: 1px solid var(--border); box-shadow: 0 -4px 16px rgba(16, 32, 64, .1); padding: 8px 16px calc(8px + env(safe-area-inset-bottom)); display: flex; align-items: center; justify-content: space-between; gap: 12px; transform: translateY(110%); transition: transform .25s; }
.sticky-bar.show { transform: none; }
.sticky-bar .k { font-size: .72rem; color: var(--muted); line-height: 1.2; }
.sticky-bar .v { font-size: 1.35rem; font-weight: 800; color: var(--brand); line-height: 1.2; }
.sticky-bar .btn { padding: 10px 16px; font-size: .88rem; }
@media (min-width: 960px) { .sticky-bar { display: none; } }

/* 記事 */
article.post { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px 20px; box-shadow: var(--shadow); }
@media (min-width: 720px) { article.post { padding: 32px 36px; } }
article.post h1 { font-size: 1.55rem; line-height: 1.45; margin: 0 0 8px; }
article.post h2 { font-size: 1.22rem; margin: 36px 0 12px; padding: 10px 14px; background: var(--brand-soft); border-left: 5px solid var(--brand); border-radius: 0 8px 8px 0; line-height: 1.5; }
article.post h3 { margin: 24px 0 8px; padding-bottom: 4px; border-bottom: 2px solid var(--line); }
.meta { font-size: .8rem; color: var(--muted); }
.lead { color: var(--muted); }
table { width: 100%; border-collapse: collapse; margin: 12px 0; font-size: .92rem; }
th, td { border: 1px solid var(--border); padding: 8px 10px; text-align: left; }
th { background: var(--brand-soft); font-weight: 700; }
article.post table { display: block; overflow-x: auto; }
article.post th, article.post td { white-space: nowrap; }
.toc { background: var(--bg); border: 1px solid var(--border); border-radius: 10px; padding: 12px 20px; margin: 16px 0; font-size: .92rem; }
.toc strong { display: block; margin-bottom: 4px; }
.toc ol { margin: 0; padding-left: 1.3em; }
.cta { background: var(--accent-soft); border: 1px solid #ffd2a6; border-radius: 10px; padding: 16px 18px; margin: 24px 0; }
.cta strong { display: block; margin-bottom: 4px; }
.cta .btn { margin-top: 10px; }

/* 内訳 */
table.bd { margin: 8px 0 0; }
table.bd td { border: 0; border-bottom: 1px solid var(--line); padding: 8px 4px; vertical-align: top; }
table.bd td:last-child { text-align: right; white-space: nowrap; font-weight: 700; }
table.bd tr.total td { border-top: 2px solid var(--text); font-size: 1.05rem; }

/* FAQ */
.faq details { border: 1px solid var(--border); border-radius: 10px; background: var(--surface); margin-bottom: 8px; }
.faq summary { cursor: pointer; padding: 12px 16px; font-weight: 700; list-style: none; display: flex; gap: 10px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::before { content: "Q"; color: var(--brand); font-weight: 900; }
.faq .a { padding: 0 16px 14px 40px; font-size: .92rem; }

/* サイドバー */
.side .card { padding: 16px; }
.side-title { font-weight: 800; font-size: .95rem; margin: 0 0 8px; padding-bottom: 6px; border-bottom: 2px solid var(--brand); }
.side ul { list-style: none; margin: 0; padding: 0; }
.side li { border-bottom: 1px solid var(--line); }
.side li:last-child { border-bottom: 0; }
.side li a { display: block; padding: 9px 2px; text-decoration: none; color: var(--text); font-size: .9rem; line-height: 1.5; }
.side li a:hover { color: var(--brand); }
.tool-card { display: flex; gap: 12px; align-items: center; text-decoration: none; color: var(--text); }
.tool-card .ic { flex: none; width: 44px; height: 44px; border-radius: 10px; background: var(--brand-soft); display: grid; place-items: center; }
.tool-card .ic svg { width: 26px; height: 26px; }
.tool-card strong { display: block; line-height: 1.4; }
.tool-card span { font-size: .8rem; color: var(--muted); }

/* トップページ */
.home-hero { background: linear-gradient(135deg, var(--brand) 0%, #1673c9 100%); color: #fff; border-radius: var(--radius); padding: 26px 22px; margin: 16px 0 8px; }
.home-hero h1 { margin: 0 0 6px; font-size: 1.6rem; line-height: 1.4; }
.home-hero p { margin: 0; opacity: .95; }
.tool-grid { display: grid; gap: 12px; grid-template-columns: 1fr; }
@media (min-width: 640px) { .tool-grid { grid-template-columns: 1fr 1fr; } }
.tool-grid .card { margin: 0; }
.tool-grid .soon { opacity: .6; }
.post-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.post-list a { display: block; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 12px 14px; text-decoration: none; color: var(--text); font-weight: 600; }
.post-list a:hover { border-color: var(--brand); color: var(--brand); }

/* フッター */
.site-footer { background: #1b2735; color: #c9d3de; margin-top: 40px; padding: 32px 0 calc(24px + env(safe-area-inset-bottom)); font-size: .86rem; }
.site-footer a { color: #e6edf5; text-decoration: none; }
.site-footer a:hover { text-decoration: underline; color: #fff; }
.footer-cols { display: grid; gap: 20px; }
@media (min-width: 720px) { .footer-cols { grid-template-columns: repeat(3, 1fr); } }
.footer-title { font-weight: 800; color: #fff; margin-bottom: 6px; }
.site-footer ul { list-style: none; margin: 0; padding: 0; }
.site-footer li { padding: 3px 0; }
.footer-note { margin: 24px 0 4px; font-size: .78rem; }
.copyright { margin: 0; font-size: .75rem; color: #8b97a5; }
body.has-sticky .site-footer { padding-bottom: 96px; }
@media (min-width: 960px) { body.has-sticky .site-footer { padding-bottom: 24px; } }

/* 固定ページ */
.form-embed iframe { width: 100%; height: 1000px; border: 0; background: #fff; border-radius: 8px; }
.todo { border: 2px dashed #d0453f; color: #d0453f; border-radius: 8px; padding: 10px 14px; margin: 16px 0; }
.side li a.tool-card { display: flex; }
