/* ========= 第1章 41節-7 専用（最小・安全版） ========= */

/* スコープ＆トークン */
.page-law-proc, .page-law-proc * { box-sizing: border-box; }
.page-law-proc{
  --container: min(1120px, calc(100% - 32px));
  --page-bg: #f5f7fb;
  --card-bg: #fff;
  --ink: #0b1f3a;
  --accent: #1f2a44;
  --head-bg: #f1f6ff;
  --border: #e5e7eb;
}
body.page-law-proc { background: var(--page-bg); color: var(--ink); }
.page-law-proc .breadcrumbs,
.page-law-proc .main-container { max-width: var(--container); margin-inline: auto; }

/* 見出し（統一） */
.page-law-proc .section-title{
  margin: 18px 0 12px !important;
  font: 700 clamp(22px,2.1vw,28px)/1.25 system-ui,"Noto Sans JP",sans-serif !important;
  color: var(--ink) !important;
  border-left: 5px solid var(--accent) !important;
  padding-left: 12px !important;
  background: transparent !important;
  box-shadow: none !important;
}

/* ===== 頻出ポイント（オレンジ・1列） ===== */
.page-law-proc .exam-notes{
  background: #FFF8E8;
  border: 2px dashed #F1C073;
  border-radius: 12px;
  box-shadow: none;
  padding: 18px 18px 16px;
  margin: 20px 0 18px;
}
.page-law-proc .exam-notes > h3{
  margin: 0 0 12px;
  font-size: clamp(18px,1.9vw,20px);
  font-weight: 700;
  color: #2B2B2B;
  border: 0; padding: 0;
}
.page-law-proc .exam-notes ul.compact{
  list-style: disc;
  margin: 0;
  padding: 0 0 0 1.2em;
}
.page-law-proc .exam-notes ul.compact li{
  margin: 8px 0;
  line-height: 1.7;
}
.page-law-proc .exam-notes ul.compact li::before{ content: none !important; }
@media (max-width: 768px){
  .page-law-proc .exam-notes{ padding: 16px 14px; }
}

.page-law-proc .main-container,
.page-law-proc .site-main,
.page-law-proc .summary-section{
  overflow: visible !important;
}


/* テーブル：フラット＋格子線＋横スクロール */
#plants-rules .table-wrap{
  overflow-x: auto; overflow-y: visible;
  -webkit-overflow-scrolling: touch;
}

/* サブ見出し（h3）— 上の余白を増やす＆下は少し余裕 */
#plants-rules .table-subtitle{
  margin: clamp(22px, 2.6vw, 32px) 0 clamp(10px, 1.4vw, 16px);
  font: 700 clamp(18px,1.8vw,22px)/1.3 system-ui,"Noto Sans JP",sans-serif;
}

/* 直後のテーブルとの距離を軽く確保（重なり防止） */
#plants-rules .table-subtitle + .table-wrap{
  margin-top: 8px;
}

/* スマホはやや控えめに（でも詰まらない） */
@media (max-width: 768px){
  #plants-rules .table-subtitle{
    margin: 20px 0 12px;
  }
  #plants-rules .table-subtitle + .table-wrap{
    margin-top: 6px;
  }
}

#plants-rules .procedures-table{
  width: 100%;
  min-width: 720px;                /* 5〜6列用の基準 */
  table-layout: fixed;
  border-collapse: separate; border-spacing: 0;
  border: 1px solid var(--border); background:#fff;
  font-size: 1rem; line-height: 1.6;
}
#plants-rules .procedures-table th,
#plants-rules .procedures-table td{
  padding: 12px 10px; background:#fff;
  border-right: 1px solid #e2e6ef; border-bottom: 1px solid var(--border);
  vertical-align: top; word-break: break-word; overflow-wrap: anywhere;
  background-clip: padding-box;
}
#plants-rules .procedures-table tr > *:last-child{ border-right: 0; }
#plants-rules thead th{
  position: sticky; top: 0; z-index: 5;
  background: var(--head-bg); border-bottom: 1px solid #cfe0ff; font-weight: 700;
}

/* 区分列（あるテーブルだけ） */
#plants-rules .procedures-table .col-kubun{ width: 8em; }
#plants-rules .cell-item{ font-weight:700; color:#0b2b66; background:#fbfdff; }

/* グループ色（薄い帯） */
#plants-rules .grp-seizo  td{ background:#f9fbff; }
#plants-rules .grp-chozo > tr:nth-child(odd)  > *{ background:#fffaf3; }
#plants-rules .grp-chozo > tr:nth-child(even) > *{ background:#fffcf7; }
#plants-rules .grp-tori  > tr:nth-child(odd)  > *{ background:#f7fcf8; }
#plants-rules .grp-tori  > tr:nth-child(even) > *{ background:#fbfefb; }

