:root {
  --c: #2457d6; --cbg: #edf2fc;   /* 区分の色の初期値(.g1〜.g5 で上書きする) */
  --navy: #1b2f57;        /* 見出し・ブランド */
  --navy-light: #edf2fc;  /* 淡い青の面 */
  --blue: #2457d6;        /* リンク・ボタン・強調 */
  --blue-dark: #1b45b0;
  --accent: #d9480f;      /* 目印(今日の日付の枠など) */
  --text: #1c2430;
  --sub: #3b4658;
  --muted: #5d6878;
  --line: #e1e6ee;
  --line-strong: #c6cfdc;
  --bg: #f4f6fa;
  --result: #f3f7ff;
  --result-line: #cfdcf6;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(20, 35, 70, .05), 0 4px 14px rgba(20, 35, 70, .04);
  --wrap: 960px;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { font-size: 16px; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: "Hiragino Sans", "Hiragino Kaku Gothic ProN", "BIZ UDPGothic", "Yu Gothic UI", "Meiryo", system-ui, sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
}
body.home { --wrap: 1120px; }
.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 20px; }
/* 広い画面では左にサイドメニュー、右に本文。狭い画面ではメニューはボタンで開く引き出し式 */
.layout { display: block; }
@media (min-width: 1180px) {
  body { --wrap: 1224px; }
  body.home { --wrap: 1384px; }
  .layout { display: grid; grid-template-columns: 236px minmax(0, 1fr); gap: 28px; align-items: start; }
}
a { color: var(--blue); text-underline-offset: 2px; }
a:hover { color: var(--blue-dark); }
:focus-visible { outline: 3px solid rgba(36, 87, 214, .35); outline-offset: 2px; }

