/* ISO統合マネジメントシステム 共通スタイル */
:root {
  --app-font: "Noto Sans JP", "Noto Sans CJK JP", "Hiragino Kaku Gothic ProN", "Yu Gothic UI", "Meiryo", system-ui, sans-serif;
  --c-bg: #f3f5f9;
  --c-surface: #ffffff;
  --c-border: #e3e8ef;
  --c-text: #1f2a37;
  --c-muted: #6b7a8c;
  --c-primary: #1d4ed8;
  --c-primary-soft: #e8efff;
  --c-side: #14213d;
  --c-side-2: #1c2d52;
  --c-side-text: #c7d2e5;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .05), 0 1px 3px rgba(16, 24, 40, .06);
  --sidebar-w: 236px;
  --topbar-h: 56px;
}
html { font-size: 14px; }
body { font-family: var(--app-font); background: var(--c-bg); color: var(--c-text); -webkit-font-smoothing: antialiased; }
a { color: var(--c-primary); }
.text-muted { color: var(--c-muted) !important; }

/* --- 外枠：左のメニュー・上の帯 --- */
.app-sidebar { position: fixed; inset: 0 auto 0 0; width: var(--sidebar-w); background: linear-gradient(180deg, var(--c-side), var(--c-side-2));
  color: var(--c-side-text); overflow-y: auto; z-index: 1030; padding: 14px 10px 24px; }
