/* おかね計算ラボ — キンクマハムスターの「ほお袋にコツコツためる」世界観
   色は飼育部屋から取っている: 毛色(アプリコット)・床材(ピンク)・ブランケット(黄)・おうち(木) */
:root {
  --ink: #3b2a20;          /* こげ茶。本文 */
  --ink-soft: #7a6355;     /* 補足 */
  --fur: #f29e4c;          /* キンクマの毛色。ブランド色 */
  --fur-deep: #c96f1c;     /* 見出し・数字 */
  --fur-tint: #fff3e3;     /* 面の塗り */
  --cheek: #f27a9b;        /* ほっぺのピンク。煽り・ボタン */
  --cheek-tint: #ffe8ef;
  --marker: #ffe066;       /* 蛍光ペン */
  --wood: #ead6b8;         /* 木のおうち。線 */
  --money: #1e9e6a;        /* 手元に残るお金 */
  --minus: #d9534f;        /* 引かれるお金 */
  --paper: #ffffff;
  --bg: #fffdf9;
  --radius: 18px;
  --display: "Mochiy Pop One", "Zen Maru Gothic", system-ui, sans-serif;
  --body: "Zen Maru Gothic", "Hiragino Maru Gothic ProN", system-ui, sans-serif;
  color-scheme: light;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--body);
  font-weight: 500;
  font-size: 16px;
  line-height: 1.85;
}
a { color: var(--fur-deep); text-underline-offset: 3px; }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 3px solid var(--cheek);
  outline-offset: 2px;
}
img { max-width: 100%; height: auto; }
.wrap { max-width: 780px; margin: 0 auto; padding: 0 16px; }

