/* こどもとお金のノート
   読者：つみたてNISAは「なんとなく」やっている30代の母。スマホで、家事や寝かしつけの合間に読む
   お手本：HugMug のスマホ画面（2026-09-29 本人「スマホ向けデザインは結構いけてる。PCはダサい」）
     - 上をはっきりした1色の面にして、黒の太字でタイトル。カテゴリは黒の細枠の英字の札
     - 面と本文の境目に、ギザギザの丸バッジと下向き矢印
     - 見出しは中央寄せで（ ）に挟む。小さな英字のラベル（\ POINT /）
     - 本文は白地に黒、飾りの枠は少なく、余白を広く
   もう1つのお手本：ほぼ日（2026-09-29 本人「とっつきやすくて安心できる非商業的なインターフェース」）
     - くすんだセージの面、丸みのある文字、細い灰色の線で区切る一覧、丸い「もっと見る」ボタン
   色はまねしない：HugMug の黄色ではなく、ピスタチオの面＋オレンジの差し色＋黒の線
   広告らしさ・AIらしさ（グラデーション、光る影、絵文字）は使わない */
:root {
  --bg: #ffffff;
  --ink: #1f1f1f;
  --sub: #6a6a6a;
  --block: #d7e3c6;       /* セージ寄りのピスタチオの面 */
  --block-deep: #c9e0b8;
  --green: #2f6f5e;       /* リンク・主役の濃い色 */
  --orange: #f0954a;      /* バッジ・Q・差し色 */
  --orange-pale: #fdf0e4;
  --line: #1f1f1f;
  --hair: #e3e3e0;
  --marker: #fff0a8;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: "Zen Kaku Gothic New", "Noto Sans JP", "Hiragino Sans", "Hiragino Kaku Gothic ProN", sans-serif;
  font-size: 16px; line-height: 1.95; letter-spacing: .03em; font-weight: 500;
}
a { color: var(--ink); text-underline-offset: 3px; }
img { max-width: 100%; height: auto; }
b, strong, h1, h2, h3 { font-weight: 700; }
h1, h2, h3, .brand, .q-text, .calc-title, .label, .foot-brand, .author-name, .intro-lead { font-family: "Zen Maru Gothic", "Hiragino Maru Gothic ProN", "Zen Kaku Gothic New", sans-serif; }
.nw { display: inline-block; }
.en { font-family: "Outfit", "Zen Kaku Gothic New", sans-serif; letter-spacing: .06em; }

