/* =========================================================
   安全マニュアル風デザイン（全ページ共通）
   色を変えたいときは、下の :root の値だけを直します。
   ========================================================= */
:root {
  --black: #141414;
  --white: #FFFFFF;
  --paper: #F2F1EC;      /* 薄いグレー（記録用紙の色） */
  --line: #CFCFCF;       /* 細い区切り線 */
  --line-soft: #E4E4E0;
  --text-sub: #555555;
  --text-dim: #9A9A9A;   /* 省略可の項目 */
  --lv1: #1E7A45;        /* 区分1 安全（緑） */
  --lv2: #F5C400;        /* 区分2 注意（黄） */
  --lv3: #D93A26;        /* 区分3 警戒（赤） */
  --stripe: repeating-linear-gradient(-45deg, var(--lv2) 0 10px, var(--black) 10px 20px);
  --gutter: 64px;
  --font: 'Noto Sans JP', 'Hiragino Sans', 'Yu Gothic', sans-serif;
  --mono: 'Roboto Mono', ui-monospace, monospace;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--white);
  color: var(--black);
  font-family: var(--font);
  font-size: 18px;
  line-height: 1.9;
  -webkit-text-size-adjust: 100%;
}
a { color: var(--black); }
a:hover { color: var(--lv3); }
button { font-family: inherit; }
:focus-visible { outline: 3px solid var(--black); outline-offset: 2px; }
h1, h2, h3 { font-weight: 900; line-height: 1.35; margin: 0; }
p { margin: 0; }
.mono { font-family: var(--mono); }