.brand { display: flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; padding: 6px 8px 18px; }
.brand-mark { width: 36px; height: 36px; border-radius: 10px; background: linear-gradient(135deg, #3b82f6, #22c55e); display: grid; place-items: center; font-size: 1.2rem; }
.brand-text { font-weight: 700; line-height: 1.15; font-size: 1rem; }
.brand-text small { font-weight: 400; font-size: .72rem; opacity: .75; }
.side-group { font-size: .7rem; letter-spacing: .08em; color: #8696b3; margin: 16px 10px 6px; }
.side-link { display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: 8px; color: var(--c-side-text); text-decoration: none; font-size: .92rem; }
.side-link i { font-size: 1.05rem; width: 1.2rem; text-align: center; opacity: .9; }
.side-link:hover { background: rgba(255,255,255,.07); color: #fff; }
.side-link.active { background: rgba(59,130,246,.22); color: #fff; box-shadow: inset 3px 0 0 #60a5fa; }
.side-link.sub { padding-left: 34px; font-size: .86rem; }
.side-link.sub i { font-size: .9rem; }
.side-link.sub2 { padding-left: 54px; font-size: .82rem; position: relative; }
.side-link.sub2::before { content: ""; position: absolute; left: 42px; top: 0; bottom: 0; border-left: 1px dashed rgba(255,255,255,.18); }
.side-link.sub2 i { font-size: .82rem; }
.side-link.disabled { opacity: .45; cursor: default; }
.side-link.disabled small { margin-left: auto; font-size: .65rem; border: 1px solid rgba(255,255,255,.25); border-radius: 999px; padding: 0 6px; }
.app-topbar { position: fixed; top: 0; left: var(--sidebar-w); right: 0; height: var(--topbar-h); background: rgba(255,255,255,.92); backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--c-border); display: flex; align-items: center; gap: 12px; padding: 0 20px; z-index: 1020; }
.topbar-title { margin-right: auto; font-weight: 600; color: var(--c-muted); font-size: .9rem; }
.fy-chip { font-size: .8rem; color: var(--c-muted); background: var(--c-bg); border: 1px solid var(--c-border); border-radius: 999px; padding: 3px 10px; }
.user-chip { display: flex; align-items: center; gap: 8px; color: var(--c-text); text-decoration: none; font-size: .9rem; }
.avatar { width: 30px; height: 30px; border-radius: 50%; background: var(--c-primary); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: .85rem; }
.with-sidebar .app-main { margin-left: var(--sidebar-w); padding: calc(var(--topbar-h) + 18px) 24px 32px; }
.no-sidebar .app-main { padding: 0; }
.app-messages { position: sticky; top: calc(var(--topbar-h) + 8px); z-index: 1010; }
@media (max-width: 991.98px) {
  .app-sidebar { transform: translateX(-100%); transition: transform .2s; }
  body.sidebar-open .app-sidebar { transform: none; box-shadow: 0 0 40px rgba(0,0,0,.3); }
  .app-topbar { left: 0; }
  .with-sidebar .app-main { margin-left: 0; padding: calc(var(--topbar-h) + 14px) 14px 24px; }
}

/* --- ページの見出し --- */
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px; margin-bottom: 16px; }
.page-head h1 { font-size: 1.45rem; font-weight: 700; margin: 0; letter-spacing: .01em; }
.page-head .sub { color: var(--c-muted); font-size: .88rem; margin-top: 2px; }
.page-head .actions { margin-left: auto; display: flex; flex-wrap: wrap; gap: 6px; }

/* --- カード・ボタン --- */
.card { border: 1px solid var(--c-border); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-header { background: #fff; border-bottom: 1px solid var(--c-border); font-weight: 600; }
.btn { border-radius: 8px; font-weight: 500; }
.btn-soft { background: #fff; border: 1px solid var(--c-border); color: var(--c-text); }
.btn-soft:hover { background: var(--c-bg); border-color: #cfd8e3; color: var(--c-text); }
.btn-primary { background: var(--c-primary); border-color: var(--c-primary); }

/* --- 表 --- */
.table-modern { margin: 0; }
.table-modern thead th { background: #f8fafc; color: var(--c-muted); font-weight: 600; font-size: .78rem; letter-spacing: .02em; border-bottom: 1px solid var(--c-border);
  white-space: nowrap; padding: 10px 12px; position: sticky; top: 0; z-index: 1; }
.table-modern td { padding: 10px 12px; vertical-align: middle; border-color: #eef2f6; }
.table-modern tbody tr:hover { background: #f8fbff; }
.nowrap { white-space: nowrap; }
.doc-no { font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace; font-size: .8rem; color: #334155; background: #f1f5f9;
  border: 1px solid #e2e8f0; border-radius: 6px; padding: 2px 7px; white-space: nowrap; }
.doc-title { color: var(--c-text); font-weight: 600; text-decoration: none; }
.doc-title:hover { color: var(--c-primary); text-decoration: underline; }
.ver-pill { display: inline-block; white-space: nowrap; font-size: .78rem; font-weight: 600; color: #1e3a8a; background: var(--c-primary-soft); border-radius: 999px; padding: 2px 9px; }
.chip { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; font-size: .74rem; border-radius: 999px; padding: 2px 9px; border: 1px solid transparent; }
.chip-muted { background: #f1f5f9; color: #475569; border-color: #e2e8f0; }
.chip-info { background: #e0f2fe; color: #075985; }
.chip-warn { background: #fef3c7; color: #92400e; }
.chip-ok { background: #dcfce7; color: #166534; }
.chip-danger { background: #fee2e2; color: #991b1b; }
.chip-dark { background: #1f2937; color: #fff; }

/* --- 分野のタグ --- */
.tag { display: inline-flex; align-items: center; gap: 4px; font-size: .74rem; font-weight: 600; border-radius: 999px; padding: 2px 10px; white-space: nowrap; text-decoration: none; border: 1px solid transparent; }
.tag::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; opacity: .85; }
.tag-E { background: #dcfce7; color: #15803d; }
.tag-H { background: #ffedd5; color: #c2410c; }
.tag-S { background: #dbeafe; color: #1d4ed8; }
.tag-filter .tag { background: #fff; border-color: var(--c-border); color: var(--c-muted); }
.tag-filter .tag.on { border-color: transparent; }
.tag-filter .tag-all.on { background: #1f2937; color: #fff; }
.tag-filter .tag-all::before { display: none; }

/* --- 文書の体系（ツリー） --- */
.doc-tree { position: sticky; top: calc(var(--topbar-h) + 18px); max-height: calc(100vh - var(--topbar-h) - 36px); overflow: auto; }
.doc-tree .card-header { font-size: .85rem; color: var(--c-muted); }
.doc-tree .tree-row { display: flex; align-items: center; gap: 2px; }
.doc-tree .tree-toggle { width: 18px; flex: 0 0 18px; color: #94a3b8; text-decoration: none; text-align: center; font-size: .75rem; }
.doc-tree .tree-node { flex: 1 1 auto; min-width: 0; display: flex; align-items: center; gap: 6px; padding: 4px 8px; border-radius: 6px; color: var(--c-text);
  text-decoration: none; font-size: .86rem; overflow: hidden; white-space: nowrap; }
.doc-tree .tree-node .label { overflow: hidden; text-overflow: ellipsis; }
.doc-tree .tree-node .count { margin-left: auto; font-size: .7rem; color: #64748b; background: #f1f5f9; border-radius: 999px; padding: 0 7px; }
.doc-tree .tree-node:hover { background: #f1f5f9; }
.doc-tree .tree-node.active { background: var(--c-primary-soft); color: #1e3a8a; font-weight: 600; box-shadow: inset 3px 0 0 var(--c-primary); }
.doc-tree .tree-children { margin-left: 14px; border-left: 1px dashed #dbe3ee; padding-left: 4px; }
.doc-tree .tree-doc { font-size: .8rem; color: #334155; padding: 3px 8px; }
.doc-tree .tree-doc .no { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: .72rem; color: #64748b; flex: 0 0 auto; }
.doc-tree .ic-upper { color: #7c3aed; } .doc-tree .ic-lower { color: #0891b2; } .doc-tree .ic-proc { color: #ea580c; }
.doc-tree .ic-reg { color: #16a34a; } .doc-tree .ic-all { color: #1d4ed8; }

/* --- 文書の画面 --- */
.doc-header { background: var(--c-surface); border: 1px solid var(--c-border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px 18px; margin-bottom: 12px; }
.doc-header .crumb { font-size: .8rem; color: var(--c-muted); }
.doc-header .crumb a { color: var(--c-muted); text-decoration: none; }
.doc-header h1 { font-size: 1.35rem; font-weight: 700; margin: 4px 0 6px; }
.doc-header .meta { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: .82rem; color: var(--c-muted); }
.doc-header .meta b { color: var(--c-text); font-weight: 600; }
.info-bar { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 0; }
.info-bar .nav-link { border: 1px solid var(--c-border); background: #fff; color: #334155; border-radius: 999px; padding: 4px 12px; font-size: .82rem; }
.info-bar .nav-link:hover { background: #f8fafc; }
.info-bar .nav-link.active-open { background: #1f2937; color: #fff; border-color: #1f2937; }
.info-bar .nav-link .badge { font-weight: 600; }
.info-panel { margin-top: 10px; }
.doc-sheet { background: #fff; border: 1px solid var(--c-border); border-radius: var(--radius); box-shadow: 0 4px 16px rgba(16,24,40,.06); }
.doc-body { max-width: 940px; margin: 0 auto; padding: 32px 40px 48px; font-size: 15px; line-height: 1.85; color: #1f2937; }
.doc-body p { margin: 0 0 .7em; }
.doc-body h1, .doc-body h2 { font-size: 1.2rem; font-weight: 700; margin: 1.6em 0 .6em; padding-bottom: .3em; border-bottom: 2px solid #e2e8f0; }
.doc-body h3 { font-size: 1.05rem; font-weight: 700; margin: 1.3em 0 .5em; padding-left: .6em; border-left: 4px solid var(--c-primary); }
.doc-body table { border-collapse: collapse; margin: .8em 0 1.2em; font-size: 13.5px; }
.doc-body td, .doc-body th { border: 1px solid #cbd5e1; padding: 6px 10px; vertical-align: top; }
.doc-body tr:first-child td { background: #f8fafc; font-weight: 600; }
.doc-body img { max-width: 100%; }
/* 図表の説明：表の表題は表の上（原本で表の下にあったものは下）、図の説明は図の下 */
.doc-body caption { caption-side: top; text-align: center; font-weight: 700; color: #1f2937; padding: .2em 0 .4em; font-size: 14px; }
.doc-body caption.caption-bottom { caption-side: bottom; padding: .4em 0 .2em; }
.doc-body .caption-note { display: block; font-weight: 400; font-size: 12.5px; color: #475569; }
.doc-body figure.image { display: table; margin: 1em auto 1.4em; }
.doc-body figure.image figcaption { display: table-caption; caption-side: bottom; text-align: center; font-weight: 700; font-size: 14px; padding-top: .4em; }
.doc-sheet-title { font-size: 1.5rem; font-weight: 700; text-align: center; letter-spacing: .08em; margin: 0 0 1.4em; padding-bottom: .6em; border-bottom: 3px double #cbd5e1; }
.doc-body h2.auto { font-size: 1.15rem; }
.doc-body h4 { font-size: .98rem; font-weight: 700; margin: 1em 0 .3em; color: #334155; }
.info-panel .card-body { background: #fcfdff; }
.alert-soft { border: 1px solid var(--c-border); background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); }
.alert-soft.migrated { border-left: 4px solid #0ea5e9; }
.alert-soft.trashed { border-left: 4px solid #dc2626; }
.alert-soft.pending { border-left: 4px solid #f59e0b; }
.alert-soft.ack { border-left: 4px solid var(--c-primary); }

/* --- ホーム --- */
.kpi { display: flex; align-items: center; gap: 14px; padding: 16px 18px; }
.kpi .ic { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; font-size: 1.3rem; }
.kpi .num { font-size: 1.6rem; font-weight: 700; line-height: 1; }
.kpi .lbl { font-size: .8rem; color: var(--c-muted); }
.list-clean .list-group-item { border-color: #eef2f6; padding: 10px 16px; }

/* --- 差分 --- */
.diff table.diff { font-size: 12px; width: 100%; }
.diff .diff_add { background: #d4f8d4; } .diff .diff_chg { background: #fff3b0; } .diff .diff_sub { background: #ffd6d6; }
.diff td { padding: 1px 4px; }

/* --- 旧スタイルの互換 --- */
.badge-scope { font-size: .75rem; }
.muted-cell { color: #adb5bd; }
.sticky-head thead th { position: sticky; top: 0; background: #fff; z-index: 1; }

/* --- サインイン --- */
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 24px;
  background: radial-gradient(1200px 600px at 10% 10%, #1d4ed8 0%, transparent 60%), radial-gradient(900px 500px at 90% 90%, #16a34a 0%, transparent 55%), #0f1b33; }
.login-card { width: 100%; max-width: 420px; border: 0; border-radius: 16px; box-shadow: 0 20px 60px rgba(0,0,0,.35); }
.login-card .brand-mark { display: grid; }

/* --- 文書：ツリーと本体の配置（ツリーは決まった幅、残りを本体に使う） --- */
.doc-layout { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 16px; align-items: start; }
.doc-main { min-width: 0; }
@media (max-width: 1399.98px) { .doc-layout { grid-template-columns: 260px minmax(0, 1fr); } }
@media (max-width: 991.98px) {
  .doc-layout { grid-template-columns: minmax(0, 1fr); }
  .doc-tree { position: static; max-height: 60vh; }
}
@media (min-width: 992px) { .doc-tree.collapse:not(.show) { display: block; } }
/* 一覧：文書名の列は細くしすぎない（狭いときは表を横にスクロール） */
.doc-table { min-width: 680px; }
@media (max-width: 1399.98px) { .doc-table { min-width: 480px; } }
.doc-table .col-title { min-width: 15em; }
.doc-table .col-status { min-width: 7.5em; }
.status-cell { display: flex; flex-wrap: wrap; gap: 4px; }
.tag-sm { font-size: .7rem; padding: 1px 7px; gap: 3px; margin-right: 3px; }
.tag-sm::before { width: 5px; height: 5px; }
/* 複数選択のチェックボックスを並べる */
.check-grid > div, .check-grid:not(:has(> div)) { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 2px 14px; }
.check-grid label { font-weight: 400; display: flex; gap: 6px; align-items: center; }

/* --- 規制事項登録一覧 --- */
.law-card .card-header { background: #f8fafc; }
.article-row { display: grid; grid-template-columns: minmax(180px, 26%) 1fr; border-top: 1px solid var(--c-border); }
.article-row:first-child { border-top: 0; }
.article-head { padding: 12px 14px; background: #fcfdff; border-right: 1px solid var(--c-border); font-size: .88rem; }
.article-no { display: inline-block; font-family: ui-monospace, Menlo, Consolas, monospace; font-size: .78rem; background: #eef2ff; color: #3730a3;
  border-radius: 4px; padding: 1px 6px; margin-right: 6px; }
.article-text { font-size: .78rem; color: #475569; margin-top: 6px; line-height: 1.6; }
.article-reqs { padding: 4px 14px; }
.article-full { font-size: .86rem; background: #f8fafc; border: 1px solid var(--c-border); border-radius: 8px; padding: 10px 12px; margin-bottom: 10px; }
.req-item { padding: 10px 0; border-bottom: 1px dashed #e2e8f0; }
.req-item:last-child { border-bottom: 0; }
.req-abolished { opacity: .55; }
.req-content { font-size: .86rem; color: #1f2937; line-height: 1.7; max-height: 7.2em; overflow: hidden; }
.req-meta { display: flex; flex-wrap: wrap; gap: 4px; margin: 6px 0; }
.req-ops { background: #f0fdf4; border: 1px solid #bbf7d0; border-radius: 8px; padding: 6px 10px; font-size: .82rem; }
.req-ops-empty { background: #fef2f2; border-color: #fecaca; color: #b91c1c; }
.req-ops-title { font-size: .72rem; color: #166534; font-weight: 700; margin-bottom: 2px; }
.req-op { display: flex; gap: 8px; align-items: flex-start; padding: 2px 0; }
.op-kind { flex: 0 0 auto; font-size: .7rem; font-weight: 700; border-radius: 4px; padding: 1px 6px; background: #e2e8f0; color: #334155; white-space: nowrap; }
.op-measurement, .op-inspection { background: #dbeafe; color: #1d4ed8; }
.op-permit, .op-report { background: #fef3c7; color: #92400e; }
.op-qualification, .op-training { background: #ede9fe; color: #6d28d9; }
.op-document, .op-record, .op-display { background: #dcfce7; color: #166534; }
.req-sites { margin-top: 6px; display: flex; flex-wrap: wrap; gap: 3px; }
.site-chip { display: inline-block; font-size: .7rem; font-weight: 600; background: #e2e8f0; color: #1e293b; border-radius: 999px; padding: 1px 8px; }
.formset-table td { min-width: 6em; }
.formset-table textarea { min-width: 18em; }
@media (max-width: 991.98px) { .article-row { grid-template-columns: 1fr; } .article-head { border-right: 0; border-bottom: 1px solid var(--c-border); } }
/* --- 複数選択のフィルタ --- */
.filter-btn { background: #fff; border: 1px solid var(--c-border); color: var(--c-text); max-width: 280px; overflow: hidden; text-overflow: ellipsis; }
.filter-btn.on { border-color: var(--c-primary); background: var(--c-primary-soft); color: #1e3a8a; font-weight: 600; }
.multi-filter .dropdown-menu { min-width: 240px; }
.mf-list { max-height: 320px; overflow: auto; }
.mf-item { display: flex; align-items: center; gap: 8px; padding: 3px 6px; border-radius: 6px; font-size: .84rem; cursor: pointer; margin: 0; }
.mf-item:hover { background: #f1f5f9; }
.mf-item .form-check-input { margin: 0; flex: 0 0 auto; }
.req-site-rows { margin-top: 8px; display: grid; gap: 6px; }
.req-site-row { border: 1px solid #dbeafe; border-left: 4px solid #3b82f6; background: #f8fbff; border-radius: 8px; padding: 6px 10px; font-size: .82rem; }
.req-site-name { font-weight: 700; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-bottom: 2px; }
/* 監視測定のカテゴリ */
.chip.cat-measurement { background: #dbeafe; color: #1d4ed8; }
.chip.cat-inspection { background: #fef3c7; color: #92400e; }
.chip.cat-execution { background: #dcfce7; color: #166534; }
.chip.cat-report { background: #ede9fe; color: #6d28d9; }
/* 順守評価 */
.eval-card .card-header { background: #f8fafc; }
.result-group .btn { flex: 1; font-weight: 700; }
.save-bar { position: sticky; bottom: 0; background: rgba(255,255,255,.95); border-top: 1px solid var(--c-border); padding: 10px 0; margin-top: 8px; z-index: 5; }
.consumption-grid input { min-width: 4.4em; padding: 2px 4px; font-size: .8rem; }
.consumption-grid th, .consumption-grid td { padding-left: 3px; padding-right: 3px; }
/* 左メニュー：折りたたみ */
.side-parent { width: 100%; background: none; border: 0; text-align: left; cursor: pointer; }
.side-parent.in-section { color: #fff; }
.side-parent .caret, .side-caret i { margin-left: auto; font-size: .75rem; opacity: .7; transition: transform .2s; }
.side-parent.collapsed .caret, .side-caret.collapsed i { transform: rotate(-90deg); }
.side-split { display: flex; align-items: center; }
.side-split .side-link { flex: 1; }
.side-caret { background: none; border: 0; color: var(--c-side-text); padding: 6px 10px; border-radius: 6px; }
.side-caret:hover { background: rgba(255,255,255,.07); color: #fff; }

/* 是正処置の流れ・なぜなぜ */
.ca-flow { display: flex; flex-wrap: wrap; gap: 4px; }
.ca-step { font-size: .75rem; padding: 2px 10px; border-radius: 999px; background: #f1f5f9; color: #64748b; }
.ca-step.now { background: var(--c-primary); color: #fff; font-weight: 600; }
.why { padding: 2px 0 2px 8px; border-left: 3px solid #cbd5e1; margin-bottom: 3px; }
.why-no { display: inline-block; min-width: 3.5em; font-weight: 600; color: #475569; }

/* 集計の小さな指標 */
.stat-mini { background: #fff; border: 1px solid var(--c-border); border-radius: var(--radius); padding: 10px 14px; height: 100%; }
.stat-mini .v { font-size: 1.5rem; font-weight: 700; line-height: 1.2; }
.stat-mini .v small { font-size: .8rem; font-weight: 500; margin-left: 2px; color: #64748b; }
.stat-mini .l { font-size: .75rem; color: #64748b; }

/* 内部監査：前回・前々回の判定 */
.past summary { list-style: none; cursor: pointer; display: flex; flex-direction: column; gap: 2px; }
.past summary::-webkit-details-marker { display: none; }
.past-chip { font-size: .72rem; padding: 0 6px; border-radius: 4px; background: #ecfdf5; color: #047857; white-space: nowrap; width: fit-content; }
.past-chip.nc { background: #fee2e2; color: #b91c1c; font-weight: 700; }
.past-chip.none { background: #f1f5f9; color: #94a3b8; }
.past[open] summary { margin-bottom: 4px; }
.past-body { border-left: 3px solid #cbd5e1; padding: 2px 0 2px 6px; margin-bottom: 6px; min-width: 14em; }

/* ウィザード */
.wiz-steps { display: flex; flex-wrap: wrap; gap: 6px; list-style: none; padding: 0; }
.wiz-steps li { display: flex; align-items: center; gap: 6px; padding: 6px 14px 6px 8px; border-radius: 999px; background: #f1f5f9; color: #64748b; font-size: .85rem; }
.wiz-steps li span { display: inline-flex; width: 22px; height: 22px; border-radius: 50%; background: #cbd5e1; color: #fff; align-items: center; justify-content: center; font-size: .75rem; font-weight: 700; }
.wiz-steps li.now { background: var(--c-primary); color: #fff; font-weight: 600; }
.wiz-steps li.now span { background: #fff; color: var(--c-primary); }
.wiz-steps li.done { background: #dcfce7; color: #166534; }
.wiz-steps li.done span { background: #16a34a; }
.choice-card { display: block; border: 1px solid var(--c-border); border-radius: var(--radius); padding: 10px 14px; min-width: 200px; cursor: pointer; background: #fff; }
.choice-card:has(input:checked) { border-color: var(--c-primary); box-shadow: 0 0 0 2px rgba(37, 99, 235, .15); }
.diff-box { border: 1px solid var(--c-border); border-radius: 6px; padding: 8px; background: #fff; font-size: .8rem; max-height: 340px; overflow: auto; }
.diff-del { background: #fee2e2; color: #991b1b; text-decoration: line-through; }
.diff-ins { background: #dcfce7; color: #166534; text-decoration: none; }

/* 組織の状況：SWOT */
.swot td { vertical-align: top; min-width: 180px; }
.swot-item { padding: 4px 0; border-bottom: 1px dashed #e2e8f0; }
.swot-item:last-child { border-bottom: 0; }
.inline-checks { display: flex; gap: 6px; }
.inline-checks > div { display: inline-flex; gap: 2px; }

/* SWOT の板 */
.swot-board { display: grid; grid-template-columns: 6em 1fr 1fr; gap: 8px; }
.swot-axis { text-align: center; font-size: .8rem; color: #64748b; }
.swot-side { display: flex; align-items: center; justify-content: center; writing-mode: vertical-rl; font-size: .85rem; color: #475569; background: #f8fafc; border-radius: 8px; }
.swot-cell { border-radius: 10px; padding: 8px; min-height: 140px; border: 1px solid var(--c-border); }
.swot-S { background: #f0fdf4; } .swot-W { background: #fff7ed; } .swot-O { background: #eff6ff; } .swot-T { background: #fef2f2; }
.swot-title { display: flex; align-items: center; gap: 6px; margin-bottom: 6px; }
.swot-add { margin-left: auto; width: 26px; height: 26px; border-radius: 50%; background: #fff; border: 1px solid var(--c-border); display: inline-flex; align-items: center; justify-content: center; }
.swot-card { display: block; background: #fff; border: 1px solid #e2e8f0; border-radius: 8px; padding: 6px 8px; margin-bottom: 6px; color: inherit; text-decoration: none; font-size: .85rem; }
a.swot-card[href]:hover, a.need-item[href]:hover { border-color: var(--c-primary); box-shadow: 0 1px 4px rgba(37,99,235,.15); }
@media (max-width: 768px) { .swot-board { grid-template-columns: 1fr; } .swot-axis, .swot-side { display: none; } }
/* 利害関係者のカード */
.holder-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 10px; }
.need-item { display: block; border-top: 1px dashed #e2e8f0; padding: 6px 0; color: inherit; text-decoration: none; font-size: .85rem; }
.chip-danger-outline { border: 1px solid #dc2626; color: #dc2626; background: #fff; }
.handling-choices { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.empty-holders { display: flex; flex-wrap: wrap; gap: 6px; }
.empty-holder { border: 1px dashed #cbd5e1; border-radius: 999px; padding: 1px 10px; background: #fff; color: #64748b; }
.empty-holder a { text-decoration: none; }

/* 環境影響評価 */
.env-table .sig-row td:first-child { border-left: 3px solid #dc2626; }
.eval-box { border: 1px solid var(--c-border); border-radius: 8px; padding: 8px 10px; margin-bottom: 8px; }

/* ダイアログ：本文と下のボタンを form で包んでも、本文だけがスクロールしてボタンが枠に収まるようにする */
.modal-dialog-scrollable .modal-content > form { display: flex; flex-direction: column; min-height: 0; overflow: hidden; }
.modal-dialog-scrollable .modal-content > form > .modal-body { overflow-y: auto; }

/* 環境影響評価 ④ 点数 */
.score-axes { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 8px 14px; margin-top: 6px; }
.score-opt { display: flex; gap: 6px; align-items: baseline; font-size: .82rem; line-height: 1.35; margin: 2px 0; }
.score-opt span { color: var(--bs-secondary-color, #6c757d); }
.env-table thead th { white-space: nowrap; }
.threshold-table input { width: 5.5em; display: inline-block; }

/* OHSリスクアセスメント */
.rl { display: inline-block; min-width: 1.7em; padding: 1px 6px; border-radius: 6px; font-weight: 700; text-align: center; text-decoration: none; }
.rl-1 { background: #e8f5e9; color: #2e7d32; }
.rl-2 { background: #e3f2fd; color: #1565c0; }
.rl-3 { background: #fff3cd; color: #8a6100; }
.rl-4 { background: #ffe0cc; color: #b34700; }
.rl-5 { background: #f8d7da; color: #a61b29; }
.ohs-table details.cases summary { cursor: pointer; font-size: .78rem; }
.ohs-table details.cases li { padding: 2px 0; border-bottom: 1px dashed var(--bs-border-color, #e5e7eb); }
.ohs-matrix td, .ohs-matrix th { white-space: nowrap; }
.ohs-table thead th { white-space: nowrap; }
.ohs-table td.hz { min-width: 13em; }
.ohs-table .ctl { padding-left: 6px; border-left: 3px solid #cbd5e1; margin: 1px 0; }
.ohs-table .ctl-elimination, .ohs-table .ctl-substitution { border-left-color: #2e7d32; }
.ohs-table .ctl-engineering { border-left-color: #1565c0; }
.ohs-table .ctl-administrative { border-left-color: #c49000; }
.ohs-table .ctl-ppe { border-left-color: #b34700; }
.nowrap-head th { white-space: nowrap; }

/* ISリスクアセスメント */
.isv { display: inline-block; min-width: 2.2em; padding: 1px 6px; border-radius: 6px; font-weight: 700; text-align: center; text-decoration: none; }
.isv-ok { background: #e8f5e9; color: #2e7d32; }
.isv-over { background: #f8d7da; color: #a61b29; }
.isv-none { background: #eef1f5; color: #6b7280; }
.is-matrix th { font-size: .75rem; min-width: 5.5em; }

/* 目標・実施計画 */
.obj-cell { display: inline-block; min-width: 3.2em; padding: 1px 6px; border-radius: 6px; font-weight: 700; }
.obj-ok { background: #e8f5e9; color: #2e7d32; }
.obj-mid { background: #fff3cd; color: #8a6100; }
.obj-ng { background: #f8d7da; color: #a61b29; }
.obj-none { background: #eef1f5; color: #6b7280; font-weight: 400; }
.obj-grid input { width: 5.2em; text-align: right; padding: 1px 4px; }
.obj-grid td, .obj-grid th { white-space: nowrap; }
