/* ツール箱 共通スタイル ── モノトーン＋ペリウィンクル（白と黒を基調に、差し色は青紫1色。影を使わず余白と大きな文字で見せる） */
:root {
  --bg: #ffffff;
  --surface: #ffffff;
  --surface-2: #f5f5f7;
  --text: #0a0a0a;
  --muted: #6b6b70;
  --border: #e7e7ea;
  --border-strong: #cfcfd4;
  --ai: #0a0a0a;          /* 主役の色（ボタン・強調）＝黒 */
  --ai-hover: #2a2a2e;
  --ai-tint: #f1f3ff;     /* 結果などの淡い面 */
  --ai-tint-2: #e2e7ff;
  --on-ai: #ffffff;
  --accent: #6f86ff;      /* 差し色（ペリウィンクル） */
  --accent-ink: #4459e0;  /* 差し色の文字用（白地で読める濃さ） */
  --grad: linear-gradient(135deg, #e9edff 0%, #f6e8ff 50%, #ffe9e1 100%);
  --grad-strong: linear-gradient(135deg, #8fa2ff 0%, #c79bff 48%, #ffa78a 100%);
  --shu: #f06d4f;         /* 注意の差し色（ごく一部） */
  --danger: #c62a1c;
  --header-bg: rgba(255, 255, 255, .86);
  --footer-bg: #0a0a0a;
  --footer-text: #a9a9b0;
  --footer-head: #ffffff;
  --footer-mark: #ffffff;
  --shadow-sm: none;
  --shadow: none;
  --shadow-lift: 0 10px 30px rgba(10, 10, 20, .08);
  --radius: 20px;
  --radius-sm: 12px;
  --focus: 0 0 0 3px rgba(111, 134, 255, .35);
  --ease: cubic-bezier(.2, .7, .3, 1);
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b0b0d;
    --surface: #141417;
    --surface-2: #1b1b1f;
    --text: #f2f2f4;
    --muted: #a2a2aa;
    --border: #2a2a30;
    --border-strong: #3c3c44;
    --ai: #f2f2f4;
    --ai-hover: #ffffff;
    --ai-tint: #181b2c;
    --ai-tint-2: #262c4a;
    --on-ai: #0b0b0d;
    --accent: #8fa2ff;
    --accent-ink: #a9b8ff;
    --grad: linear-gradient(135deg, #1d2140 0%, #2a1f3d 50%, #3a2420 100%);
    --shu: #ff8a6e;
    --danger: #ff8f80;
    --header-bg: rgba(11, 11, 13, .82);
    --footer-bg: #000000;
    --footer-text: #9a9aa2;
    --footer-head: #f2f2f4;
    --footer-mark: #f2f2f4;
    --shadow-lift: 0 10px 30px rgba(0, 0, 0, .45);
    --focus: 0 0 0 3px rgba(143, 162, 255, .4);
  }
}
/* 死亡後の期限・法要ページでは差し色を抑える */
.quiet { --shu: var(--muted); --accent: var(--muted); }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 76px; }
td, th { overflow-wrap: normal; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Noto Sans JP", "Yu Gothic UI", "Meiryo", system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.85;
  letter-spacing: .02em;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--text); text-underline-offset: .22em; text-decoration-thickness: 1px; text-decoration-color: var(--accent); }
a:hover { color: var(--accent-ink); }
img { max-width: 100%; height: auto; }
::selection { background: var(--ai-tint-2); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

.wrap { max-width: 820px; margin: 0 auto; padding: 0 20px; }
.wrap.wide { max-width: 1120px; }

/* ───── ヘッダー ───── */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: var(--header-bg);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid transparent;
}
.home .site-header .wrap { max-width: 1120px; }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; min-height: 64px; gap: 12px; }
.logo { display: inline-flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; font-weight: 700; font-size: 1.1rem; letter-spacing: .06em; }
.logo:hover { color: var(--text); }
.logo-mark { flex: none; display: block; }
.logo-mark .m-base { fill: var(--text); }
.logo-mark .m-line { stroke: var(--bg); }
.logo-mark .m-accent { fill: var(--accent); }
.nav-link {
  display: inline-flex; align-items: center; min-height: 38px; padding: 0 16px;
  font-size: .86rem; font-weight: 700; letter-spacing: .04em; color: var(--text); text-decoration: none;
  border: 1px solid var(--text); border-radius: 999px; background: transparent;
  transition: background .2s, color .2s;
}
.nav-link:hover { background: var(--text); color: var(--bg); }

/* ───── 見出し・本文 ───── */
main { padding: 32px 0 72px; }
h1, h2, h3 { font-weight: 700; letter-spacing: .02em; }
h1 { font-size: 2rem; line-height: 1.4; margin: 0 0 12px; }
h2 { font-size: 1.45rem; line-height: 1.5; margin: 64px 0 16px; }
/* 見出しの後ろの小さな丸（差し色） */
h2::after { content: ""; display: inline-block; width: .36em; height: .36em; margin-left: .35em; border-radius: 50%; background: var(--accent); vertical-align: .12em; }
h3 { font-size: 1.08rem; margin: 28px 0 6px; }
main p, main li { max-width: 70ch; }
.lead { color: var(--muted); margin: 0 0 28px; font-size: 1.02rem; }
.note { font-size: .875rem; color: var(--muted); }

