/* ==========================================================================
   MedTube 手順書 共通スタイル

   方針
   1. 色は「意味が言えるもの」だけ持つ。
        navy  = 構造・リンク・SurgiLink
        green = 医師 / 院内 / できる
        brown = 管理者 / 院外 / できない
        amber = 注意 / red = 禁止（枠を塗るのは red だけ）
   2. 箱を減らす。囲みは「本当に囲む理由があるもの」だけに残し、
      それ以外は罫と余白で区切る。
   3. 見出し・リード・本文のサイズ差をはっきりつける。
   4. 医師向け＝寒色寄りの紙、管理者向け＝暖色寄りの紙。
      本文中のアクセント（見出しの罫・番号）も --accent で切り替える。
   ========================================================================== */

:root {
  --navy: #1f4d88;
  --navy-dark: #173a68;
  --navy-soft: #eaf0f8;
  --sky: #4a9fc9;

  --ink: #16202b;
  --ink-2: #44586d;
  /* キャプション・補足に使う灰。地の色に対して 4.5:1 を確保する明度に留める */
  --ink-3: #5f7288;
  --line: #dde5ed;
  --line-soft: #edf1f6;
  --paper: #ffffff;

  --doctor: #0d7c66;
  --doctor-soft: #e3f2ed;
  --admin: #94481c;
  --admin-soft: #fbeee2;

  --warn: #a6560a;
  --warn-soft: #fdf7ec;
  --danger: #ab241c;
  --danger-soft: #fbeeec;

  /* 「院内 / できる」は医師色と同じ緑。緑を1つに絞るための別名 */
  --ok: var(--doctor);
  --ok-soft: var(--doctor-soft);

  /* 本文の一行の長さ。表・図・写真はここに縛られず版面いっぱいを使う */
  --measure: 42em;

  --radius: 12px;
  --radius-sm: 8px;
  --lift: 0 1px 2px rgba(22, 32, 43, .05), 0 6px 18px rgba(22, 32, 43, .06);
  --maxw: 1000px;

  --font: -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Hiragino Kaku Gothic ProN",
    "Noto Sans JP", "Yu Gothic UI", Meiryo, sans-serif;
  --mono: "SF Mono", "Consolas", "Menlo", monospace;

  /* doc テーマで上書きされる */
  --accent: var(--navy);
  --accent-soft: var(--navy-soft);
  --canvas: #f5f7fa;
  --fill: #f7f9fc;
}

/* ---------- 読み手ごとのトーン ----------
   医師向け＝わずかに寒色の紙／管理者向け＝わずかに暖色の紙。
   <body class="doc--doctor"> または <body class="doc--admin"> を付ける。 */
.doc--doctor {
  --accent: var(--doctor);
  --accent-soft: var(--doctor-soft);
  --canvas: #f4f7f9;
  --fill: #f6faf9;
}
.doc--admin {
  --accent: var(--admin);
  --accent-soft: var(--admin-soft);
  --canvas: #faf6f2;
  --fill: #fbf8f4;
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: 88px; }

body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background: var(--canvas);
  line-height: 1.86;
  font-size: 16.5px;
  -webkit-font-smoothing: antialiased;
  text-size-adjust: 100%;
}

