/* マルチテナントの SaaS。style.css・flow.css・cm.css の上に重ねる（接頭辞 tn-） */
.tn-h4 { margin: 0 0 8px; font-size: 14px; display: flex; align-items: center; flex-wrap: wrap; gap: 4px; }
.tn-nl { display: block; margin: 6px 0 0; }
.tn-tips { margin-top: 12px; }
.tn-tnote { margin: 8px 0 0; font-size: 12px; color: var(--muted); }
.tn-n { text-align: right !important; white-space: nowrap; font-variant-numeric: tabular-nums; }
.tn-n small, .tn-tbl th small { display: block; font-size: 11px; font-weight: 500; color: var(--muted); }
.tn-okt { color: #15803d; font-weight: 700; }
.tn-need { white-space: nowrap; }
.tn-ngt { color: #b91c1c; font-weight: 700; }

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

/* 分け方を比べる */
.tn-md { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr); gap: 10px; align-items: start; }
.tn-mdres, .tn-mdcmp, .tn-nzfig, .tn-nzres, .tn-mtcard, .tn-mtres { padding: 12px 14px; min-width: 0; }
.tn-kpis { margin: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
.tn-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; }
.tn-kpi dt { font-size: 11.5px; font-weight: 700; color: var(--muted); }
.tn-kpi dd { margin: 0; font-size: 16px; font-weight: 700; color: var(--ink); font-variant-numeric: tabular-nums; }
.tn-kpi small { font-size: 11.5px; color: var(--ink2); }
.tn-kpi.tn-ok { background: #f0fdf4; border-color: #bbf7d0; }
.tn-kpi.tn-ok dd { color: #14532d; }
.tn-kpi.tn-mid { background: #fffbeb; border-color: #fde68a; }
.tn-kpi.tn-mid dd { color: #78350f; }
.tn-kpi.tn-ng { background: #fef2f2; border-color: #fecaca; }
.tn-kpi.tn-ng dd { color: #7f1d1d; }
.tn-iso { margin: 10px 0 0; font-size: 12.5px; color: var(--ink2); }
.tn-iso b { display: inline-block; font-size: 11px; color: #fff; background: var(--ink2); border-radius: 6px; padding: 0 7px; margin-right: 6px; }
.tn-notes { margin: 8px 0 0; padding-left: 1.2em; font-size: 12.5px; color: var(--ink2); display: grid; gap: 4px; }
.tn-notes b { color: var(--ink); margin-right: 6px; }
.tn-tbl { font-size: 12.5px; }
.tn-tbl th, .tn-tbl td { padding: 6px 8px; }
#tnMdTable { min-width: 680px; }
#tnMdTable tbody th { min-width: 14em; }
.tn-tbl tr.tn-on th, .tn-tbl tr.tn-on td { background: #f0fdf4; }
.tn-tbl tr.tn-total th, .tn-tbl tr.tn-total td { border-top: 2px solid var(--line); font-weight: 700; }
.tn-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; }
.tn-sel:hover { border-color: #94a3b8; background: var(--any-bg); }
.tn-sel[aria-pressed="true"] { border-color: #15803d; background: #dcfce7; }
.tn-det { margin-top: 12px; border-top: 1px dashed var(--line); padding-top: 8px; }
.tn-det summary { cursor: pointer; font-size: 12.5px; font-weight: 700; color: var(--ink2); }
.tn-det summary:hover { color: var(--ink); }
.tn-det .cm-wrap { margin-top: 6px; }
#tnMdSizes { min-width: 600px; }
.tn-assume { margin: 8px 0 0; padding-left: 1.2em; font-size: 12px; color: var(--ink2); display: grid; gap: 3px; }

/* うるさい隣人 */
.tn-nz { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 10px; align-items: start; }
.tn-bars { display: grid; gap: 10px; }
.tn-brow { display: grid; grid-template-columns: 9.5em minmax(0, 1fr); gap: 8px; align-items: center; }
.tn-bname { font-size: 12.5px; font-weight: 700; display: flex; flex-direction: column; min-width: 0; }
.tn-bname small { font-size: 11px; font-weight: 500; color: var(--muted); }
.tn-btrack { position: relative; display: flex; height: 26px; background: var(--line2); border-radius: 6px; overflow: hidden; }
.tn-seg { display: block; height: 100%; }
.tn-s-punch { background: #1d4ed8; }
.tn-s-bg { background: #94a3b8; }
.tn-s-agg { background: #ea580c; }
.tn-capl { position: absolute; top: 0; bottom: 0; width: 0; border-left: 2px dashed #b91c1c; }
.tn-key { margin: 10px 0 0; display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 11.5px; color: var(--muted); }
.tn-key span { display: inline-flex; align-items: center; gap: 5px; }
.tn-sw { display: inline-block; width: 14px; height: 10px; border-radius: 3px; }
.tn-swcap { width: 0; height: 12px; border-radius: 0; border-left: 2px dashed #b91c1c; }
.tn-sum { margin: 10px 0 0; font-size: 13px; font-weight: 700; border-radius: 8px; padding: 7px 10px; }
.tn-sum.tn-ok { background: #f0fdf4; color: #14532d; }
.tn-sum.tn-ng { background: #fef2f2; color: #7f1d1d; }
.tn-fxnotes li { list-style: disc; }

/* 鍵の持ち方 */
.tn-kopts { margin-bottom: 10px; }
.tn-kopt > b { display: flex; align-items: center; gap: 6px; }
.tn-kn { flex: none; width: 20px; height: 20px; border-radius: 6px; background: var(--line2); color: var(--ink2); font: 600 11.5px/20px var(--latin); text-align: center; }
.tn-cases { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.tn-case { background: var(--paper); border: 1px solid var(--line); border-radius: 14px; padding: 11px 13px; min-width: 0; }
.tn-case.tn-ok { border-color: #86efac; background: #f7fef9; }
.tn-case.tn-mid { border-color: #fcd34d; background: #fffdf5; }
.tn-ch { display: flex; align-items: center; gap: 8px; }
.tn-ch b { font-size: 14px; }
.tn-cn { flex: none; width: 24px; height: 24px; border-radius: 50%; background: #15803d; color: #fff; font: 600 12px/24px var(--latin); text-align: center; }
.tn-cask { margin: 6px 0 8px; font-size: 13px; color: var(--ink2); }
.tn-kbtns { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 5px; }
.tn-kbtn { appearance: none; font: inherit; font-size: 12.5px; font-weight: 700; text-align: left; cursor: pointer; display: flex; align-items: center; gap: 6px; color: var(--ink); background: var(--paper); border: 1px solid var(--line); border-radius: 10px; padding: 6px 9px; min-width: 0; }
.tn-kbtn:hover { border-color: #94a3b8; }
.tn-kbtn[aria-pressed="true"] { background: #0f172a; border-color: #0f172a; color: #fff; }
.tn-kbtn[aria-pressed="true"] .tn-kn { background: #15803d; color: #fff; }
.tn-kans { margin-top: 8px; background: var(--line2); border-radius: 10px; padding: 8px 11px; font-size: 12.5px; color: var(--ink2); }
.tn-kans p { margin: 0 0 4px; }
.tn-kah b { color: var(--ink); }
.tn-kno { color: #78350f; }
.tn-kans .srcl { margin: 4px 0 0; }
.tn-kfoot { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin-top: 10px; }
.tn-ksum { font-size: 13px; color: var(--ink2); }

/* 1 社ごとの粗利 */
.tn-mt { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 10px; align-items: start; }
#tnMtTable { min-width: 720px; }
#tnMtTable tbody th { min-width: 11em; }
.tn-tbl tr.tn-loss th, .tn-tbl tr.tn-loss td { background: #fef2f2; color: #7f1d1d; }
.tn-tbl tfoot th, .tn-tbl tfoot td { border-top: 2px solid var(--line); }
.tn-flags { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.tn-flags li { font-size: 13px; border-radius: 8px; padding: 7px 10px; background: var(--line2); color: var(--ink2); }
.tn-flags li.tn-ok { background: #f0fdf4; color: #14532d; }
.tn-flags li.tn-mid { background: #fffbeb; color: #78350f; }
.tn-flags li.tn-ng { background: #fef2f2; color: #7f1d1d; }

/* 残す形 */
.tn-tpls { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; margin-top: 10px; align-items: start; }
.tn-tpl { padding: 12px 14px; min-width: 0; }
.tn-tpl-wide { grid-column: 1 / -1; }
.tn-tplh { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 6px; }
.tn-tplh .tn-h4 { margin: 0; }
.tn-ltbl { min-width: 1100px; }
.tn-ltbl td { white-space: nowrap; }
.tn-ttbl { min-width: 620px; }
.tn-ttbl td:first-child { min-width: 8em; }
.tn-pre { margin: 0; background: #0f172a; color: #e2e8f0; border-radius: 8px; padding: 9px 11px; font: 500 11.5px/1.6 var(--latin); white-space: pre-wrap; overflow-wrap: anywhere; max-height: 460px; overflow-y: auto; }

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

@media (max-width: 1100px) {
  .tn-md, .tn-nz, .tn-mt, .tn-tpls { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 760px) {
  .tn-kpis { grid-template-columns: minmax(0, 1fr); }
  .tn-cases { grid-template-columns: minmax(0, 1fr); }
  .tn-kbtns { grid-template-columns: minmax(0, 1fr); }
  .tn-brow { grid-template-columns: minmax(0, 1fr); gap: 3px; }
  .tn-lab { min-width: 0; width: 100%; }
}