.breadcrumb { font-size: .8rem; color: var(--muted); margin-bottom: 18px; letter-spacing: .04em; }
.breadcrumb a { color: var(--muted); text-decoration: none; }
.breadcrumb a:hover { color: var(--text); text-decoration: underline; }

/* ツールページの見出し */
.tool-title { display: flex; align-items: center; gap: 16px; }
.tool-title .ticon { width: 56px; height: 56px; border-radius: 18px; }
.tool-title .ticon svg { width: 28px; height: 28px; }

/* 線画アイコンの地（淡いグラデーションの角丸） */
.ticon {
  flex: none; display: inline-grid; place-items: center;
  width: 46px; height: 46px; border-radius: 14px;
  background: var(--grad); color: var(--text);
}

/* ───── パネル（ツール本体） ───── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: none;
  padding: 28px;
  margin: 24px 0;
}
.card table th { width: 7em; white-space: nowrap; }

label { display: block; font-weight: 700; font-size: .88rem; letter-spacing: .03em; margin: 18px 0 6px; }
label.inline { display: inline-flex; align-items: flex-start; gap: 8px; font-weight: 400; font-size: .95rem; margin: 12px 18px 0 0; cursor: pointer; }
input[type="text"], input[type="number"], input[type="date"], input[type="search"], select, textarea {
  width: 100%;
  min-height: 50px;
  font: inherit;
  font-variant-numeric: tabular-nums;
  color: var(--text);
  background: var(--surface-2);
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  padding: 10px 16px;
  transition: border-color .15s, box-shadow .15s, background .15s;
}
input[type="date"] { -webkit-appearance: none; appearance: none; }
select { -webkit-appearance: none; appearance: none; padding-right: 40px; cursor: pointer;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 20px) 50%, calc(100% - 15px) 50%;
  background-size: 5px 5px; background-repeat: no-repeat; }
input[type="number"] { max-width: 260px; }
textarea { min-height: 220px; resize: vertical; line-height: 1.75; }
input:hover, select:hover, textarea:hover { border-color: var(--border-strong); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: var(--focus); background: var(--surface); }
input[type="checkbox"], input[type="radio"] { flex: none; width: 18px; height: 18px; margin: .3em 0 0; accent-color: var(--accent); }
input[type="range"] { accent-color: var(--accent); }
.row { display: flex; flex-wrap: wrap; gap: 0 16px; align-items: flex-end; }
.row > div { flex: 1 1 200px; min-width: 0; }
.row input[type="number"] { max-width: none; }

button, .btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 46px;
  font: inherit; font-weight: 700; font-size: .92rem; letter-spacing: .04em;
  cursor: pointer;
  border: 1px solid var(--ai);
  border-radius: 999px;
  padding: 8px 22px;
  margin-top: 16px;
  background: var(--ai);
  color: var(--on-ai);
  transition: background .2s, border-color .2s, color .2s, transform .2s var(--ease);
}
button:hover, .btn:hover { background: var(--ai-hover); border-color: var(--ai-hover); }
button:active, .btn:active { transform: scale(.98); }
button:disabled { opacity: .4; cursor: default; }
button.sub { background: transparent; color: var(--text); border-color: var(--border-strong); }
button.sub:hover { background: var(--surface-2); border-color: var(--text); color: var(--text); }

/* タブ：分割ボタン（segmented control） */
.tabs {
  display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 4px;
  padding: 4px; margin: 0 0 10px;
  background: var(--surface-2);
  border: 0;
  border-radius: 16px;
}
.tabs button {
  flex: 1 1 auto; margin: 0; min-height: 42px; padding: 6px 12px;
  background: transparent; color: var(--muted); border: 1px solid transparent;
  border-radius: 12px; font-weight: 700; font-size: .9rem; line-height: 1.4;
}
.tabs button:hover { background: transparent; color: var(--text); border-color: transparent; }
.tabs button[aria-selected="true"] { background: var(--ai); color: var(--on-ai); border-color: var(--ai); }
.panel[hidden] { display: none; }

/* ───── 結果 ───── */
.result {
  position: relative;
  background: var(--ai-tint);
  border: 0;
  border-radius: 18px;
  padding: 22px 24px;
  margin-top: 22px;
}
.result::before {
  content: "計算結果";
  display: inline-flex; align-items: center; gap: 6px; margin-bottom: 6px;
  font-size: .74rem; font-weight: 700; letter-spacing: .14em; color: var(--accent-ink);
}
.result:empty { display: none; }
.result > div + div { margin-top: 4px; }
.big {
  font-size: clamp(1.8rem, 6.8vw, 2.8rem);
  font-weight: 700; line-height: 1.25; letter-spacing: 0;
  font-variant-numeric: tabular-nums;
  color: var(--text);
  margin-bottom: 8px;
}
.result .note { margin-top: 8px; }