/* ---------- ヘッダー ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--navy);
  color: #fff;
  box-shadow: inset 0 -3px 0 var(--sky);
}
.site-header__inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 11px 24px 13px;
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}
.site-header__brand {
  font-weight: 700;
  font-size: 16.5px;
  letter-spacing: .02em;
  color: #fff;
  text-decoration: none;
  display: flex;
  align-items: baseline;
  gap: 8px;
  white-space: nowrap;
}
.site-header__sub {
  font-size: 12.5px;
  color: rgba(255, 255, 255, .72);
  font-weight: 400;
  letter-spacing: .04em;
}
.site-header__nav {
  margin-left: auto;
  display: flex;
  gap: 2px;
  flex-wrap: wrap;
}
.site-header__nav a {
  color: rgba(255, 255, 255, .8);
  text-decoration: none;
  font-size: 13.5px;
  padding: 4px 10px;
  border-radius: 6px;
  white-space: nowrap;
}
.site-header__nav a:hover { background: rgba(255, 255, 255, .13); color: #fff; }
.site-header__nav a[aria-current="page"] {
  color: #fff;
  font-weight: 700;
  box-shadow: inset 0 -2px 0 #fff;
  border-radius: 0;
}

/* 管理者向けは配色を変え、医師向けと取り違えないようにする */
.site-header--admin { background: #6b3413; box-shadow: inset 0 -3px 0 #c9873f; }
.site-header--admin .site-header__nav a[aria-current="page"] { box-shadow: inset 0 -2px 0 #f0c391; }

/* ---------- レイアウト ---------- */
.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 24px 104px; }

.breadcrumb {
  font-size: 12.5px;
  color: var(--ink-3);
  padding: 22px 0 0;
  letter-spacing: .02em;
}
.breadcrumb a { color: var(--ink-3); text-decoration: none; }
.breadcrumb a:hover { color: var(--ink-2); text-decoration: underline; }
.breadcrumb span { margin: 0 7px; opacity: .45; }

/* ---------- ページ冒頭 ---------- */
.page-head { padding: 10px 0 6px; }
.page-head__eyebrow {
  display: inline-block;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: .12em;
  padding: 0;
  margin-bottom: 14px;
  background: none !important;
}
.page-head__eyebrow--doctor { color: var(--doctor); }
.page-head__eyebrow--admin { color: var(--admin); }
.page-head__eyebrow--common { color: var(--navy); }

h1 {
  font-size: 36px;
  line-height: 1.34;
  margin: 0 0 16px;
  letter-spacing: .015em;
  font-weight: 700;
  font-feature-settings: "palt" 1;
}

.lead {
  font-size: 19px;
  color: var(--ink-2);
  margin: 0 0 24px;
  line-height: 1.86;
  font-feature-settings: "palt" 1;
  max-width: 46em;
}
.lead strong { color: var(--ink); }

.meta-row {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
  margin: 0 0 8px;
  padding-bottom: 22px;
  font-size: 12.5px;
  color: var(--ink-3);
  border-bottom: 1px solid var(--line);
  letter-spacing: .02em;
}
.meta-row span { background: none; border: 0; padding: 0; }
.meta-row span + span { padding-left: 18px; border-left: 1px solid var(--line); }

/* ---------- 見出し ----------
   h2 は下線で囲わず、上にアクセントの短い罫を置く。
   節の切れ目は「線」ではなく「余白」で作る。 */
h2 {
  font-size: 25px;
  line-height: 1.5;
  margin: 78px 0 18px;
  padding: 0;
  border: 0;
  font-weight: 700;
  letter-spacing: .02em;
  font-feature-settings: "palt" 1;
}
h2::before {
  content: "";
  display: block;
  width: 32px;
  height: 3px;
  border-radius: 2px;
  background: var(--accent);
  margin-bottom: 15px;
}
.page-head + h2, .page-head + figure + h2 { margin-top: 46px; }

h3 {
  font-size: 19.5px;
  line-height: 1.6;
  margin: 40px 0 12px;
  padding-left: 14px;
  border-left: 3px solid var(--accent);
  font-weight: 700;
  letter-spacing: .01em;
}
h4 { font-size: 16px; margin: 26px 0 6px; font-weight: 700; color: var(--ink-2); }

p { margin: 0 0 16px; }
/* URLをそのままリンク文字にしている箇所が狭い画面ではみ出すため、
   収まらないときだけ途中で折り返す */
a { color: var(--navy); text-underline-offset: .18em; overflow-wrap: break-word; }
a:hover { color: var(--sky); }

main ul, main ol { margin: 0 0 18px; padding-left: 1.4em; }
main li { margin-bottom: 6px; }

/* 読み物の行長を抑える。表・図・カード群・ステップは版面いっぱいのまま。 */
main > p,
main > ul:not(.steps),
main > ol:not(.steps),
main > .note,
main > .aside,
main > .checklist,
.symptom__body > p,
.symptom__body > ul:not(.steps),
.symptom__body > ol:not(.steps),
.symptom__body > .note,
.symptom__body > .aside,
.symptom__body > .checklist,
.symptom__body > .escalate {
  max-width: var(--measure);
}

/* ---------- カード ----------
   影は使わない。囲みの理由は「中身がひとまとまりであること」だけ。 */
.card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px 24px;
  margin: 22px 0;
}
.card > :first-child { margin-top: 0; }
.card > :last-child { margin-bottom: 0; }
.card h3 {
  font-size: 17.5px;
  margin: 26px 0 8px;
  padding-left: 0;
  border-left: 0;
}
.card > h3:first-child { margin-top: 0; }
/* 設定シートのように、カード自体が節になっている場合の見出し */
.card > h2 {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 0 10px;
  font-size: 20px;
}
.card > h2::before { display: none; }
.card > h2 .stepshot__num { margin-bottom: 0; flex: none; }