/* ---------- ヘッダー ---------- */
header.site { background: var(--paper); border-bottom: 2px solid var(--wood); position: relative; z-index: 5; }
header.site .bar { display: flex; align-items: center; justify-content: space-between; height: 60px; }
.logo { display: flex; align-items: center; gap: 8px; text-decoration: none; color: var(--ink); font-family: var(--display); font-size: 1.15rem; letter-spacing: .02em; }
.logo img { width: 38px; height: 38px; }
.logo span { color: var(--fur); }
header.site .lang { font-size: .8rem; color: var(--ink-soft); text-decoration: none; border: 1.5px solid var(--wood); border-radius: 999px; padding: 2px 12px; }
.catnav { display: flex; gap: 8px; overflow-x: auto; padding: 0 16px 10px; max-width: 780px; margin: 0 auto; scrollbar-width: none; }
.catnav::-webkit-scrollbar { display: none; }
.catnav a {
  flex: none;
  font-size: .82rem;
  font-weight: 700;
  color: var(--ink);
  text-decoration: none;
  background: var(--fur-tint);
  border-radius: 999px;
  padding: 4px 14px;
}
.catnav a[aria-current="page"] { background: var(--fur); color: #fff; }

/* ---------- 文字の強弱 ---------- */
main { padding: 20px 0 56px; }
h1 { font-family: var(--display); font-weight: 400; font-size: clamp(1.5rem, 5vw, 2.1rem); line-height: 1.45; margin: 6px 0 10px; letter-spacing: .01em; }
h2 { font-size: 1.3rem; font-weight: 900; line-height: 1.5; margin: 40px 0 12px; }
h3 { font-size: 1.05rem; font-weight: 900; margin: 24px 0 6px; }
.mark { background: linear-gradient(transparent 58%, var(--marker) 58%); padding: 0 2px; }
.lead { color: var(--ink-soft); margin: 0 0 8px; }
.crumbs { font-size: .78rem; color: var(--ink-soft); }
.crumbs a { color: var(--ink-soft); }
.updated { font-size: .75rem; color: var(--ink-soft); margin: 0; }
.badge {
  display: inline-block;
  font-size: .72rem;
  font-weight: 900;
  color: #fff;
  background: var(--cheek);
  border-radius: 6px;
  padding: 1px 8px;
  margin-right: 6px;
  vertical-align: 2px;
}
.badge.cat { background: var(--fur); }

/* ---------- ツールページ冒頭 ---------- */
.tool-hero { display: grid; grid-template-columns: 1fr 120px; gap: 8px 12px; align-items: end; margin-bottom: 14px; }
.tool-hero img { width: 120px; justify-self: end; }
.hook {
  grid-column: 1 / -1;
  margin: 4px 0 0;
  padding: 10px 14px;
  background: var(--cheek-tint);
  border-left: 5px solid var(--cheek);
  border-radius: 0 12px 12px 0;
  font-weight: 700;
}
@media (max-width: 520px) {
  .tool-hero { grid-template-columns: 1fr 84px; }
  .tool-hero img { width: 84px; }
}

/* ---------- 入力フォーム ---------- */
.card {
  background: var(--paper);
  border: 2px solid var(--wood);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 18px;
}
.form { display: grid; gap: 16px; }
.field label { display: block; font-size: .92rem; font-weight: 900; margin-bottom: 4px; }
.field .hint { font-size: .78rem; color: var(--ink-soft); margin-top: 4px; line-height: 1.6; }
.input-unit { display: flex; align-items: center; gap: 8px; }
.input-unit input, .field select, textarea {
  flex: 1;
  width: 100%;
  min-width: 0;
  font: inherit;
  font-size: 1.1rem;
  font-weight: 700;
  padding: 11px 14px;
  border: 2px solid var(--wood);
  border-radius: 12px;
  background: #fffaf3;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}
.field select { font-size: .95rem; }
.input-unit input:focus, .field select:focus, textarea:focus { border-color: var(--fur); outline: none; box-shadow: 0 0 0 4px var(--fur-tint); }
.input-unit span { color: var(--ink-soft); font-weight: 700; white-space: nowrap; }
.check { display: flex !important; align-items: center; gap: 10px; font-weight: 700 !important; font-size: .92rem !important; margin: 2px 0; }
.check input { width: 22px; height: 22px; accent-color: var(--fur); flex: none; }

/* ---------- 計算結果 = おかねのレシート（このサイトの顔） ---------- */
#result {
  position: relative;
  background: var(--paper);
  border: none;
  border-radius: 6px 6px 0 0;
  padding: 26px 22px 30px;
  margin: 28px 0 34px;
  box-shadow: 0 10px 30px rgba(120, 80, 40, .14);
  font-variant-numeric: tabular-nums;
}
#result::before {
  content: "RECEIPT ・ 計算結果";
  display: block;
  text-align: center;
  font-size: .72rem;
  letter-spacing: .25em;
  color: var(--ink-soft);
  border-bottom: 2px dashed var(--wood);
  padding-bottom: 10px;
  margin-bottom: 14px;
}
html[lang="en"] #result::before { content: "RECEIPT · YOUR RESULT"; }
/* 下端をレシートのギザギザに */
#result::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -12px;
  height: 12px;
  background: linear-gradient(-45deg, transparent 8px, var(--paper) 0) 0 0 / 16px 12px repeat-x,
              linear-gradient(45deg, transparent 8px, var(--paper) 0) 0 0 / 16px 12px repeat-x;
  filter: drop-shadow(0 4px 3px rgba(120, 80, 40, .08));
}
.result { display: flex; flex-direction: column; }
.stat { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 9px 0; border-bottom: 1.5px dotted var(--wood); }
.stat .k { font-size: .9rem; color: var(--ink-soft); font-weight: 700; }
.stat .v { font-size: 1.15rem; font-weight: 900; text-align: right; white-space: nowrap; }
.stat.main { order: -1; flex-direction: column; align-items: center; gap: 0; border-bottom: 2px solid var(--ink); padding: 4px 0 14px; margin-bottom: 4px; }
.stat.main .k { font-size: .95rem; color: var(--ink); }
.stat.main .v { font-family: var(--display); font-weight: 400; font-size: clamp(2rem, 9vw, 2.8rem); color: var(--fur-deep); line-height: 1.3; white-space: normal; text-align: center; }
#result .table-scroll { margin-top: 10px; }
#result table.data td:last-child { font-weight: 700; }
.note { font-size: .82rem; color: var(--ink-soft); margin: 12px 0 0; line-height: 1.7; }
.bd-bar { display: flex; height: 14px; border-radius: 999px; overflow: hidden; margin-top: 16px; }
.bd-bar span { display: block; height: 100%; }
.legend { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: .78rem; color: var(--ink-soft); margin-top: 8px; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 4px; vertical-align: middle; }
:root { --bar: var(--fur); --bar2: #f9cf9c; }
.chart svg { width: 100%; height: auto; display: block; }

/* 次の一手（結果の直下に出す導線） */
.next {
  display: block;
  margin-top: 18px;
  padding: 14px 18px;
  border-radius: 14px;
  background: var(--fur);
  color: #fff;
  text-decoration: none;
  font-weight: 900;
  box-shadow: 0 4px 0 var(--fur-deep);
  transition: transform .12s, box-shadow .12s;
}
.next:hover { transform: translateY(2px); box-shadow: 0 2px 0 var(--fur-deep); }
.next small { display: block; font-weight: 500; opacity: .92; }

/* キンクマ先生のひとこと */
.tip { display: grid; grid-template-columns: 76px 1fr; gap: 12px; align-items: center; margin: 8px 0 26px; }
.tip img { width: 76px; }
.tip p {
  position: relative;
  margin: 0;
  padding: 12px 16px;
  background: var(--paper);
  border: 2px solid var(--wood);
  border-radius: 16px;
  font-size: .92rem;
}
.tip p::before { content: ""; position: absolute; left: -10px; top: 50%; margin-top: -8px; border: 8px solid transparent; border-right-color: var(--wood); border-left: 0; }
.tip b { display: block; font-size: .75rem; color: var(--fur-deep); }

/* ---------- 表 ---------- */
table.data { width: 100%; border-collapse: collapse; font-size: .88rem; font-variant-numeric: tabular-nums; }
table.data th { font-weight: 900; background: var(--fur-tint); }
table.data th, table.data td { padding: 7px 9px; border-bottom: 1px solid var(--wood); text-align: right; }
table.data th:first-child, table.data td:first-child { text-align: left; }
table.data tr:hover td { background: #fffaf3; }
table.data a { font-weight: 700; }
.table-scroll { overflow-x: auto; }

/* ---------- 広告・PR ---------- */
.ad-slot { min-height: 100px; margin: 24px 0; }
.ad-slot:empty { display: none; }
.cta {
  position: relative;
  border: 2px dashed var(--cheek);
  border-radius: var(--radius);
  padding: 30px 20px 18px;
  margin: 26px 0;
  background: var(--cheek-tint);
}
.cta::before {
  content: "PR";
  position: absolute;
  top: 10px;
  left: 20px;
  font-size: .68rem;
  font-weight: 900;
  color: var(--ink-soft);
  background: var(--paper);
  border-radius: 4px;
  padding: 0 6px;
}
.cta strong { display: block; font-size: 1.05rem; font-weight: 900; margin-bottom: 4px; }

/* ---------- ツール一覧カード ---------- */
.tools { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; padding: 0; margin: 0; list-style: none; }
.tools a {
  display: grid;
  grid-template-columns: 44px 1fr;
  gap: 2px 12px;
  align-items: start;
  height: 100%;
  background: var(--paper);
  border: 2px solid var(--wood);
  border-radius: 16px;
  padding: 14px 16px;
  text-decoration: none;
  color: var(--ink);
  transition: border-color .15s, transform .15s;
}
.tools a:hover { border-color: var(--fur); transform: translateY(-2px); }
.tools .ico { grid-row: span 2; font-size: 1.7rem; line-height: 44px; text-align: center; background: var(--fur-tint); border-radius: 12px; }
.tools b { font-weight: 900; font-size: 1rem; color: var(--ink); }
.tools small { color: var(--ink-soft); font-size: .8rem; line-height: 1.55; }

/* ---------- 共有 ---------- */
.share { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 6px 0 28px; font-size: .85rem; font-weight: 700; color: var(--ink-soft); }
.share button { font: inherit; padding: 7px 16px; border-radius: 999px; border: 2px solid var(--wood); background: var(--paper); color: var(--ink); cursor: pointer; }
.share button:hover { border-color: var(--fur); }
.share .native { display: none; border-color: var(--cheek); color: var(--cheek); }
.can-share .share .native { display: inline-block; }

/* ---------- 解説・FAQ ---------- */
.explain { margin-top: 36px; }
.explain h2 { display: flex; align-items: center; gap: 10px; }
.explain h2::before { content: ""; flex: none; width: 10px; height: 26px; border-radius: 5px; background: var(--fur); }
.explain table { margin: 8px 0 18px; }
.faq dt { font-weight: 900; margin-top: 18px; }
.faq dt::before { content: "Q. "; color: var(--fur-deep); font-family: var(--display); }
.faq dd { margin: 4px 0 0; color: var(--ink-soft); }
.faq dd::before { content: "A. "; color: var(--cheek); font-weight: 900; }

/* ---------- トップページ ---------- */
.home-hero { display: grid; grid-template-columns: 1.3fr 1fr; gap: 16px; align-items: center; padding: 18px 0 8px; }
.home-hero h1 { font-size: clamp(1.75rem, 6.4vw, 2.7rem); margin: 0 0 12px; }
.home-hero img { width: 100%; max-width: 300px; justify-self: center; filter: drop-shadow(0 12px 18px rgba(201, 111, 28, .18)); }
.home-hero .lead { font-size: 1.02rem; }
@media (max-width: 600px) {
  .home-hero { grid-template-columns: 1fr 120px; }
  .home-hero img { max-width: 120px; align-self: start; }
}
.quick { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.quick a { font-weight: 900; font-size: .88rem; text-decoration: none; color: var(--ink); background: var(--marker); border-radius: 999px; padding: 6px 14px; }
.season {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: center;
  margin: 18px 0 6px;
  padding: 14px 18px;
  border-radius: var(--radius);
  background: var(--ink);
  color: #fff;
  text-decoration: none;
}
.season b { color: var(--marker); }
.season span { font-family: var(--display); font-size: .9rem; color: var(--ink); background: var(--marker); border-radius: 999px; padding: 4px 14px; white-space: nowrap; }
.cat-head { display: grid; grid-template-columns: 72px 1fr; gap: 12px; align-items: center; margin: 40px 0 12px; }
.cat-head img { width: 72px; }
.cat-head h2 { margin: 0; }
.cat-head p { margin: 0; font-size: .85rem; color: var(--ink-soft); }
.cat-head a { text-decoration: none; color: inherit; }
.more { display: inline-block; margin-top: 10px; font-weight: 900; font-size: .9rem; }

/* ---------- 年収別ページ ---------- */
.pager { display: flex; justify-content: space-between; gap: 10px; margin: 18px 0; }
.pager a { flex: 1; text-align: center; font-weight: 900; text-decoration: none; background: var(--paper); border: 2px solid var(--wood); border-radius: 12px; padding: 10px; color: var(--ink); }
.pager a:hover { border-color: var(--fur); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chips a { font-size: .85rem; font-weight: 700; text-decoration: none; background: var(--fur-tint); color: var(--ink); border-radius: 999px; padding: 3px 12px; }
.chips a[aria-current="page"] { background: var(--fur); color: #fff; }

/* ---------- スマホ下部の結果バー ---------- */
.sticky-result {
  position: fixed;
  left: 12px;
  right: 12px;
  bottom: 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  border-radius: 16px;
  background: var(--ink);
  color: #fff;
  text-decoration: none;
  box-shadow: 0 8px 24px rgba(59, 42, 32, .3);
  transition: transform .2s, opacity .2s;
  z-index: 10;
}
.sticky-result span { font-size: .75rem; opacity: .8; }
.sticky-result b { font-family: var(--display); font-weight: 400; font-size: 1.15rem; color: var(--marker); font-variant-numeric: tabular-nums; }
.sticky-result small { margin-left: auto; font-size: .72rem; opacity: .75; }
.sticky-result.hide { transform: translateY(130%); opacity: 0; pointer-events: none; }
@media (min-width: 900px) { .sticky-result { display: none; } }

/* ---------- フッター ---------- */
footer.site { background: var(--fur-tint); border-top: 2px solid var(--wood); padding: 28px 0 90px; font-size: .8rem; color: var(--ink-soft); }
.foot-cats { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 16px; margin-bottom: 18px; }
.foot-cats b { display: block; color: var(--ink); font-weight: 900; margin-bottom: 4px; }
.foot-cats a { display: block; color: var(--ink-soft); text-decoration: none; line-height: 1.9; }
.foot-cats a:hover { color: var(--fur-deep); }
.footer-tools { display: flex; flex-wrap: wrap; gap: 4px 16px; margin-bottom: 10px; }
.footer-tools a { color: var(--ink-soft); }

/* お問い合わせ */
textarea { font-size: 1rem; font-weight: 500; }
.submit { font: inherit; font-weight: 900; padding: 13px; border: 0; border-radius: 12px; background: var(--fur); color: #fff; cursor: pointer; box-shadow: 0 4px 0 var(--fur-deep); }
.submit:disabled { opacity: .6; }

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}

/* ---------- 演出: レシートが印刷されて出てくる・結果が弾む ---------- */
@keyframes print { from { clip-path: inset(0 0 100% 0); transform: translateY(-8px); } to { clip-path: inset(0 0 -20px 0); transform: none; } }
@keyframes bump { 0% { transform: scale(1); } 40% { transform: scale(1.06); } 100% { transform: scale(1); } }
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
#result { animation: print .7s cubic-bezier(.2, .8, .2, 1) both; }
.stat.main.bump .v { animation: bump .35s ease-out; display: inline-block; }
.home-hero img { animation: float 3.2s ease-in-out infinite; }
.tool-hero img { animation: float 3.6s ease-in-out infinite; }
@media (prefers-reduced-motion: reduce) {
  #result, .stat.main.bump .v, .home-hero img, .tool-hero img { animation: none; }
}

/* 数字で見る日本のお金 */
.stats-title { margin-top: 30px; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.stats a { display: flex; flex-direction: column; gap: 2px; padding: 14px 12px; background: var(--paper); border: 2px solid var(--wood); border-radius: 16px; text-decoration: none; color: var(--ink); text-align: center; transition: border-color .15s, transform .15s; }
.stats a:hover { border-color: var(--fur); transform: translateY(-2px); }
.stats b { font-family: var(--display); font-weight: 400; font-size: clamp(1.15rem, 4.6vw, 1.6rem); color: var(--fur-deep); line-height: 1.3; }
.stats span { font-size: .8rem; font-weight: 700; }
.stats em { font-style: normal; font-size: .75rem; font-weight: 900; color: var(--cheek); margin-top: 4px; }
@media (max-width: 520px) { .stats { grid-template-columns: 1fr; } .stats a { flex-direction: row; flex-wrap: wrap; align-items: baseline; justify-content: space-between; text-align: left; } .stats em { width: 100%; text-align: right; margin: 0; } }
h1 { text-wrap: balance; }
.nw { display: inline-block; }
.logo b { font-weight: 400; }
.home-hero h1 { font-size: clamp(1.4rem, 5.6vw, 2.5rem); }

/* ---------- 自社商品（キンクマ家計簿） ---------- */
.promo { display: grid; grid-template-columns: 64px 1fr; gap: 12px; align-items: center; margin: 0 0 24px; padding: 14px 16px; border-radius: var(--radius); background: var(--marker); color: var(--ink); text-decoration: none; font-size: .88rem; box-shadow: 0 4px 0 #e6c53f; transition: transform .12s, box-shadow .12s; }
.promo:hover { transform: translateY(2px); box-shadow: 0 2px 0 #e6c53f; }
.promo img { width: 64px; }
.promo b { display: block; font-size: 1rem; font-weight: 900; }
.lp-hero { display: grid; grid-template-columns: 1.4fr 1fr; gap: 16px; align-items: center; padding: 12px 0; }
.lp-hero img { width: 100%; max-width: 260px; justify-self: center; animation: float 3.4s ease-in-out infinite; }
.lp-hero h1 { font-size: clamp(1.5rem, 5.4vw, 2.4rem); }
@media (max-width: 600px) { .lp-hero { grid-template-columns: 1fr; } .lp-hero img { max-width: 160px; grid-row: 1; } }
.lp-price { display: flex; align-items: baseline; gap: 10px; margin: 10px 0 14px; }
.lp-price b { font-family: var(--display); font-weight: 400; font-size: 2.4rem; color: var(--cheek); }
.lp-price span { font-size: .85rem; font-weight: 700; color: var(--ink-soft); }
.buy { display: inline-block; font-weight: 900; font-size: 1.05rem; padding: 15px 28px; border-radius: 999px; background: var(--cheek); color: #fff; text-decoration: none; box-shadow: 0 5px 0 #c2557a; transition: transform .12s, box-shadow .12s; }
.buy:hover { transform: translateY(3px); box-shadow: 0 2px 0 #c2557a; }
.buy.soon { background: var(--wood); color: var(--ink); box-shadow: none; cursor: default; }
.lp-preview .sheet { background: #fff; border: 2px solid var(--wood); border-radius: 12px; overflow: hidden; font-size: .88rem; font-variant-numeric: tabular-nums; box-shadow: 0 10px 30px rgba(120, 80, 40, .12); }
.sheet-tabs { display: flex; gap: 2px; background: var(--fur-tint); padding: 6px 6px 0; overflow-x: auto; }
.sheet-tabs span { padding: 4px 12px; font-size: .75rem; font-weight: 700; color: var(--ink-soft); border-radius: 6px 6px 0 0; white-space: nowrap; }
.sheet-tabs .on { background: #fff; color: var(--fur-deep); }
.sheet table { width: 100%; border-collapse: collapse; }
.sheet th, .sheet td { padding: 7px 12px; border-bottom: 1px solid var(--wood); text-align: right; }
.sheet th:first-child, .sheet td:first-child { text-align: left; }
.sheet thead th { background: var(--fur); color: #fff; }
.sheet .in { background: var(--marker); font-weight: 900; color: #1a3fbf; }
.sheet .more-rows { text-align: center; color: var(--ink-soft); font-size: .8rem; }
.lp-features { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; padding: 0; list-style: none; }
.lp-features li { background: var(--paper); border: 2px solid var(--wood); border-radius: 16px; padding: 14px 16px; font-size: .9rem; color: var(--ink-soft); }
.lp-features b { display: block; color: var(--ink); font-size: 1rem; margin-bottom: 4px; }
.lp-for { padding: 0; list-style: none; }
.lp-for li { padding: 8px 0 8px 30px; position: relative; border-bottom: 1.5px dotted var(--wood); font-weight: 700; }
.lp-for li::before { content: "✔"; position: absolute; left: 4px; color: var(--money); }
.lp-steps li { margin: 6px 0; font-weight: 700; }
.lp-cta { text-align: center; margin: 24px 0; }
