/* ============================================================
   指針工房 公開サイト
   ひな形という刊行物の案内として組む。地は白に近い色、文字は黒、罫線は細い灰色。
   朱は、引用の問いと、本文に入る文の印と、作成画面へのボタンにだけ使う。
   飾りの図は置かず、見本の実際のページと、実際に出力される文を見せる。
   ============================================================ */
:root {
  --bg: #faf9f6;
  --paper: #ffffff;
  --paper-2: #f2f0eb;
  --ink: #1c1c1c;
  --ink-2: #3a3a3a;
  --ink-3: #6b6b6b;
  --ink-4: #9a9a9a;
  --rule: #d9d5cc;
  --rule-soft: #e9e6df;
  --shu: #b5412d;
  --shu-deep: #8f3121;
  --shu-tint: #ecd5cd;
  --shu-wash: #f7ece8;
  --serif: "Noto Serif JP", "Noto Serif CJK JP", "Hiragino Mincho ProN", serif;
  --sans: "Noto Sans JP", "Noto Sans CJK JP", "Hiragino Kaku Gothic ProN", sans-serif;
  --wrap: 1120px;
  --col: 760px;
  --gutter: clamp(16px, 4vw, 40px);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: var(--sans); font-size: 16px; line-height: 1.9;
  word-break: normal; line-break: strict; overflow-wrap: break-word;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration-color: var(--ink-4); text-underline-offset: .22em; text-decoration-thickness: 1px; }
a:hover { color: var(--shu-deep); text-decoration-color: var(--shu); }
:focus-visible { outline: 2px solid var(--shu); outline-offset: 3px; }
img { max-width: 100%; height: auto; }
p { margin: 0 0 1em; }

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter); }
.col { max-width: var(--col); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--ink-3); }
.small { font-size: 13px; }
.nw { white-space: nowrap; }
.r { text-align: right !important; }

/* ---- 見出し ---- */
h1, h2, h3 { font-family: var(--serif); color: var(--ink); margin: 0; letter-spacing: .02em; word-break: keep-all; overflow-wrap: anywhere; }
h2 { font-size: 25px; font-weight: 600; line-height: 1.5; margin: 0 0 20px; }
h2:not(:first-child) { margin-top: 64px; }
.col + table, table + .col, .col + .col > h2:first-child { margin-top: 40px; }
h3 { font-size: 18px; font-weight: 600; line-height: 1.6; margin: 44px 0 12px; }
.lead { font-size: 17px; line-height: 2; color: var(--ink-2); }