/* ヘッダー：面の色のまま、ロゴを大きく */
.site-header { background: var(--block); padding-top: env(safe-area-inset-top, 0px); }
.header-in { max-width: 760px; margin: 0 auto; padding: 14px 18px 6px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.brand { display: flex; align-items: center; gap: 8px; color: var(--ink); text-decoration: none; font-weight: 700; font-size: 19px; letter-spacing: .02em; white-space: nowrap; }
.logo-mark { width: 30px; height: 30px; flex: none; }
.gnav { display: flex; gap: 12px; font-size: 12.5px; font-weight: 700; white-space: nowrap; }
.gnav a { text-decoration: none; }

/* 面（トップの hero と記事の頭） */
.block { background: var(--block); }
.block-in { max-width: 760px; margin: 0 auto; padding: 8px 18px 44px; }
.crumbs { font-size: 11.5px; font-weight: 700; display: flex; gap: 6px; flex-wrap: wrap; align-items: center; margin: 0 0 12px; }
.crumbs a { text-decoration: none; }
.tag { display: inline-block; border: 1.5px solid var(--line); background: #fff; border-radius: 6px; padding: 1px 12px; font-size: 12px; font-weight: 700; letter-spacing: .08em; }
.entry-title { font-size: clamp(22px, 6.2vw, 30px); line-height: 1.55; margin: 14px 0 10px; letter-spacing: .03em; }
.byline { display: flex; flex-wrap: wrap; gap: 2px 14px; font-size: 13px; margin: 0 0 14px; }
.byline .date::before { content: "» "; }
.lead { margin: 0; font-size: 15px; line-height: 1.95; }
.pr-note { font-size: 12px; margin: 12px 0 0; }
.pr { display: inline-block; border: 1px solid var(--ink); border-radius: 4px; padding: 0 5px; margin-right: 6px; font-size: 10.5px; line-height: 1.6; background: #fff; }

/* 面と本文の境目のバッジ */
.divider { position: relative; border-top: 1.5px solid var(--line); height: 0; margin-bottom: 44px; }
.divider svg { position: absolute; left: 50%; top: 0; width: 56px; height: 56px; transform: translate(-50%, -50%); }

/* トップ */
.hero-eyebrow { display: inline-block; margin: 6px 0 16px; }
.hero h1 { margin: 0 0 16px; font-size: clamp(28px, 8vw, 40px); line-height: 1.4; font-weight: 900; letter-spacing: .02em; }
.hero-lead { margin: 0 0 18px; font-size: 15.5px; }
.hero-facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin: 0; padding: 0; list-style: none; }
.hero-facts li { background: #fff; border: 1.5px solid var(--line); border-radius: 12px; padding: 8px 6px; text-align: center; font-size: 12.5px; line-height: 1.5; }
.hero-facts b { display: block; font-size: 17px; font-weight: 900; }

.wrap { max-width: 760px; margin: 0 auto; padding: 8px 18px 36px; }
.label { text-align: center; font-size: 13px; font-weight: 700; margin: 0 0 4px; }
.label::before { content: "\\ "; } .label::after { content: " /"; }
.section-title, .sources h2, .more h2 {
  display: table; margin: 0 auto 18px; padding: 4px 24px; text-align: center;
  font-size: 19px; line-height: 1.6; letter-spacing: .04em;
  border-left: 2px solid var(--line); border-right: 2px solid var(--line); border-radius: 22px / 50%;
}
.section-sub { text-align: center; margin: -6px 0 18px; color: var(--sub); font-size: 13.5px; }

/* 疑問のリスト：ほぼ日のように、細い灰色の線で区切った行 */
.q-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--hair); }
.q-list li { border-bottom: 1px solid var(--hair); }
.q-list a { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; column-gap: 12px; align-items: center; padding: 15px 2px; text-decoration: none; line-height: 1.65; }
.q-list a::after { content: "›"; color: var(--sub); font-size: 20px; }
.q-list a:active { background: #f6f6f3; }
.q-mark { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: var(--orange); color: #fff; font-weight: 700; font-size: 15px; font-family: "Zen Maru Gothic", sans-serif; }
.q-text { font-weight: 700; font-size: 15.5px; }
.q-cat { display: block; font-size: 11.5px; font-weight: 700; color: var(--sub); }
.pill { display: block; width: fit-content; margin: 18px auto 0; padding: 9px 38px; border: 1px solid #cfcfca; border-radius: 99px; color: var(--sub); font-weight: 700; font-size: 14px; text-decoration: none; background: #fff; }

/* 記事 */
.entry { max-width: 720px; margin: 0 auto; padding: 0 18px 40px; }
.summary { border: 1.5px solid var(--line); border-radius: 14px; padding: 14px 18px 12px; margin: 0 0 26px; }
.summary .label { margin-bottom: 6px; }
.summary ul { margin: 0; padding-left: 1.2em; }
.summary li { margin: 2px 0; line-height: 1.75; font-weight: 700; font-size: 15px; }
.toc { border-top: 1.5px solid var(--line); border-bottom: 1.5px solid var(--line); padding: 10px 2px; margin: 0 0 30px; font-size: 14px; }
.toc summary { cursor: pointer; font-weight: 700; list-style: none; }
.toc summary::before { content: "＋ "; } .toc[open] summary::before { content: "－ "; }
.toc ul { margin: 6px 0 4px; padding-left: 1.2em; }
.toc li { margin: 4px 0; line-height: 1.6; }
.toc a { text-decoration: none; }

.entry-body { overflow-wrap: anywhere; }
.entry-body h2 { font-size: 20px; line-height: 1.6; margin: 52px 0 16px; letter-spacing: .03em; }
.entry-body h2::before { content: ""; display: block; width: 36px; height: 4px; border-radius: 2px; background: var(--orange); margin: 0 0 10px; }
.entry-body h3 { font-size: 17px; line-height: 1.7; margin: 34px 0 12px; padding: 0 0 4px; border-bottom: 1px dashed #bdbdb6; }
.entry-body p { margin: 0 0 1.2em; }
.entry-body a { color: var(--green); }
.entry-body strong { background: linear-gradient(transparent 62%, var(--marker) 62%); }
.entry-body ul, .entry-body ol { padding-left: 1.3em; }
.entry-body li { margin: 4px 0; }

.table-wrap { overflow-x: auto; margin: 0 0 1.4em; -webkit-overflow-scrolling: touch; }
.entry-body table { border-collapse: collapse; width: 100%; min-width: 0; font-size: 14px; line-height: 1.65; }
.entry-body th, .entry-body td { border-bottom: 1px solid var(--hair); padding: 10px 8px; text-align: left; vertical-align: top; }
.entry-body thead th { border-bottom: 1.5px solid var(--line); font-size: 13px; }
.entry-body tbody th { font-weight: 700; }

.box { border-radius: 14px; padding: 14px 18px 4px; margin: 0 0 1.5em; }
.box-title { margin: 0 0 6px; font-weight: 700; font-size: 14.5px; }
.box-point { background: var(--block); }
.box-note { background: var(--orange-pale); }
.box-data { border: 1.5px solid var(--line); font-size: 14.5px; }

.link-card { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; align-items: center; border: 1.5px solid var(--line); border-radius: 14px; padding: 12px 16px; margin: 0 0 1.5em; text-decoration: none; color: var(--ink) !important; }
.link-card::after { content: "→"; font-weight: 900; }
.link-card-label { display: block; font-size: 11.5px; font-weight: 700; color: var(--sub); }
.link-card-title { font-weight: 700; line-height: 1.6; }
.link-card > span { grid-column: 1; }

.sources { margin-top: 44px; font-size: 13px; }
.sources h2 { font-size: 15px; }
.sources ul { padding-left: 1.2em; margin: 0; }
.sources a { color: var(--sub); }

.author, .intro { background: var(--block); border-radius: 18px; padding: 22px 18px; margin: 36px 0 0; font-size: 14px; line-height: 1.85; text-align: center; }
.author p, .intro p { margin: 0 0 6px; }
.author-mark { width: 64px; height: 64px; overflow: hidden; border-radius: 50%; background: #fff; border: 1.5px solid var(--line); margin: 0 auto 10px; display: grid; place-items: center; font-weight: 900; font-size: 26px; }
.author-name, .intro-lead { font-weight: 700; font-size: 15px; }
.author .bio, .intro .bio { text-align: left; }
.more { margin-top: 40px; }

/* 図（[[fig:名前|説明]]） */
.fig { margin: 0 0 1.6em; padding: 14px 12px 10px; border: 1.5px solid var(--line); border-radius: 14px; background: #fff; }
.fig svg { display: block; width: 100%; height: auto; }
.fig figcaption { margin-top: 6px; font-size: 12.5px; color: var(--sub); line-height: 1.7; }

/* 会話（:::talk） */
.talk { display: grid; gap: 12px; margin: 4px 0 1.8em; }
.talk-row { display: grid; grid-template-columns: 48px minmax(0, 1fr); gap: 10px; align-items: start; }
.talk-icon { width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-family: "Zen Maru Gothic", sans-serif; border: 1.5px solid var(--line); background: #fff; overflow: hidden; }
.talk-icon .logo-mark { width: 48px; height: 48px; }
.talk-icon img, .author-mark img { width: 100%; height: 100%; object-fit: cover; display: block; }
.talk-mari .talk-icon { background: var(--orange-pale); color: #a05a1c; font-size: 18px; }
.talk-body { border-radius: 4px 16px 16px 16px; padding: 8px 14px 10px; }
.talk-mari .talk-body { background: #fff; border: 1.5px solid var(--line); }
.talk-note .talk-body { background: var(--block); }
.talk p.talk-name { margin: 0; font-size: 11.5px; font-weight: 700; color: var(--sub); }
.talk p.talk-text { margin: 2px 0 0; line-height: 1.85; font-size: 15px; }

/* よくある質問 */
.faq { margin-top: 44px; }
.faq h2 { display: table; margin: 0 auto 14px; padding: 4px 24px; font-size: 19px; border-left: 2px solid var(--line); border-right: 2px solid var(--line); border-radius: 22px / 50%; }
.faq-item { border-bottom: 1px solid var(--hair); }
.faq-item:first-of-type { border-top: 1px solid var(--hair); }
.faq-item summary { list-style: none; cursor: pointer; display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 10px; align-items: start; padding: 14px 2px; font-weight: 700; line-height: 1.65; min-height: 44px; }
.faq-item summary::-webkit-details-marker { display: none; }
.faq-a { padding: 0 2px 12px 40px; font-size: 15px; }
.faq-a p { margin: 0 0 .6em; }

/* 計算機 */
.calc { border: 1.5px solid var(--line); border-radius: 18px; padding: 18px; margin: 0 0 1.5em; background: #fff; }
.calc-title { margin: 0 0 14px; font-weight: 900; font-size: 17px; text-align: center; }
.calc-row { display: grid; gap: 6px; margin: 0 0 14px; }
.calc-row label, .calc-label { font-size: 13px; font-weight: 700; }
.calc select { font: inherit; padding: 9px 10px; border: 1.5px solid var(--line); border-radius: 10px; background: #fff; width: 100%; }
.calc-amount { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; align-items: center; }
.calc input[type=range] { width: 100%; accent-color: var(--orange); }
.calc output { font-weight: 900; min-width: 5.5em; text-align: right; }
.calc-rates { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.calc-rates button { font: inherit; font-weight: 700; padding: 8px 0; border: 1.5px solid var(--line); border-radius: 10px; background: #fff; color: var(--ink); cursor: pointer; }
.calc-rates button[aria-pressed=true] { background: var(--ink); color: #fff; }
.calc-result { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; background: var(--block); border-radius: 12px; padding: 12px 6px; margin: 4px 0 10px; text-align: center; }
.calc-k { margin: 0; font-size: 11.5px; font-weight: 700; line-height: 1.5; }
.calc-v { margin: 4px 0 0; font-weight: 900; font-size: 16px; line-height: 1.3; }
.calc-main { font-size: 20px; }
.calc-foot { margin: 6px 0 0; font-size: 12px; color: var(--sub); line-height: 1.7; }

/* フッター */
.site-footer { margin-top: 30px; background: var(--ink); color: #eaeaea; padding-bottom: env(safe-area-inset-bottom, 0px); }
.footer-in { max-width: 760px; margin: 0 auto; padding: 30px 18px 34px; font-size: 12.5px; }
.site-footer a { color: #fff; }
.foot-brand { display: flex; align-items: center; gap: 8px; margin: 0; font-weight: 900; font-size: 17px; color: #fff; }
.foot-lead { margin: 4px 0 14px; }
.foot-nav { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-bottom: 14px; font-weight: 700; }
.foot-note { line-height: 1.8; color: #bdbdbd; }
.foot-copy { margin: 10px 0 0; color: #bdbdbd; }

@media (min-width: 720px) {
  body { font-size: 17px; }
  .block-in { padding: 16px 20px 52px; }
  /* PCでは会話と筆者のアイコンが小さく見えるので大きく（2026-09-30 本人） */
  .talk-row { grid-template-columns: 64px minmax(0, 1fr); gap: 14px; }
  .talk-icon, .talk-icon .logo-mark { width: 64px; height: 64px; }
  .talk-mari .talk-icon { font-size: 26px; }
  .talk p.talk-name { font-size: 13px; }
  .talk p.talk-text { font-size: 16px; }
  .author-mark { width: 96px; height: 96px; }
}

/* 読みやすさ・使いやすさ（デジタル庁デザインシステムの考え方を参考に） */
a:focus-visible, button:focus-visible, select:focus-visible, input:focus-visible, summary:focus-visible { outline: 3px solid var(--orange); outline-offset: 2px; border-radius: 4px; }
.calc-rates button, .calc select, .pill { min-height: 44px; }
@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto !important; } }
.entry-body img.infographic { display: block; width: 100%; height: auto; margin: 0 0 1.4em; border-radius: 12px; border: 1px solid var(--hair); }
.entry-body tbody th:first-child, .entry-body td:first-child { white-space: nowrap; }

/* お問い合わせ（Googleフォームの埋め込み。高さは自動で伸びないので、スマホで最後の送信ボタンまで入る高さにする） */
.contact-form { display: block; width: 100%; height: 1350px; border: 0; margin: 24px 0 8px; background: transparent; }
@media (min-width: 700px) { .contact-form { height: 1200px; } }
.contact-alt { font-size: 13px; color: #666; }

/* トップのイラスト（2026-09-30。背景はヒーローの面と同じ #d7e3c6 で描き込み済み） */
.hero-art { display: block; width: 100%; height: auto; margin: 22px auto 0; max-width: 520px; }
@media (min-width: 900px) {
  .hero .hero-in { max-width: 1040px; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); gap: 36px; align-items: center; }
  .hero-art { margin: 0; max-width: none; }
}

/* PCでは目次を左に固定（2026-09-30 本人「PC向けには目次が左にFixで出る方がいい」）。本文に入ったら出す（JSが body に toc-on を付ける） */
@media (min-width: 1180px) {
  .entry details.toc { position: fixed; top: 96px; left: calc(50% - 360px - 228px); width: 204px; max-height: calc(100vh - 130px); overflow: auto;
    margin: 0; padding: 0 4px 0 0; border: none; font-size: 13px; opacity: 0; pointer-events: none; transition: opacity .2s; }
  body.toc-on .entry details.toc { opacity: 1; pointer-events: auto; }
  .entry details.toc summary { color: var(--sub); font-size: 12px; margin-bottom: 8px; }
  .entry details.toc > div.toc { position: static; opacity: 1; border: none; padding: 0; margin: 0; }
  .entry details.toc summary::before { content: ""; }
  .entry .toc ul { padding-left: 0; list-style: none; border-left: 2px solid var(--hair); }
  .entry .toc li { margin: 0; line-height: 1.55; }
  .entry .toc a { display: block; padding: 6px 0 6px 12px; margin-left: -2px; border-left: 2px solid transparent; color: var(--sub); }
  .entry .toc a:hover { color: var(--ink, #1f1f1f); }
  .entry .toc a.is-active { color: var(--green); font-weight: 700; border-left-color: var(--green); }
}

/* 表の最小幅は列の数で（2026-09-30）。3列以下は画面の幅に収める。1列目の折り返し禁止は2列の表だけ（3列以上で1列目が長いと、ほかの列が細くなりすぎるため） */
.table-wrap.cols-4 table { min-width: 520px; } .table-wrap.cols-5 table { min-width: 620px; } .table-wrap.cols-6 table { min-width: 720px; }
.table-wrap:not(.cols-2) td:first-child, .table-wrap:not(.cols-2) tbody th:first-child { white-space: normal; min-width: 5.5em; }

/* トップの記事一覧をジャンルごとに（2026-09-30） */
.cat-chips { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin: 4px 0 30px; }
.cat-chip { display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 0 14px; border: 1.5px solid var(--line); border-radius: 999px; background: #fff; font-size: 13.5px; font-weight: 700; text-decoration: none; color: var(--ink); }
.cat-chip span { font-size: 12px; color: var(--sub); font-weight: 500; }
.q-group { margin: 0 0 30px; scroll-margin-top: 16px; }
.q-group-title { font-size: 16px; margin: 0 0 8px; padding-left: 10px; border-left: 4px solid var(--orange); line-height: 1.5; }

/* ジャンルのボタンをアイコンつきのカードに、記事の行に小さな画像（2026-09-30） */
.cat-chip { border-radius: 14px; min-height: 64px; padding: 8px 12px; gap: 10px; }
.cat-chip b { flex: 1; line-height: 1.45; }
.cat-ic { width: 40px; height: 40px; flex: none; display: block; }
.q-group-title { display: flex; align-items: center; gap: 10px; border-left: none; padding-left: 0; font-size: 17px; }
.q-group-title .cat-ic { width: 34px; height: 34px; }
.q-group .q-list a { grid-template-columns: minmax(0, 1fr) auto; }
.q-thumb { width: 72px; height: 48px; border-radius: 8px; object-fit: cover; display: block; background: var(--block); }
.q-thumb-ic { display: grid; place-items: center; } .q-thumb-ic .cat-ic { width: 34px; height: 34px; }
@media (min-width: 720px) { .cat-chips { grid-template-columns: repeat(2, minmax(0, 1fr)); }  }

/* スマホでは、トップのイラストを小さくして、下の記事一覧が見えるように（2026-09-30 本人「画像が大きすぎて、下に記事一覧があることがみえない」） */
@media (max-width: 899px) {
  .hero-art { max-width: 300px; margin: 18px auto 0; }
  .hero .block-in { padding-bottom: 30px; }
}
/* スマホでは、ヘッダーのサイト名とメニューが1行に収まるように（2026-09-30） */
@media (max-width: 420px) {
  .brand span { font-size: 15px; }
  .gnav { gap: 10px; } .gnav a { font-size: 12px; }
}