/* ---- ヘッダー・フッター ---- */
.site-header { background: #fff; border-bottom: 1px solid var(--line); }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; height: 60px; gap: 12px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--navy); text-decoration: none; font-weight: 700; font-size: 1.08rem; letter-spacing: .02em; white-space: nowrap; }
.brand:hover { color: var(--navy); }
.brand svg { width: 30px; height: 30px; flex: none; }
.head-l { display: flex; align-items: center; gap: 4px; min-width: 0; }
.menu-btn { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; padding: 0; margin-left: -8px; background: transparent; border: 0; border-radius: 8px; color: var(--navy); flex: none; }
.menu-btn:hover { background: var(--navy-light); border: 0; }
.menu-btn svg { width: 22px; height: 22px; }
.nav { display: flex; gap: 4px; }
.nav a { color: var(--sub); text-decoration: none; font-size: .92rem; font-weight: 600; padding: 7px 12px; border-radius: 8px; white-space: nowrap; }
.nav a:hover { background: var(--navy-light); color: var(--blue-dark); }
.site-footer { border-top: 1px solid var(--line); padding: 28px 0 36px; background: #fff; margin-top: 24px; }
.site-footer p { margin: 6px 0; }
.site-footer .links a { margin: 0 2px; }

/* ---- 本文 ---- */
main { padding: 28px 0 56px; min-width: 0; }
h1 { font-size: 1.7rem; line-height: 1.4; margin: 0 0 8px; color: var(--navy); letter-spacing: .01em; }
h2 { font-size: 1.2rem; line-height: 1.5; margin: 40px 0 12px; padding-left: 12px; border-left: 5px solid var(--blue); color: var(--navy); }
h3 { font-size: 1.02rem; margin: 22px 0 8px; color: var(--navy); }
.lead { color: var(--muted); margin: 0 0 20px; font-size: 1rem; }
.small { font-size: .85rem; color: var(--muted); }
.note { font-size: .88rem; color: var(--muted); margin: 8px 0; }
.page-info { display: flex; flex-wrap: wrap; gap: 3px 18px; margin: -10px 0 18px; font-size: .8rem; line-height: 1.6; color: var(--muted); }
.page-info span { display: inline-flex; align-items: center; gap: 5px; }
.page-info svg { width: 14px; height: 14px; flex: none; }
.crumb { font-size: .82rem; color: var(--muted); margin: 0 0 14px; }
.crumb a { color: var(--muted); text-decoration: none; }
.crumb a:hover { color: var(--blue); text-decoration: underline; }
.crumb span { margin: 0 6px; color: var(--line-strong); }

.card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; margin: 16px 0; box-shadow: var(--shadow); overflow-x: auto; }
.card > :first-child { margin-top: 0; }
.card > :last-child { margin-bottom: 0; }
.result, .explain { overflow-x: auto; }

/* ---- 入力 ---- */
.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px 22px; }
.grid > div:has(> label.f) { display: flex; flex-direction: column; justify-content: flex-end; }
label.f { display: block; font-size: .87rem; font-weight: 600; color: var(--sub); margin-bottom: 6px; line-height: 1.5; }
input[type=text], input[type=number], input[type=date], input[type=month], input[type=time], input[type=search], input[type=tel], input[type=email], input:not([type]), select, textarea {
  width: 100%; font-size: 1rem; line-height: 1.4; padding: 10px 12px; border: 1px solid var(--line-strong); border-radius: 8px;
  background: #fff; color: var(--text); font-family: inherit; transition: border-color .15s, box-shadow .15s;
}
input:hover, select:hover, textarea:hover { border-color: #9aa8bd; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px rgba(36, 87, 214, .16); }
.grid > div > input:not([type=checkbox]):not([type=radio]), .grid > div > select { height: 46px; }   /* 入力欄と選択欄の高さをそろえる */
input[type=number] { text-align: right; font-variant-numeric: tabular-nums; }
input[type=checkbox], input[type=radio] { width: 17px; height: 17px; accent-color: var(--blue); vertical-align: -3px; }
textarea { min-height: 120px; line-height: 1.6; }
.inline label { display: inline-flex; align-items: center; gap: 6px; margin-right: 16px; font-size: .95rem; }
button, .btn {
  font-family: inherit; font-size: .92rem; font-weight: 600; line-height: 1.4; padding: 9px 16px; border-radius: 8px; border: 1px solid var(--blue);
  background: var(--blue); color: #fff; cursor: pointer; transition: background .15s, border-color .15s;
}
button:hover, .btn:hover { background: var(--blue-dark); border-color: var(--blue-dark); }
button.secondary { background: #fff; color: var(--blue); border-color: var(--line-strong); }
button.secondary:hover { background: var(--navy-light); border-color: var(--blue); }
button.small { font-size: .82rem; padding: 5px 11px; font-weight: 500; color: var(--muted); }
button.small:hover { color: var(--blue-dark); }
button.small:not(.secondary), button.small:not(.secondary):hover { color: #fff; }   /* 青い小さなボタンは白い文字 */
.actions { margin-top: 16px; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
details > summary { cursor: pointer; font-weight: 600; color: var(--sub); }

/* ---- 結果 ---- */
.result { background: var(--result); border: 1px solid var(--result-line); border-radius: var(--radius); padding: 18px 22px; margin-top: 16px; }
.result .big { font-size: 1.9rem; line-height: 1.3; font-weight: 700; color: var(--blue); font-variant-numeric: tabular-nums; letter-spacing: .01em; }
.result table { margin-top: 8px; }
.result > :first-child { margin-top: 0; }
.result > :last-child { margin-bottom: 0; }
.result { scroll-margin-top: 12px; }
/* 結果が画面の下に隠れている間、結果の要点を画面の下に固定して見せる帯(app.js が出し入れする) */
.result-bar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; display: flex; align-items: center; gap: 10px; width: 100%;
  padding: 9px 14px calc(9px + env(safe-area-inset-bottom, 0px)); background: #fff; color: var(--text); border: 0; border-top: 2px solid var(--blue); border-radius: 0;
  box-shadow: 0 -6px 20px rgba(20, 35, 70, .14); text-align: left; font-weight: 400; font-size: .86rem; line-height: 1.45; }
.result-bar:hover { background: #fff; border-color: var(--blue); }
.rb-label { flex: none; font-size: .7rem; font-weight: 700; color: #fff; background: var(--blue); border-radius: 999px; padding: 2px 9px; }
.rb-body { flex: 1; min-width: 0; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow: hidden; }
.rb-body .big { font-size: 1.2rem; font-weight: 700; color: var(--blue); font-variant-numeric: tabular-nums; }
.rb-body .small { font-size: .78rem; color: var(--muted); }
.rb-go { flex: none; font-size: .72rem; color: var(--blue); }
@media (min-width: 1180px) {
  .result-bar { left: auto; right: 24px; bottom: 24px; width: min(520px, 42vw); padding: 12px 16px; border: 1px solid var(--result-line); border-top: 3px solid var(--blue); border-radius: 12px; box-shadow: 0 10px 30px rgba(20, 35, 70, .18); }
}

/* ---- グラフ(assets/chart.js)。文字は本文の色、色は図形だけに使う ---- */
.chart { position: relative; margin: 12px 0 4px; padding: 14px 16px 12px; background: #fff; border: 1px solid var(--line); border-radius: 10px; }
.chart-t { font-size: .86rem; font-weight: 600; color: var(--sub); margin: 0 0 10px; }
.chart-legend { list-style: none; display: flex; flex-wrap: wrap; gap: 4px 16px; margin: 0 0 10px; padding: 0; font-size: .8rem; color: var(--sub); }
.chart-legend li { display: inline-flex; align-items: center; gap: 6px; }
.chart-legend i { flex: none; }
.chart-legend .key-box { width: 11px; height: 11px; border-radius: 3px; }
.chart-legend .key-line { width: 16px; height: 3px; border-radius: 2px; }
.chart-tip { position: absolute; z-index: 5; pointer-events: none; min-width: 9em; padding: 7px 10px; background: #fff; border: 1px solid var(--line-strong); border-radius: 8px; box-shadow: 0 6px 18px rgba(20, 35, 70, .16); font-size: .8rem; line-height: 1.5; color: var(--text); white-space: nowrap; }
.chart-tip .tip-h { font-size: .74rem; color: var(--muted); margin-bottom: 2px; }
.chart-tip .tip-r { display: flex; align-items: center; gap: 7px; }
.chart-tip .tip-r i { width: 12px; height: 3px; border-radius: 2px; flex: none; }
.chart-tip .tip-r b { font-variant-numeric: tabular-nums; }
.chart-tip .tip-r span { color: var(--muted); }
/* 内訳の帯: 高さ28px、区切りは2pxのすき間(線で囲まない) */
.seg { display: flex; gap: 2px; height: 28px; }
.seg-p { min-width: 0; border-radius: 4px; display: flex; align-items: center; padding-left: 7px; font-size: .76rem; font-weight: 600; white-space: nowrap; cursor: default; }
.seg-p:hover, .seg-p:focus-visible, .sbar-s:hover, .sbar-s:focus-visible { filter: brightness(1.08); }
/* 横棒の比較: 太さ22px、根元は直角・先だけ丸める */
.sbar { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 10px 12px; align-items: center; padding-right: 6.6em; }
.sbar-l { font-size: .82rem; color: var(--sub); white-space: nowrap; }
.sbar-t { position: relative; height: 22px; }
.sbar-g { position: absolute; top: -5px; bottom: -5px; width: 1px; background: var(--line); }
.sbar-g:first-child { background: var(--line-strong); }
.sbar-b { position: relative; display: flex; gap: 2px; height: 100%; }
.sbar-s { min-width: 0; }
.sbar-s:last-child { border-radius: 0 4px 4px 0; }
.sbar-v { position: absolute; top: 50%; transform: translateY(-50%); margin-left: 7px; font-size: .78rem; font-weight: 600; color: var(--text); white-space: nowrap; font-variant-numeric: tabular-nums; }
.sbar-a { position: relative; height: 1.3em; font-size: .72rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.sbar-a span { position: absolute; transform: translateX(-50%); white-space: nowrap; }
.sbar-a span:first-child { transform: none; }
/* 折れ線 */
.lchart svg { display: block; max-width: 100%; touch-action: pan-y; outline-offset: 2px; }
.lchart .grid { stroke: var(--line); stroke-width: 1; }
.lchart .ax { stroke: var(--line-strong); stroke-width: 1; }
.lchart .hair { stroke: #8a96a8; stroke-width: 1; }
.lchart .tick { font-size: 11px; fill: var(--muted); font-variant-numeric: tabular-nums; }

/* ---- 表(横の罫線だけにして角を丸める) ---- */
table { border-collapse: separate; border-spacing: 0; width: 100%; font-size: .93rem; background: #fff; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
th, td { border: 0; border-bottom: 1px solid var(--line); padding: 9px 12px; text-align: left; vertical-align: top; }
tbody tr:last-child > *, table > tr:last-child > *, tfoot tr:last-child > * { border-bottom: 0; }
th { background: #f3f6fa; color: var(--sub); font-weight: 600; }
thead th { font-size: .86rem; }
td.num, th.num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.kv td:first-child { width: 42%; min-width: 7em; background: #f8fafc; color: var(--sub); }
.kv td.num { white-space: normal; }   /* 項目と値の表は、値に長い説明が入ることがあるので折り返す(折り返さないと項目の列がつぶれる) */
tr.hl td { background: #fff6d6; font-weight: 700; }
/* 文字の列が、折り返さない数字の列に押されて細くつぶれた表(app.js が見つけて t-wide を付ける)は、
   文字の列に最低限の幅を確保する。はみ出す分は表の枠の中で横にスクロールする */
table.t-wide td:not(.num):not(:has(input, select, textarea)), table.t-wide th:first-child { min-width: 6em; }   /* 早見表で現在の入力に当たる行 */
/* 書類・カレンダーなど、格子の罫線を使う表は元の形のまま */
.doc table, table.kcal, .cal table { border-collapse: collapse; border-radius: 0; overflow: visible; }
.doc table th, .doc table td { border: 1px solid #bbb; }
main .doc { overflow-x: auto; }
.doc h2, .doc h3 { color: inherit; }

/* ---- 補足・注意 ---- */
.explain { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 6px 22px; margin: 12px 0; font-size: .93rem; line-height: 1.85; }
/* 「あわせて知っておきたいこと」(計算の根拠とは別の、周辺の実務知識・よくある誤解) */
h2.tips-h { border-left-color: #1baf7a; }
.explain.tips { background: #f5fbf8; border-color: #cfe9dd; }
.explain ul, .explain ol { padding-left: 1.3em; }
.explain li { margin: 9px 0; }
.badge { display: inline-block; font-size: .74rem; font-weight: 600; line-height: 1.5; background: var(--navy-light); color: var(--blue-dark); border-radius: 999px; padding: 3px 11px; margin-left: 6px; vertical-align: middle; letter-spacing: 0; }
.warn { background: #fdecea; border: 1px solid #f5b5b0; border-radius: 8px; padding: 10px 14px; font-size: .9rem; }
.ok { color: #1f7a37; font-weight: 700; }
.ng { color: #c62828; font-weight: 700; }
code { background: #eef1f6; padding: 1px 6px; border-radius: 4px; font-size: .9em; }

/* ---- トップページ ---- */
.hero { text-align: center; background: linear-gradient(135deg, #e9f0ff 0%, #f6f8ff 55%, #eef6ff 100%); border: 1px solid #dbe5fa; border-radius: 16px; padding: 40px 24px 30px; margin-bottom: 8px; }
.hero h1 { font-size: 1.9rem; margin: 0 0 8px; }
.hero .eyebrow { font-size: .85rem; font-weight: 600; color: var(--blue-dark); margin: 0 0 6px; letter-spacing: .06em; }
.hero .hero-lead { color: var(--sub); margin: 0 auto 22px; max-width: 640px; }
.search { position: relative; max-width: 620px; margin: 0 auto; }
.search input { height: 54px; padding: 0 18px 0 50px; font-size: 1.02rem; border-radius: 14px; border-color: #c9d6f2; box-shadow: 0 4px 16px rgba(36, 87, 214, .10); }
.search svg { position: absolute; left: 17px; top: 50%; width: 21px; height: 21px; margin-top: -10.5px; color: var(--muted); pointer-events: none; }
.chips { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin: 18px auto 0; max-width: 860px; }
.chip { display: inline-flex; align-items: center; gap: 6px; font-size: .84rem; font-weight: 600; color: var(--sub); background: #fff; border: 1px solid #d5ddec; border-radius: 999px; padding: 5px 13px; text-decoration: none; }
.chip:hover { border-color: var(--blue); color: var(--blue-dark); background: #fff; }
.chip b { font-weight: 600; font-size: .76rem; color: var(--muted); }
.points { list-style: none; display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 22px; padding: 0; margin: 22px 0 0; font-size: .84rem; color: var(--sub); }
.points li { display: inline-flex; align-items: center; gap: 6px; }
.points svg { width: 16px; height: 16px; color: #1f7a37; flex: none; }
/* 最近の更新 */
.news { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 14px 20px 10px; margin: 14px 0 0; }
.news-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 4px; }
.news-head strong { font-size: .95rem; color: var(--navy); }
.news-head a { font-size: .82rem; text-decoration: none; white-space: nowrap; }
.news-head a:hover { text-decoration: underline; }
.updates { list-style: none; margin: 0; padding: 0; }
.updates li { display: flex; align-items: baseline; gap: 10px; padding: 7px 0; font-size: .88rem; line-height: 1.65; }
.updates li + li { border-top: 1px solid #eef1f6; }
.updates time { flex: none; width: 7em; color: var(--muted); font-size: .8rem; font-variant-numeric: tabular-nums; white-space: nowrap; }
.updates .tag { flex: none; min-width: 4.6em; text-align: center; font-size: .7rem; font-weight: 700; line-height: 1.7; border-radius: 999px; padding: 0 9px; }
.updates .txt { min-width: 0; }
.tag.t-add { background: #e4f6ee; color: #14804a; }
.tag.t-law { background: #fff1e0; color: #c2590a; }
.tag.t-fix { background: #e9edf3; color: #47566b; }
.tag.t-info { background: #e7f0ff; color: #2457d6; }
#search-status { margin: 14px 0 0; font-size: .9rem; color: var(--muted); text-align: center; }

/* 対象(いちばん大きな区分)ごとの色。アイコン・小分類の枠の上の線・マウスを載せたときの色に使う */
.g1 { --c: #2457d6; --cbg: #e7f0ff; }   /* 会社員・個人 */
.g2 { --c: #14804a; --cbg: #e4f6ee; }   /* 個人事業主 */
.g3 { --c: #5b3fd0; --cbg: #efeaff; }   /* 法人・経営者 */
.g4 { --c: #c2590a; --cbg: #fff1e0; }   /* 経理・給与の実務 */
.g5 { --c: #0b7285; --cbg: #e2f5f8; }   /* 日付・便利ツール */
.c0 { --c: #b7791f; --cbg: #fff4d6; }   /* よく使われるツール */
.cat-sec { scroll-margin-top: 16px; }

/* 対象ごとの見出しの帯 */
.grp { margin-top: 46px; scroll-margin-top: 12px; }
.grp-head { display: flex; align-items: center; gap: 14px; background: var(--cbg); border-left: 6px solid var(--c); border-radius: 12px; padding: 14px 18px; }
.grp-head .ico { display: inline-flex; align-items: center; justify-content: center; width: 46px; height: 46px; border-radius: 12px; background: #fff; color: var(--c); flex: none; }
.grp-head .ico svg { width: 25px; height: 25px; }
.grp-head h2 { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 10px; margin: 0; padding: 0; border: 0; font-size: 1.3rem; line-height: 1.4; color: var(--navy); }
.grp-head h2 .n { font-size: .8rem; font-weight: 700; color: var(--c); }
.grp-head p { margin: 2px 0 0; font-size: .85rem; line-height: 1.6; color: var(--sub); }
.grp h3.cat { margin-top: 26px; }

/* トップの「対象から探す」ボタン */
.whos { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; max-width: 980px; margin: 22px auto 0; }
.who { display: flex; flex-direction: column; align-items: center; gap: 5px; background: #fff; border: 1px solid #d5ddec; border-radius: 12px; padding: 12px 8px 10px; text-decoration: none; color: var(--navy); transition: border-color .15s, box-shadow .15s, transform .15s; }
.who:hover { border-color: var(--c); color: var(--navy); box-shadow: 0 6px 16px rgba(20, 35, 70, .10); transform: translateY(-1px); }
.who .ico { display: inline-flex; align-items: center; justify-content: center; width: 38px; height: 38px; border-radius: 10px; background: var(--cbg); color: var(--c); }
.who .ico svg { width: 21px; height: 21px; }
.who strong { font-size: .84rem; line-height: 1.4; text-align: center; }
.who .n { font-size: .74rem; color: var(--muted); }

h3.cat { display: flex; align-items: center; gap: 10px; font-size: 1.16rem; margin: 44px 0 14px; color: var(--navy); }
.featured h3.cat { margin-top: 30px; }
h3.cat .ico { display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; border-radius: 10px; background: var(--cbg); color: var(--c); flex: none; }
h3.cat .ico svg { width: 20px; height: 20px; }
h3.cat .n { font-size: .78rem; font-weight: 600; color: var(--muted); background: #e9edf4; border-radius: 999px; padding: 1px 9px; }

/* 小分類ごとの枠 */
/* 小分類の数(n2〜n5)と一覧の幅に合わせて列数を変え、枠が1つだけ次の段に余らないようにする */
#tools { container-type: inline-size; }
.sub-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.sub-grid .sub:last-child:nth-child(odd) { grid-column: 1 / -1; }
@container (min-width: 860px) {
  .sub-grid { grid-template-columns: repeat(3, 1fr); }
  .sub-grid .sub:last-child:nth-child(odd) { grid-column: auto; }
  .sub-grid.n1 { grid-template-columns: minmax(0, 520px); }
  .sub-grid.n2, .sub-grid.n4 { grid-template-columns: repeat(2, 1fr); }
  .sub-grid.n5 { grid-template-columns: repeat(6, 1fr); }
  .sub-grid.n5 .sub { grid-column: span 2; }
  .sub-grid.n5 .sub:nth-child(n+4) { grid-column: span 3; }
}
@container (min-width: 1000px) {
  .sub-grid.n4 { grid-template-columns: repeat(4, 1fr); }
}
.sub { background: #fff; border: 1px solid var(--line); border-top: 3px solid var(--c); border-radius: var(--radius); padding: 14px 8px 8px; box-shadow: 0 1px 2px rgba(20, 35, 70, .04); scroll-margin-top: 16px; }
.sub:target { box-shadow: 0 0 0 4px var(--cbg); }
.sub h4 { margin: 0 10px 6px; font-size: .95rem; line-height: 1.5; color: var(--navy); }
.link-list { list-style: none; margin: 0; padding: 0; }
.link-list li + li { border-top: 1px solid #eef1f6; }
.link-list a { display: block; position: relative; padding: 9px 26px 9px 10px; border-radius: 8px; text-decoration: none; }
.link-list a::after { content: "›"; position: absolute; right: 10px; top: 50%; transform: translateY(-54%); font-size: 1.15rem; color: var(--line-strong); }
.link-list a:hover { background: var(--cbg); }
.link-list a:hover::after { color: var(--c); }
.link-list strong { display: block; font-size: .93rem; font-weight: 600; line-height: 1.5; color: var(--text); }
.link-list a:hover strong { color: var(--c); }
.link-list em { display: block; font-style: normal; font-size: .76rem; line-height: 1.5; color: var(--muted); margin-top: 1px; }

/* ---- サイドメニュー ---- */
.side { display: none; }
.side-h { font-size: .78rem; font-weight: 700; letter-spacing: .03em; margin: 18px 0 5px 10px; }
.side-nav > .side-h:first-child { margin-top: 0; }
.side-h a { display: inline-flex; align-items: center; gap: 7px; color: var(--c); text-decoration: none; }
.side-h a::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--c); flex: none; }
.side-h a:hover { text-decoration: underline; }
.side-cats, .side-subs, .side-tools { list-style: none; margin: 0; padding: 0; }
.side-cat { display: flex; align-items: center; gap: 9px; padding: 6px 10px; border-radius: 9px; text-decoration: none; color: var(--sub); font-size: .87rem; font-weight: 600; line-height: 1.4; }
.side-cat .ico { display: inline-flex; align-items: center; justify-content: center; width: 26px; height: 26px; border-radius: 8px; background: var(--cbg); color: var(--c); flex: none; }
.side-cat .ico svg { width: 15px; height: 15px; }
.side-cat:hover { background: #fff; color: var(--navy); }
.side-cats > li.open > .side-cat { background: #fff; color: var(--navy); box-shadow: 0 1px 3px rgba(20, 35, 70, .08); }
.side-subs { display: none; margin: 3px 0 9px 22px; padding-left: 10px; border-left: 2px solid var(--cbg); }
.side-cats > li.open > .side-subs { display: block; }
.side-subs a { display: block; padding: 4px 8px; border-radius: 6px; font-size: .82rem; line-height: 1.5; color: var(--muted); text-decoration: none; }
.side-subs a:hover { color: var(--c); background: #fff; }
.side-subs > li.cur > a { color: var(--c); font-weight: 700; }
.side-tools { margin: 2px 0 6px 8px; }
.side-tools a { font-size: .78rem; padding: 3px 8px; }
.side-tools li.cur > a { background: var(--cbg); color: var(--c); font-weight: 700; }
.side-backdrop { display: none; }
@media (min-width: 1180px) {
  .side { display: block; position: sticky; top: 0; max-height: 100vh; overflow-y: auto; padding: 28px 0 24px; scrollbar-width: thin; }
  .menu-btn { display: none; }
}
@media (max-width: 1179px) {
  .side { display: block; position: fixed; top: 0; bottom: 0; left: 0; width: min(86vw, 330px); background: var(--bg); z-index: 60; overflow-y: auto; padding: 20px 12px 28px;
          transform: translateX(-104%); visibility: hidden; transition: transform .2s ease, visibility .2s; box-shadow: 0 0 40px rgba(20, 35, 70, .25); }
  body.menu-open .side { transform: none; visibility: visible; }
  .side-backdrop { display: block; position: fixed; top: 0; right: 0; bottom: 0; left: 0; background: rgba(15, 25, 45, .45); z-index: 55; opacity: 0; pointer-events: none; transition: opacity .2s; }
  body.menu-open .side-backdrop { opacity: 1; pointer-events: auto; }
  body.menu-open { overflow: hidden; }
  .side .side-subs { display: block; }   /* 引き出し式のメニューでは小分類を全部見せる */
}

.tool-list { list-style: none; padding: 0; margin: 0 0 8px; display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 12px; }
.tool-list a { display: flex; flex-direction: column; height: 100%; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px 15px; text-decoration: none; color: var(--text); box-shadow: 0 1px 2px rgba(20, 35, 70, .04); transition: border-color .15s, box-shadow .15s, transform .15s; }
.tool-list a:hover { border-color: var(--blue); box-shadow: 0 6px 18px rgba(36, 87, 214, .13); transform: translateY(-1px); }
.tool-list strong { display: block; color: var(--navy); font-size: .97rem; line-height: 1.5; }
.tool-list em { display: block; font-style: normal; font-size: .76rem; font-weight: 600; color: #4a6fc6; line-height: 1.5; margin-top: 3px; }
.tool-list span { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow: hidden; font-size: .81rem; line-height: 1.6; color: var(--muted); margin-top: 7px; }
.related { margin-top: 44px; }
.related .more { font-size: .9rem; margin: 12px 0 0; }

@media (max-width: 640px) {
  .wrap { padding: 0 16px; }
  main { padding: 20px 0 44px; }
  h1 { font-size: 1.4rem; }
  h2 { font-size: 1.1rem; margin-top: 32px; }
  .grid { grid-template-columns: 1fr; gap: 14px; }
  .card { padding: 16px; }
  .result { padding: 14px 16px; }
  .result .big { font-size: 1.6rem; }
  .explain { padding: 4px 16px; }
  th, td { padding: 8px 9px; }
  .site-header .wrap { height: 54px; }
  .brand { font-size: 1rem; gap: 8px; }
  .brand svg { width: 26px; height: 26px; }
  .nav a { padding: 6px 8px; font-size: .86rem; }
  .hero { padding: 28px 16px 22px; border-radius: 14px; }
  .hero h1 { font-size: 1.45rem; }
  .search input { height: 50px; font-size: 1rem; }
  .tool-list { grid-template-columns: 1fr; gap: 10px; }
  .sub-grid { grid-template-columns: 1fr; gap: 12px; }
  .sub-grid .sub:last-child:nth-child(odd) { grid-column: auto; }
  .nav a:first-child { display: none; }   /* 「ツール一覧」はメニューボタンで代わりになる */
  .nav a:last-child { display: none; }    /* 「運営者情報」はフッターにある */
  h3.cat { margin-top: 34px; font-size: 1.08rem; }
  .chips { gap: 6px; }
  .chart { padding: 12px 12px 10px; }
  .sbar { padding-right: 6em; gap: 8px 8px; }
  .sbar-l { font-size: .76rem; white-space: normal; max-width: 6.5em; line-height: 1.3; }
  .whos { grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 18px; }
  .crumb { white-space: nowrap; overflow-x: auto; margin-bottom: 10px; scrollbar-width: none; }
  .crumb::-webkit-scrollbar { display: none; }
  .who:last-child:nth-child(odd) { grid-column: 1 / -1; }
  .grp { margin-top: 36px; }
  .grp-head { padding: 12px 14px; gap: 12px; }
  .grp-head h2 { font-size: 1.12rem; }
  .grp-head .ico { width: 40px; height: 40px; }
  .news { padding: 12px 14px 8px; }
  .updates li { flex-wrap: wrap; gap: 4px 8px; }
  .updates .txt { flex: 1 1 100%; }
  .chip { font-size: .8rem; padding: 4px 11px; }
  main .doc { padding: 18px 14px; }
  main .doc table th, main .doc table td { padding: 5px 6px; }
  .points { flex-direction: column; align-items: flex-start; gap: 6px; max-width: 320px; margin: 18px auto 0; text-align: left; }
  .points li { align-items: flex-start; }
  .points svg { margin-top: 5px; }
}

/* ---- 勘定科目・消費税区分の辞典 ---- */
.jiten-search { max-width: none; margin: 4px 0 6px; }
.jiten-ul { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 8px; }
.jiten-ul a { display: block; height: 100%; background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px; text-decoration: none; }
.jiten-ul a:hover { border-color: var(--blue); box-shadow: var(--shadow); }
.jiten-ul strong { display: block; font-size: .94rem; line-height: 1.5; color: var(--navy); }
.jiten-ul span { display: block; font-size: .84rem; line-height: 1.5; color: var(--text); margin-top: 2px; }
.jiten-ul em { display: block; font-style: normal; font-size: .76rem; line-height: 1.5; color: var(--muted); margin-top: 1px; }

/* ---- トップページ: 調べる・確認する(辞典・カレンダー・手続きナビ) ---- */
.quick { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 10px; margin: 14px 0 0; }
.quick a { display: block; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 13px 16px; text-decoration: none; }
.quick a:hover { border-color: var(--blue); }
.quick strong { display: block; font-size: .95rem; color: var(--navy); }
.quick span { display: block; font-size: .8rem; line-height: 1.55; color: var(--muted); margin-top: 3px; }
@media (max-width: 720px) { .quick { grid-template-columns: 1fr; gap: 8px; } }

/* ---- 業務ソフト(body.app): サイドメニューを出さず、表を広く使う ---- */
body.app .side, body.app .menu-btn, body.app .side-backdrop { display: none !important; }
body.app .layout { display: block; }
@media (min-width: 1180px) { body.app { --wrap: 1384px; } }
.gy-bar { position: sticky; top: 0; z-index: 20; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 14px; background: #fff; border: 1px solid var(--line-strong); border-radius: var(--radius); box-shadow: var(--shadow); padding: 9px 14px; margin: 16px 0 10px; }
.gy-file-info { display: flex; flex-direction: column; min-width: 0; line-height: 1.45; }
.gy-name { font-weight: 600; color: var(--navy); font-size: .92rem; overflow-wrap: anywhere; }
.gy-st { font-size: .8rem; font-weight: 600; }
.gy-st.dirty { color: var(--accent); }
.gy-st.clean { color: #2b8a3e; }
.gy-btns { display: flex; flex-wrap: wrap; gap: 6px; }
.gy-bar button.small:not(.secondary), .gy-dlg button.small:not(.secondary) { color: #fff; }
/* 保存の呼びかけ(gyomu.js の updNudge)と、ダウンロードで保存したあとの一言(showDlNote)。帯の中の1行として出す */
.gy-nudge { flex-basis: 100%; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 12px; background: #fff4e6; border: 1px solid #f3b571; border-left: 5px solid var(--accent); border-radius: 8px; padding: 8px 12px; font-size: .88rem; line-height: 1.6; }
.gy-nudge p { margin: 0; flex: 1 1 24em; color: var(--text); }
.gy-nudge strong { color: #a33a0b; margin-right: .3em; }
.gy-nudge-btns { display: flex; flex-wrap: wrap; gap: 6px; }
.gy-dlnote { flex-basis: 100%; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 12px; background: var(--navy-light); border-radius: 8px; padding: 6px 12px; font-size: .84rem; color: var(--sub); line-height: 1.55; }
.gy-nudge[hidden], .gy-dlnote[hidden] { display: none; }
.gy-dlg { border: 1px solid var(--line-strong); border-radius: var(--radius); padding: 18px 20px; max-width: 540px; width: calc(100% - 32px); color: var(--text); box-shadow: 0 12px 40px rgba(20, 35, 70, .25); }
.gy-dlg::backdrop { background: rgba(20, 35, 70, .35); }
.gy-dlg-body p { margin: 0 0 8px; }
.gy-dlg-btns { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; margin-top: 14px; }
.gy-hist { padding-left: 1.5em; font-size: .88rem; max-height: 40vh; overflow: auto; margin: 6px 0 0; }
.gy-notice { background: #fff8e6; border: 1px solid #f0d58a; border-radius: 10px; padding: 9px 14px; font-size: .88rem; line-height: 1.65; margin: 0 0 10px; }
.gy-tabs { display: flex; flex-wrap: wrap; gap: 2px; border-bottom: 2px solid var(--line); margin: 18px 0 14px; }
.gy-tabs button { background: transparent; border: 0; border-bottom: 3px solid transparent; border-radius: 0; color: var(--sub); padding: 9px 14px; margin-bottom: -2px; }
.gy-tabs button:hover { background: var(--navy-light); color: var(--blue-dark); }
.gy-tabs button[aria-selected=true] { color: var(--blue); border-bottom-color: var(--blue); }
.gy-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin: 0 0 12px; }
.gy-inline { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: .9rem; color: var(--sub); }
.gy-inline select { width: auto; max-width: 100%; height: 40px; padding: 6px 10px; font-size: .92rem; }
.gy-scroll { overflow-x: auto; }
.gy-t { font-size: .86rem; }
.gy-t th { white-space: nowrap; font-size: .8rem; }
.gy-t td { padding: 8px 10px; }
.gy-t td.num { white-space: nowrap; }
.gy-t td:first-child { min-width: 10em; }
.gy-t td.nw { white-space: nowrap; }
.gy-meisai th { white-space: normal; min-width: 4.6em; line-height: 1.4; }
.gy-meisai td { white-space: nowrap; }
.gy-meisai td:first-child, .gy-meisai td:nth-child(2), .gy-meisai td:last-child { white-space: normal; }
.gy-meisai td:last-child { min-width: 8em; }
.gy-sum-row td { font-weight: 700; background: #f8fafc; }
.gy-gone td { color: var(--muted); }
.gy-warn { display: block; color: #c92a2a; font-size: .8rem; line-height: 1.5; margin-top: 2px; }
.gy-form { margin: 0 0 16px; border-color: var(--result-line); }
.gy-ptitle { margin-top: 4px; font-size: 1.08rem; }
.gy-sum { margin-top: 18px; }
.gy-sum h3 { font-size: .98rem; margin: 0 0 8px; }
.app-list .soon > div { display: flex; flex-direction: column; height: 100%; background: #fafbfd; border: 1px dashed var(--line-strong); border-radius: var(--radius); padding: 14px 16px 15px; }
.app-list .soon strong { display: block; color: var(--sub); font-size: .97rem; line-height: 1.5; }
.app-list .soon em { color: var(--muted); }
@media (max-width: 640px) {
  .gy-bar { position: static; padding: 9px 12px; }
  .gy-tabs button { padding: 8px 10px; font-size: .86rem; }
}
@media print {
  .no-print, .gy-bar, .gy-tabs, .gy-tools, .gy-notice, .gy-dlg { display: none !important; }
  body.app main { padding: 0; }
  .gy-t tr { break-inside: avoid; }
  .gy-t .small { font-size: inherit; }
  .gy-t thead { display: table-header-group; }
  body.app .wrap { max-width: none; padding: 0; }
  .gy-t { font-size: 8pt; }
  .gy-t th, .gy-t td { padding: 3px 4px; }
  .gy-scroll { overflow: visible; }
}

/* ---- 書式・規程集(body.kitei)。用紙は明朝体のA4。印刷では用紙だけを出す ---- */
/* ヘッダーのメニューが5つになったので、幅が880px以下では「ツール一覧」(メニューボタンで代わり)と「運営者情報」(フッターにある)を出さない */
@media (max-width: 880px) { .nav a:first-child, .nav a:last-child { display: none; } }
/* 幅が狭いときは、ヘッダーのメニュー(辞典・業務ソフト・書式)をサイト名の下の段に置く */
@media (max-width: 540px) {
  .site-header .wrap { flex-wrap: wrap; height: auto; row-gap: 0; padding-top: 7px; padding-bottom: 5px; }
  .head-l { height: 40px; }
  .nav { width: 100%; margin: 0 -8px; overflow-x: auto; scrollbar-width: none; }
  .nav a { padding: 5px 8px; }
}
.kt-fh { margin: 0 0 10px; font-size: 1.05rem; }
#kt-form .grid > div { min-width: 0; }   /* 行の表が広いとき、表だけを横にスクロールさせる */
.kt-rows { min-width: 100%; }
.kt-rows input { height: 34px; padding: 4px 8px; font-size: .9rem; min-width: 6.5em; }
.kt-rows th, .kt-rows td { padding: 4px 6px; }
.kt-actions { margin: 14px 0 4px; }
.kt-paper { background: #fff; border: 1px solid #c9ced8; box-shadow: var(--shadow); max-width: 794px; margin: 14px auto 28px; padding: 56px 64px;
  font-family: "Yu Mincho", "YuMincho", "Hiragino Mincho ProN", "BIZ UDPMincho", "MS PMincho", serif; font-size: 14.5px; line-height: 1.85; color: #111; overflow-wrap: anywhere; }
.kt-paper .kt-title { text-align: center; font-size: 1.45rem; letter-spacing: .15em; margin: 0 0 1.3em; color: #111; border: 0; padding: 0; font-weight: 700; }
.kt-paper p { margin: 0 0 .35em; }
.kt-paper .kt-p { text-indent: 1em; }
.kt-paper .kt-p.ni { text-indent: 0; }
.kt-paper .kt-center { text-align: center; }
.kt-paper .kt-right { text-align: right; }
.kt-paper .kt-h { font-weight: 700; margin-top: .9em; }
.kt-paper .kt-art { margin: .55em 0; }
.kt-paper .kt-ah { font-weight: 700; margin: 0; }
.kt-paper .kt-ap { padding-left: 1em; margin: 0 0 .15em; }
.kt-paper .kt-kou { display: inline-block; width: 1em; margin-left: -1em; }
.kt-paper .kt-list { list-style: none; padding-left: 0; margin: .3em 0 .6em; }
.kt-paper .kt-list li { padding-left: 2.4em; text-indent: -2.4em; margin: 0 0 .2em; }
.kt-paper .kt-no { display: inline-block; min-width: 2.4em; text-indent: 0; }
.kt-paper .kt-tbl { width: 100%; border-collapse: collapse; margin: .5em 0 1em; font-size: .92em; border: 0; border-radius: 0; background: #fff; }
.kt-paper .kt-tbl th, .kt-paper .kt-tbl td { border: 1px solid #555; padding: 5px 8px; text-align: left; vertical-align: top; color: #111; }
.kt-paper .kt-tbl th { background: #f2f2f2; font-weight: 700; }
.kt-paper .kt-tbl td.num { text-align: right; white-space: nowrap; }
.kt-paper .kt-kv th { width: 30%; }
.kt-paper .kt-sign { text-align: right; margin-top: 1.3em; }
.kt-paper .kt-sign p { margin: 0 0 .2em; }
.kt-paper .kt-blank { height: 1.1em; }
.kt-cat h2 .n { font-size: .8rem; font-weight: 600; color: var(--muted); margin-left: 8px; }
@media screen and (max-width: 640px) { .kt-paper { padding: 22px 16px; font-size: 13.5px; overflow-x: auto; } .kt-paper .kt-tbl { font-size: .86em; } .kt-paper .kt-tbl th, .kt-paper .kt-tbl td { padding: 4px 5px; } }
@media print {
  body.kitei main > *:not(.kt-paper) { display: none !important; }
  body.kitei main { page: kitei; padding: 0; }
  body.kitei .kt-paper { border: 0; box-shadow: none; padding: 0; margin: 0; max-width: none; font-size: 10.5pt; }
  body.kitei .kt-paper .kt-tbl tr, body.kitei .kt-paper .kt-art { break-inside: avoid; }
}
@page kitei { size: A4 portrait; margin: 20mm 20mm 18mm; }

@media print {
  .site-header, .site-footer, .actions, .nav, .crumb, .related, .side, .side-backdrop, .page-info, button { display: none !important; }
  .layout { display: block; }
  body { background: #fff; }
  .card, .result { border: 1px solid #999; box-shadow: none; }
  .result { background: #fff; }
}

/* ---- 金額の入力・要点・判断のヒント(2026-11-16 役員報酬の最適化で試作。ほかのツールにも使える部品) ---- */
.amt { margin-bottom: 18px; }
.amt-help { font-size: .86rem; color: var(--muted); margin: 2px 0 10px; }
.amt-row { display: flex; align-items: center; gap: 10px; }
.amt-box { flex: 1; min-width: 0; display: flex; align-items: baseline; gap: 8px; border: 1px solid var(--line-strong); border-radius: 10px; padding: 4px 14px; background: #fff; }
.amt-box:focus-within { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(36, 87, 214, .15); }
.amt-box input { flex: 1; min-width: 0; border: 0; padding: 4px 0; font-size: 1.7rem; font-weight: 700; color: var(--navy); text-align: right; font-variant-numeric: tabular-nums; background: transparent; box-shadow: none; outline: none; }
.amt-box span { color: var(--sub); font-weight: 600; white-space: nowrap; }
.stepbtn { flex: none; width: 48px; height: 48px; padding: 0; border-radius: 10px; font-size: 1.35rem; font-weight: 700; line-height: 1; background: var(--navy-light); color: var(--blue-dark); border: 1px solid var(--result-line); touch-action: manipulation; user-select: none; }
.stepbtn:hover { background: #dfe8fb; color: var(--blue-dark); border-color: var(--blue); }
.amt input[type=range] { width: 100%; margin: 14px 0 2px; accent-color: var(--blue); }
.amt-scale { display: flex; justify-content: space-between; font-size: .78rem; color: var(--muted); }
details.more-opts { margin-top: 18px; border-top: 1px dashed var(--line-strong); padding-top: 12px; }
details.more-opts > .grid { margin-top: 14px; }
.hl-label { font-size: .92rem; color: var(--sub); font-weight: 600; margin-bottom: 2px; }
.hl-sub { margin-left: 8px; color: var(--sub); font-size: .95rem; white-space: nowrap; }
.kfig { display: grid; grid-template-columns: repeat(3, 1fr); margin: 14px 0 4px; border-top: 1px solid var(--result-line); border-bottom: 1px solid var(--result-line); }
.kfig > div { padding: 10px 14px 10px 0; }
.kfig > div + div { padding-left: 14px; border-left: 1px solid var(--result-line); }
.kfig dt { font-size: .8rem; color: var(--muted); }
.kfig dd { margin: 2px 0 0; font-weight: 700; font-size: 1.12rem; font-variant-numeric: tabular-nums; color: var(--text); }
.kfig dd.s { font-weight: 400; font-size: .8rem; color: var(--muted); }
.hints h3 { font-size: .95rem; margin: 14px 0 4px; }
.hints ul { margin: 0; padding-left: 1.2em; }
.hints li { margin: 6px 0; font-size: .92rem; line-height: 1.75; }
.yh-tbl .xcol { display: none; }
.yh-tbl.showall .xcol { display: table-cell; }
.yh-tbl tbody tr { cursor: pointer; }
.yh-tbl tbody tr:hover td { background: #f7f9fe; }
.yh-tbl tr.best td { background: #fff8e5; }
.yh-tbl tr.sel td { background: var(--navy-light); }
.yh-tbl tr.sel td:first-child { box-shadow: inset 4px 0 0 var(--blue); }
.cmp { background: #fff; border: 1px solid var(--line); border-left: 4px solid var(--blue); border-radius: 10px; padding: 10px 16px; font-size: .93rem; margin: 8px 0; }
.cmp .note { margin: 2px 0 0; }
.lchart .mark { stroke: var(--accent); stroke-width: 1.5; stroke-dasharray: 4 3; }
.lchart .mark-t { fill: var(--accent); font-size: 11px; font-weight: 700; }
@media (max-width: 640px) {
  .kfig { grid-template-columns: 1fr; }
  .kfig > div, .kfig > div + div { padding: 8px 0; border-left: 0; }
  .kfig > div + div { border-top: 1px solid var(--result-line); }
  .amt-box input { font-size: 1.45rem; }
  .stepbtn { width: 44px; height: 44px; }
}
@media (max-width: 640px) {   /* 役員報酬の比べの表: スマホでは「月額・本人の手取り・合計」の3列にし、残りは「すべての項目を表示」で出す */
  .yh-tbl:not(.showall) th:nth-child(3), .yh-tbl:not(.showall) td:nth-child(3),
  .yh-tbl:not(.showall) th:nth-child(5), .yh-tbl:not(.showall) td:nth-child(5) { display: none; }
  .yh-tbl th, .yh-tbl td { padding-left: 7px; padding-right: 7px; }
  .yh-tbl { font-size: .86rem; }
  .yh-tbl th.num { white-space: normal; }
}
/* 小さめの金額欄(賞与など)と、行を押して選べる早見表 */
.amt-box.sm { padding: 2px 12px; }
.amt-box.sm input { font-size: 1.15rem; padding: 6px 0; }
.hay tbody tr { cursor: pointer; }
.hay tbody tr:hover td { background: #f7f9fe; }
.hay tr.sel td { background: var(--navy-light); }
.hay tr.sel td:first-child { box-shadow: inset 4px 0 0 var(--blue); }
@media (max-width: 640px) {   /* 早見表・内訳の表: スマホでは文字と余白を詰めて画面の幅に収める */
  .hay, .bd-tbl { font-size: .8rem; }
  .hay th, .hay td, .bd-tbl th, .bd-tbl td { padding-left: 4px; padding-right: 4px; }
  .hay th.num, .bd-tbl th.num { white-space: normal; }
}
@media (max-width: 640px) {   /* フリーランスの早見表: スマホでは「事業所得」「手取り(月)」を隠して4列にする */
  .fl-hay th:nth-child(2), .fl-hay td:nth-child(2), .fl-hay th:nth-child(5), .fl-hay td:nth-child(5) { display: none; }
}
/* 画面下の「結果」の帯: 要点の見出し(.hl-label)は1行に収め、金額が必ず見えるようにする */
.rb-body .hl-label { font-size: .74rem; margin: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rb-body .hl-sub { font-size: .78rem; margin-left: 6px; }
.lchart .mark.sub { stroke: var(--muted); stroke-dasharray: 2 3; }
.lchart .mark-t.sub { fill: var(--muted); }
/* 役員報酬: 報酬を変えられる期限 */
.deadline { margin: 10px 0 0; padding: 8px 14px; font-size: .9rem; line-height: 1.7; background: #fff; border: 1px solid var(--line); border-radius: 10px; }
.deadline:empty { display: none; }
/* ふるさと納税: 入れ方の切り替え・源泉徴収票の扶養の欄・家族構成ごとの早見表 */
.mode-row { margin-bottom: 16px; }
.mode-row select { font-weight: 600; }
.slip-fy-h { margin: 16px 0 4px; }
.slip-fy { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
@media (max-width: 640px) { .slip-fy { grid-template-columns: repeat(2, 1fr); } }
.mtx { overflow: visible; font-size: .86rem; }
.mtx th { white-space: nowrap; }
.mtx th.num { white-space: normal; min-width: 5.2em; }
.mtx td { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; cursor: pointer; }
.mtx td:first-child, .mtx th:first-child { position: sticky; left: 0; z-index: 1; background: #f3f6fa; text-align: left; cursor: default; font-weight: 600; box-shadow: 2px 0 0 var(--line-strong); }
.mtx tbody td:not(:first-child):hover { background: #f7f9fe; }
.mtx td.sel { background: var(--navy-light); box-shadow: inset 0 0 0 2px var(--blue); font-weight: 700; }
@media (max-width: 640px) { .mtx { font-size: .8rem; } .mtx th, .mtx td { padding-left: 6px; padding-right: 6px; } }
/* 「こんな場面で使えます」「この計算でできないこと」(meta の scenes・limits から build.py が作る) */
.uses { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin: 28px 0 8px; }
.uses-box { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 4px 18px 10px; }
.uses-box h2 { font-size: 1rem; margin: 12px 0 6px; padding: 0; border: 0; }
.uses-box ul { margin: 0; padding-left: 1.2em; }
.uses-box li { margin: 5px 0; font-size: .9rem; line-height: 1.7; }
.uses-box .limits li::marker { color: var(--muted); }
@media (max-width: 640px) { .uses { grid-template-columns: 1fr; } }
/* 職種別の平均年収の一覧: スマホでは「月給」「年間賞与」を隠して4列に。要点の補足は折り返す */
@media (max-width: 640px) {
  .nen-rank th:nth-child(4), .nen-rank td:nth-child(4), .nen-rank th:nth-child(5), .nen-rank td:nth-child(5) { display: none; }
  .hl-sub { white-space: normal; display: block; margin-left: 0; }
}
/* 補助金・助成金を探す(/hojokin/) */
.hj-checks { display: flex; flex-wrap: wrap; gap: 6px 18px; margin-top: 12px; font-size: .9rem; }
.hj-checks label { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }
.hj-count { font-weight: 700; margin: 18px 0 8px; }
.hj-list { display: grid; gap: 12px; }
.hj { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 18px 10px; box-shadow: var(--shadow); }
.hj h3 { font-size: 1.02rem; margin: 4px 0 8px; line-height: 1.5; }
.hj h3 a { color: var(--navy); text-decoration: none; }
.hj h3 a:hover { text-decoration: underline; }
.hj-badges { display: flex; gap: 8px; align-items: center; min-height: 1.2em; font-size: .78rem; font-weight: 700; }
.hj-new { color: #fff; background: var(--blue); border-radius: 999px; padding: 1px 9px; }
.hj-left { color: var(--sub); }
.hj-left.soon { color: #9a5b00; }
.hj-left.urgent { color: #b3261e; }
.hj-dl { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 4px 18px; margin: 0; font-size: .88rem; }
.hj-dl > div { display: flex; gap: 8px; }
.hj-dl dt { flex: none; width: 5.5em; color: var(--muted); }
.hj-dl dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.hj-link { margin: 8px 0 0; font-size: .86rem; }
.hj-src { margin-top: 18px; overflow-wrap: anywhere; }
@media (max-width: 640px) { .hj { padding: 10px 14px 8px; } .hj-dl { grid-template-columns: 1fr; } }
@media (max-width: 640px) {   /* 社会保険料の計算の結果の表: スマホでは「料率」の列を隠す(料率は項目名と計算の前提に書いてある) */
  .sh-tbl th:nth-child(2), .sh-tbl td:nth-child(2) { display: none; }
}

/* ---- 線表(setsuritsu-todokede)。月の目盛りの上に、きっかけの日から期限までを横棒、期限を◆で示す ---- */
.st-key { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 0; margin: 0 0 6px; border-top: 1px solid var(--line); }
.st-key > div { padding: 8px 12px 8px 0; border-bottom: 1px solid var(--line); }
.st-key span { display: block; font-size: .78rem; color: var(--muted); }
.st-key b { font-size: 1rem; font-variant-numeric: tabular-nums; color: var(--text); }
.gantt { display: grid; grid-template-columns: minmax(10em, 15em) minmax(0, 1fr); column-gap: 12px; align-items: stretch; }
.gantt-g { grid-column: 1 / -1; display: flex; align-items: center; gap: 7px; margin: 10px 0 2px; font-size: .8rem; font-weight: 700; color: var(--sub); }
.gantt-g i { width: 11px; height: 11px; border-radius: 3px; flex: none; }
.gantt-l { padding: 5px 0; font-size: .82rem; line-height: 1.35; color: var(--text); }
.gantt-l small { display: block; font-size: .72rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.gantt-t { position: relative; min-height: 34px; border-radius: 4px; outline-offset: 1px; }
.gantt-t:hover, .gantt-t:focus-visible { background: rgba(36, 87, 214, .05); }
.gantt-m { position: absolute; top: 0; bottom: 0; width: 1px; background: var(--line); }
.gantt-v { position: absolute; top: 0; bottom: 0; width: 0; border-left: 2px dashed var(--navy); opacity: .55; }
.gantt-today { position: absolute; top: 0; bottom: 0; width: 2px; background: #d6336c; opacity: .7; }
.gantt-b { position: absolute; top: 50%; height: 10px; margin-top: -5px; border-radius: 3px; min-width: 3px; opacity: .85; }
.gantt-d { position: absolute; top: 50%; width: 11px; height: 11px; margin: -5.5px 0 0 -5.5px; background: var(--navy); transform: rotate(45deg); border: 1.5px solid #fff; box-sizing: border-box; }
.gantt-e { position: absolute; top: 50%; transform: translateY(-50%); margin-left: 8px; font-size: .72rem; font-weight: 600; color: var(--text); white-space: nowrap; font-variant-numeric: tabular-nums; }
.gantt-e.in { margin: 0 8px 0 0; }
.gantt-h { padding: 0; }
.gantt-a { font-size: .7rem; color: var(--muted); border-bottom: 1px solid var(--line-strong); }
.gantt-ay, .gantt-am { position: relative; height: 1.45em; }
.gantt-a span { position: absolute; bottom: 2px; padding-left: 3px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.gantt-ay span { font-weight: 700; color: var(--sub); border-left: 1px solid var(--line-strong); }
.gantt-am span { overflow: hidden; }
.gantt-a.thin .gantt-am span:nth-child(even) { visibility: hidden; }
.chart-legend .gantt-key-d { width: 9px; height: 9px; background: var(--navy); transform: rotate(45deg); margin: 0 2px; }
.chart-legend .gantt-key-v { width: 0; height: 12px; border-left: 2px dashed var(--navy); opacity: .7; }
.chart-legend .gantt-key-t { width: 2px; height: 12px; background: #d6336c; }
@media (max-width: 640px) {
  .gantt { grid-template-columns: minmax(0, 1fr); }
  .gantt-h { display: none; }
  .gantt-l { padding: 6px 0 0; }
  .gantt-t { min-height: 24px; }
}
@media print {
  .gantt-fig { break-inside: avoid; }
  .gantt-t, .gantt-l { break-inside: avoid; }
}