.grid { display: grid; gap: 16px; margin: 24px 0; }
.grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid > ul, .grid > ol { margin-bottom: 0; }

/* ---------- ステップ ---------- */
.steps { counter-reset: step; list-style: none; padding: 0; margin: 26px 0; }
.steps > li {
  counter-increment: step;
  position: relative;
  padding: 0 0 30px 52px;
  margin: 0;
}
.steps > li::before {
  content: counter(step);
  position: absolute;
  left: 0; top: 1px;
  width: 30px; height: 30px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-weight: 700;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.steps > li::after {
  content: "";
  position: absolute;
  left: 14.5px; top: 38px; bottom: 6px;
  width: 1px;
  background: var(--line);
}
.steps > li:last-child { padding-bottom: 0; }
.steps > li:last-child::after { display: none; }
.steps__title { font-weight: 700; font-size: 17px; margin: 0 0 6px; line-height: 1.6; }
.steps > li > :last-child { margin-bottom: 0; }
.steps--admin > li::before { background: var(--admin); }
.steps--doctor > li::before { background: var(--doctor); }

/* ---------- 注意書き ----------
   info / ok は罫だけ。warn はごく薄い地。塗るのは danger だけにして、
   「色が付いている＝本当に危ない」を成り立たせる。 */
.note {
  margin: 22px 0;
  padding: 1px 0 1px 18px;
  border-left: 3px solid var(--line);
  border-radius: 0;
  font-size: 15.5px;
  line-height: 1.85;
  color: var(--ink-2);
}
.note > :first-child { margin-top: 0; }
.note > :last-child { margin-bottom: 0; }
.note strong { color: var(--ink); }
.note__label {
  font-weight: 700;
  display: block;
  margin-bottom: 3px;
  font-size: 15.5px;
  color: var(--ink);
  letter-spacing: .01em;
}
.note + .note { margin-top: 14px; }

.note--info { border-left-color: #c3d2e2; }
.note--ok { border-left-color: var(--doctor); }
.note--ok .note__label { color: var(--doctor); }
.note--warn {
  border-left-color: var(--warn);
  background: var(--warn-soft);
  padding: 14px 18px;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}
.note--warn .note__label { color: var(--warn); }
.note--danger {
  border-left-width: 4px;
  border-left-color: var(--danger);
  background: var(--danger-soft);
  padding: 16px 20px;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  color: var(--ink);
}
.note--danger .note__label { color: var(--danger); }

/* ---------- 補足（note より一段弱い）----------
   「読まなくても困らないが、書いておきたい」ものはここに落とす。 */
.aside {
  margin: 18px 0;
  padding-left: 17px;
  border-left: 2px solid var(--line-soft);
  font-size: 14.8px;
  line-height: 1.85;
  color: var(--ink-2);
}
.aside > :first-child { margin-top: 0; }
.aside > :last-child { margin-bottom: 0; }
.aside strong { color: var(--ink-2); }
/* ラベルは行内に流し込む。本文が <p> で始まる場合だけ自然に改行される */
.aside__label { font-weight: 700; color: var(--ink-2); margin-right: .35em; }

/* ---------- 「くわしくはこちら」の送り出し ----------
   FAQ の各項目の末尾に繰り返し出るので、地の文ではなく
   小さな導線として扱う（矢印は CSS 側で出す）。 */
.seealso { margin: 14px 0 0; font-size: 13.5px; line-height: 1.6; }
.seealso a {
  display: inline-flex;
  align-items: baseline;
  gap: 7px;
  color: var(--accent);
  font-weight: 700;
  text-decoration: none;
}
.seealso a::after { content: "→"; font-size: 11.5px; }
.seealso a:hover { text-decoration: underline; }

/* ---------- 連絡・エスカレーション ----------
   症状ごとに繰り返す「誰に何を伝えるか」を、見出しではなく
   小さな締めのブロックとして扱う。 */
.escalate {
  margin: 22px 0 0;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  font-size: 14.8px;
  line-height: 1.8;
  color: var(--ink-2);
}
.escalate__label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .1em;
  color: var(--ink-3);
  margin-bottom: 6px;
}
.escalate > p { margin: 0 0 8px; }
.escalate ul { margin: 0; padding-left: 1.25em; }
.escalate li { margin-bottom: 2px; }
.escalate strong { color: var(--ink); }

/* ---------- テーブル ----------
   縦罫を落として横罫だけにする。本文の左端と揃える。 */
.table-scroll {
  overflow-x: auto;
  margin: 22px 0;
  -webkit-overflow-scrolling: touch;
  /* 縦罫を外したぶん、横スクロールできることが分かるよう端に影を出す。
     background-attachment: local で、スクロールしきった側の影だけが消える。 */
  background:
    linear-gradient(to right, var(--canvas), transparent) left center,
    linear-gradient(to left, var(--canvas), transparent) right center,
    radial-gradient(farthest-side at 0 50%, rgba(22, 32, 43, .13), transparent) left center,
    radial-gradient(farthest-side at 100% 50%, rgba(22, 32, 43, .13), transparent) right center;
  background-repeat: no-repeat;
  background-size: 36px 100%, 36px 100%, 12px 100%, 12px 100%;
  background-attachment: local, local, scroll, scroll;
}
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 15px;
  line-height: 1.75;
  background: none;
  min-width: 520px;
}
th, td {
  border: 0;
  border-bottom: 1px solid var(--line);
  padding: 12px 18px 12px 0;
  text-align: left;
  vertical-align: top;
  /* 日本語は1文字ずつ折り返せてしまうため、列がつぶれるのを防ぐ */
  min-width: 4.5em;
}
th:last-child, td:last-child { padding-right: 0; }
thead th {
  background: none;
  font-weight: 700;
  color: var(--ink);
  font-size: 13.5px;
  letter-spacing: .04em;
  white-space: nowrap;
  padding-bottom: 9px;
  border-bottom: 2px solid var(--ink-2);
}
tbody th { color: var(--ink); white-space: normal; }
tbody tr:last-child td, tbody tr:last-child th { border-bottom: 0; }
table p:last-child { margin-bottom: 0; }