/* ---- 上の帯 ---- */
.site-head { border-bottom: 1px solid var(--rule); background: var(--bg); }
.site-head .wrap { display: flex; align-items: center; justify-content: space-between; height: 72px; gap: 16px; }
.site-head .logo { display: block; flex: 0 0 auto; }
.site-head .logo img { height: 36px; width: auto; display: block; }
.site-nav { display: flex; align-items: center; gap: 26px; font-size: 14px; }
.site-nav a { text-decoration: none; color: var(--ink-2); white-space: nowrap; }
.site-nav a:hover { color: var(--shu-deep); }
.site-nav a[aria-current="page"] { color: var(--ink); font-weight: 700; }
.site-nav a.btn, .site-nav a.btn:hover { color: #fff; }
@media (max-width: 820px) {
  .hide-sm { display: none; }
  .site-head .logo img { height: 30px; }
}

/* ---- ボタン ---- */
.btn {
  display: inline-flex; align-items: center; gap: 8px; text-decoration: none; cursor: pointer;
  font-family: var(--sans); font-size: 15px; font-weight: 700; letter-spacing: .04em; line-height: 1.4;
  padding: 14px 24px; border: 1px solid var(--ink); background: var(--ink); color: #fff; border-radius: 0;
}
.btn:hover { background: var(--shu-deep); border-color: var(--shu-deep); color: #fff; }
.btn.shu { background: var(--shu); border-color: var(--shu); }
.btn.shu:hover { background: var(--shu-deep); border-color: var(--shu-deep); }
.btn.line { background: transparent; color: var(--ink); }
.btn.line:hover { background: var(--ink); color: #fff; border-color: var(--ink); }
.btn.sm { font-size: 13px; padding: 9px 16px; }
.btn[disabled] { opacity: .5; cursor: default; }
.btn-row { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin: 28px 0 0; }

/* ---- 最初の画面 ---- */
.top { padding: clamp(48px, 7vw, 88px) 0 clamp(56px, 7vw, 96px); }
.top-grid { display: grid; grid-template-columns: minmax(0, 1.08fr) minmax(0, .92fr); gap: clamp(36px, 6vw, 80px); align-items: center; }
@media (max-width: 960px) { .top-grid { grid-template-columns: minmax(0, 1fr); } }
.edition { font-size: 13px; color: var(--ink-3); letter-spacing: .08em; margin: 0; }
.voice {
  font-family: var(--serif); font-weight: 600; font-size: clamp(32px, 4.3vw, 56px); line-height: 1.38;
  letter-spacing: .01em; margin: 22px 0 26px; word-break: keep-all; overflow-wrap: anywhere;
  /* 行頭の「を半字ぶん左へ出し、引用の文字の頭を下の行とそろえる */
  text-indent: -.5em;
}
.top h1 { font-size: clamp(19px, 1.7vw, 23px); font-weight: 500; line-height: 1.7; color: var(--ink-2); margin: 0 0 26px; }
.top .note { font-size: 13px; color: var(--ink-3); margin: 22px 0 0; }

/* 見本の実際のページ。紙の上に置いた1枚として見せる */
.sheet-fig { margin: 0; }
.top .sheet-fig { max-width: 470px; justify-self: end; width: 100%; }
@media (max-width: 960px) { .top .sheet-fig { justify-self: start; } }
.sheet {
  display: block; background: var(--paper); border: 1px solid var(--rule);
  box-shadow: 0 1px 0 rgba(28, 28, 28, .03), 0 26px 50px -28px rgba(28, 28, 28, .34);
}
.sheet img { display: block; width: 100%; }
.sheet:hover { border-color: var(--ink-3); }
.sheet-fig figcaption { font-size: 13px; color: var(--ink-3); line-height: 1.8; margin-top: 14px; }

/* ---- 節 ---- */
.band { padding: clamp(56px, 8vw, 96px) 0; border-top: 1px solid var(--rule); }

/* はしがき。本の前書きと同じく明朝で組み、段落の頭を1字下げる */
.essay p { font-family: var(--serif); font-size: 17.5px; line-height: 2.1; text-indent: 1em; color: var(--ink); }
.essay .sign { text-indent: 0; text-align: right; font-size: 14px; color: var(--ink-3); margin-top: 28px; }

/* ---- 設問と本文の対照 ---- */
.qa { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); border-top: 1px solid var(--ink); margin-top: 40px; }
@media (max-width: 880px) { .qa { grid-template-columns: minmax(0, 1fr); } }
.qa-q { padding: 28px 32px 30px 0; }
@media (max-width: 880px) { .qa-q { padding-right: 0; } }
.qnum { font-family: var(--serif); font-size: 14px; color: var(--shu); letter-spacing: .12em; margin: 0 0 6px; }
.qtext { font-family: var(--serif); font-size: 20px; font-weight: 600; line-height: 1.7; margin: 0 0 20px; }
.qa-opts { display: grid; gap: 8px; }
.qa-opt {
  display: block; width: 100%; text-align: left; cursor: pointer; position: relative;
  font-family: var(--sans); color: var(--ink); background: transparent;
  border: 1px solid var(--rule); padding: 12px 16px 12px 44px; line-height: 1.6;
}
.qa-opt::before {
  content: ""; position: absolute; left: 16px; top: 16px; width: 14px; height: 14px;
  border: 1.5px solid var(--ink-4); border-radius: 50%; background: var(--paper);
}
.qa-opt:hover { border-color: var(--ink-3); }
.qa-opt[aria-pressed="true"] { border-color: var(--ink); background: var(--paper); }
.qa-opt[aria-pressed="true"]::before { border-color: var(--ink); background: radial-gradient(circle, var(--ink) 0 4px, var(--paper) 4.5px); }
.qa-opt .ol { display: block; font-size: 15px; font-weight: 700; }
.qa-opt .od { display: block; font-size: 13px; color: var(--ink-3); margin-top: 2px; }
.qa-a { background: var(--paper); border-left: 1px solid var(--rule); padding: 28px 30px 30px; }
@media (max-width: 880px) { .qa-a { border-left: 0; border-top: 1px solid var(--rule); padding: 22px 18px 24px; } }
.qa-a-h { font-size: 12px; color: var(--ink-3); letter-spacing: .14em; margin: 0 0 16px; }
.place + .place { margin-top: 22px; }
.where { font-size: 13px; color: var(--ink-3); margin: 0 0 8px; line-height: 1.7; }
.where .sub::before { content: "　"; }
.doc-line { font-size: 14.5px; line-height: 1.95; margin: 0; padding: 2px 0 2px 14px; border-left: 2px solid var(--shu); }
.doc-line b { font-weight: 700; }
/* 文書の表をそのまま写す。記号の色も文書の既定の色と同じにする */
table.doc-snip { width: 100%; border-collapse: collapse; font-size: 13.5px; line-height: 1.6; }
table.doc-snip th { background: #f2f2ef; font-weight: 700; text-align: left; padding: 7px 9px; border: 1px solid #b9b9b6; border-bottom: 1.5px solid #8e8e8a; white-space: nowrap; }
table.doc-snip td { padding: 8px 9px; border: 1px solid #c9c9c6; }
table.doc-snip tbody tr { box-shadow: inset 2px 0 0 var(--shu); }
.doc-snip .ok, .doc-snip .cond, .doc-snip .ng { white-space: nowrap; font-weight: 700; }
.doc-snip .ok { color: #1a3c6e; }
.doc-snip .cond { color: #5f7699; }
.doc-snip .ng { color: #7d5614; }
.snip-scroll { overflow-x: auto; }
@media (max-width: 640px) {
  table.doc-snip { font-size: 12px; }
  table.doc-snip th, .doc-snip .ok, .doc-snip .cond, .doc-snip .ng { white-space: normal; }
  table.doc-snip th, table.doc-snip td { padding: 6px; }
}

/* ---- 見本の全ページ ---- */
.contact-sheet { display: grid; grid-template-columns: repeat(auto-fill, minmax(78px, 1fr)); gap: 14px 10px; margin: 36px 0 48px; }
.contact-sheet a { display: block; text-decoration: none; }
.contact-sheet img { display: block; width: 100%; background: var(--paper); border: 1px solid var(--rule); }
.contact-sheet a:hover img { border-color: var(--ink); }
.contact-sheet span { display: block; text-align: center; font-size: 11px; color: var(--ink-3); margin-top: 4px; font-variant-numeric: tabular-nums; }

/* ---- 一覧の表 ---- */
table.ledger { width: 100%; border-collapse: collapse; font-size: 15px; margin: 8px 0 0; }
table.ledger th, table.ledger td { text-align: left; padding: 13px 14px 13px 0; border-bottom: 1px solid var(--rule); vertical-align: top; line-height: 1.75; }
table.ledger th:last-child, table.ledger td:last-child { padding-right: 0; }
table.ledger thead th { font-size: 12.5px; font-weight: 500; color: var(--ink-3); border-bottom: 1px solid var(--ink); padding-top: 0; }
table.ledger tbody th { font-weight: 600; }
table.ledger time { font-variant-numeric: tabular-nums; }
table.ledger.combo td { font-size: 13.5px; }
.topic-link { margin-top: -.5em; font-size: 14px; }
table.ledger.kv th { width: 13em; }
@media (max-width: 640px) { table.ledger.kv th { width: 7.5em; } }
table.ledger .src { display: block; font-size: 12.5px; color: var(--ink-3); }
.notes-table td a { text-decoration-color: var(--rule); }
@media (max-width: 700px) {
  .notes-table thead { display: none; }
  .notes-table tr { display: grid; grid-template-columns: auto 1fr; gap: 0 12px; border-bottom: 1px solid var(--rule); padding: 10px 0; }
  .notes-table th, .notes-table td { border: 0; padding: 2px 0; }
  .notes-table td:nth-child(3) { grid-column: 1 / -1; }
}
@media (max-width: 640px) { table.ledger { font-size: 14px; } table.ledger th, table.ledger td { padding-right: 10px; } }

/* ---- 改版の履歴 ---- */
table.changes { width: 100%; border-collapse: collapse; border-top: 1px solid var(--ink); font-size: 15px; }
table.changes thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
table.changes tbody { border-bottom: 1px solid var(--rule); }
table.changes th { width: 150px; padding: 24px 24px 24px 0; text-align: left; vertical-align: top; font-family: var(--serif); font-weight: 400; }
table.changes th .b { display: block; font-size: 21px; font-weight: 600; color: var(--ink); }
table.changes th time { font-size: 13px; color: var(--ink-3); }
table.changes td { padding: 6px 0 6px 20px; position: relative; vertical-align: top; color: var(--ink-2); line-height: 1.8; }
table.changes tr:first-child td { padding-top: 26px; }
table.changes tr:last-child td { padding-bottom: 24px; }
table.changes td::before { content: ""; position: absolute; left: 0; top: calc(6px + .9em); width: 10px; height: 1px; background: var(--ink-3); }
table.changes tr:first-child td::before { top: calc(26px + .9em); }
@media (max-width: 700px) {
  table.changes, table.changes tbody, table.changes tr, table.changes th, table.changes td { display: block; width: auto; }
  table.changes th { padding: 20px 0 6px; }
  table.changes tr:first-child td { padding-top: 6px; }
  table.changes tr:first-child td::before { top: calc(6px + .9em); }
}

/* ---- よくある質問 ---- */
.faq { margin: 0; }
.faq dt { font-family: var(--serif); font-weight: 600; font-size: 17px; line-height: 1.7; padding-top: 24px; border-top: 1px solid var(--rule); }
.faq dt:first-child { border-top: 1px solid var(--ink); }
.faq dd { margin: 8px 0 24px; color: var(--ink-2); }

/* ---- 入力欄 ---- */
.form { display: grid; gap: 16px; margin-top: 8px; }
.form .two { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 640px) { .form .two { grid-template-columns: 1fr; } }
.form label { display: block; font-size: 12.5px; font-weight: 700; color: var(--ink-2); margin-bottom: 6px; letter-spacing: .04em; }
.form input[type=text], .form input[type=email], .form select, .form textarea {
  width: 100%; font-family: var(--sans); font-size: 15px; padding: 12px 14px;
  border: 1px solid var(--rule); border-bottom: 1.5px solid var(--ink-3); border-radius: 0; background: var(--paper); color: var(--ink);
}
.form input:focus, .form select:focus, .form textarea:focus { outline: none; border-bottom-color: var(--shu); box-shadow: 0 2px 0 -0.5px var(--shu); }
.form .agree { display: flex; gap: 10px; align-items: flex-start; font-size: 13px; color: var(--ink-2); line-height: 1.7; font-weight: 400; }
.form .agree input { margin-top: 5px; accent-color: var(--shu); }
.form .hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.form .btn-row { margin-top: 4px; }
.form-msg { font-size: 13.5px; min-height: 1.6em; }
.form-msg.ok { color: var(--ink); font-weight: 700; }
.form-msg.ng { color: var(--shu-deep); }

/* ---- 下層のページの頭 ---- */
.page-head { padding: clamp(40px, 6vw, 64px) 0 clamp(36px, 5vw, 52px); }
.page-head h1 { font-size: clamp(28px, 3.2vw, 40px); font-weight: 600; line-height: 1.45; margin: 14px 0 18px; }
.page-head .lead { margin: 0; }
.crumbs { font-size: 12.5px; color: var(--ink-3); margin: 0; }
.crumbs a { text-decoration: none; }
.crumbs span { margin: 0 8px; color: var(--ink-4); }

/* ---- 業種別のページ ---- */
.ind-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 400px); gap: clamp(36px, 6vw, 72px); align-items: start; }
@media (max-width: 960px) { .ind-grid { grid-template-columns: minmax(0, 1fr); } .ind-grid .sheet-fig { max-width: 420px; } }
.rules { list-style: none; padding: 0; margin: 0 0 8px; counter-reset: rule; border-top: 1px solid var(--ink); }
.rules li { counter-increment: rule; display: grid; grid-template-columns: 2.6em 1fr; padding: 14px 0; border-bottom: 1px solid var(--rule); line-height: 1.85; }
.rules li::before { content: counter(rule, cjk-decimal); font-family: var(--serif); color: var(--shu); }
.other-links { display: flex; flex-wrap: wrap; gap: 6px 22px; font-size: 14px; }

/* ---- 文章のページ ---- */
.prose h2 { font-size: 20px; margin: 44px 0 12px; }
.prose h2:first-child { margin-top: 0; }

/* ---- 奥付 ---- */
.colophon { border-top: 1px solid var(--ink); padding: 64px 0 88px; }
.colophon .wrap { display: grid; grid-template-columns: minmax(0, 1fr) 260px; gap: 48px; align-items: start; }
@media (max-width: 820px) { .colophon .wrap { grid-template-columns: minmax(0, 1fr); } }
.colo-box { border: 1px solid var(--ink); padding: 24px 28px 20px; max-width: 560px; background: var(--paper); }
.colo-title { font-family: var(--serif); font-weight: 600; font-size: 15px; letter-spacing: .5em; margin: 0 0 12px; }
table.colo { border-collapse: collapse; font-size: 14px; width: 100%; }
table.colo th { text-align: left; font-weight: 500; color: var(--ink-3); padding: 7px 22px 7px 0; white-space: nowrap; vertical-align: top; border-top: 1px dotted var(--rule); }
table.colo td { padding: 7px 0; border-top: 1px dotted var(--rule); }
.colo-side img { height: 34px; width: auto; display: block; margin-bottom: 20px; }
.colo-links a { display: block; font-size: 14px; margin-bottom: 8px; text-decoration: none; color: var(--ink-2); }
.colo-links a:hover { color: var(--shu-deep); text-decoration: underline; }

/* ---- 印刷 ---- */
@media print {
  .site-head, .colophon, .btn-row, .form { display: none; }
  body { background: #fff; }
}

/* ---- 管理画面の見出し ---- */
.admin-h { font-size: 30px; margin-bottom: 14px; }
#login-form { max-width: 520px; }

/* ============================================================
   管理画面
   ============================================================ */
.admin { padding: 40px 0 90px; }
.admin-tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--ink); margin-bottom: 28px; overflow-x: auto; }
.admin-tabs button {
  font-family: var(--sans); font-size: 13.5px; font-weight: 700; background: none; border: 0; cursor: pointer;
  padding: 12px 16px; color: var(--ink-3); border-bottom: 3px solid transparent; white-space: nowrap;
}
.admin-tabs button[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--shu); }
.admin-tabs .cnt { font-family: var(--serif); margin-left: 6px; color: var(--shu); }
.kpis { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 1px; background: var(--rule); border: 1px solid var(--rule); margin-bottom: 28px; }
.kpis div { background: var(--paper); padding: 18px 20px; }
.kpis b { display: block; font-family: var(--serif); font-size: 30px; line-height: 1.25; }
.kpis span { font-size: 12px; color: var(--ink-3); }
.a-card { background: #fff; border: 1px solid var(--rule); padding: 22px 24px; margin-bottom: 16px; }
.a-card .top { display: flex; gap: 14px; align-items: baseline; flex-wrap: wrap; margin-bottom: 10px; }
.a-card .top h3 { font-size: 20px; }
.a-card .meta { font-size: 12.5px; color: var(--ink-3); }
.a-card .sig { font-size: 13px; line-height: 1.75; padding: 6px 0; border-top: 1px dashed var(--rule-soft); }
.a-card .sig time { color: var(--ink-3); margin-right: 8px; font-variant-numeric: tabular-nums; }
.a-card pre {
  white-space: pre-wrap; word-break: normal; overflow-wrap: anywhere; background: var(--paper); border: 1px solid var(--rule-soft);
  padding: 16px 18px; font-family: var(--sans); font-size: 13px; line-height: 1.85; margin: 12px 0; max-height: 360px; overflow-y: auto;
}
.a-card .problems { margin: 12px 0 0; padding: 12px 16px; border-left: 3px solid var(--shu); background: var(--shu-wash); font-size: 13px; line-height: 1.8; }
.a-card .problems li { margin-left: 1em; }
.a-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 14px; }
@media (max-width: 760px) { .a-grid { grid-template-columns: 1fr; } }
.state { font-size: 11px; font-weight: 700; padding: 2px 8px; border: 1px solid var(--ink); letter-spacing: .04em; }
.state.sent, .state.posted, .state.done { background: var(--ink); color: var(--paper); }
.state.skipped { border-style: dashed; color: var(--ink-3); border-color: var(--ink-4); }
.state.approved { border-color: var(--shu); color: var(--shu); }
.a-table { width: 100%; border-collapse: collapse; font-size: 13.5px; background: #fff; border: 1px solid var(--rule); }
.a-table th, .a-table td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--rule-soft); vertical-align: top; line-height: 1.7; }
.a-table th { font-size: 12px; color: var(--ink-3); background: var(--paper); }
.filters { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 18px; }
.filters button { font-family: var(--sans); font-size: 12.5px; border: 1px solid var(--rule); background: #fff; padding: 6px 12px; border-radius: 14px; cursor: pointer; }
.filters button[aria-pressed="true"] { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.law-note { font-size: 13px; line-height: 1.85; color: var(--ink-2); background: var(--paper-2); padding: 16px 20px; border-left: 3px solid var(--ink); margin-bottom: 22px; }
