/* Nettoge Mod Compat — 記事の MOD 一覧で「入れた MOD」を選んで、ぶつかる MOD に印を出す（相性チェック）。
 * 色・線・角はデザイン v2 のトークン（tokens-nettoge.css の --ntg2-*）を使う。ダークはサイトの html[data-nettoge-theme="dark"] に合わせて
 * 段階の色だけ下で差し替える。フォールバックはトークンが無い環境（手元のプレビュー）用。!important は使わない */

.ntg-mc,
.ntg-mc-upd,
.ntg-mc-tools,
.ntg-mc-dr,
.ntg-mc-float {
	--mc-surface: var(--ntg2-surface, #fff);
	--mc-paper: var(--ntg2-paper-2, #f6f4f1);
	--mc-text: var(--ntg2-text, #2a2622);
	--mc-sub: var(--ntg2-sub, #5f5953);
	--mc-muted: var(--ntg2-muted, #8a847d);
	--mc-line: var(--ntg2-line, #e3e0dc);
	--mc-accent: var(--ntg2-teal, #2f7a72);
	--mc-accent-bg: var(--ntg2-teal-bg, #e8f2f0);
	--mc-radius: var(--ntg2-radius, 6px);
	--mc-radius-sm: var(--ntg2-radius-sm, 4px);
	/* 段階の色（字・地・線） */
	--mc-x: #b91c1c;
	--mc-x-bg: #fdeceb;
	--mc-w: #9a5a00;
	--mc-w-bg: #fdf1dc;
	--mc-v: #35598f;
	--mc-v-bg: #e9eff8;
	--mc-l: var(--mc-sub);
	--mc-l-bg: var(--mc-paper);
	--mc-ok: var(--mc-accent);
}

html[data-nettoge-theme="dark"] .ntg-mc,
html[data-nettoge-theme="dark"] .ntg-mc-tools,
html[data-nettoge-theme="dark"] .ntg-mc-dr,
html[data-nettoge-theme="dark"] .ntg-mc-float {
	--mc-x: #f87171;
	--mc-x-bg: #3a2828;
	--mc-w: #f0b35a;
	--mc-w-bg: #3a3122;
	--mc-v: #8fb3ea;
	--mc-v-bg: #26303f;
}

.ntg-mc-lv-x { --lv: var(--mc-x); --lv-bg: var(--mc-x-bg); }
.ntg-mc-lv-w { --lv: var(--mc-w); --lv-bg: var(--mc-w-bg); }
.ntg-mc-lv-v { --lv: var(--mc-v); --lv-bg: var(--mc-v-bg); }
.ntg-mc-lv-l { --lv: var(--mc-l); --lv-bg: var(--mc-l-bg); }
.ntg-mc-lv-ok { --lv: var(--mc-ok); --lv-bg: var(--mc-accent-bg); }

/* ---------- パネル ---------- */
.ntg-mc {
	background: var(--mc-surface);
	border: 1px solid var(--mc-line);
	border-radius: var(--mc-radius);
	border-top: 3px solid var(--mc-accent);
	color: var(--mc-text);
	margin: 1.4em 0 1.8em;
	padding: 1em 1.1em 1.1em;
	scroll-margin-top: 90px;
}

.ntg-mc__head { align-items: baseline; display: flex; flex-wrap: wrap; gap: .2em .8em; margin-bottom: .35em; }
.ntg-mc__title { font-size: 1.12em; font-weight: 700; letter-spacing: .02em; }
.ntg-mc__sub { color: var(--mc-sub); font-size: .86em; }
#body_wrap .ntg-mc .ntg-mc__lead { color: var(--mc-sub); font-size: .9em; margin: 0 0 .8em; }
/* JS が動いたら案内文は見出しの言い換えなので畳む（JS が無いときだけ読ませる） */
.ntg-mc.is-ready .ntg-mc__lead { display: none; }

.ntg-mc__stats { display: grid; gap: .5em; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.ntg-mc-stat {
	background: var(--mc-paper);
	border-radius: var(--mc-radius-sm);
	display: flex;
	flex-direction: column;
	padding: .55em .7em .5em;
}
.ntg-mc-stat__n { color: var(--lv, var(--mc-text)); font-size: 1.5em; font-variant-numeric: tabular-nums; font-weight: 700; line-height: 1.1; }
.ntg-mc-stat__l { color: var(--mc-sub); font-size: .78em; margin-top: .15em; }
.ntg-mc-stat.is-in .ntg-mc-stat__n { color: var(--mc-accent); }
.ntg-mc-stat[class*="ntg-mc-lv-"]:not(.is-zero) { background: var(--lv-bg); }
.ntg-mc-stat.is-zero .ntg-mc-stat__n { color: var(--mc-muted); }

.ntg-mc__tools { align-items: center; display: flex; flex-wrap: wrap; gap: .5em 1em; justify-content: space-between; margin: .8em 0 0; }

/* スイッチ（軽微・版しだいも表示） */
.ntg-mc-switch { align-items: center; color: var(--mc-sub); cursor: pointer; display: inline-flex; font-size: .86em; gap: .5em; position: relative; }
.ntg-mc-switch input { height: 1px; opacity: 0; position: absolute; width: 1px; }
.ntg-mc-switch__ui {
	background: var(--mc-line);
	border-radius: 999px;
	flex: none;
	height: 20px;
	position: relative;
	transition: background .15s;
	width: 36px;
}
.ntg-mc-switch__ui::after {
	background: var(--mc-surface);
	border-radius: 50%;
	box-shadow: 0 1px 2px rgba(0, 0, 0, .25);
	content: "";
	height: 16px;
	left: 2px;
	position: absolute;
	top: 2px;
	transition: transform .15s;
	width: 16px;
}
.ntg-mc-switch input:checked + .ntg-mc-switch__ui { background: var(--mc-accent); }
.ntg-mc-switch input:checked + .ntg-mc-switch__ui::after { transform: translateX(16px); }
.ntg-mc-switch input:focus-visible + .ntg-mc-switch__ui { outline: 2px solid var(--mc-accent); outline-offset: 2px; }

.ntg-mc .ntg-mc-btn {
	background: none;
	border: 1px solid var(--mc-line);
	border-radius: var(--mc-radius-sm);
	color: var(--mc-sub);
	cursor: pointer;
	font: inherit;
	font-size: .82em;
	padding: .3em .8em;
}
.ntg-mc .ntg-mc-btn:hover { border-color: var(--mc-x); color: var(--mc-x); }
.ntg-mc .ntg-mc-btn[hidden] { display: none; }

/* 選んだ MOD の札 */
.ntg-mc__chips { display: flex; flex-wrap: wrap; gap: .35em; margin-top: .7em; }
.ntg-mc__chips:empty { display: none; }
.ntg-mc-chip {
	align-items: center;
	background: var(--mc-accent-bg);
	border-radius: 999px;
	display: inline-flex;
	font-size: .8em;
	max-width: 100%;
}
.ntg-mc-chip .ntg-mc-jump { color: var(--mc-accent); font-weight: 400; overflow: hidden; padding: .22em .1em .22em .8em; text-decoration: none; text-overflow: ellipsis; white-space: nowrap; }
.ntg-mc-chip .ntg-mc-jump:hover { text-decoration: underline; }
.ntg-mc-chip__x {
	background: none;
	border: 0;
	border-radius: 50%;
	color: var(--mc-accent);
	cursor: pointer;
	font: inherit;
	font-size: 1.05em;
	line-height: 1;
	margin-right: .2em;
	padding: .2em .45em;
}
.ntg-mc-chip__x:hover { background: var(--mc-surface); }

#body_wrap .ntg-mc .ntg-mc__summary { font-size: .92em; margin: .8em 0 .5em; }

/* 衝突の組 */
.ntg-mc__list { display: grid; gap: .4em; }
.ntg-mc-pair { background: var(--mc-paper); border-left: 3px solid var(--lv); border-radius: var(--mc-radius-sm); }
.ntg-mc-pair > summary {
	align-items: center;
	cursor: pointer;
	display: flex;
	gap: .6em;
	list-style: none;
	padding: .55em .8em;
}
.ntg-mc-pair > summary::-webkit-details-marker { display: none; }
.ntg-mc-pair > summary::after {
	border-bottom: 2px solid var(--mc-muted);
	border-right: 2px solid var(--mc-muted);
	content: "";
	flex: none;
	height: 7px;
	margin-left: auto;
	transform: rotate(45deg) translate(-2px, -2px);
	transition: transform .15s;
	width: 7px;
}
.ntg-mc-pair[open] > summary::after { transform: rotate(-135deg) translate(-2px, -2px); }
.ntg-mc-pair__names { font-size: .92em; font-weight: 700; min-width: 0; overflow-wrap: anywhere; }
.ntg-mc-pair__body { padding: 0 .9em .7em; }
.ntg-mc-pair__go { align-items: center; color: var(--mc-muted); display: flex; flex-wrap: wrap; font-size: .82em; gap: .3em .6em; margin-top: .4em; }

#body_wrap .ntg-mc .ntg-mc__note { border-top: 1px dashed var(--mc-line); color: var(--mc-muted); font-size: .8em; line-height: 1.7; margin: 1em 0 0; padding-top: .7em; }

/* ---------- 共通の小さな部品 ---------- */
.ntg-mc-tag {
	background: var(--lv-bg);
	border-radius: 3px;
	color: var(--lv);
	display: inline-block;
	flex: none;
	font-size: .76em;
	font-weight: 700;
	letter-spacing: .02em;
	line-height: 1.5;
	padding: 0 .55em;
	white-space: nowrap;
}

.ntg-mc-jump {
	background: none;
	border: 0;
	color: var(--mc-accent);
	cursor: pointer;
	font: inherit;
	font-weight: 700;
	padding: 0;
	text-align: left;
	text-decoration: underline;
	text-decoration-color: color-mix(in srgb, currentColor 35%, transparent);
	text-underline-offset: .2em;
}
.ntg-mc-jump:hover { text-decoration-color: currentColor; }
.ntg-mc-jump:disabled { color: var(--mc-text); cursor: default; text-decoration: none; }

#body_wrap .ntg-mc-why { font-size: .86em; line-height: 1.7; list-style: none; margin: .35em 0 0; padding: 0; }
#body_wrap .ntg-mc-why > li { margin: .2em 0; padding-left: 1em; position: relative; }
#body_wrap .ntg-mc-why > li::before { background: var(--mc-muted); border-radius: 50%; content: ""; height: 4px; left: .2em; position: absolute; top: .78em; width: 4px; }
.ntg-mc-ex { color: var(--mc-muted); display: block; font-size: .92em; }
.ntg-mc-ex code {
	background: var(--mc-surface);
	border: 1px solid var(--mc-line);
	border-radius: 3px;
	color: var(--mc-sub);
	font-size: .92em;
	margin-left: .35em;
	overflow-wrap: anywhere;
	padding: 0 .35em;
}

/* ---------- 一覧の行（ETB の 1 列目） ---------- */
tr.etb-row { scroll-margin-top: 90px; }

.ntg-mc-tools { align-items: center; display: flex; flex-wrap: wrap; gap: .4em; margin-top: .55em; }

.ntg-mc-check {
	align-items: center;
	background: var(--mc-surface);
	border: 1px solid var(--mc-line);
	border-radius: 999px;
	color: var(--mc-sub);
	cursor: pointer;
	display: inline-flex;
	font: inherit;
	font-size: .8em;
	font-weight: 700;
	gap: .4em;
	line-height: 1.2;
	padding: .3em .75em .3em .45em;
	white-space: nowrap;
}
.ntg-mc-check::before {
	border: 1.5px solid var(--mc-muted);
	border-radius: 3px;
	box-sizing: border-box;
	content: "";
	flex: none;
	height: 14px;
	width: 14px;
}
.ntg-mc-check:hover { border-color: var(--mc-accent); color: var(--mc-accent); }
.ntg-mc-check[aria-pressed="true"] { background: var(--mc-accent); border-color: var(--mc-accent); color: #fff; }
.ntg-mc-check[aria-pressed="true"]::before {
	background: #fff;
	border-color: #fff;
	/* チェックの印（SVG を背景に描く。外部の読み込みは無い） */
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 14 14'%3E%3Cpath d='M3 7.2l2.6 2.6L11 4.4' fill='none' stroke='%232f7a72' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
	background-position: center;
	background-size: 12px;
}
html[data-nettoge-theme="dark"] .ntg-mc-check[aria-pressed="true"] { color: #10201e; }

.ntg-mc-badge {
	align-items: center;
	background: var(--lv-bg);
	border: 0;
	border-radius: 999px;
	color: var(--lv);
	cursor: pointer;
	display: inline-flex;
	font: inherit;
	font-size: .78em;
	font-weight: 700;
	gap: .35em;
	line-height: 1.2;
	padding: .35em .7em;
	white-space: nowrap;
}
.ntg-mc-badge::before { background: currentColor; border-radius: 50%; content: ""; height: 7px; width: 7px; }
.ntg-mc-badge::after {
	border-bottom: 1.5px solid currentColor;
	border-right: 1.5px solid currentColor;
	content: "";
	height: 5px;
	margin-left: .1em;
	transform: rotate(45deg) translateY(-2px);
	transition: transform .15s;
	width: 5px;
}
.ntg-mc-badge[aria-expanded="true"]::after { transform: rotate(-135deg) translate(-1px, -1px); }
.ntg-mc-badge[hidden] { display: none; }

.ntg-mc-none { color: var(--mc-muted); font-size: .74em; }

/* 選んだ行は 1 列目の左端に差し色の線 */
tr.ntg-mc-on > td.etb-first-cell { box-shadow: inset 3px 0 0 var(--ntg2-teal, #2f7a72); }
tr.ntg-mc-flash > td { animation: ntg-mc-flash 1.8s ease-out; }
@keyframes ntg-mc-flash {
	0%, 30% { background-color: var(--ntg2-teal-bg, #e8f2f0); }
	100% { background-color: transparent; }
}

/* 行の下の詳細（全幅）。ETB のスマホ表示は tbody > tr を display:block にし、560〜781px では tbody を 2 列の格子にする。
   閉じた詳細行がその指定に負けて格子の枠を取り、札が半分の幅に押し込まれた（2026-09-30 依頼主「壊れてる」）ので、ETB と同じ強さで消す。
   開いたときは格子の幅いっぱい（ETB の詳細行と同じ grid-column） */
tr.ntg-mc-dr[hidden],
.etb-wrapper .etb-table > tbody > tr.ntg-mc-dr[hidden] { display: none; }
.etb-wrapper .etb-table > tbody > tr.ntg-mc-dr { grid-column: 1 / -1; }
tr.ntg-mc-dr > td { background: var(--mc-paper); padding: .7em 1em .8em; }
#body_wrap .ntg-mc-detail__head { color: var(--mc-muted); font-size: .8em; margin: 0 0 .4em; }
.ntg-mc-item { background: var(--mc-surface); border-left: 3px solid var(--lv); border-radius: var(--mc-radius-sm); padding: .55em .8em .6em; }
.ntg-mc-item + .ntg-mc-item { margin-top: .45em; }
.ntg-mc-item__head { align-items: center; display: flex; flex-wrap: wrap; gap: .5em; }
.ntg-mc-item__head .ntg-mc-jump { font-size: .92em; }

/* ETB のスマホ表示（行が札になる）では詳細行も札の幅いっぱいに */
@media (max-width: 767px) {
	.ntg-mc { padding: .9em .85em 1em; }
	.ntg-mc__stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	tr.ntg-mc-dr,
	tr.ntg-mc-dr > td { display: block; width: auto; }
	tr.ntg-mc-dr > td { padding: .6em .7em .7em; }
}

/* ---------- 画面下の集計バー ---------- */
.ntg-mc-float {
	align-items: center;
	background: var(--mc-surface);
	border: 1px solid var(--mc-line);
	border-radius: 999px;
	bottom: 14px;
	box-shadow: 0 6px 20px rgba(0, 0, 0, .18);
	color: var(--mc-text);
	cursor: pointer;
	display: flex;
	font: inherit;
	font-size: .84em;
	gap: .55em;
	left: 50%;
	max-width: calc(100vw - 24px);
	padding: .5em .6em .5em 1em;
	position: fixed;
	transform: translateX(-50%);
	white-space: nowrap;
	z-index: 90;
}
.ntg-mc-float[hidden] { display: none; }
/* テーマの画面の下の固定の操作（#ntg-fixdock。frontend.js が入れる）の中では、ページトップと 1 列に並ぶ。位置はドックが持つ（2026-10-07） */
.ntg-fixdock .ntg-mc-float { max-width: 100%; position: static; transform: none; }
.ntg-mc-float__in { font-weight: 700; }
.ntg-mc-float__n { background: var(--lv-bg); border-radius: 999px; color: var(--lv); font-weight: 700; padding: .1em .6em; }
.ntg-mc-float__go { background: var(--mc-accent); border-radius: 999px; color: #fff; font-weight: 700; padding: .25em .8em; }
html[data-nettoge-theme="dark"] .ntg-mc-float__go { color: #10201e; }

@media (prefers-reduced-motion: reduce) {
	.ntg-mc-switch__ui, .ntg-mc-switch__ui::after, .ntg-mc-badge::after, .ntg-mc-pair > summary::after { transition: none; }
	tr.ntg-mc-flash > td { animation: none; }
}

/* 記事の冒頭の「相性データの更新」日時（本文の wp:html。日時と組の数は frontend.js がデータから入れ直す） */
#body_wrap .ntg-mc-upd { align-items: center; background: var(--mc-accent-bg); border-left: 4px solid var(--mc-accent); border-radius: var(--mc-radius-sm); color: var(--mc-text); display: flex; flex-wrap: wrap; gap: .2em .8em; margin: 0 0 1.6em; padding: .6em 1em; }
#body_wrap .ntg-mc-upd__label { color: var(--mc-accent); font-size: .85em; font-weight: 700; }
#body_wrap .ntg-mc-upd__time { font-size: 1.15em; font-variant-numeric: tabular-nums; font-weight: 700; }
#body_wrap .ntg-mc-upd__sub { color: var(--mc-sub); font-size: .8em; }