/* 記入して使う表は、読む表と見た目を変える。書き込む欄を「枠」として見せる */
.table--form {
  border-collapse: separate;
  border-spacing: 0 6px;
  margin-left: 0;
}
/* 見出し行のない「ラベル＋記入欄」型は、読む表のような最小幅が要らない */
.table--form:not(:has(thead)) { min-width: 0; }
.table--form th, .table--form td { border-bottom: 0; padding: 12px 16px; }
.table--form thead th { box-shadow: inset 0 -2px 0 var(--ink-2); padding-bottom: 9px; }
.table--form tbody th {
  width: 42%;
  padding-left: 0;
  background: none;
  font-weight: 700;
  color: var(--ink);
}
.table--form tbody td {
  background: var(--fill);
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--ink-3);
}

/* ---------- チェックリスト ---------- */
.checklist { list-style: none; padding: 0; margin: 16px 0 20px; }
.checklist li {
  position: relative;
  padding: 4px 0 4px 30px;
  border: 0;
  font-size: 15.5px;
  line-height: 1.8;
  margin-bottom: 0;
}
.checklist li::before {
  content: "";
  position: absolute;
  left: 1px; top: 11px;
  width: 15px; height: 15px;
  border: 1.5px solid var(--ink-3);
  border-radius: 3px;
  background: #fff;
}

/* ---------- スクリーンショット ---------- */
.shot {
  display: block;
  max-width: 100%;
  height: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: #fff;
}
.shot--sm { max-width: 320px; }
.shot--md { max-width: 480px; }

