/* 事業ツール箱 共通スタイル
   方針：帳票（伝票・帳簿）の青い罫線と、印鑑の朱だけで構成する。
   朱は「ロゴの印」と「主要な操作ボタン」にだけ使う。 */

:root {
  --paper: #f1f4f2;      /* 伝票の地色 */
  --sheet: #ffffff;
  --ink: #1c2a33;        /* 本文 */
  --muted: #56666f;      /* 補足 */
  --rule: #9fbacb;       /* 帳簿の青罫 */
  --rule-soft: #d6e3ea;
  --shu: #c0392b;        /* 朱（印鑑） */
  --shu-dark: #9c2b20;
  --focus: #1f6fb2;
  --gothic: "BIZ UDPGothic", "Hiragino Sans", "Yu Gothic", "Meiryo", sans-serif;
  --mincho: "BIZ UDPMincho", "Hiragino Mincho ProN", "Yu Mincho", serif;
  --measure: 40em;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--gothic);
  font-size: 16px;
  line-height: 1.8;
  font-feature-settings: "palt" 0;
}

img { max-width: 100%; height: auto; }

a { color: var(--focus); text-underline-offset: 0.2em; }
a:hover { color: var(--ink); }

:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
  border-radius: 2px;
}

.skip {
  position: absolute; left: -9999px; top: 0;
  background: var(--sheet); padding: 8px 12px; z-index: 10;
}
.skip:focus { left: 8px; top: 8px; }

.wrap {
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 16px;
}

/* ---------- ヘッダー ---------- */
.site-header {
  background: var(--sheet);
  border-bottom: 2px solid var(--rule);
}
.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 64px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  text-decoration: none;
  font-family: var(--mincho);
  font-weight: 700;
  font-size: 1.25rem;
  letter-spacing: 0.08em;
}
.brand svg { width: 34px; height: 34px; flex: none; }
.site-nav { display: flex; gap: 20px; font-size: 0.875rem; }
.site-nav a { color: var(--muted); text-decoration: none; }
.site-nav a:hover, .site-nav a[aria-current="page"] { color: var(--ink); text-decoration: underline; }

@media (max-width: 560px) {
  .site-nav { gap: 14px; font-size: 0.8125rem; }
  .brand { font-size: 1.125rem; }
}

/* ---------- 本文 ---------- */
main { display: block; padding: 40px 0 72px; }

h1, h2, h3 { line-height: 1.45; margin: 0; }
h1 { font-family: var(--mincho); font-size: 2rem; font-weight: 700; letter-spacing: 0.04em; }
h2 { font-size: 1.375rem; font-weight: 700; margin-top: 2.5em; }
h3 { font-size: 1.0625rem; font-weight: 700; margin-top: 1.8em; }
p { margin: 0.9em 0 0; }

.lead { color: var(--muted); max-width: var(--measure); margin-top: 0.75em; }

.prose { max-width: var(--measure); }
.prose ul, .prose ol { padding-left: 1.4em; margin: 0.9em 0 0; }
.prose li + li { margin-top: 0.35em; }
.prose h2 {
  padding-bottom: 0.35em;
  border-bottom: 1px solid var(--rule);
}

.crumbs { font-size: 0.8125rem; color: var(--muted); margin-bottom: 14px; }
.crumbs a { color: var(--muted); }

/* ---------- トップ：道具の台帳 ---------- */
.intro { max-width: 44em; }
.intro h1 { font-size: clamp(1.75rem, 4.2vw, 2.5rem); line-height: 1.4; }

.ledger {
  margin-top: 36px;
  background: var(--sheet);
  border: 1px solid var(--rule);
}
.ledger-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  padding: 14px 20px;
  border-bottom: 2px solid var(--rule);
}
.ledger-head h2 { margin: 0; font-size: 1.125rem; }
.ledger-head span { font-size: 0.8125rem; color: var(--muted); }

.ledger table { width: 100%; border-collapse: collapse; }
.ledger th, .ledger td {
  text-align: left;
  vertical-align: top;
  padding: 14px 20px;
  border-bottom: 1px solid var(--rule-soft);
}
.ledger thead th {
  font-size: 0.8125rem;
  font-weight: 400;
  color: var(--muted);
  background: #f7faf9;
  border-bottom: 1px solid var(--rule);
}
.ledger tbody tr:last-child td { border-bottom: 0; }
.ledger .cat { white-space: nowrap; color: var(--muted); font-size: 0.875rem; width: 9em; }
.ledger .name a { font-weight: 700; color: var(--ink); }
.ledger .name a:hover { color: var(--focus); }
.ledger .desc { color: var(--muted); font-size: 0.9375rem; }
.ledger tr.soon .name { color: var(--muted); font-weight: 400; }
.ledger .tag {
  display: inline-block;
  margin-left: 8px;
  font-size: 0.75rem;
  color: var(--muted);
  border: 1px solid var(--rule-soft);
  padding: 0 6px;
  border-radius: 3px;
  vertical-align: 1px;
}

@media (max-width: 640px) {
  .ledger thead { display: none; }
  .ledger tr { display: block; padding: 12px 16px; border-bottom: 1px solid var(--rule-soft); }
  .ledger tbody tr:last-child { border-bottom: 0; }
  .ledger td { display: block; padding: 0; border: 0; }
  .ledger .cat { width: auto; font-size: 0.75rem; }
  .ledger .desc { margin-top: 2px; }
}

