/* 安全点検 報告書の見本。naisei.dev の「帳簿と判子」で、紙の報告書として描く。
   形は /sample/koumuten/report（月次報告の見本）に揃えてあるが、向こうの CSS には依存しない。
   重要度は判子の「字」と「塗り／線の色」の両方で示す（色だけに頼らない） */
:root {
  --nd-fg: #1e2a2f;
  --nd-sub: #46545a;
  --nd-green: #1a5f4a;
  --nd-green-d: #134a39;
  --nd-shu: #c8402b;
  --nd-paper: #f3f8f6;
  --nd-rule: #d3e5de;
  --nd-sans: 'BIZ UDPGothic', -apple-system, 'Hiragino Sans', 'Yu Gothic UI', sans-serif;
  --nd-hand: 'Klee One', 'BIZ UDPGothic', serif;
  --nd-mono: ui-monospace, SFMono-Regular, Consolas, 'BIZ UDGothic', monospace;
  --ink-mute: #5d6b71;
  --grid: #e3ebe7;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
*::before, *::after { box-sizing: border-box; }
.rp-body {
  font-family: var(--nd-sans); color: var(--nd-fg); line-height: 1.8; -webkit-font-smoothing: antialiased;
  background: repeating-linear-gradient(180deg, transparent 0 35px, #dfe9e4 35px 36px), #eef4f1;
}
a { color: var(--nd-green); }
a:focus-visible { outline: 3px solid var(--nd-green); outline-offset: 2px; }

/* ---------- 上部バー（見本の外側） ---------- */
.nd-bar {
  position: sticky; top: 0; z-index: 60; display: flex; align-items: center; justify-content: space-between; gap: 10px;
  min-height: 50px; padding: 6px clamp(10px, 3vw, 28px); background: var(--nd-green); color: #fff;
  box-shadow: 0 2px 10px rgba(0,0,0,.12);
}
.nd-brand { display: flex; align-items: center; gap: 10px; min-width: 0; color: #fff; text-decoration: none; }
.nd-stamp {
  display: inline-grid; place-items: center; flex: none; width: 34px; height: 34px;
  border: 2px solid var(--nd-shu); border-radius: 6px; background: #fff; color: var(--nd-shu);
  font-size: 11.5px; font-weight: 700; line-height: 1; transform: rotate(-6deg);
}
.nd-brand-text { font-size: 13.5px; line-height: 1.35; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nd-brand-text b { font-weight: 700; }
.nd-only-wide { display: none; }
.nd-actions { display: flex; align-items: center; gap: 14px; flex: none; }
.nd-link { color: #fff; font-size: 13.5px; font-weight: 700; text-underline-offset: 3px; }
.nd-link:focus-visible, .nd-brand:focus-visible { outline: 3px solid #ffd27a; outline-offset: 2px; }
@media (min-width: 760px) {
  .nd-only-wide { display: inline; }
  .nd-brand-text { font-size: 14.5px; }
}

/* ---------- 紙 ---------- */
.rp-wrap { padding: 20px clamp(10px, 3vw, 24px) 56px; }
.rp-paper {
  max-width: 880px; margin: 0 auto; padding: 22px 16px 26px; background: #fff;
  border: 1.5px solid var(--nd-fg); border-radius: 4px; box-shadow: 6px 6px 0 rgba(30,42,47,.1);
}

/* 表紙 */
.rp-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; padding-bottom: 16px; border-bottom: 3px double var(--nd-fg); }
.rp-to { display: inline-block; padding-bottom: 2px; border-bottom: 1px solid var(--nd-fg); font-size: 15px; font-weight: 700; }
.rp-head h1 { margin-top: 10px; font-size: clamp(22px, 5.6vw, 30px); font-weight: 700; line-height: 1.4; }
.rp-head h1 span { display: block; font-family: var(--nd-hand); font-weight: 600; font-size: .62em; color: var(--nd-green); }
.rp-date { margin-top: 6px; font-size: 12.5px; color: var(--ink-mute); }
.nb { display: inline-block; }
.rp-seal {
  flex: none; display: grid; place-items: center; align-content: center; width: 68px; height: 68px; margin-top: 4px;
  border: 3px solid var(--nd-shu); border-radius: 50%; box-shadow: inset 0 0 0 3px #fff, inset 0 0 0 4.5px var(--nd-shu);
  color: var(--nd-shu); font-weight: 700; line-height: 1.1; transform: rotate(-10deg); opacity: .92;
}
.rp-seal span { font-size: 17px; letter-spacing: .1em; }
.rp-seal small { font-size: 9.5px; letter-spacing: .04em; }

/* 節 */
.rp-sec { padding: 26px 0 4px; }
.rp-sec + .rp-sec { margin-top: 22px; border-top: 1px dashed #c9d8d2; }
.rp-sec h2 { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; font-size: 19px; font-weight: 700; line-height: 1.4; }
.rp-sec h2 small { font-size: 13px; font-weight: 400; color: var(--ink-mute); }
.rp-no {
  display: grid; place-items: center; flex: none; width: 32px; height: 32px; border: 2.5px solid var(--nd-shu); border-radius: 6px;
  color: var(--nd-shu); font-family: var(--nd-hand); font-size: 17px; font-weight: 600; line-height: 1; transform: rotate(-6deg);
}
.rp-two { display: grid; gap: 14px; }
.rp-p { font-size: 14px; line-height: 1.9; color: var(--nd-sub); }
.rp-p + .rp-p { margin-top: 8px; }

/* ---------- 重要度の判子 ---------- */
.sv {
  display: inline-grid; place-items: center; flex: none; min-width: 44px; height: 26px; padding: 0 7px;
  border: 2px solid currentColor; border-radius: 4px; background: #fff;
  font-size: 13px; font-weight: 700; line-height: 1; letter-spacing: .04em; transform: rotate(-4deg);
}
.sv-u { color: #fff; background: var(--nd-shu); border-color: var(--nd-shu); }
.sv-h { color: var(--nd-shu); }
.sv-m { color: var(--nd-green); }
.sv-l { color: var(--ink-mute); border-style: dashed; }

/* 状態 */
.st { display: inline-flex; align-items: center; gap: 4px; padding: 1px 9px; border-radius: 999px; font-size: 12px; font-weight: 700; white-space: nowrap; background: #eef2f1; color: var(--ink-mute); }
.st-done { background: #e3f3ea; color: var(--nd-green); }
.st-done::before { content: ""; width: 10px; height: 6px; margin: -2px 1px 0 0; border-left: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(-45deg); }

/* ---------- 一 まとめ ---------- */
.rp-memo {
  position: relative; margin: 6px 4px 0; padding: 14px 16px 16px; background: #fff4b8; border-radius: 2px;
  box-shadow: 0 6px 14px rgba(30,42,47,.12); transform: rotate(-.6deg);
}
.rp-memo::before { content: ""; position: absolute; top: -8px; left: 50%; width: 72px; height: 18px; margin-left: -36px; background: rgba(200,64,43,.18); transform: rotate(2deg); }
.rp-memo-h { font-family: var(--nd-hand); font-weight: 600; font-size: 14px; color: var(--nd-shu); }
.rp-memo-t { font-family: var(--nd-hand); font-weight: 600; font-size: 18px; line-height: 1.7; }
.rp-memo-t b { background: linear-gradient(transparent 62%, rgba(242,162,58,.55) 62%); }

.sv-counts { list-style: none; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 20px; }
.sv-counts li { display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; align-items: center; column-gap: 12px; padding: 12px 14px; border: 1.5px solid var(--nd-fg); border-radius: 6px; }
.sv-counts .sv { grid-row: span 2; }
.sv-counts b { font-size: 34px; font-weight: 700; line-height: 1.1; }
.sv-counts b small { margin-left: 2px; font-size: .4em; color: var(--nd-sub); }
.sv-counts em { font-style: normal; font-size: 12.5px; font-weight: 700; color: var(--nd-sub); }
.sv-counts li.is-done em { color: var(--nd-green); }

.todo { margin-top: 18px; padding: 14px 16px 16px; border: 2px solid var(--nd-green); border-radius: 6px; background: var(--nd-paper); }
.todo-h { font-family: var(--nd-hand); font-size: 16px; font-weight: 600; color: var(--nd-green); }
.todo ol { list-style: none; counter-reset: t; display: grid; gap: 8px; margin-top: 6px; }
.todo li { counter-increment: t; display: grid; grid-template-columns: 26px 1fr; column-gap: 8px; align-items: baseline; font-size: 15px; line-height: 1.6; }
.todo li::before {
  content: counter(t); display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%;
  background: var(--nd-green); color: #fff; font-size: 12.5px; font-weight: 700; line-height: 1;
}
.todo li b { font-weight: 700; }
.todo li span { grid-column: 2; font-size: 12.5px; color: var(--nd-sub); }

/* ---------- 二 範囲 ---------- */
.scope { padding: 12px 14px 14px; border: 1.5px solid var(--nd-fg); border-radius: 6px; }
.scope-h { display: flex; align-items: center; gap: 8px; font-size: 14.5px; font-weight: 700; }
.scope-h::before { content: ""; flex: none; width: 18px; height: 18px; border-radius: 50%; background: var(--nd-green); }
.scope-out .scope-h::before { background: #fff; border: 2px solid var(--ink-mute); }
.scope ul { list-style: none; display: grid; gap: 4px; margin-top: 8px; }
.scope li { position: relative; padding-left: 16px; font-size: 13.5px; line-height: 1.7; color: var(--nd-sub); }
.scope li::before { content: ""; position: absolute; left: 3px; top: .75em; width: 6px; height: 6px; border-radius: 50%; background: #9fbdb1; }
.rp-method { margin-top: 12px; }
.rp-limit { margin-top: 12px; padding: 10px 12px; border-left: 4px solid var(--nd-shu); background: #fdf3f0; font-size: 13.5px; line-height: 1.8; }

/* ---------- 三 一覧 ---------- */
.fd-list { list-style: none; border-top: 1.5px solid var(--nd-fg); }
.fd-list a {
  display: grid; grid-template-columns: 26px auto 1fr; grid-template-areas: "no sv t" ". . st";
  align-items: center; gap: 4px 10px; padding: 11px 4px; border-bottom: 1px solid var(--grid);
  color: var(--nd-fg); text-decoration: none;
}
.fd-list a:hover .fd-t { color: var(--nd-green); text-decoration: underline; text-underline-offset: 3px; }
.fd-list .fd-no { grid-area: no; }
.fd-list .sv { grid-area: sv; justify-self: start; }
.fd-list .fd-t { grid-area: t; font-size: 14.5px; font-weight: 700; line-height: 1.55; }
.fd-list .st { grid-area: st; justify-self: start; }
.fd-no { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--nd-paper); border: 1px solid #c9d8d2; font-size: 12.5px; font-weight: 700; }

/* ---------- 四 詳細 ---------- */
.fd { margin-top: 14px; padding: 16px 14px 14px; border: 1.5px solid var(--nd-fg); border-radius: 6px; scroll-margin-top: 64px; }
.fd.is-urgent { border-color: var(--nd-shu); box-shadow: inset 4px 0 0 var(--nd-shu); }
.fd-head { display: grid; grid-template-columns: auto auto 1fr; align-items: start; gap: 8px 10px; }
.fd-head h3 { font-size: 16.5px; font-weight: 700; line-height: 1.55; }
.fd-head .sv { margin-top: 1px; }
.fd-body { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; margin-top: 12px; }
.fd-body > div, .fd-body dd { min-width: 0; } /* コード例の長い行で枠が押し広げられないように */
.fd-body dt { font-size: 12.5px; font-weight: 700; color: var(--nd-green); }
.fd-body dd { font-size: 14px; line-height: 1.85; color: var(--nd-sub); }
.fd-body dd b { color: var(--nd-fg); }
.fd-body code, .fd-also code { font-family: var(--nd-mono); font-size: .92em; padding: 0 4px; border-radius: 3px; background: var(--nd-paper); color: var(--nd-fg); }
.code {
  margin-top: 8px; padding: 10px 12px; overflow-x: auto; border-left: 4px solid var(--nd-green); border-radius: 0 4px 4px 0;
  background: #f6f9f8; font-family: var(--nd-mono); font-size: 12.5px; line-height: 1.7; color: var(--nd-fg); white-space: pre;
}
.code code { padding: 0; background: none; font-size: inherit; }
.code .c { color: #5f7a70; }
.fd-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin-top: 12px; padding-top: 10px; border-top: 1px dashed #c9d8d2; font-size: 13px; }
.fd-cost { font-weight: 700; }
.fd-cost::before { content: "手間の目安 "; font-weight: 400; color: var(--ink-mute); }
.fd-also { margin-top: 10px; padding: 10px 12px; border-radius: 4px; background: #fff8e6; border: 1px solid #f0dca8; font-size: 13.5px; line-height: 1.8; }
.fd-also b { color: var(--nd-fg); }
.fd-sub { margin-top: 26px; font-size: 14px; font-weight: 700; color: var(--nd-sub); }

/* ---------- 五 良かった点 ---------- */
.good { list-style: none; display: grid; gap: 8px; }
.good li { position: relative; padding: 10px 12px 10px 42px; border-radius: 6px; background: var(--nd-paper); font-size: 14px; line-height: 1.75; }
.good li::before {
  content: ""; position: absolute; left: 14px; top: 15px; width: 14px; height: 8px;
  border-left: 3px solid var(--nd-green); border-bottom: 3px solid var(--nd-green); transform: rotate(-45deg);
}

/* ---------- 六 次の一手 ---------- */
.plan { list-style: none; display: grid; gap: 10px; }
.plan li { padding: 12px 14px; border: 1.5px solid var(--nd-fg); border-radius: 6px; }
.plan-when { font-family: var(--nd-hand); font-size: 16px; font-weight: 600; color: var(--nd-shu); }
.plan li p { margin-top: 2px; font-size: 14px; line-height: 1.75; }
.plan li p small { display: block; font-size: 12.5px; color: var(--nd-sub); }
.rp-reply { margin-top: 14px; padding: 12px 14px; border: 1.5px dashed #9fbdb1; border-radius: 6px; font-size: 14px; line-height: 1.85; }

/* ---------- 七 点検した項目 ---------- */
.ck { list-style: none; display: grid; grid-template-columns: 1fr; border-top: 1px solid var(--grid); }
.ck li { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 4px; border-bottom: 1px solid var(--grid); font-size: 13.5px; line-height: 1.5; }
.ck-r { flex: none; display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 700; white-space: nowrap; }
.ck-r::before { content: ""; width: 12px; height: 12px; border-radius: 50%; }
.ck-ok { color: var(--nd-green); }
.ck-ok::before { background: var(--nd-green); }
.ck-ng { color: var(--nd-shu); }
.ck-ng::before { background: #fff; border: 3px solid var(--nd-shu); }
.ck-na { color: var(--ink-mute); font-weight: 400; }
.ck-na::before { width: 10px; height: 2px; border-radius: 0; background: var(--ink-mute); }
.ck-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-bottom: 8px; font-size: 12.5px; }

.rp-foot { margin-top: 26px; padding-top: 14px; border-top: 3px double var(--nd-fg); font-size: 13px; color: var(--nd-sub); }
.rp-foot-note { margin-top: 2px; font-size: 12px; color: var(--ink-mute); }
.rp-after { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 22px; }
.nd-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px; padding: 0 18px; border: 0; border-radius: 8px;
  background: var(--nd-green); color: #fff; font-size: 14.5px; font-weight: 700; text-decoration: none;
}
.nd-btn:hover { background: var(--nd-green-d); }
.nd-btn-ghost { background: #fff; color: var(--nd-fg); border: 1.5px solid var(--nd-fg); }
.nd-btn-ghost:hover { background: var(--nd-paper); }

/* ---------- フッター（見本の外側） ---------- */
.nd-footer { background: var(--nd-fg); color: #d7dfe2; padding: 40px 0 44px; }
.nd-footer-in { max-width: 1120px; margin: 0 auto; padding: 0 clamp(16px, 4vw, 48px); display: flex; flex-wrap: wrap; gap: 18px 40px; justify-content: space-between; }
.nd-footer-brand { flex: 1 1 260px; }
.nd-footer-logo { font-size: 20px; font-weight: 700; color: #fff; text-decoration: none; }
.nd-footer-logo span { color: #8fd3b6; font-weight: 400; }
.nd-footer-brand p { margin-top: 6px; font-size: 13px; color: #b8c3c7; }
.nd-footer-nav { flex: 1 1 320px; display: flex; flex-wrap: wrap; gap: 4px 22px; font-size: 14px; }
.nd-footer-nav a { min-height: 32px; display: inline-flex; align-items: center; color: #fff; text-decoration: none; }
.nd-footer-nav a:hover { text-decoration: underline; }
.nd-footer-legal { flex: 1 1 100%; font-size: 11.5px; line-height: 1.8; color: #a9b5ba; }

@media (max-width: 759px) {
  .code { font-size: 11.5px; }
}
@media (min-width: 760px) {
  .rp-paper { padding: 34px 44px 38px; }
  .rp-seal { width: 78px; height: 78px; }
  .rp-memo { margin: 8px 40px 0; }
  .rp-two { grid-template-columns: 1fr 1fr; gap: 18px; }
  .sv-counts { grid-template-columns: repeat(4, 1fr); }
  .fd-list a { grid-template-columns: 26px auto 1fr auto; grid-template-areas: "no sv t st"; }
  .fd-list .st { justify-self: end; }
  .fd { padding: 18px 20px 16px; }
  .fd-body > div { display: grid; grid-template-columns: 9.5em 1fr; gap: 14px; }
  .fd-body dt { padding-top: 2px; }
  .plan { grid-template-columns: repeat(3, 1fr); }
  .ck { grid-template-columns: 1fr 1fr; column-gap: 28px; }
}
@media print {
  .nd-bar, .rp-after, .nd-footer { display: none; }
  .rp-body { background: #fff; }
  .rp-paper { border: 0; box-shadow: none; }
  .rp-memo { transform: none; box-shadow: none; }
  .fd { break-inside: avoid; }
}