/* 画面写真＋説明の2カラム。囲まず、写真の枠だけを見せる */
.stepshot {
  display: grid;
  grid-template-columns: minmax(0, 1.02fr) minmax(0, 1fr);
  gap: 26px;
  align-items: start;
  margin: 26px 0;
  padding: 0;
  background: none;
  border: 0;
  border-radius: 0;
}
.stepshot > figure { margin: 0; }
.stepshot > figure figcaption { text-align: left; margin-top: 9px; }
.stepshot__body > :first-child { margin-top: 0; }
.stepshot__body > :last-child { margin-bottom: 0; }
.stepshot__num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 27px; height: 27px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-weight: 700;
  font-size: 13.5px;
  margin-bottom: 10px;
}
.stepshot--doctor .stepshot__num { background: var(--doctor); }
.stepshot--admin .stepshot__num { background: var(--admin); }

/* ステップの中に置かれた画面写真は、本文と同じ流れで読ませる */
.steps .stepshot { margin: 18px 0; gap: 22px; }

/* ---------- 院内／院外バッジ ---------- */
.where {
  display: inline-block;
  font-size: 12px;
  font-weight: 700;
  padding: 2px 9px;
  border-radius: 4px;
  white-space: nowrap;
  letter-spacing: .02em;
}
.where--in { background: var(--doctor-soft); color: var(--doctor); }
.where--out { background: var(--admin-soft); color: var(--admin); }

/* ---------- 大きな二択 ----------
   院内＝緑 / 院外＝茶。ページ内で最も強い対比なので、
   ここだけは面で塗る。 */
