:root {
  --ledger: #1f6b3a;
  --ledger-d: #13472a;
  --leaf: #43a047;
  --ink: #1c2421;
  --sub: #55615c;
  --rule: #e3ece5;
  --paper: #ffffff;
  --ground: #eef4ef;
  --pencil: #c8372d;
  --amber: #a15c00;
  --note: #fff6c9;
  --head: "Zen Kaku Gothic New", "Hiragino Sans", sans-serif;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; font-family: "BIZ UDPGothic", "Hiragino Sans", sans-serif; color: var(--ink); background: var(--ground); line-height: 1.75; font-size: 16px; }
a { color: var(--ledger); }
[hidden] { display: none !important; }
.wrap { max-width: 1080px; margin: 0 auto; padding: 0 16px; }

/* ヘッダー */
.top { padding: 14px 0; }
.top .wrap { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ledger); font-family: var(--head); font-weight: 900; font-size: 17px; line-height: 1.3; word-break: keep-all; }
.brand img { width: 30px; height: 30px; flex: none; }
.to-ext { font-size: 13px; color: var(--ledger); text-decoration: none; border: 1.5px solid var(--ledger); padding: 5px 12px; border-radius: 999px; white-space: nowrap; background: #fff; }

/* ボタン */
.go, .check, .btn { display: inline-block; background: var(--ledger); color: #fff; border: 0; text-decoration: none; font-weight: 700; font-size: 18px; padding: 15px 30px; border-radius: 12px; box-shadow: 0 6px 0 var(--ledger-d); transition: transform .1s, box-shadow .1s; font-family: inherit; cursor: pointer; text-align: center; }
.go:active, .check:active, .btn:active { transform: translateY(4px); box-shadow: 0 2px 0 var(--ledger-d); }
.check:disabled { background: #9aa59f; box-shadow: 0 6px 0 #6f7a74; cursor: default; transform: none; }
.btn-s { display: inline-block; margin-top: 8px; background: var(--ledger); color: #fff; text-decoration: none; border-radius: 8px; padding: 8px 14px; font-weight: 700; font-size: 14px; box-shadow: 0 4px 0 var(--ledger-d); }

/* ヒーロー: 左に問い、右に領収書 */
.hero { padding: 28px 0 56px; overflow-x: clip; }
.hero .wrap { display: grid; grid-template-columns: 1.05fr 1fr; gap: 48px; align-items: center; }
.hero .wrap > *, .band .wrap > *, .result > * { min-width: 0; }
.hero h1 { font-family: var(--head); font-weight: 900; font-size: clamp(28px, 3.9vw, 46px); line-height: 1.34; word-break: keep-all; overflow-wrap: anywhere; letter-spacing: .01em; margin: 0 0 18px; }
.hero .lead { font-size: 17px; color: var(--sub); margin: 0 0 26px; max-width: 30em; }
.free { margin: 14px 0 0; font-size: 14px; color: var(--sub); }

/* 領収書 */
.receipt-wrap { position: relative; max-width: 440px; width: 100%; justify-self: center; }
.receipt { position: relative; background: var(--paper); padding: 26px 26px 44px; border-radius: 4px; box-shadow: 0 18px 40px -18px rgba(31, 107, 58, .35); transform: rotate(-1.2deg);
  -webkit-mask: radial-gradient(circle 7px at 50% 100%, transparent 98%, #000) 0 0 / 22px 100% repeat-x; mask: radial-gradient(circle 7px at 50% 100%, transparent 98%, #000) 0 0 / 22px 100% repeat-x; }
.receipt .head { display: flex; justify-content: space-between; font-size: 13px; color: var(--sub); border-bottom: 2px dashed var(--rule); padding-bottom: 10px; }
.receipt .amount { font-family: var(--head); font-weight: 900; font-size: 40px; margin: 12px 0 4px; letter-spacing: .02em; }
.receipt .item { font-size: 15px; margin: 0; }
.receipt .tadashi { font-size: 14px; color: var(--sub); margin: 2px 0 16px; }
.memo { border-top: 1px solid var(--rule); padding: 12px 104px 0 0; font-size: 14px; min-height: 76px; }
.memo .label { color: var(--sub); font-size: 12px; display: block; }
.memo .line { display: block; border-bottom: 2px solid var(--rule); min-height: 1.7em; }
.memo .written { display: block; font-weight: 700; color: var(--ledger); clip-path: inset(0 100% 0 0); animation: write 1.4s steps(22) 1.6s forwards; }
.stamp { position: absolute; right: 16px; bottom: 20px; width: 84px; height: 84px; border: 3px solid var(--leaf); border-radius: 50%; color: var(--leaf); display: flex; flex-direction: column; align-items: center; justify-content: center; font-family: var(--head); font-weight: 900; font-size: 14px; line-height: 1.2; transform: rotate(-14deg) scale(2); opacity: 0; animation: stamp .35s ease-out 3.1s forwards; }
.stamp img { width: 26px; height: 26px; margin-bottom: 2px; }
.sticky { position: absolute; z-index: 2; right: -30px; top: -34px; width: 196px; background: var(--note); padding: 12px 14px 14px; font-family: "Klee One", serif; font-weight: 600; color: var(--pencil); font-size: 16px; line-height: 1.5; box-shadow: 0 8px 18px -8px rgba(0,0,0,.25); transform: rotate(4deg); opacity: 0; animation: stick .5s ease-out .5s forwards; }
.sticky::before { content: ""; position: absolute; top: -8px; left: 50%; width: 60px; height: 16px; margin-left: -30px; background: rgba(200, 55, 45, .18); transform: rotate(-3deg); }
@keyframes stick { from { opacity: 0; transform: rotate(10deg) translateY(-12px); } to { opacity: 1; transform: rotate(4deg); } }
@keyframes write { to { clip-path: inset(0 0 0 0); } }
@keyframes stamp { to { opacity: .92; transform: rotate(-14deg) scale(1); } }

/* 帳簿の1行（入力） */
.ledger-sec { background: var(--paper); padding: 48px 0 56px; border-top: 6px solid var(--ledger); }
h2.sec-t { word-break: keep-all; overflow-wrap: anywhere; font-family: var(--head); font-weight: 900; font-size: 26px; line-height: 1.4; margin: 0 0 6px; }
.ledger-sec .lead2 { color: var(--sub); margin: 0 0 22px; }
.row { display: grid; grid-template-columns: 1fr .85fr 2fr 1fr 1.1fr; border: 2px solid var(--ledger); border-radius: 10px; overflow: hidden; background: #fff; }
.row > div { padding: 8px 12px 10px; border-right: 1px solid var(--rule); min-width: 0; }
.row > div:last-child { border-right: 0; }
.row label { display: block; font-size: 12px; color: var(--ledger); font-weight: 700; margin-bottom: 4px; }
.row label small { font-weight: 400; color: var(--sub); }
.row input, .row select { display: block; width: 100%; border: 0; border-bottom: 2px solid var(--rule); border-radius: 0; background: transparent; font-size: 16px; padding: 4px 0; min-height: 36px; color: var(--ink); font-family: inherit; }
.row input::placeholder { color: #9aa59f; }
.row input:focus, .row select:focus { outline: 0; border-bottom-color: var(--ledger); }
.amount { position: relative; }
.amount input { padding-right: 24px; }
.amount span { position: absolute; right: 0; top: 50%; transform: translateY(-50%); color: var(--sub); font-size: 14px; }
.submit-line { display: flex; align-items: center; gap: 18px; margin-top: 18px; flex-wrap: wrap; }
#turnstile { min-height: 65px; min-width: 300px; }
.left { font-size: 13px; color: var(--sub); margin: 0; }
.error { color: var(--pencil); font-size: 14px; margin: 10px 0 0; font-weight: 700; }

/* 結果: 付箋と書き直し */
.result { display: grid; grid-template-columns: 1fr 1.2fr; gap: 28px; margin-top: 34px; align-items: start; scroll-margin-top: 16px; }
.verdict { grid-column: 1 / -1; display: flex; align-items: center; gap: 14px; }
.verdict .dot { flex: none; width: 44px; height: 44px; border-radius: 50%; background: var(--c); }
.verdict b { display: block; word-break: keep-all; overflow-wrap: anywhere; font-family: var(--head); font-size: 24px; line-height: 1.4; color: var(--c); }
.verdict small { display: block; color: var(--sub); font-size: 13px; }
.lv-r { --c: var(--pencil); } .lv-y { --c: var(--amber); } .lv-g { --c: var(--leaf); }
.qnote { background: var(--note); font-family: "Klee One", serif; font-weight: 600; color: var(--pencil); font-size: 18px; line-height: 1.6; padding: 18px 20px; transform: rotate(-1.5deg); box-shadow: 0 10px 20px -10px rgba(0,0,0,.25); }
.qnote .who { display: block; font-size: 13px; color: #8a5a00; margin-bottom: 4px; }
.qnote p { margin: 0; }
.fix { border-left: 4px solid var(--leaf); padding: 2px 0 2px 18px; }
.fix h3 { margin: 0 0 4px; font-size: 15px; }
.fix p { margin: 0 0 14px; font-size: 15px; }
.fix .new { background: #f1f8f2; border: 1.5px dashed var(--leaf); border-radius: 8px; padding: 12px 14px; font-weight: 700; color: var(--ledger); display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.fix .new button { flex: none; border: 1.5px solid var(--ledger); background: #fff; color: var(--ledger); border-radius: 6px; font-size: 12px; padding: 2px 10px; font-family: inherit; cursor: pointer; }
.disclaimer { grid-column: 1 / -1; font-size: 12px; color: var(--sub); margin: 0; }

/* 拡張の帯 */
.band { background: var(--ledger); color: #fff; padding: 56px 0; overflow: hidden; }
.band .wrap { display: grid; grid-template-columns: 1.1fr .9fr; gap: 40px; align-items: center; }
.band h2 { font-family: var(--head); font-weight: 900; font-size: 30px; line-height: 1.4; margin: 0 0 12px; }
.band p { color: #d8eadc; margin: 0 0 22px; }
.band .cta { display: inline-block; background: #fff; color: var(--ledger); text-decoration: none; font-weight: 700; padding: 14px 26px; border-radius: 12px; box-shadow: 0 6px 0 #0f3b22; }
.band img { width: 100%; max-width: 360px; height: auto; border-radius: 10px; transform: rotate(2deg); box-shadow: 0 24px 50px -20px rgba(0,0,0,.6); justify-self: center; }
.band.slim { padding: 40px 0; }
.band.slim .wrap { grid-template-columns: 1fr; max-width: 760px; }

/* 見ているところ */
.points { padding: 56px 0 24px; }
.points ul { list-style: none; padding: 0; margin: 18px 0 0; display: grid; grid-template-columns: 1fr 1fr; gap: 18px 36px; }
.points li { border-bottom: 1px solid #cfdcd2; padding-bottom: 14px; }
.points b { display: block; font-family: var(--head); font-size: 18px; margin-bottom: 2px; }
.points li p { margin: 0; color: var(--sub); font-size: 15px; }

.faq { padding: 32px 0 56px; }
.faq details { background: #fff; border-radius: 10px; padding: 14px 18px; margin-top: 10px; }
.faq summary { font-weight: 700; cursor: pointer; }
.faq details p { margin: 8px 0 0; color: var(--sub); }

.read { display: block; background: #fff; border-radius: 14px; padding: 22px 24px; text-decoration: none; color: var(--ink); border: 2px solid var(--rule); margin-top: 14px; }
details + .read { margin-top: 28px; }
.read:hover { border-color: var(--leaf); }
.read b { display: block; font-family: var(--head); font-size: 22px; line-height: 1.45; margin: 2px 0 4px; }
.read span { color: var(--sub); font-size: 14px; }

/* 記事・規約・案内ページ */
.page { max-width: 760px; margin: 0 auto; padding: 12px 16px 56px; }
.page > h1, article h1 { font-family: var(--head); font-weight: 900; font-size: clamp(24px, 4vw, 32px); line-height: 1.4; word-break: keep-all; overflow-wrap: anywhere; margin: 8px 0 10px; }
.page > .lead { color: var(--sub); margin: 0 0 20px; }
.card { background: var(--paper); border-radius: 14px; padding: 22px 24px; margin-bottom: 18px; box-shadow: 0 10px 30px -22px rgba(31, 107, 58, .45); }
.card h2 { font-family: var(--head); font-weight: 900; font-size: 20px; line-height: 1.45; margin: 0 0 8px; }
article.card { border-top: 6px solid var(--ledger); padding-top: 26px; }
article { overflow-wrap: anywhere; }
article h2 { font-family: var(--head); font-weight: 900; font-size: 21px; line-height: 1.45; margin: 32px 0 8px; padding-left: 12px; border-left: 4px solid var(--leaf); }
article p, article li { font-size: 15.5px; }
article table { border-collapse: collapse; width: 100%; font-size: 14px; margin: 8px 0; }
article th, article td { border-bottom: 1px solid var(--rule); padding: 8px; text-align: left; }
article thead th { color: var(--ledger); border-bottom: 2px solid var(--ledger); }
article td.n { text-align: right; white-space: nowrap; }
.src { font-size: 13px; color: var(--sub); }
.body-s { margin: 0; font-size: 15px; }
.shot { display: block; width: 100%; max-width: 320px; height: auto; margin: 4px auto 0; border-radius: 10px; box-shadow: 0 18px 40px -20px rgba(0,0,0,.45); }

.steps { counter-reset: s; list-style: none; padding: 0; margin: 0; }
.steps li { counter-increment: s; position: relative; padding: 0 0 20px 50px; }
.steps li::before { content: counter(s); position: absolute; left: 0; top: 0; width: 34px; height: 34px; border-radius: 50%; border: 2.5px solid var(--leaf); color: var(--ledger); font-family: var(--head); font-weight: 900; display: flex; align-items: center; justify-content: center; transform: rotate(-10deg); }
.steps h3 { margin: 0 0 4px; font-size: 17px; font-family: var(--head); }
.steps p { margin: 0; font-size: 15px; color: var(--sub); }

.plans { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; }
.plans div { border: 1.5px solid var(--rule); border-radius: 10px; padding: 12px 14px; font-size: 14px; }
.plans b { display: block; font-family: var(--head); font-size: 16px; color: var(--ledger); margin-bottom: 4px; }

.reasons { display: grid; gap: 8px; }
.reasons button { text-align: left; border: 1.5px solid var(--rule); background: #fff; border-radius: 10px; padding: 12px 14px; font-size: 15px; font-family: inherit; cursor: pointer; color: var(--ink); }
.reasons button:hover { border-color: var(--leaf); }
.done { background: #f1f8f2; color: var(--ledger); border-radius: 8px; padding: 12px; font-size: 14px; margin: 0; }

footer { background: #fff; border-top: 1px solid var(--rule); font-size: 12px; color: var(--sub); padding: 18px 0 28px; }
footer a { color: var(--sub); margin-right: 14px; display: inline-block; }

.totop { position: fixed; right: 16px; bottom: 16px; width: 48px; height: 48px; border-radius: 50%; border: 0; background: var(--ledger); color: #fff; font-size: 22px; font-weight: 700; cursor: pointer; box-shadow: 0 4px 0 var(--ledger-d); z-index: 10; font-family: inherit; }


/* 割合のチェック（経費率・家事按分） */
.tool-hero { padding: 20px 0 36px; }
.tool-hero h1 { font-family: var(--head); font-weight: 900; font-size: clamp(26px, 3.4vw, 40px); line-height: 1.38; word-break: keep-all; overflow-wrap: anywhere; margin: 0 0 14px; }
.tool-hero .lead { font-size: 16px; color: var(--sub); margin: 0; max-width: 40em; }
.row.row4 { grid-template-columns: 1.3fr 1fr 1fr 1fr; }
.row.row2 { grid-template-columns: 1fr 1fr; }
.ratio-result, .anbun-result { margin-top: 34px; display: grid; gap: 26px; scroll-margin-top: 16px; }
.meter { border-left: 4px solid var(--leaf); padding: 2px 0 2px 18px; }
.meter.high { border-left-color: var(--amber); }
.meter h3 { margin: 0 0 10px; font-size: 17px; font-family: var(--head); }
.meter h3 small { font-family: "BIZ UDPGothic", sans-serif; font-weight: 400; font-size: 13px; color: var(--sub); }
.bars { display: grid; gap: 8px; }
.bar { display: grid; grid-template-columns: 6.5em 1fr 4.5em; align-items: center; gap: 10px; font-size: 14px; }
.bar .k { color: var(--sub); }
.bar .track { height: 18px; background: var(--ground); border-radius: 4px; overflow: hidden; }
.bar .track i { display: block; height: 100%; width: 0; border-radius: 4px; transition: width .6s ease-out; }
.bar.you .track i { background: var(--ledger); }
.meter.high .bar.you .track i { background: var(--amber); }
.bar.avg .track i { background: #b7cdbd; }
.bar b { text-align: right; font-family: var(--head); font-size: 16px; }
.verdict-t { margin: 10px 0 0; font-family: var(--head); font-weight: 900; font-size: 20px; color: var(--ledger); }
.meter.high .verdict-t { color: var(--amber); }
.basis { margin: 2px 0 0; font-size: 13px; color: var(--sub); }
.next { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.next p { margin: 0; font-size: 14px; color: var(--sub); }
table.ref { border-collapse: collapse; width: 100%; font-size: 14px; margin: 24px 0 8px; background: #fff; border-radius: 10px; overflow: hidden; }
table.ref th, table.ref td { padding: 8px 12px; border-bottom: 1px solid var(--rule); text-align: left; }
table.ref thead th { color: var(--ledger); border-bottom: 2px solid var(--ledger); }
.tabs { display: flex; gap: 8px; flex-wrap: wrap; margin: 14px 0 18px; }
.tabs button { border: 2px solid var(--ledger); background: #fff; color: var(--ledger); border-radius: 999px; padding: 8px 20px; font-size: 16px; font-weight: 700; font-family: inherit; cursor: pointer; }
.tabs button[aria-selected="true"] { background: var(--ledger); color: #fff; }
.tick { display: flex; align-items: center; gap: 8px; margin: 14px 0 0; font-size: 15px; cursor: pointer; }
.tick input { width: 18px; height: 18px; accent-color: var(--ledger); }
#shared-row { margin-top: 10px; }
.big { font-family: var(--head); font-weight: 900; font-size: 18px; color: var(--ledger); }
.ratio-result .qnote, .anbun-result .qnote { max-width: 640px; }
.anbun-result .fix .new { margin-bottom: 14px; }
.big b { display: block; font-size: 56px; line-height: 1.1; }

@media (max-width: 760px) {
  .hero .wrap, .band .wrap, .result { grid-template-columns: 1fr; }
  .hero { padding-bottom: 40px; }
  .sticky { right: -4px; top: -34px; width: 170px; font-size: 14px; }
  .receipt-wrap { margin-top: 44px; }
  .row { grid-template-columns: 1fr 1fr; }
  .row > div { border-bottom: 1px solid var(--rule); }
  .row > div:nth-child(2), .row > div:last-child { border-right: 0; }
  .row > .wide { grid-column: 1 / -1; border-right: 0; }
  .row > div:nth-child(4), .row > div:last-child { border-bottom: 0; }
  .points ul, .plans { grid-template-columns: 1fr; }
  .row.row4 { grid-template-columns: 1fr 1fr; }
  .row.row4 > div:first-child { grid-column: 1 / -1; border-right: 0; }
  .row.row4 > div:nth-child(2) { border-right: 1px solid var(--rule); }
  .row.row4 > div:nth-child(3) { border-right: 0; border-bottom: 0; }
  .row.row2 > div { border-bottom: 0; }
  .bar { grid-template-columns: 5.5em 1fr 4em; }
  table.ref { font-size: 12.5px; }
  table.ref th, table.ref td { padding: 6px 8px; }
  .band h2 { font-size: 24px; }
  .card { padding: 18px; }
  .brand { font-size: 15px; gap: 8px; }
  .brand img { width: 26px; height: 26px; }
  .to-ext { font-size: 12px; padding: 4px 10px; }
  .memo { padding-right: 84px; }
  .stamp { width: 72px; height: 72px; font-size: 12px; right: 10px; }
  .stamp img { width: 22px; height: 22px; }
  .verdict b { font-size: 21px; }
  h2.sec-t { font-size: 23px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .sticky, .stamp { animation: none; opacity: 1; }
  .stamp { transform: rotate(-14deg); opacity: .92; }
  .memo .written { animation: none; clip-path: none; }
}