/* ---------- ページ最上部の黄黒ライン・ヘッダー ---------- */
.top-stripe { height: 6px; background: var(--stripe); }
.site-header {
  background: var(--black); color: var(--white);
  min-height: 68px; padding: 0 var(--gutter);
  display: flex; align-items: center; justify-content: space-between; gap: 20px;
}
.brand { display: flex; align-items: center; gap: 14px; color: var(--white); text-decoration: none; }
.brand:hover { color: var(--white); }
.brand-mark {
  width: 34px; height: 30px; flex-shrink: 0; background: var(--lv2);
  clip-path: polygon(50% 0, 100% 100%, 0 100%);
  display: flex; align-items: flex-end; justify-content: center;
  color: var(--black); font-weight: 900; font-size: 16px; line-height: 1.1;
}
.brand-name { font-weight: 900; font-size: 17px; letter-spacing: 0.04em; line-height: 1.4; }
.brand-rev { font-family: var(--mono); font-size: 11px; color: var(--text-dim); border: 1px solid #5A5A5A; padding: 0 6px; line-height: 1.6; }
.site-nav { display: flex; gap: 28px; font-size: 14px; font-weight: 700; }
.site-nav a { color: var(--white); text-decoration: none; }
.site-nav a:hover { text-decoration: underline; }

/* ---------- ボタン ---------- */
.btn {
  display: inline-block; padding: 14px 24px; font-weight: 900; font-size: 15px; line-height: 1.4;
  text-decoration: none; cursor: pointer; border: 2px solid var(--black);
  background: var(--black); color: var(--white);
}
.btn:hover { background: #333; color: var(--white); }
.btn-outline { background: var(--white); color: var(--black); }
.btn-outline:hover { background: var(--paper); color: var(--black); }
.btn-invert { background: var(--white); color: var(--black); border-color: var(--white); }
.btn-invert:hover { background: var(--paper); color: var(--black); }
.btn-ghost-light { background: transparent; color: var(--white); border-color: var(--white); }
.btn-ghost-light:hover { background: #333; }
.btn[aria-disabled="true"], .btn:disabled {
  background: var(--line-soft); color: #8A8A8A; border-color: var(--line-soft); cursor: default;
}

/* ---------- 区分の印（全員／区分2〜／区分3） ---------- */
.badge {
  display: inline-block; min-width: 64px; text-align: center; padding: 2px 8px;
  font-size: 12px; font-weight: 900; line-height: 1.6; flex-shrink: 0;
}
.badge-lv1 { background: var(--lv1); color: var(--white); }
.badge-lv2 { background: var(--lv2); color: var(--black); }
.badge-lv3 { background: var(--lv3); color: var(--white); }
.badge-off { background: var(--line-soft); color: #8A8A8A; }

/* ---------- 相談記録（会話） ---------- */
.talk { display: flex; flex-direction: column; gap: 6px; }
.talk-who { display: flex; gap: 8px; align-items: center; }
.talk-role { font-size: 11px; font-weight: 700; padding: 1px 8px; line-height: 1.7; color: var(--white); background: var(--black); }
.talk-name { font-weight: 900; font-size: 15px; }
.talk-line { border-left: 4px solid var(--black); padding: 2px 0 2px 16px; line-height: 1.95; }
.talk.is-minato .talk-role { background: var(--lv3); }
.talk.is-minato .talk-line { border-left-color: var(--lv3); }

/* ---------- セクション見出し（STEP） ---------- */
.step-head { display: flex; align-items: baseline; gap: 18px; flex-wrap: wrap; }
.step-no { font-family: var(--mono); font-weight: 700; font-size: 14px; color: var(--lv3); }
.step-head h2 { font-size: 28px; }
.step-note { font-size: 14px; color: var(--text-sub); line-height: 1.6; }

/* ---------- 黄黒の縞の枠（担当者を呼ぶ） ---------- */
.caution-box { border: 3px solid var(--black); }
.caution-box::before { content: ""; display: block; height: 12px; background: var(--stripe); }
.caution-body { padding: 26px 30px; display: flex; flex-direction: column; gap: 12px; }

/* ---------- フッター ---------- */
.site-footer {
  margin-top: 64px; padding: 24px var(--gutter); background: var(--black); color: #CFCFCF;
  font-size: 13px; display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap;
}

/* =========================================================
   トップページ
   ========================================================= */
.hero {
  padding: 72px var(--gutter) 64px; border-bottom: 2px solid var(--black);
  display: flex; gap: 40px; align-items: stretch; position: relative;
  /* 記録用紙風の方眼 */
  background-color: var(--white);
  background-image:
    linear-gradient(to right, rgba(20,20,20,0.07) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(20,20,20,0.07) 1px, transparent 1px);
  background-size: 24px 24px;
}
.hero::after {
  /* 右下の透かし文字 */
  content: "SAFETY MANUAL"; position: absolute; right: var(--gutter); bottom: 10px;
  font-family: var(--mono); font-weight: 700; font-size: 12px; letter-spacing: 0.3em; color: rgba(20,20,20,0.35);
}
.mascot { margin: 0; align-self: center; flex-shrink: 0; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.mascot svg { width: clamp(220px, 20vw, 300px); height: auto; display: block; filter: drop-shadow(6px 6px 0 rgba(20,20,20,0.12)); }
.mascot figcaption { display: flex; flex-direction: column; align-items: center; line-height: 1.5; border-top: 2px solid var(--black); padding-top: 6px; min-width: 180px; }
.mascot figcaption .mono { font-size: 11px; font-weight: 700; letter-spacing: 0.25em; color: var(--text-sub); }
.mascot figcaption span:last-child { font-size: 14px; font-weight: 900; }
/* 四隅のトンボ（記録用紙の印刷用マーク） */
.hero-mark { position: absolute; width: 18px; height: 18px; pointer-events: none; }
.hero-mark::before, .hero-mark::after { content: ""; position: absolute; background: rgba(20,20,20,0.45); }
.hero-mark::before { left: 0; top: 8px; width: 18px; height: 2px; }
.hero-mark::after { left: 8px; top: 0; width: 2px; height: 18px; }
.hero-mark.tl { left: 20px; top: 20px; } .hero-mark.tr { right: 20px; top: 20px; }
.hero-mark.bl { left: 20px; bottom: 20px; } .hero-mark.br { right: 20px; bottom: 20px; }
.hero-main { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; gap: 22px; }
.hero-kicker { align-self: flex-start; border: 2px solid var(--black); font-weight: 900; font-size: 13px; padding: 3px 12px; letter-spacing: 0.06em; line-height: 1.6; }
.hero h1 { font-size: 52px; line-height: 1.3; letter-spacing: 0.01em; }
.hero h1 .underline { border-bottom: 6px solid var(--black); }
.hero-lead { color: #3A3A3A; max-width: 560px; line-height: 1.95; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 6px; }

.record { width: 480px; flex-shrink: 0; border: 2px solid var(--black); display: flex; flex-direction: column; }
.record-head { background: var(--black); color: var(--white); padding: 6px 16px; font-size: 12px; font-weight: 700; display: flex; justify-content: space-between; }
.record-head .mono { color: var(--text-dim); }
.record-body { padding: 22px 22px 24px; display: flex; flex-direction: column; gap: 18px; }
.record-body .talk-line { font-size: 16px; line-height: 1.85; }

/* 作業区分の選択 */
.level-section { padding: 56px var(--gutter); background: var(--paper); display: flex; flex-direction: column; gap: 24px; }
.level-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.level-card {
  text-align: left; cursor: pointer; padding: 0; background: var(--white); color: var(--black);
  display: flex; flex-direction: column; border: 2px solid var(--text-dim);
}
.level-card:hover { border-color: var(--black); }
.level-card[aria-pressed="true"] { border: 4px solid var(--black); }
.level-band { display: flex; justify-content: space-between; padding: 8px 22px; font-weight: 900; font-size: 15px; letter-spacing: 0.06em; }
.level-band.lv1 { background: var(--lv1); color: var(--white); }
.level-band.lv2 { background: var(--lv2); color: var(--black); }
.level-band.lv3 { background: var(--lv3); color: var(--white); }
.level-card-body { padding: 18px 22px 20px; display: flex; flex-direction: column; gap: 8px; }
.level-card-title { font-size: 21px; font-weight: 900; line-height: 1.4; }
.level-card-desc { font-size: 15px; line-height: 1.8; color: #3A3A3A; }
.level-card-sel { font-size: 13px; font-weight: 900; color: #777777; }
.level-card[aria-pressed="true"] .level-card-sel { color: var(--black); }

/* 点検の進み具合 */
.progress-band { padding: 26px var(--gutter); background: var(--black); color: var(--white); display: flex; align-items: center; gap: 36px; }
.progress-label { font-weight: 900; font-size: 14px; width: 120px; flex-shrink: 0; line-height: 1.5; }
.progress-main { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.progress-bar { height: 12px; background: #3A3A3A; }
.progress-bar > div { height: 100%; background: var(--white); width: 0; }
.progress-text { font-size: 13px; color: #CFCFCF; line-height: 1.7; }
.progress-actions { display: flex; gap: 12px; flex-shrink: 0; }
.progress-actions .btn { padding: 11px 18px; font-size: 14px; }

/* 目次 */
.toc-section { padding: 64px var(--gutter) 0; display: flex; flex-direction: column; gap: 8px; }
.toc-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; border-bottom: 4px solid var(--black); padding-bottom: 12px; }
.toc-row {
  display: flex; align-items: center; gap: 20px; padding: 14px 8px;
  border-bottom: 1px solid var(--line); text-decoration: none; color: var(--black);
}
a.toc-row:hover { background: var(--paper); color: var(--black); }
.toc-no { font-family: var(--mono); font-weight: 700; font-size: 22px; width: 56px; flex-shrink: 0; }
.toc-title { width: 300px; flex-shrink: 0; font-weight: 900; font-size: 17px; line-height: 1.5; }
.toc-desc { flex: 1 1 0; min-width: 0; font-size: 15px; color: var(--text-sub); line-height: 1.6; }
.toc-status { flex-shrink: 0; font-size: 12px; font-weight: 700; text-align: right; line-height: 1.5; color: var(--text-sub); white-space: nowrap; }
.toc-row.is-optional { color: var(--text-dim); }
.toc-row.is-optional .toc-desc { color: var(--text-dim); }
.toc-row.is-draft { cursor: default; }

/* 付録と「一人で進まない」 */
.appendix-section { padding: 64px var(--gutter) 0; display: flex; gap: 24px; align-items: flex-start; }
.appendix-section .caution-box { flex: 1 1 0; min-width: 0; }
.caution-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; font-size: 15px; font-weight: 700; }
.caution-list div { padding: 10px 12px; background: var(--paper); line-height: 1.6; }
.appendix-grid { width: 500px; flex-shrink: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); border-top: 2px solid var(--black); border-left: 2px solid var(--black); }
.appendix-item { padding: 20px 22px; border-right: 2px solid var(--black); border-bottom: 2px solid var(--black); text-decoration: none; color: var(--black); display: flex; flex-direction: column; gap: 2px; line-height: 1.6; }
a.appendix-item:hover { background: var(--paper); color: var(--black); }
.appendix-item .mono { font-size: 12px; color: var(--lv3); font-weight: 700; }
.appendix-item strong { font-weight: 900; font-size: 16px; }
.appendix-item span:last-child { font-size: 13px; color: var(--text-sub); }
.draft-note { font-size: 12px; font-weight: 700; color: var(--text-sub); }

/* =========================================================
   章ページ
   ========================================================= */
.header-level { display: flex; align-items: center; gap: 10px; font-size: 13px; line-height: 1.5; }
.header-level-label { color: #CFCFCF; }
.header-level-chip { padding: 3px 12px; font-weight: 900; border: 1px solid #5A5A5A; }
.header-level-chip.lv1 { background: var(--lv1); color: var(--white); border-color: var(--lv1); }
.header-level-chip.lv2 { background: var(--lv2); color: var(--black); border-color: var(--lv2); }
.header-level-chip.lv3 { background: var(--lv3); color: var(--white); border-color: var(--lv3); }
.header-level a { color: var(--white); font-weight: 700; }

/* 左に目次、真ん中に本文、右に目次と同じ幅の余白を置いて、本文が画面の中央に来るようにする */
.chapter-layout { display: grid; grid-template-columns: 210px minmax(0, 820px) minmax(0, 210px); column-gap: 40px; justify-content: center; align-items: start; padding: 0 24px; }
.chapter-side { padding-top: 40px; position: sticky; top: 0; max-height: 100vh; overflow-y: auto; }
.side-head { font-size: 12px; font-weight: 700; color: var(--lv3); padding-bottom: 6px; border-bottom: 3px solid var(--black); }
.side-link { display: flex; align-items: center; padding: 6px; font-size: 13px; line-height: 1.6; text-decoration: none; color: var(--black); border-bottom: 1px solid var(--line-soft); }
.side-link .mono { width: 30px; flex-shrink: 0; font-size: 12px; }
a.side-link:hover { background: var(--paper); color: var(--black); }
.side-link.is-current { background: var(--black); color: var(--white); font-weight: 900; }
.side-link.is-draft:not(.is-current) { color: var(--text-dim); }
.side-gap { height: 12px; }

.chapter-main { min-width: 0; padding: 40px 0 0; display: flex; flex-direction: column; gap: 44px; }

.ch-head { display: flex; gap: 28px; align-items: stretch; border-bottom: 4px solid var(--black); padding-bottom: 24px; }
.ch-no { width: 120px; flex-shrink: 0; background: var(--black); color: var(--white); display: flex; flex-direction: column; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; line-height: 1.4; padding: 12px 0; }
.ch-no .mono { font-size: 56px; line-height: 1; margin: 4px 0; }
.ch-head-main { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; gap: 10px; justify-content: center; }
.ch-head h1 { font-size: 38px; }
.ch-sub { font-size: 16px; color: #3A3A3A; line-height: 1.6; }
.ch-tags { display: flex; gap: 8px; flex-wrap: wrap; }
.ch-tags > span { font-size: 12px; font-weight: 900; line-height: 1.6; padding: 2px 10px; }
.tag-outline { border: 1.5px solid var(--black); }
.tag-damage { border: 1.5px solid var(--black); }
.tag-damage.dmg-大 { background: var(--lv3); border-color: var(--lv3); color: var(--white); }
.tag-damage.dmg-中 { background: var(--black); color: var(--white); }
.ch-updated { font-size: 12px; color: var(--text-sub); }

.ch-sec { display: flex; flex-direction: column; gap: 20px; }
.sec-head { display: flex; align-items: center; gap: 14px; font-size: 22px; }
.sec-head .mono { font-size: 13px; padding: 2px 10px; background: var(--black); color: var(--white); line-height: 1.7; }

/* 事故報告カード */
.incident { border: 2px solid var(--lv3); }
.incident-head { background: var(--lv3); color: var(--white); padding: 6px 18px; font-size: 13px; font-weight: 900; display: flex; justify-content: space-between; gap: 12px; }
.incident-body { margin: 0; padding: 16px 20px; display: grid; grid-template-columns: 110px minmax(0, 1fr); row-gap: 10px; font-size: 16px; line-height: 1.8; }
.incident-body dt { font-weight: 900; color: var(--lv3); }
.incident-body dd { margin: 0; }

/* 対策 */
.measure { display: flex; flex-direction: column; gap: 20px; margin-top: 12px; }
.measure-head { display: flex; align-items: center; gap: 12px; padding-bottom: 8px; border-bottom: 2px solid var(--black); flex-wrap: wrap; }
.measure-head .mono { font-weight: 700; font-size: 13px; color: var(--lv3); }
.measure-title { font-weight: 900; font-size: 20px; flex: 1 1 0; min-width: 12em; line-height: 1.5; }
.measure-body { display: flex; flex-direction: column; gap: 20px; }
.optional-note { font-size: 12px; font-weight: 700; color: var(--text-sub); }
.measure.is-optional .measure-head { border-bottom-color: var(--text-dim); }
.measure.is-optional .measure-head .mono, .measure.is-optional .measure-title { color: var(--text-dim); }
.measure.is-optional .measure-body { opacity: 0.5; }

/* 設定の手順メモ（差し替え用の囲み） */
.howto { border: 2px dashed var(--black); padding: 0 0 14px; }
.howto-head { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 6px 16px; background: var(--paper); border-bottom: 1px solid var(--black); font-size: 13px; font-weight: 900; }
.howto-date { font-family: var(--mono); font-weight: 500; }
.howto ol { margin: 12px 0 8px; padding-left: 2.4em; font-size: 15px; }
.howto-note { padding: 0 16px; font-size: 12px; color: var(--text-sub); line-height: 1.7; }

/* 用語 */
.terms { border: 1.5px solid var(--black); margin-top: 12px; }
.terms-head { background: var(--black); color: var(--white); font-size: 13px; font-weight: 900; padding: 6px 16px; }
.term { display: flex; gap: 16px; padding: 12px 16px; border-bottom: 1px solid var(--line-soft); font-size: 15px; line-height: 1.8; }
.term:last-child { border-bottom: none; }
.term-word { width: 170px; flex-shrink: 0; font-weight: 900; }
.term-desc { flex: 1 1 0; min-width: 0; }

/* 指差し確認 */
.pointing { background: var(--paper); border-left: 8px solid var(--lv2); padding: 24px 28px; display: flex; flex-direction: column; gap: 8px; }
.pointing-head { display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; margin-bottom: 6px; }
.pointing-head h2 { font-size: 22px; }
.pointing-head span { font-size: 13px; font-weight: 700; }
.pointing-row { display: flex; gap: 14px; align-items: center; background: var(--white); padding: 12px 16px; font-weight: 700; font-size: 17px; line-height: 1.6; }
.pointing-row .mono { color: var(--lv3); }
.pointing-text { flex: 1 1 0; min-width: 0; }
.yoshi { font-weight: 900; flex-shrink: 0; }

/* 点検表 */
.checklist { border: 3px solid var(--black); }
.checklist-head { background: var(--black); color: var(--white); padding: 12px 22px; display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.checklist-head h2 { font-size: 19px; }
.checklist-head .mono { font-weight: 700; font-size: 14px; }
.checklist-meta { display: flex; gap: 16px 24px; flex-wrap: wrap; padding: 12px 22px; font-size: 13px; border-bottom: 1.5px solid var(--black); background: var(--paper); }
.checklist-meta label { display: flex; align-items: center; gap: 8px; font-weight: 700; }
.checklist-meta input {
  font: inherit; font-weight: 400; font-size: 14px; border: none; border-bottom: 1.5px solid var(--black);
  background: var(--white); padding: 4px 6px; width: 150px; border-radius: 0; color: var(--black);
}
.checklist-meta .meta-wide { flex: 1 1 220px; }
.checklist-meta .meta-wide input { flex: 1 1 0; min-width: 0; width: auto; }
.checklist-bar { height: 8px; background: var(--line-soft); }
.checklist-bar > div { height: 100%; background: var(--black); width: 0; }
.check-row { display: flex; align-items: center; gap: 16px; padding: 12px 22px; border-bottom: 1px solid var(--line); cursor: pointer; font-size: 16px; line-height: 1.6; }
.check-row:hover { background: var(--paper); }
.check-no { font-size: 12px; color: #777777; width: 34px; flex-shrink: 0; }
.check-text { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; }
.check-row input { width: 24px; height: 24px; accent-color: var(--black); flex-shrink: 0; margin: 0; cursor: pointer; }
.check-row.is-optional .check-text { color: var(--text-dim); }
.checklist-foot { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; padding: 14px 22px; }
.save-note { font-size: 13px; color: var(--text-sub); }
.checklist-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.checklist-actions .btn { padding: 10px 18px; font-size: 14px; }

.expert h2 { font-size: 18px; }
.expert p { font-size: 16px; line-height: 1.9; }

/* 前の章／次の章 */
.pager { display: flex; border: 2px solid var(--black); }
.pager-item { flex: 1 1 0; min-width: 0; padding: 14px 20px; text-decoration: none; display: flex; flex-direction: column; gap: 2px; line-height: 1.6; color: var(--black); }
.pager-item .mono { font-size: 12px; color: #777777; }
.pager-prev { border-right: 2px solid var(--black); }
.pager-next { text-align: right; background: var(--black); color: var(--white); }
.pager-next .mono { color: #CFCFCF; }
a.pager-item:hover { background: var(--paper); color: var(--black); }
a.pager-next:hover { background: #333; color: var(--white); }
.pager-item.is-draft { color: var(--text-dim); }
.pager-next.is-draft { background: var(--line-soft); color: #8A8A8A; }
.pager-next.is-draft .mono { color: #8A8A8A; }


/* 担当者を呼ぶ枠の中のリンク */
.expert-link { font-size: 14px; font-weight: 900; align-self: flex-start; }

/* 第14章：演習（あなたならどうする？） */
.quiz { border: 2px solid var(--black); }
.quiz-head { background: var(--black); color: var(--white); font-size: 13px; font-weight: 900; padding: 6px 16px; }
.quiz p { padding: 14px 18px; line-height: 1.9; }
.answer { border-top: 0; }
.answer summary {
  cursor: pointer; font-weight: 900; font-size: 14px; padding: 10px 16px;
  border: 2px solid var(--black); background: var(--white); list-style: none;
}
.answer summary::-webkit-details-marker { display: none; }
.answer summary::before { content: "▶ "; font-size: 11px; }
.answer[open] summary::before { content: "▼ "; }
.answer summary:hover { background: var(--paper); }
.answer-body { display: flex; flex-direction: column; gap: 20px; padding-top: 20px; }

/* 第14章：事例の一覧 */
.case-index { border: 2px solid var(--lv3); }
.case-head { background: var(--lv3); color: var(--white); font-size: 13px; font-weight: 900; padding: 6px 16px; }
.case-row { display: flex; gap: 14px; align-items: baseline; padding: 9px 16px; border-bottom: 1px solid var(--line-soft); text-decoration: none; font-size: 16px; line-height: 1.6; }
.case-row:last-child { border-bottom: none; }
.case-row:hover { background: var(--paper); color: var(--black); }
.case-row .mono { font-size: 12px; color: var(--lv3); width: 42px; flex-shrink: 0; }
.case-title { flex: 1 1 0; min-width: 0; font-weight: 700; }
.case-ch { font-size: 12px; color: var(--text-sub); flex-shrink: 0; }

/* 付録 */
.appendix-lead { line-height: 1.9; }
.group-head { display: flex; justify-content: space-between; gap: 12px; padding: 10px 22px; background: var(--paper); border-bottom: 1.5px solid var(--black); border-top: 1.5px solid var(--black); font-weight: 900; font-size: 15px; }
.group-head a { text-decoration: none; }
.group-head a:hover { text-decoration: underline; }
.group-head .mono { font-size: 13px; }
.search-box { display: flex; align-items: center; gap: 12px; font-weight: 900; font-size: 14px; margin-bottom: 16px; }
.search-box input { flex: 1 1 0; min-width: 0; font: inherit; font-weight: 400; font-size: 15px; padding: 8px 10px; border: 2px solid var(--black); border-radius: 0; }
.term-ch { display: block; font-size: 12px; font-weight: 700; margin-top: 2px; }
.term-empty { color: var(--text-sub); }

.flow { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.flow-step { border: 2px solid var(--black); display: grid; grid-template-columns: 170px minmax(0, 1fr); }
.flow-step + .flow-step { border-top: 0; }
.flow-head { background: var(--black); color: var(--white); padding: 16px 18px; display: flex; flex-direction: column; justify-content: center; }
.flow-head .mono { font-size: 12px; color: #CFCFCF; }
.flow-head strong { font-size: 28px; font-weight: 900; line-height: 1.3; }
.flow-body { padding: 14px 20px; font-size: 16px; line-height: 1.8; }
.flow-body p { font-weight: 700; }
.flow-body ul { margin: 6px 0 0; padding-left: 1.3em; }

.map-table { border: 2px solid var(--black); }
.map-row { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1.4fr) 110px; border-bottom: 1px solid var(--line); font-size: 16px; line-height: 1.7; }
.map-row:last-child { border-bottom: none; }
.map-row > div { padding: 10px 14px; }
.map-scene { font-weight: 900; background: var(--paper); }
.map-who { display: flex; flex-wrap: wrap; gap: 6px; align-items: flex-start; }
.map-ch { font-size: 13px; }
.who-chip { border: 1.5px solid var(--black); padding: 0 8px; font-size: 13px; font-weight: 700; line-height: 1.8; }
.who-contact { font-weight: 400; }

.contact-row { display: flex; align-items: center; gap: 16px; padding: 12px 22px; border-bottom: 1px solid var(--line); }
.contact-label { width: 240px; flex-shrink: 0; display: flex; flex-direction: column; line-height: 1.5; }
.contact-label span { font-size: 12px; color: var(--text-sub); }
.contact-row input { flex: 1 1 0; min-width: 0; font: inherit; font-size: 14px; border: none; border-bottom: 1.5px solid var(--black); padding: 6px; border-radius: 0; background: var(--white); }
.expert-item { border-left: 4px solid var(--black); padding: 2px 0 2px 16px; }
.expert-item a { font-weight: 900; }
.expert-item p { font-size: 16px; line-height: 1.85; }

/* =========================================================
   スマホ・タブレット
   ========================================================= */
@media (max-width: 1000px) {
  .chapter-side { display: none; }
  .chapter-layout { display: block; max-width: 808px; margin: 0 auto; padding: 0 var(--gutter); }
}
@media (max-width: 1100px) {
  .hero { flex-direction: column; }
  .record { width: auto; }
  .mascot { align-self: flex-start; flex-direction: row; gap: 20px; }
  .mascot svg { width: 180px; }
  .mascot figcaption { min-width: 0; align-items: flex-start; }
  .appendix-section { flex-direction: column; align-items: stretch; }
  .appendix-grid { width: auto; }
  .toc-title { width: 240px; }
}
@media (max-width: 900px) {
  .toc-row { display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; gap: 2px 12px; align-items: start; }
  .toc-no { width: auto; font-size: 18px; grid-row: span 3; }
  .toc-title { width: auto; font-size: 16px; }
  .toc-row .badge { grid-column: 3; grid-row: 1; }
  .toc-desc { grid-column: 2 / 4; }
  .toc-status { grid-column: 2 / 4; text-align: left; }
  .toc-status:empty { display: none; }
}
@media (max-width: 760px) {
  :root { --gutter: 16px; }
  body { font-size: 17px; }
  .site-header { flex-wrap: wrap; padding-top: 12px; padding-bottom: 12px; }
  .brand-name { font-size: 15px; }
  .brand-rev { display: none; }
  .site-nav { gap: 18px; font-size: 13px; }
  .hero { padding-top: 40px; padding-bottom: 40px; gap: 32px; }
  .hero h1 { font-size: 32px; }
  .hero::after, .hero-mark { display: none; }
  .hero-actions .btn { flex: 1 1 100%; text-align: center; }
  .level-section, .toc-section, .appendix-section { padding-top: 40px; }
  .level-section { padding-bottom: 40px; }
  .step-head h2 { font-size: 23px; }
  .level-grid { grid-template-columns: 1fr; gap: 12px; }
  .progress-band { flex-direction: column; align-items: stretch; gap: 14px; }
  .progress-actions .btn { flex: 1 1 0; text-align: center; }
  .caution-body { padding: 20px 18px; }
  .caution-list { grid-template-columns: 1fr; }
  .appendix-item { padding: 16px; }

  /* 章ページ */
  .header-level-label { display: none; }
  .chapter-main { gap: 36px; padding-top: 24px; }
  .ch-head { gap: 16px; }
  .ch-no { width: 72px; }
  .ch-no .mono { font-size: 34px; }
  .ch-head h1 { font-size: 26px; }
  .sec-head { font-size: 20px; }
  .incident-body { grid-template-columns: 1fr; row-gap: 0; padding: 14px 16px; }
  .incident-body dd { margin-bottom: 10px; }
  .incident-body dd:last-child { margin-bottom: 0; }
  .term { flex-direction: column; gap: 2px; }
  .term-word { width: auto; }
  .pointing { padding: 20px 16px; }
  .pointing-row { padding: 10px 12px; gap: 10px; }
  .checklist-head, .checklist-meta, .checklist-foot { padding-left: 14px; padding-right: 14px; }
  .checklist-meta label { flex: 1 1 100%; }
  .checklist-meta input { flex: 1 1 0; min-width: 0; width: auto; }
  .check-row { display: grid; grid-template-columns: 34px minmax(0, 1fr) 24px; gap: 6px 10px; padding: 12px 14px; }
  .check-row .badge { grid-column: 2; grid-row: 2; justify-self: start; }
  .check-row input { grid-column: 3; grid-row: 1 / span 2; align-self: center; }
  .checklist-actions { width: 100%; }
  .checklist-actions .btn { flex: 1 1 0; }
  .pager { flex-direction: column; }
  .pager-prev { border-right: none; border-bottom: 2px solid var(--black); }

  /* 付録・第14章 */
  .flow-step { grid-template-columns: 1fr; }
  .flow-head { flex-direction: row; align-items: baseline; gap: 12px; padding: 10px 16px; }
  .flow-head strong { font-size: 22px; }
  .map-row { grid-template-columns: 1fr; }
  .map-row > div { padding: 6px 14px; }
  .map-scene { padding-top: 10px !important; }
  .contact-row { flex-direction: column; align-items: stretch; gap: 6px; padding: 12px 14px; }
  .contact-label { width: auto; }
  .group-head { padding: 10px 14px; }
  .case-row { flex-wrap: wrap; gap: 2px 10px; }
  .case-ch { width: 100%; padding-left: 52px; }
}

/* =========================================================
   印刷
   ========================================================= */
@media print {
  .top-stripe, .site-nav, .no-print { display: none !important; }
  .site-header, .site-footer, .progress-band { background: none; color: var(--black); border-bottom: 2px solid var(--black); }
  .brand, .brand-name { color: var(--black); }
  * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  body { font-size: 11pt; }
  .chapter-side, .header-level a { display: none !important; }
  .chapter-layout { padding: 0; display: block; }
  .chapter-main { max-width: none; padding-top: 16px; }
  .measure.is-optional .measure-body { opacity: 0.6; }
  .incident, .terms, .pointing-row, .check-row, .howto { break-inside: avoid; }
  .checklist-meta input { border-bottom: 1px solid var(--black); background: none; }
  .answer-body { display: flex !important; }
  .flow-step, .map-row, .expert-item, .group-head { break-inside: avoid; }

  /* 「点検表を印刷する」ボタンのときは、点検表だけを印刷する */
  body.print-checklist .site-header,
  body.print-checklist .site-footer,
  body.print-checklist .chapter-main > :not(.checklist) { display: none !important; }
}