.choice {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin: 26px 0;
}
.choice__card {
  border-radius: var(--radius);
  padding: 20px 22px;
  border: 1px solid;
  font-size: 15.5px;
}
.choice__card--in { border-color: #b6ddd1; background: var(--doctor-soft); }
.choice__card--out { border-color: #e8c8a8; background: var(--admin-soft); }
.choice__head {
  font-size: 17px;
  font-weight: 700;
  margin: 0 0 2px;
  letter-spacing: .01em;
}
.choice__card--in .choice__head { color: #0a6252; }
.choice__card--out .choice__head { color: #7c3a14; }
.choice__sub { font-size: 12.5px; color: var(--ink-3); margin: 0 0 12px; }
.choice__card ul { margin: 0; padding-left: 1.25em; }
.choice__card li { margin-bottom: 4px; line-height: 1.8; }
.choice__card > :last-child { margin-bottom: 0; }

/* ---------- 数字つきの要点 ----------
   箱にせず、罫で区切った番号つきの段落にする。 */
.keypoints { margin: 24px 0; counter-reset: kp; border-top: 1px solid var(--line); }
.keypoints > div {
  counter-increment: kp;
  position: relative;
  background: none;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  padding: 16px 0 16px 46px;
  font-size: 15.5px;
  line-height: 1.8;
  color: var(--ink-2);
}
.keypoints > div::before {
  content: counter(kp);
  position: absolute;
  left: 0; top: 17px;
  width: 26px; height: 26px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 700;
  font-size: 13px;
  display: flex; align-items: center; justify-content: center;
}
.keypoints strong { display: block; margin-bottom: 2px; color: var(--ink); font-size: 16.5px; }
.keypoints strong a { text-decoration: none; }
.keypoints strong a:hover { text-decoration: underline; }

/* ---------- コード・入力例 ---------- */
code {
  font-family: var(--mono);
  background: var(--line-soft);
  padding: 1px 5px;
  border-radius: 3px;
  font-size: .88em;
  color: var(--navy-dark);
  word-break: break-all;
}
/* 連絡テンプレートなど、写して使う「用紙」。黒い端末画面には見せない */
pre {
  background: var(--paper);
  color: var(--ink);
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  padding: 20px 22px;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  overflow-x: auto;
  font-family: var(--mono);
  font-size: 13.5px;
  line-height: 1.85;
  margin: 22px 0;
}
pre code { background: none; color: inherit; padding: 0; font-size: 1em; }

.kbd {
  display: inline-block;
  font-family: var(--mono);
  font-size: 12px;
  background: #fff;
  border: 1px solid var(--line);
  border-bottom-width: 2px;
  border-radius: 4px;
  padding: 0 6px;
  color: var(--ink);
}

/* ---------- 図版 ---------- */
figure { margin: 26px 0; }
figure svg, figure img { max-width: 100%; height: auto; display: block; }
figcaption {
  font-size: 13px;
  color: var(--ink-3);
  margin-top: 11px;
  line-height: 1.8;
  text-align: center;
}
.figure-frame {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px;
  overflow-x: auto;
}

/* 狭い画面では図を縮小せず横スクロールさせる。
   max-width:100% のまま縮めると、図中の文字が実効数pxまで潰れて判読できなくなるため。 */
@media (max-width: 760px) {
  .figure-frame { padding: 14px; }
  .figure-frame > svg,
  .figure-frame > img {
    /* 図中の最小文字(12px)が実効10px程度を保てる幅。図はviewBox幅620〜900で描かれている */
    width: 760px;
    max-width: none;
  }
  figure:has(.figure-frame)::before {
    content: "→ 図は横にスクロールできます";
    display: block;
    font-size: 12px;
    color: var(--ink-3);
    margin-bottom: 7px;
  }
}

/* ---------- 症状別ナビ（折りたたみ）---------- */
.symptom {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--paper);
  margin: 10px 0;
  overflow: hidden;
}
.symptom + .symptom { margin-top: 8px; }
.symptom > summary {
  cursor: pointer;
  padding: 15px 20px;
  font-weight: 700;
  font-size: 16px;
  line-height: 1.6;
  list-style: none;
  display: flex;
  align-items: baseline;
  gap: 12px;
}
.symptom > summary::-webkit-details-marker { display: none; }
.symptom > summary::before {
  content: "▶";
  font-size: 9.5px;
  color: var(--accent);
  transition: transform .15s;
  flex: none;
  position: relative;
  top: -2px;
}
.symptom[open] > summary::before { transform: rotate(90deg); }
.symptom[open] > summary { border-bottom: 1px solid var(--line-soft); }
.symptom > summary:hover { background: var(--fill); }
.symptom__body { padding: 6px 24px 24px; }
.symptom__body > :first-child { margin-top: 18px; }
.symptom__body > h3:first-child { margin-top: 22px; }

/* 折りたたみの一括開閉ボタン・印刷ボタン */
main > button {
  font: inherit;
  font-size: 13.5px;
  font-weight: 700;
  color: var(--accent);
  background: none;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 16px;
  margin: 6px 0 14px;
  cursor: pointer;
}
main > button:hover { border-color: var(--accent); background: var(--fill); }

/* ---------- 責任分界 ---------- */
.who {
  display: inline-block;
  font-size: 11.5px;
  font-weight: 700;
  padding: 1px 8px;
  border-radius: 4px;
  white-space: nowrap;
  letter-spacing: .02em;
}
.who--admin { background: var(--admin-soft); color: var(--admin); }
.who--doctor { background: var(--doctor-soft); color: var(--doctor); }
.who--surgilink { background: var(--navy-soft); color: var(--navy); }

/* ---------- ページ送り ---------- */
.pager {
  display: flex;
  gap: 14px;
  margin-top: 72px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
  flex-wrap: wrap;
}
.pager a {
  flex: 1 1 240px;
  background: none;
  border: 0;
  border-radius: var(--radius-sm);
  padding: 12px 4px;
  text-decoration: none;
  color: inherit;
}
.pager a:hover { background: var(--fill); }
.pager small {
  display: block;
  color: var(--ink-3);
  font-size: 11.5px;
  letter-spacing: .1em;
  margin-bottom: 2px;
}
.pager strong { font-size: 16px; color: var(--navy); font-weight: 700; }
.pager a:hover strong { color: var(--sky); }
.pager .pager__next { text-align: right; }

.site-footer {
  border-top: 1px solid var(--line);
  background: none;
  padding: 24px;
  font-size: 12.5px;
  color: var(--ink-3);
  letter-spacing: .02em;
}
.site-footer div { max-width: var(--maxw); margin: 0 auto; }

/* ---------- レスポンシブ ---------- */
@media (max-width: 780px) {
  body { font-size: 16px; line-height: 1.84; }
  h1 { font-size: 27px; }
  .lead { font-size: 17px; }
  h2 { font-size: 21px; margin-top: 52px; }
  h2::before { margin-bottom: 12px; }
  h3 { font-size: 18px; margin-top: 32px; }
  .wrap { padding: 0 18px 80px; }
  .grid--2, .grid--3 { grid-template-columns: 1fr; }
  .stepshot { grid-template-columns: 1fr; gap: 16px; }
  .choice { grid-template-columns: 1fr; }
  .shot--sm, .shot--md { max-width: 100%; }
  .card { padding: 18px 18px; }
  .site-header__inner { padding: 9px 16px 11px; }
  .site-header__sub { display: none; }
  .steps > li { padding-left: 44px; padding-bottom: 26px; }
  .symptom > summary { padding: 14px 16px; font-size: 15.5px; }
  .symptom__body { padding: 4px 16px 20px; }
  .meta-row { gap: 12px; font-size: 12px; }
  .meta-row span + span { padding-left: 12px; }
  /* 見出し行のない記入表は、狭い画面ではラベルと欄を縦に積む */
  .table--form:not(:has(thead)) tbody th { width: auto; display: block; padding: 0 0 4px; }
  .table--form:not(:has(thead)) tbody td { display: block; }
  .pager a { padding: 10px 4px; }
}

/* ---------- 印刷 ---------- */
@media print {
  body { background: #fff; font-size: 10.5pt; line-height: 1.62; }
  .site-header, .pager, .site-footer, .breadcrumb, .no-print { display: none !important; }
  main > button { display: none !important; }
  .wrap { max-width: none; padding: 0; }
  h1 { font-size: 20pt; }
  .lead { font-size: 11.5pt; }
  h2 { font-size: 14pt; margin-top: 26pt; break-after: avoid; }
  h3 { font-size: 11.5pt; margin-top: 16pt; break-after: avoid; }
  .card, table, .figure-frame { box-shadow: none; break-inside: avoid; }
  /* 画面用の横スクロール影は、紙では灰色の帯として出てしまう */
  .table-scroll { background: none; overflow: visible; }
  table { min-width: 0; }
  .figure-frame { overflow: visible; }
  .figure-frame > svg, .figure-frame > img { width: auto; max-width: 100%; }
  figure:has(.figure-frame)::before { content: none; }
  .steps > li, .note, .aside, .escalate, figure { break-inside: avoid; }
  .stepshot, .choice__card, .keypoints > div { break-inside: avoid; }
  .shot { max-width: 320px; }
  .symptom { border: 1px solid #ccc; margin: 6pt 0; }
  .symptom__body { display: block !important; }
  .table--form tbody td { background: none; border: 1px solid #bbb; }
  pre { border: 1px solid #ccc; border-left: 3px solid #666; }
  a { color: #000; text-decoration: none; }
  a[href^="http"]::after { content: " (" attr(href) ")"; font-size: 8.5pt; color: #555; }
}

/* ---------- 自院の値の差し込み欄 ----------
   未設定のときは記入欄らしく淡く、差し込まれたら本文と同じ濃さにする。
   差し込みは assets/config.js（textContent のみ）で行う。 */
.mt-fill { color: var(--ink-3); }
.mt-fill.is-set {
  color: var(--ink);
  font-weight: 700;
  word-break: break-all;
}
@media print {
  .mt-fill.is-set { font-weight: 700; }
}

/* ---------- 差し込み状態の表示 ----------
   配布URLが効いているか／壊れていないかを、開発者コンソールを開かずに分かるようにする。
   フッタ内に出るため、印刷には出さない。 */
.mt-status {
  margin-top: 10px;
  font-size: 12.5px;
  color: var(--ink-3);
  line-height: 1.7;
}
.mt-status--warn {
  color: var(--warn);
  font-weight: 700;
}
.mt-status__reset {
  font: inherit;
  font-weight: 400;
  color: var(--navy);
  background: none;
  border: 0;
  border-bottom: 1px solid currentColor;
  padding: 0;
  cursor: pointer;
}
.mt-status__reset:hover { color: var(--sky); }
@media print { .mt-status { display: none; } }