.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; margin-top: 20px; }
.stat { background: var(--surface); border: 1px solid var(--ai-tint-2); border-radius: 16px; padding: 14px 16px; }
.stat:first-child { background: var(--ai); border-color: var(--ai); }
.stat:first-child .k, .stat:first-child .v { color: var(--on-ai); }
.stat .k { font-size: .76rem; color: var(--muted); display: block; font-weight: 700; letter-spacing: .06em; }
.stat .v { display: block; font-size: 1.7rem; font-weight: 700; line-height: 1.35; font-variant-numeric: tabular-nums; }

table { width: 100%; border-collapse: collapse; font-size: .95rem; }
th, td { border-bottom: 1px solid var(--border); padding: 10px 12px; text-align: left; vertical-align: top; }
th { background: var(--surface-2); font-weight: 700; font-size: .82rem; letter-spacing: .04em; color: var(--muted); }
.table-scroll { overflow: auto; max-height: 440px; background: var(--surface); border: 1px solid var(--border); border-radius: 16px; }
.table-scroll thead th { position: sticky; top: 0; z-index: 1; }
.table-scroll tbody tr:hover td { background: var(--ai-tint); }

/* ───── 広告枠（楽天市場の商品リンク） ─────
   目立たせるが、広告だとわかる表示を守る：先頭に【PR】と「楽天市場」を明記、リンクは下線つきの文字（ボタンに見せない）、クリックのお願いはしない */
.pr-slot:empty { display: none; }
.pr-slot {
  position: relative;
  margin: 28px 0 32px;
  padding: 20px 22px 14px;
  background: var(--grad);
  border: 1.5px solid var(--accent);
  border-radius: 20px;
  font-size: 1rem;
}
.pr-slot::before {
  content: "【PR】広告・商品紹介（外部サイトへ移動します）";
  display: block; margin-bottom: 8px; padding-bottom: 10px;
  border-bottom: 1px solid rgba(111, 134, 255, .35);
  font-size: .86rem; font-weight: 700; color: var(--accent-ink); line-height: 1.5; letter-spacing: .04em;
}
.pr-slot ul { list-style: none; margin: 0; padding: 0; }
.pr-slot li { margin: 0; max-width: none; border-bottom: 1px solid rgba(111, 134, 255, .2); }
.pr-slot li:last-child { border-bottom: 0; }
.pr-slot a {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px 2px; background: none; border: 0;
  font-size: 1.05rem; font-weight: 700; line-height: 1.55; color: var(--text);
  text-decoration: underline; text-decoration-color: var(--accent); text-decoration-thickness: 2px; text-underline-offset: .28em;
}
/* 外部サイトへ移動することを示す矢印 */
.pr-slot a::after { content: "↗"; flex: none; font-size: 1rem; color: var(--accent-ink); text-decoration: none; }
.pr-slot a:hover { color: var(--accent-ink); }

/* ページ上部のプロモーション表記（本文と同じ文字サイズ。小さくしない） */
.pr-notice { display: none; margin: 0 0 16px; padding: 8px 14px; font-size: 1rem; color: var(--text); background: var(--surface-2); border: 0; border-radius: 12px; }
.pr-notice.is-on { display: block; }
body:has(.pr-slot:not(:empty)) .pr-notice { display: block; }

/* ───── Google AdSense の広告枠（運営者番号があるページにだけ build-site.js が入れる）─────
   「広告」の小さなラベルだけを付ける。ボタンや矢印で目立たせない。data-ads-quiet が見えている間は ads.js が hidden にする */
.ad-slot { margin: 32px 0; min-height: 0; }
.ad-slot[hidden] { display: none; }
.ad-label { margin: 0 0 4px; font-size: .75rem; line-height: 1.4; color: var(--muted); letter-spacing: .04em; }

/* ───── トップページ ───── */
.hero {
  position: relative; overflow: hidden;
  margin: 8px 0 8px;
  padding: 56px 0 24px;
  background: transparent;
  border: 0;
  border-radius: 0;
}
/* 右側のグラデーションの面（飾り） */
.hero::after {
  content: ""; position: absolute; right: 0; top: 56px; width: 300px; height: 300px;
  background: var(--grad-strong); border-radius: 48px; pointer-events: none;
}
/* グラデーションの面に重なる黒い丸 */
.hero::before { content: ""; position: absolute; right: 236px; top: 300px; width: 56px; height: 56px; border-radius: 50%; background: var(--text); z-index: 1; pointer-events: none; }
.hero { padding-right: 340px; }
.hero > * { position: relative; z-index: 1; }
.hero-kicker { display: inline-block; font-size: .78rem; font-weight: 700; letter-spacing: .16em; color: var(--on-ai); background: var(--accent); padding: 2px 12px; margin: 0 0 22px; }
.hero-catch { font-size: clamp(2.2rem, 6.4vw, 3.9rem); line-height: 1.22; font-weight: 700; letter-spacing: .01em; margin: 0 0 22px; max-width: none; }
.hero-catch::after { content: ""; display: inline-block; width: .32em; height: .32em; margin-left: .18em; border-radius: 50%; background: var(--text); vertical-align: .08em; }
.hero .lead { max-width: 36em; margin-bottom: 24px; }
.ib { display: inline-block; }
.badges { list-style: none; padding: 0; margin: 0 0 28px; display: flex; flex-wrap: wrap; gap: 8px; }
.badges li { display: inline-flex; align-items: center; gap: 6px; padding: 4px 14px 4px 10px; font-size: .84rem; font-weight: 700; color: var(--text); background: transparent; border: 1px solid var(--border-strong); border-radius: 999px; }
.badges li svg { color: var(--accent); }
.search { position: relative; max-width: 600px; }
.search svg { position: absolute; left: 20px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.search input[type="search"] { min-height: 58px; padding-left: 52px; border-radius: 999px; font-size: 1rem; background: var(--surface-2); }
.sec-title { margin-top: 64px; font-size: clamp(1.6rem, 4vw, 2.2rem); }
.search-status { margin: -4px 0 0; color: var(--muted); font-size: .95rem; min-height: 0; }
.search-status:empty { display: none; }
.cat { margin-top: 40px; }
.cat[hidden] { display: none; }
.cat-head { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 14px; margin-bottom: 14px; padding-bottom: 10px; border-bottom: 1px solid var(--border); }
.cat-head h3 { margin: 0; font-size: 1.15rem; display: inline-flex; align-items: center; gap: 10px; }
.cat-head h3::before { content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--accent); }
.cat-head p { margin: 0; font-size: .86rem; color: var(--muted); }