.notes {
  margin-top: 40px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 0 40px;
  max-width: 64em;
}
.notes h2 { font-size: 1rem; margin-top: 1.2em; }
.notes p { color: var(--muted); font-size: 0.9375rem; margin-top: 0.4em; }

/* ---------- ボタン・フォーム ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 44px;
  padding: 0 18px;
  font: inherit;
  font-size: 0.9375rem;
  font-weight: 700;
  color: var(--ink);
  background: var(--sheet);
  border: 1px solid var(--rule);
  border-radius: 4px;
  cursor: pointer;
}
.btn:hover { border-color: var(--ink); }
.btn-primary { background: var(--shu); border-color: var(--shu); color: #fff; }
.btn-primary:hover { background: var(--shu-dark); border-color: var(--shu-dark); color: #fff; }
.btn-quiet { border-color: transparent; background: transparent; color: var(--muted); font-weight: 400; }
.btn-quiet:hover { color: var(--ink); border-color: var(--rule-soft); }
.btn-small { min-height: 36px; padding: 0 12px; font-size: 0.875rem; }

.field { display: block; margin-top: 12px; }
.field > span { display: block; font-size: 0.8125rem; color: var(--muted); margin-bottom: 4px; }
.field input, .field select, .field textarea,
.items input, .items select {
  width: 100%;
  font: inherit;
  font-size: 16px; /* iOSの自動ズーム防止 */
  color: var(--ink);
  background: var(--sheet);
  border: 1px solid var(--rule);
  border-radius: 3px;
  padding: 8px 10px;
  line-height: 1.5;
}
.field textarea { min-height: 84px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus,
.items input:focus, .items select:focus { border-color: var(--focus); outline: 2px solid var(--focus); outline-offset: -1px; }

.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }

.info-table { margin-top: 1em; border-collapse: collapse; width: 100%; background: var(--sheet); }
.info-table th, .info-table td { border: 1px solid var(--rule); padding: 10px 14px; text-align: left; vertical-align: top; }
.info-table th { width: 8em; font-weight: 400; color: var(--muted); background: #f7faf9; }

/* ---------- フッター ---------- */
.site-footer {
  border-top: 2px solid var(--rule);
  background: var(--sheet);
  padding: 28px 0 36px;
  font-size: 0.8125rem;
  color: var(--muted);
}
.site-footer nav { display: flex; flex-wrap: wrap; gap: 8px 20px; margin-bottom: 10px; }
.site-footer a { color: var(--muted); }

/* ---------- 広告・紹介枠（後で使う） ---------- */
.pr-box {
  margin-top: 28px;
  border: 1px solid var(--rule);
  background: var(--sheet);
  padding: 16px 20px;
  max-width: var(--measure);
}
.pr-box .pr-label { font-size: 0.75rem; color: var(--muted); }

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

/* ---------- 記事ページ ---------- */
.article { max-width: 46em; }
.article h1 { font-size: clamp(1.5rem, 3.6vw, 2rem); line-height: 1.45; }
.article .updated { font-size: 0.8125rem; color: var(--muted); margin-top: 10px; }
.article h2 { padding-bottom: 0.35em; border-bottom: 1px solid var(--rule); }
.article table { width: 100%; border-collapse: collapse; margin-top: 1em; background: var(--sheet); font-size: 0.9375rem; }
.article th, .article td { border: 1px solid var(--rule); padding: 8px 12px; text-align: left; vertical-align: top; }
.article thead th { background: #f7faf9; font-weight: 400; color: var(--muted); font-size: 0.8125rem; }
.article tbody th { font-weight: 400; background: #f7faf9; width: 38%; }
.article td.n { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.article tr.here td, .article tr.here th { background: #fff7e0; font-weight: 700; }
.article .table-wrap { overflow-x: auto; }
.article .source { font-size: 0.8125rem; color: var(--muted); margin-top: 8px; }
.article .key {
  margin-top: 20px; background: var(--sheet); border: 1px solid var(--rule); border-left: 4px solid var(--shu);
  padding: 14px 18px;
}
.article .key .big { font-family: var(--mincho); font-size: 2rem; font-weight: 700; line-height: 1.3; }
.article .key p { margin-top: 4px; }
.cta {
  margin-top: 28px; background: var(--sheet); border: 1px solid var(--rule); padding: 18px 20px;
}
.cta p { margin: 0 0 12px; }
.cta .btn { text-decoration: none; }
.checker { margin-top: 16px; background: var(--sheet); border: 1px solid var(--rule); padding: 8px 20px 18px; }
.checker .row2 { max-width: 30em; }
.checker output { display: block; margin-top: 14px; font-weight: 700; }
.checker output.ng { color: var(--shu-dark); }
.toc { margin-top: 24px; background: var(--sheet); border: 1px solid var(--rule); padding: 12px 20px 14px; font-size: 0.9375rem; }
.toc p { margin: 0; font-weight: 700; }
.toc ol { margin: 6px 0 0; padding-left: 1.4em; }
.pref-links { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 10px; font-size: 0.9375rem; }