/* モバイル：少しだけコンパクトに */
@media (max-width: 768px){
  #plants-rules .procedures-table{ min-width: 680px; font-size: .95rem; }
  #plants-rules .procedures-table th,
  #plants-rules .procedures-table td{ padding: 10px 8px; }
  #plants-rules .procedures-table .col-kubun{ width: 6.6em; }
}

/* --- 区分列：幅を少し絞る（PC） --- */
#plants-rules .procedures-table .col-kubun{
  width: 6.2em;              /* ← 8em → 6.2em に */
}

/* --- 区分列を“左固定”にする（見出し＋本文） --- */
#plants-rules .procedures-table thead th.col-kubun{
  position: sticky;
  top: 0;                    /* 横ヘッダとして上固定 */
  left: 0;                   /* ＋ 左固定 */
  z-index: 8;                /* 交点で最前面に */
  background: var(--head-bg);
  box-shadow: none;  /* 右側との境目を白帯で自然に */
}
#plants-rules .procedures-table tbody th.cell-item{
  position: sticky;
  left: 0;                   /* ← 行ラベルを左固定 */
  z-index: 7;                /* 見出しより一段下 */
  background: #fbfdff;       /* 行ラベルの薄色は維持 */
  box-shadow: none;  /* 潜り込み防止の白帯 */
  background-clip: padding-box;
}

/* --- 交点の積み重ねを安定化（他ヘッダより上に） --- */
#plants-rules thead th{ z-index: 5; }        /* デフォルトの横ヘッダ */
#plants-rules .procedures-table thead th.col-kubun{ z-index: 8; }
#plants-rules .procedures-table tbody th.cell-item{ z-index: 7; }

/* --- モバイルはさらにタイトに --- */
@media (max-width: 768px){
  #plants-rules .procedures-table .col-kubun{ width: 5.4em; } /* 6.6em → 5.4em */
  /* 余白は既存指定（10px 8px）でOK。固定は上のルールが効く */
}

#plants-rules .procedures-table thead th.col-kubun{
  top: 0;
  background: var(--head-bg);
}
#plants-rules .procedures-table thead th.col-kubun,
#plants-rules .procedures-table tbody th.cell-item{
  position: sticky;
}
#plants-rules .procedures-table thead th.col-kubun,
#plants-rules .procedures-table tbody th.cell-item{
  position: sticky;
}

/* 擬似要素の仕切り線（右端に1px） */
#plants-rules .procedures-table thead th.col-kubun,
#plants-rules .procedures-table tbody th.cell-item{
  position: sticky;
}
#plants-rules .procedures-table thead th.col-kubun::after,
#plants-rules .procedures-table tbody th.cell-item::after{
  content: "";
  position: absolute;
  top: 0; right: -1px; bottom: 0;
  width: 1px;
  background: var(--border);  /* 既存の罫線色と合わせる */
  pointer-events: none;
}

/* ▼ 区分の幅をもう一段タイトに */
#plants-rules .procedures-table .col-kubun{ width: 5.6em; }
@media (max-width: 768px){
  #plants-rules .procedures-table .col-kubun{ width: 5.0em; }
}

/* ▼ 記号列（◎/○/–）を中央寄せ。区分だけは左（or中央）のまま */
#plants-rules .procedures-table td{ text-align: center; }
#plants-rules .procedures-table .cell-item{ text-align: center; } /* 今の見た目どおり中央 */

/* 注釈カード */
.notes-panel{
  margin: 14px 0 24px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-left: 5px solid var(--accent);
  border-radius: 10px;
  padding: 14px 16px 12px;
}
.notes-title{
  margin: 0 0 8px;
  font: 700 clamp(16px,1.7vw,18px)/1.35 system-ui,"Noto Sans JP",sans-serif;
  color: var(--ink);
}

/* ここを置き換え（重なり修正） */
.notes-list{
  margin: 0; padding: 0;            /* ← 左インデントは li 側で確保 */
  list-style: none; counter-reset: jpnotes;
}

/* 各行に余白を作る＆相対位置の基点に */
.notes-list > li{
  position: relative;
  padding-left: 2.2em;              /* ★ 番号ぶんのスペースを確保 */
  margin: 8px 0;
  line-height: 1.7;
  color: var(--ink);
}

/* 番号バッジ（※1, ※2...） */
.notes-list > li::before{
  counter-increment: jpnotes;
  content: "※" counter(jpnotes);
  position: absolute;
  left: 0; top: 0;                  /* ★ 本文に被らない固定位置 */
  color: var(--hint);
  font-weight: 700;
}

/* 本文へ戻る矢印の見た目はそのまま */
.notes-panel .backref{
  margin-left: .4em; text-decoration: none; color: var(--hint);
  font-size: .9em;
}
.notes-panel .backref:hover{ text-decoration: underline; }

/* （お好みで）モバイルは少し詰める */
@media (max-width: 768px){
  .notes-list > li{ padding-left: 2em; margin: 6px 0; }
}