/* カテゴリの目次（チップ）・人気のツール・件数（build-site.js が生成） */
.cat-chips { margin: 28px 0 0; }
.cat-chips[hidden], .featured[hidden] { display: none; }
.cat-chips-head { margin: 0 0 10px; font-size: .78rem; font-weight: 700; letter-spacing: .14em; color: var(--muted); }
.cat-chips ul { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.cat-chips li { max-width: none; }
.cat-chips a {
  display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 8px 0 16px;
  font-size: .88rem; font-weight: 700; color: var(--text); text-decoration: none;
  background: transparent; border: 1px solid var(--border-strong); border-radius: 999px;
  transition: background .2s, border-color .2s, color .2s;
}
.cat-chips a:hover { background: var(--text); border-color: var(--text); color: var(--bg); }
.cat-chips a:hover .chip-count { background: var(--accent); color: #fff; }
.chip-count { display: inline-grid; place-items: center; min-width: 24px; height: 24px; padding: 0 7px; font-size: .74rem; color: var(--text); background: var(--surface-2); border-radius: 999px; }
.featured .tool-grid { margin-top: 16px; }
.sec-count { margin-left: 12px; font-size: .9rem; font-weight: 700; color: var(--muted); letter-spacing: .04em; }
.sec-title .sec-count { vertical-align: .3em; }
.nf-cats-head { margin: 28px 0 8px; font-weight: 700; }
.nf-cats { list-style: none; padding: 0; margin: 0 0 20px; display: flex; flex-wrap: wrap; gap: 6px 18px; }

/* ツールカード */
.tool-grid, .tool-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.tool-grid > li, .tool-list > li { max-width: none; }
.tool-grid > li[hidden] { display: none; }
.tool-card {
  display: flex; align-items: center; gap: 14px; height: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 18px 16px 18px 18px;
  color: var(--text); text-decoration: none;
  transition: transform .25s var(--ease), box-shadow .25s var(--ease), border-color .25s;
}
.tool-card:hover { color: var(--text); transform: translateY(-3px); box-shadow: var(--shadow-lift); border-color: var(--text); }
.tool-card:hover .tc-arrow { color: var(--text); transform: translateX(3px); }
.tc-body { flex: 1; min-width: 0; }
.tc-body strong { display: block; font-size: 1rem; line-height: 1.5; letter-spacing: .02em; }
.tc-body span { display: block; margin-top: 3px; font-size: .82rem; line-height: 1.65; color: var(--muted); }
.tc-arrow { flex: none; color: var(--border-strong); transition: transform .25s var(--ease), color .25s; }

/* 人気のツール：大きめのカード */
.featured .tool-card { flex-direction: column; align-items: flex-start; padding: 22px; gap: 16px; }
.featured .tool-card .ticon { width: 100%; height: 112px; border-radius: 14px; background: var(--grad-strong); color: #fff; }
.featured .tool-card .ticon svg { width: 40px; height: 40px; }
.featured li:nth-child(6n+2) .ticon { background: linear-gradient(135deg, #7fd3ff 0%, #8fa2ff 55%, #c79bff 100%); }
.featured li:nth-child(6n+3) .ticon { background: linear-gradient(135deg, #ffb38a 0%, #ff8fb1 50%, #c79bff 100%); }
.featured li:nth-child(6n+4) .ticon { background: linear-gradient(135deg, #9ee6c1 0%, #7fd3ff 55%, #8fa2ff 100%); }
.featured li:nth-child(6n+5) .ticon { background: linear-gradient(135deg, #c79bff 0%, #8fa2ff 100%); }
.featured li:nth-child(6n) .ticon { background: linear-gradient(135deg, #ffd27f 0%, #ffa78a 55%, #ff8fb1 100%); }
.featured .tool-card .tc-arrow { position: absolute; right: 18px; bottom: 18px; }
.featured .tool-card { position: relative; padding-bottom: 26px; }

/* 関連ツール（小さめ） */
.tool-list.related { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.related .tool-card { padding: 12px 12px 12px 14px; gap: 12px; }
.related .ticon { width: 38px; height: 38px; border-radius: 12px; }
.related .ticon svg { width: 20px; height: 20px; }
.related .tc-body strong { font-size: .94rem; }
.related .tc-body span { font-size: .78rem; }

/* ───── FAQ（アコーディオン） ───── */
.faq { display: grid; gap: 0; border-top: 1px solid var(--border); }
.faq details { background: transparent; border: 0; border-bottom: 1px solid var(--border); border-radius: 0; }
.faq summary {
  display: flex; align-items: flex-start; gap: 14px; padding: 18px 48px 18px 2px;
  font-weight: 700; cursor: pointer; list-style: none; position: relative;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: ""; position: absolute; right: 14px; top: 26px; width: 8px; height: 8px;
  border-right: 2px solid var(--text); border-bottom: 2px solid var(--text);
  transform: rotate(45deg); transition: transform .25s var(--ease);
}
.faq details[open] summary::after { transform: rotate(-135deg); top: 30px; }
.faq summary:hover .faq-qt { color: var(--accent-ink); }
.faq-q, .faq-al { flex: none; display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; font-size: .8rem; font-weight: 700; line-height: 1; margin-top: 1px; }
.faq-q { background: var(--ai); color: var(--on-ai); }
.faq-al { background: #4459e0; color: #fff; } /* 白文字が読める濃さ（明暗とも） */
.faq-a { display: flex; gap: 14px; padding: 0 2px 20px; }
.faq-a p { margin: 0; }

/* ───── フッター ───── */
.site-footer { background: var(--footer-bg); color: var(--footer-text); padding: 64px 0 32px; font-size: .86rem; margin-top: 40px; }
.home .site-footer .wrap { max-width: 1120px; }
.site-footer a { color: var(--footer-text); text-decoration: none; }
.site-footer a:hover { color: #fff; text-decoration: underline; text-decoration-color: var(--accent); }
.site-footer :focus-visible { outline-color: #fff; }
.f-top { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); gap: 40px; padding-bottom: 32px; border-bottom: 1px solid rgba(255, 255, 255, .12); }
.f-brand .logo { color: var(--footer-head); font-size: 1.3rem; }
.f-brand .logo-mark .m-base { fill: #fff; }
.f-brand .logo-mark .m-line { stroke: #0a0a0a; }
.f-brand p { margin: 14px 0 0; line-height: 1.8; }
.f-tools { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 20px; }
.f-head { margin: 0 0 10px; color: var(--footer-head); font-weight: 700; font-size: .76rem; letter-spacing: .16em; }
.f-col ul { list-style: none; padding: 0; margin: 0; }
.f-col li { margin: 0 0 6px; line-height: 1.6; }
.f-cats { display: block; }
.f-cats ul { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px 20px; }
.f-cats li { line-height: 1.6; }
.f-bottom { padding-top: 22px; }
.f-links { list-style: none; padding: 0; margin: 0 0 12px; display: flex; flex-wrap: wrap; gap: 6px 22px; }
.f-bottom p { margin: 4px 0; }

/* ───── 注意書き・期限一覧・法要日程（ライフイベント系ツール） ───── */
.notice-box { background: var(--surface-2); border: 0; border-radius: 16px; padding: 18px 22px; margin: 20px 0; font-size: .93rem; }
.notice-box p { margin: 4px 0; }
.kigen-list { list-style: none; padding: 0; margin: 12px 0 0; display: grid; gap: 10px; counter-reset: k; }
.kigen-list > li {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: 16px; align-items: baseline;
  background: var(--surface); border: 1px solid var(--border); border-left: 4px solid var(--accent);
  border-radius: 14px; padding: 14px 16px; max-width: none;
}
.kigen-list > li > * { grid-column: 1 / -1; }
.kigen-list > li > .kname { grid-column: 1; }
.kigen-list > li > .kdate { grid-column: 2; text-align: right; }
.kigen-list .kname { font-weight: 700; font-size: 1.05rem; }
.kigen-list .kdate { font-size: 1.25rem; font-weight: 700; line-height: 1.4; font-variant-numeric: tabular-nums; }
.kigen-list .krule, .kigen-list .knote { font-size: .9rem; margin: 4px 0 0; max-width: none; }
.kigen-list .krule { padding-top: 8px; margin-top: 8px; border-top: 1px dashed var(--border); }
.kigen-list .knote { color: var(--muted); }
.kigen-list .note { margin: 2px 0 0; text-align: right; }
.tag { display: inline-block; font-size: .72rem; font-weight: 700; border: 1px solid var(--border-strong); border-radius: 999px; padding: 0 8px; margin-left: 8px; color: var(--muted); vertical-align: 2px; line-height: 1.7; }
.past { color: var(--danger); font-weight: 700; }
.kigen-list .past { text-align: right; }
.table-wide { overflow-x: auto; border: 1px solid var(--border); border-radius: 16px; background: var(--surface); }
.table-wide table { font-size: .95rem; }
.table-wide tbody tr:last-child td { border-bottom: 0; }
.table-wide tbody tr:nth-child(even) td { background: var(--surface-2); }
.table-wide .nw { white-space: nowrap; }
.table-wide td { vertical-align: top; }
.table-wide td strong { font-size: 1.05rem; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
  .tool-card:hover, .tool-card:hover .tc-arrow { transform: none; }
}

@media print {
  .site-header, .site-footer, .pr-slot, .pr-notice, .ad-slot, .tool-list, .no-print, .share { display: none !important; }
  body { background: #fff; color: #000; }
  .card, .result { border: 0; background: #fff; padding: 0; box-shadow: none; }
  .result::before { display: none; }
  .kigen-list > li { border: 1px solid #999; break-inside: avoid; }
}

/* タブレット */
@media (max-width: 900px) {
  .tool-grid, .tool-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .f-top { grid-template-columns: 1fr; gap: 28px; }
  .hero { padding-right: 0; }
  .hero::after { width: 180px; height: 180px; top: 24px; right: -40px; opacity: .55; }
  .hero::before { display: none; }
}
/* スマホ */
@media (max-width: 600px) {
  .wrap { padding: 0 16px; }
  main { padding: 22px 0 52px; }
  h1 { font-size: 1.5rem; }
  h2 { font-size: 1.25rem; margin-top: 48px; }
  .tool-title { gap: 12px; }
  .tool-title .ticon { width: 46px; height: 46px; border-radius: 14px; }
  .tool-title .ticon svg { width: 24px; height: 24px; }
  .card { padding: 20px 16px; border-radius: 18px; }
  .hero { padding: 36px 0 12px; }
  .hero::after { width: 140px; height: 140px; top: 10px; right: -50px; opacity: .45; }
  .hero-catch { font-size: 2.1rem; }
  .tool-grid, .tool-list, .tool-list.related { grid-template-columns: 1fr; }
  .featured .tool-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .featured .tool-card { padding: 14px; gap: 10px; }
  .featured .tool-card .ticon { height: 72px; }
  .featured .tool-card .tc-body span { display: none; }
  .featured .tool-card .tc-arrow { display: none; }
  .f-tools { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .f-cats ul { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  input[type="number"] { max-width: none; }
  .tabs button { font-size: .84rem; padding: 6px 4px; letter-spacing: 0; }
  .tabs:has(> :nth-child(4)) { grid-auto-flow: row; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .result .kigen-list > li { padding: 12px; }
  .result:has(.kigen-list), .result:has(.table-wide) { padding: 16px 10px; }
  .result { padding: 18px 16px; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stat .v { font-size: 1.4rem; }
  /* 期限一覧：スマホではカード状に縦積み */
  .kigen-list > li { grid-template-columns: 1fr; }
  .kigen-list > li > .kname, .kigen-list > li > .kdate { grid-column: 1; text-align: left; }
  .kigen-list .note, .kigen-list .past { text-align: left; }
  /* 法要の表：行ごとのカードにする */
  .table-wide.hoyo-cards { border: 0; background: transparent; overflow: visible; }
  .table-wide.hoyo-cards thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .table-wide.hoyo-cards table, .table-wide.hoyo-cards tbody { display: block; }
  .table-wide.hoyo-cards tbody tr { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 4px 12px; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 12px 14px; margin-bottom: 8px; }
  .table-wide.hoyo-cards tbody tr:nth-child(even) td { background: transparent; }
  .table-wide.hoyo-cards td { display: block; border: 0; padding: 0; background: transparent; }
  .table-wide.hoyo-cards td:first-child { grid-column: 1 / -1; font-weight: 700; padding-bottom: 6px; margin-bottom: 4px; border-bottom: 1px dashed var(--border); }
  .table-wide.hoyo-cards td:nth-child(3)::before { content: "直前の土日（候補）"; display: block; font-size: .75rem; color: var(--muted); font-weight: 700; }
  .table-wide.hoyo-cards td:nth-child(2)::before { content: "日付"; display: block; font-size: .75rem; color: var(--muted); font-weight: 700; }
  .table-wide.hoyo-cards .nw { white-space: normal; }
  .card table th { width: auto; }
}

/* ───── シェアボタン（フッターの上） ───── */
.share { margin-top: 8px; margin-bottom: 0; padding-top: 24px; padding-bottom: 8px; }
.share:empty { display: none; }
.share-head { margin: 0 0 10px; font-size: .78rem; font-weight: 700; letter-spacing: .14em; color: var(--muted); }
.share-btns { display: flex; flex-wrap: wrap; gap: 8px; }
.share-btns a, .share-btns button {
  display: inline-flex; align-items: center; min-height: 42px; margin: 0; padding: 0 18px;
  font-size: .88rem; font-weight: 700; text-decoration: none; border-radius: 999px;
  border: 1px solid var(--border-strong); background: transparent; color: var(--text);
}
.share-btns a:hover, .share-btns button:hover { background: var(--text); color: var(--bg); border-color: var(--text); }

/* ───── トップ：段取りから探す ───── */
.flow-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-top: 16px; }
.flow { border: 1px solid var(--border); border-radius: 20px; padding: 20px 22px; background: var(--surface); }
.flow-k { display: inline-block; margin: 0 0 6px; font-size: .72rem; font-weight: 700; letter-spacing: .14em; color: #fff; background: var(--accent); padding: 1px 10px; }
.flow h3 { margin: 0 0 10px; font-size: 1.15rem; }
.flow ol { margin: 0; padding: 0; list-style: none; counter-reset: f; }
.flow li { counter-increment: f; position: relative; padding: 7px 0 7px 32px; border-top: 1px solid var(--border); max-width: none; }
.flow li:first-child { border-top: 0; }
.flow li::before { content: counter(f); position: absolute; left: 0; top: 9px; width: 22px; height: 22px; border-radius: 50%; background: var(--surface-2); font-size: .75rem; font-weight: 700; display: grid; place-items: center; }
.flow a { text-decoration: none; font-weight: 700; font-size: .95rem; }
.flow a:hover { text-decoration: underline; }
@media (max-width: 900px) { .flow-grid { grid-template-columns: 1fr; } }

/* ───── 自分のAIで確かめる（assets/ai-ask.js） ───── */
.ai-ask { margin: 24px 0; padding: 20px 22px; border: 1.5px dashed var(--accent); border-radius: 20px; background: var(--surface); }
.ai-ask:empty { display: none; }
.ai-head { margin: 0 0 6px; font-weight: 700; font-size: 1.05rem; display: flex; align-items: center; gap: 8px; }
.ai-head::before { content: "AI"; display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--accent); color: #fff; font-size: .72rem; letter-spacing: 0; }
.ai-lead, .ai-note { font-size: .88rem; color: var(--muted); margin: 4px 0; }
.ai-l { font-size: .84rem; margin: 12px 0 4px; }
.ai-ask textarea { min-height: 0; font-size: .9rem; }
.ai-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 8px; }
.ai-bar button { margin: 0; }
.ai-ok { font-size: .85rem; font-weight: 700; color: var(--accent-ink); }
@media print { .ai-ask { display: none !important; } }

/* REQ-0017: quiet spacing, readable controls and responsive navigation. */
@media screen {
  :root { --muted: #565b68; --accent-ink: #394dc4; --border: #dce0e9; --border-strong: #b6bdcd; --radius: 18px; --radius-sm: 10px; }
  .site-header { border-bottom-color: var(--border); }
  .site-header .wrap { min-height: 76px; }
  main { padding-top: 44px; }
  h1 { letter-spacing: -.025em; line-height: 1.5; }
  h2 { margin-top: 72px; }
  h2::after { display: none; }
  .lead { line-height: 1.95; }
  .card { padding: 32px; margin: 32px 0; box-shadow: 0 4px 24px rgba(20, 30, 70, .025); }
  input[type="text"], input[type="number"], input[type="date"], input[type="search"], select, textarea { border-color: var(--border-strong); background-color: var(--surface); }
  input::placeholder, textarea::placeholder { color: var(--muted); opacity: 1; }
  button, .btn { border-radius: 12px; min-height: 48px; }
  .tabs { gap: 6px; border: 1px solid var(--border); }
  .tabs button { min-height: 48px; }
  .nav-link, .share-btns a, .share-btns button { min-height: 44px; }
  .breadcrumb a { display: inline-flex; align-items: center; min-height: 44px; }
  .result { padding: 26px; border: 1px solid var(--ai-tint-2); }
  .pr-notice { display: block; border-left: 3px solid var(--accent-ink); border-radius: 4px; padding: 12px 16px; }
  .pr-slot { border-radius: 12px; border-color: var(--border-strong); background: var(--surface-2); }
  .pr-slot::before { color: var(--text); }
  .pr-slot a { min-height: 48px; border-radius: 0; box-shadow: none; }
  .home .hero { padding-top: 72px; padding-bottom: 48px; border-bottom: 1px solid var(--border); }
  .hero::after { top: 74px; width: 260px; height: 260px; border-radius: 72px 72px 120px 72px; background: var(--grad); }
  .hero::before { width: 36px; height: 36px; top: 296px; right: 232px; background: var(--accent-ink); }
  .hero-kicker, .flow-k { background: var(--ai-tint); color: var(--accent-ink); border-radius: 6px; padding: 4px 12px; }
  .hero-catch { line-height: 1.35; letter-spacing: -.035em; }
  .hero-catch::after { display: none; }
  .hero .search input[type="search"] { background-color: var(--surface); border: 1px solid var(--border-strong); border-radius: 14px; }
  .cat-chips { padding: 24px; background: var(--surface-2); border-radius: 18px; }
  .cat-chips ul { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
  .cat-chips a { display: flex; justify-content: space-between; min-height: 48px; height: 100%; border-radius: 10px; padding: 8px 12px; background: var(--surface); border-color: var(--border); }
  .cat-chips a:hover .chip-count { background: var(--bg); color: var(--text); }
  .cat { margin-top: 52px; }
  .cat-head { padding-bottom: 16px; margin-bottom: 18px; }
  .tool-grid, .tool-list { gap: 14px; }
  .tool-card { padding: 22px 18px; border-radius: 14px; }
  .tool-card:hover { transform: translateY(-2px); border-color: var(--accent-ink); }
  .tc-body strong { line-height: 1.65; }
  .tc-body span { margin-top: 7px; line-height: 1.8; }
  .faq details { border-color: var(--border); }
  .faq summary { min-height: 60px; }
  .site-footer a { display: inline-flex; align-items: center; min-height: 44px; }
  .flow a { display: inline-flex; align-items: center; min-height: 44px; }
  .ai-head::before { background: var(--accent-ink); color: var(--bg); }
  .tool-page .kh-app button, .tool-page .kh-app input:not([type="file"]):not([type="checkbox"]):not([type="radio"]), .tool-page .kh-app select,
  .tool-page label:has(input[type="checkbox"]), .tool-page label:has(input[type="radio"]),
  .tool-page .st-sibs a, .tool-page .kd-sibs a { min-height: 44px; }
  .tool-page .kh-list button.lk { display: inline-flex; align-items: center; min-height: 44px; }
  .tool-page .kh-app label:has(input), label.inline { align-items: center; }
  .tool-page .kd-list { grid-template-columns: repeat(auto-fill, minmax(min(240px, 100%), 1fr)); }
  .tool-page .kd-list a { padding: 16px; border-radius: 12px; }
  .wrap, .card, .row > *, .tool-title > span, .kh-row > *, .kd-list a > * { min-width: 0; }
  .tool-page .kh-cab { display: block; overflow-x: auto; max-width: 100%; }
  .tool-page .kd-table { table-layout: fixed; }
  .tool-page .kd-table th, .tool-page .kd-table td { white-space: normal; overflow-wrap: anywhere; }
}
@media screen and (prefers-color-scheme: dark) {
  :root { --muted: #b5bac8; --accent-ink: #b9c5ff; --border: #343946; --border-strong: #596174; }
}
@media screen and (max-width: 900px) {
  .cat-chips ul { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .home .hero { padding-top: 48px; padding-right: 0; }
  .hero::after { width: 160px; height: 160px; top: 24px; right: -50px; opacity: .45; }
}
@media screen and (max-width: 600px) {
  .site-header .wrap { min-height: 68px; }
  main { padding-top: 24px; }
  h1 { font-size: 1.5rem; }
  .home .hero { padding: 36px 0 32px; }
  .hero-catch { font-size: clamp(1.9rem, 8.7vw, 2.6rem); }
  .hero::after { display: none; }
  .card, .tool-page .card.kh-app { padding: 20px 16px; margin: 24px 0; border-radius: 14px; }
  .cat-chips { padding: 16px; }
  .cat-chips ul { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cat-chips a { font-size: .82rem; padding: 8px; gap: 4px; }
  .featured .tool-grid { grid-template-columns: 1fr; }
  .featured .tool-card { padding: 18px 16px; gap: 14px; }
  .featured .tool-card .ticon { height: 46px; }
  .featured .tool-card .tc-body span { display: block; }
  .featured .tool-card .tc-arrow { display: block; flex: none; }
  .result { padding: 20px 16px; }
  .tool-page .kh-app input, .tool-page .kh-app select { font-size: 16px; }
  .tool-page .kh-bar .sp { display: none; }
  .tool-page .kh-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tool-page .kh-bar > * { max-width: 100%; }
  .tool-page .kh-bar { gap: 8px; }
  .tool-title { align-items: flex-start; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stat { min-width: 0; }
}

/* REQ-0018: preserve the logo artwork size and enlarge only its hit area.
   Extra specificity keeps the filter rule above each tool's inline stylesheet. */
@media screen {
  .site-header .logo {
    min-height: 44px;
    padding-block: 6px;
  }
  .tool-page .filters,
  .tool-page .st-cats,
  .tool-page .kd-cats {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    min-width: 0;
  }
  .tool-page .filters button,
  .tool-page .st-cats button,
  .tool-page .kd-cats button {
    min-height: 44px;
    height: auto;
    max-width: 100%;
    min-width: 0;
    margin: 0;
    padding: 8px 12px;
    white-space: normal;
    overflow-wrap: anywhere;
  }
}

/* ───── 短い答え・根拠・最終更新・カテゴリのページ（scripts/build-site.js が入れる。company/research/29・30）───── */
.answer { margin: -12px 0 24px; padding: 12px 16px; font-size: .98rem; line-height: 1.8; color: var(--text); background: var(--ai-tint); border-left: 3px solid var(--accent); border-radius: var(--radius-sm); overflow-wrap: anywhere; }
.page-meta { margin: 28px 0 8px; font-size: .84rem; color: var(--muted); }
.page-meta p { margin: 4px 0; overflow-wrap: anywhere; }
.page-meta a { color: var(--muted); }
.cat-page .tool-grid { margin-top: 8px; }
.cat-links { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.cat-links li { max-width: none; }
.cat-links a {
  display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 8px 0 16px;
  font-size: .88rem; font-weight: 700; color: var(--text); text-decoration: none;
  border: 1px solid var(--border-strong); border-radius: 999px;
}
.cat-links a:hover { background: var(--text); border-color: var(--text); color: var(--bg); }
