/* 大規模なデータ移行。style.css・flow.css・cm.css の上に重ねる（接頭辞 bm-） */
.bm-h4 { margin: 0 0 8px; font-size: 14px; display: flex; align-items: center; flex-wrap: wrap; gap: 4px; }
.bm-h4:focus { outline: none; }
.bm-nl { display: block; margin: 6px 0 0; }
.bm-sm { margin: 8px 0 0; font-size: 12px; color: var(--muted); }
.bm-n { text-align: right !important; white-space: nowrap; font-variant-numeric: tabular-nums; }
.bm-nw { white-space: nowrap; }
.bm-box { padding: 12px 14px; min-width: 0; }
.bm-tips { margin-top: 12px; }
.bm-mt { margin-top: 10px; }
.bm-tbl { font-size: 12.5px; }
.bm-tbl th, .bm-tbl td { padding: 6px 8px; vertical-align: top; }
.bm-tbl tbody th { font-weight: 700; }
.bm-badge { font-style: normal; display: inline-block; font-size: 11px; font-weight: 700; line-height: 1.5; border-radius: 999px; padding: 1px 9px; white-space: nowrap; }
.bm-b-ok { background: #dcfce7; color: #14532d; }
.bm-b-mid { background: #fef3c7; color: #78350f; }
.bm-b-ng { background: #fee2e2; color: #991b1b; }

/* 段階の流れ */
.bm-flow { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.bm-step { background: var(--paper); border: 1px solid var(--line); border-radius: 14px; padding: 11px 13px; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.bm-stephead { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.bm-stephead b { font-size: 14px; }
.bm-sn { flex: none; width: 22px; height: 22px; border-radius: 50%; background: #15803d; color: #fff; font: 600 11.5px/22px var(--latin); text-align: center; }
.bm-when { display: inline-block; font-size: 11px; font-weight: 700; color: #334155; background: var(--line2); border-radius: 6px; padding: 1px 7px; margin-right: 6px; }
.bm-step p { margin: 0; font-size: 12.5px; color: var(--ink2); }
.bm-meta { margin: auto 0 0; display: grid; gap: 4px; }
.bm-meta div { background: var(--any-bg); border: 1px solid var(--line2); border-radius: 8px; padding: 4px 8px; min-width: 0; }
.bm-meta dt { font-size: 10.5px; font-weight: 700; color: var(--muted); }
.bm-meta dd { margin: 0; font-size: 12px; color: var(--ink2); }
.bm-ptbl { min-width: 720px; }
.bm-ptbl tbody th { min-width: 11em; }

/* 道具の操作 */
.bm-ctl { padding: 12px 14px; display: grid; gap: 8px; margin-bottom: 10px; }
.bm-crow { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
.bm-lab { font-size: 12.5px; font-weight: 700; color: var(--muted); min-width: 5.5em; }
.bm-scene { margin: 0; font-size: 13px; color: var(--ink2); background: var(--line2); border-radius: 8px; padding: 7px 11px; }

/* 計算の結果 */
.bm-calc { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); gap: 10px; align-items: start; }
.bm-kpis { margin: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
.bm-kpi { background: var(--any-bg); border: 1px solid var(--line); border-radius: 10px; padding: 7px 10px; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.bm-kpi dt { font-size: 11.5px; font-weight: 700; color: var(--muted); }
.bm-kpi dd { margin: 0; font-size: 16px; font-weight: 700; color: var(--ink); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.bm-kpi small { font-size: 11.5px; color: var(--ink2); }
.bm-kpi.bm-ok { background: #f0fdf4; border-color: #bbf7d0; }
.bm-kpi.bm-ok dd { color: #14532d; }
.bm-kpi.bm-mid { background: #fffbeb; border-color: #fde68a; }
.bm-kpi.bm-mid dd { color: #78350f; }
.bm-kpi.bm-ng { background: #fef2f2; border-color: #fecaca; }
.bm-kpi.bm-ng dd { color: #7f1d1d; }
.bm-verdict { margin: 10px 0 0; border-radius: 10px; padding: 9px 12px; border: 1px solid var(--line); display: flex; flex-direction: column; gap: 3px; }
.bm-verdict b { font-size: 15px; }
.bm-verdict span { font-size: 12.5px; color: var(--ink2); }
.bm-v-ok { background: #f0fdf4; border-color: #bbf7d0; } .bm-v-ok b { color: #14532d; }
.bm-v-mid { background: #fffbeb; border-color: #fde68a; } .bm-v-mid b { color: #78350f; }
.bm-v-ng { background: #fef2f2; border-color: #fecaca; } .bm-v-ng b { color: #991b1b; }
.bm-sugh { margin: 12px 0 6px; }
.bm-sug { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.bm-sug li { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; font-size: 12.5px; color: var(--ink2); background: var(--any-bg); border: 1px solid var(--line2); border-radius: 10px; padding: 6px 10px; }
.bm-sug li span { flex: 1 1 220px; min-width: 0; }
.bm-notes { margin: 10px 0 0; padding-left: 1.2em; display: grid; gap: 3px; font-size: 12px; color: var(--muted); }

/* 枠の中の手順の帯 */
.bm-barwrap { margin: 0 0 10px; }
.bm-bar { position: relative; display: flex; height: 30px; border-radius: 8px; overflow: hidden; background: var(--line2); border: 1px solid var(--line); }
.bm-seg { display: flex; align-items: center; justify-content: center; min-width: 0; height: 100%; overflow: hidden; border-right: 1px solid rgba(255, 255, 255, .7); }
.bm-seg i { font-style: normal; font-size: 11px; font-weight: 700; color: #fff; white-space: nowrap; padding: 0 3px; }
.bm-s-stop { background: #64748b; }
.bm-s-copy { background: #1d4ed8; }
.bm-s-idx { background: #6366f1; }
.bm-s-verify { background: #0f766e; }
.bm-s-margin { background: repeating-linear-gradient(135deg, #f59e0b 0 6px, #fbbf24 6px 12px); }
.bm-s-margin i { color: #451a03; }
.bm-s-decide { background: #0f172a; }
.bm-s-sw { background: #7c3aed; }
.bm-s-back { background: repeating-linear-gradient(135deg, #cbd5e1 0 6px, #e2e8f0 6px 12px); }
.bm-s-back i { color: #334155; }
.bm-over { position: absolute; top: 0; bottom: 0; right: 0; background: rgba(220, 38, 38, .28); border-left: 2px solid #b91c1c; pointer-events: none; }
.bm-mk { position: absolute; top: -1px; bottom: -1px; width: 0; border-left: 2px dashed #0f172a; pointer-events: none; }
.bm-mk-pnr { border-left-color: #b45309; }
.bm-mk-end { border-left: 2px solid #b91c1c; }
.bm-marks { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-top: 6px; font-size: 11.5px; font-weight: 700; }
.bm-mkl-pnr { color: #b45309; }
.bm-mkl-end { color: #b91c1c; }
.bm-mkl-over { color: #991b1b; }
.bm-sw { display: inline-block; width: 12px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.bm-stbl { min-width: 560px; }
.bm-stbl tbody th { white-space: nowrap; }
.bm-stbl tr.bm-trng td, .bm-stbl tr.bm-trng th { background: #fef2f2; }
.bm-ctbl { min-width: 980px; }
.bm-ctbl td:last-child { min-width: 18em; }
.bm-ctbl tr.bm-on th, .bm-ctbl tr.bm-on td { background: #f0fdf4; }
.bm-ctbl tbody th { min-width: 14em; }
.bm-sel { appearance: none; font: inherit; font-size: 12.5px; font-weight: 700; text-align: left; cursor: pointer; color: var(--ink); background: var(--paper); border: 1px solid var(--line); border-radius: 8px; padding: 4px 9px; width: 100%; }
.bm-sel:hover { border-color: #94a3b8; background: var(--any-bg); }
.bm-sel[aria-pressed="true"] { border-color: #15803d; background: #dcfce7; }

/* 照合の練習 */
.bm-legend { list-style: none; margin: 0 0 10px; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.bm-legend li { background: var(--any-bg); border: 1px solid var(--line2); border-radius: 10px; padding: 6px 9px; font-size: 12px; color: var(--ink2); display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.bm-legend b { font-size: 12.5px; color: var(--ink); }
.bm-legend small { font-size: 11px; color: var(--muted); font-weight: 700; }
.bm-quiz { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; align-items: start; }
.bm-qrow { background: var(--paper); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; min-width: 0; display: flex; flex-direction: column; gap: 7px; }
.bm-qrow.bm-qok { border-color: #86efac; background: #f7fef9; }
.bm-qrow.bm-qng { border-color: #fecaca; background: #fffafa; }
.bm-qrow.bm-flash { border-color: #a78bfa; box-shadow: 0 0 0 2px #ede9fe; }
.bm-qtt { display: flex; flex-direction: column; gap: 2px; }
.bm-qtt b { font-size: 14px; }
.bm-qtt span { font-size: 13px; color: var(--ink2); }
.bm-qans { margin: 0; font-size: 12.5px; color: var(--ink2); background: var(--line2); border-radius: 8px; padding: 7px 10px; display: grid; gap: 4px; }
.bm-qans p { margin: 0; }
.bm-qans .srcl { margin: 0; padding: 0; }
.bm-qans .cm-go { margin: 2px 0 0; }
.bm-qfoot { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin-top: 10px; }
.bm-qsum { font-size: 13px; color: var(--ink2); }
.bm-mtbl { min-width: 760px; }
.bm-mtbl tbody th { min-width: 12em; }
.bm-mtbl tr.bm-costrow th, .bm-mtbl tr.bm-costrow td { background: var(--any-bg); font-size: 12px; color: var(--ink2); }

/* 抜き取りの道具 */
.bm-smrow { display: grid; grid-template-columns: minmax(0, 220px) minmax(0, 1fr); gap: 12px; align-items: start; }
.bm-smk dd { font-size: 22px; }
.bm-smtxt p { margin: 8px 0 0; font-size: 13px; color: var(--ink2); }
.bm-smtxt .bm-sm { font-size: 12px; color: var(--muted); }
.bm-meter { height: 12px; border-radius: 999px; background: var(--line2); border: 1px solid var(--line); overflow: hidden; }
.bm-meterfill { display: block; height: 100%; background: #b91c1c; }
.bm-meterfill.bm-mid { background: #d97706; }
.bm-meterfill.bm-ok { background: #15803d; }

/* 戻し方の表 */
.bm-wtbl { min-width: 760px; }
.bm-wtbl tbody th { min-width: 12em; }

/* 残す形 */
.bm-tpls { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; margin-top: 10px; }
.bm-tpl { padding: 12px 14px; min-width: 0; }
.bm-tplh { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 6px; }
.bm-tplh .bm-h4 { margin: 0; }
.bm-tcrow { margin-bottom: 8px; }
.bm-pre { margin: 0; background: #0f172a; color: #e2e8f0; border-radius: 8px; padding: 10px 12px; font: 500 11.5px/1.6 var(--latin); white-space: pre-wrap; overflow-wrap: anywhere; max-height: 520px; overflow-y: auto; }
.bm-ltbl { min-width: 1500px; }
.bm-ltbl th { white-space: nowrap; }
.bm-ltbl td:first-child { font-weight: 700; white-space: nowrap; }
.bm-ltbl td:nth-child(3) { min-width: 26em; }
.bm-ltbl td:nth-child(2), .bm-ltbl td:nth-child(5), .bm-ltbl td:nth-child(6) { min-width: 11em; }
.bm-rtbl { min-width: 1100px; }
.bm-rtbl th { white-space: nowrap; }
.bm-rtbl td:first-child { font-weight: 700; white-space: nowrap; }
.bm-rtbl td:nth-child(2) { min-width: 18em; }

/* AI 時代 */
.bm-ainote { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 12px; }

.bm-sel:focus-visible { outline: 3px solid #2563eb; outline-offset: 2px; }

@media (max-width: 1100px) {
  .bm-flow { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .bm-calc { grid-template-columns: minmax(0, 1fr); }
  .bm-legend { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  .bm-flow, .bm-quiz, .bm-legend, .bm-smrow { grid-template-columns: minmax(0, 1fr); }
  .bm-kpis { grid-template-columns: minmax(0, 1fr); }
  .bm-lab { min-width: 0; width: 100%; }
  .bm-meta div { display: flex; gap: 8px; align-items: baseline; }
  .bm-meta dt { flex: none; width: 8.5em; }
}
