/* UNDER LAYERS — 設定ページ(settings.html・assets/js/settings.js。docs/ui-design.md §3.14)
   kb.css の .box .band と legal.css の見出しを使う。接頭辞は set- */

.set-main {
	display: grid;
	gap: 18px;
	margin-top: 18px;
}

.set-note {
	margin: 2px 0 6px;
	font-size: var(--fs-xs);
	line-height: 1.6;
}

.set-row {
	display: grid;
	grid-template-columns: minmax(0, 1fr) auto;
	align-items: center;
	gap: 6px 14px;
	padding: 10px 0;
	border-top: 1px dashed var(--line);
}

.set-note + .set-row,
.box-body > .set-row:first-child { border-top: 0; }

.set-name {
	color: var(--fg-hi);
	font-size: var(--fs-m);
}

.set-help,
.set-why {
	margin: 2px 0 0;
	color: var(--sub);
	font-size: var(--fs-xs);
	line-height: 1.55;
}

/* 解放前などで変えられない項目: 理由を琥珀色で出す */
.set-why { color: var(--warn); }
.set-why::before { content: "※ "; }

.set-row.is-locked .set-name,
.set-row.is-off .set-name { color: var(--sub); }

.set-ctl {
	display: flex;
	justify-content: flex-end;
	min-width: 0;
}

/* ON / OFF のスイッチ(ヘッダーにあった音のスイッチと同じ [ ON ] の書き方) */
.set-sw {
	min-width: 76px;
	min-height: 40px;
	padding: 0 8px;
	color: var(--sub);
	background: var(--bg-1);
	border: 1px solid var(--line-hi);
	font: inherit;
	font-size: var(--fs-s);
	white-space: pre;
	cursor: pointer;
}

.set-sw[aria-checked="true"] {
	color: var(--bg);
	background: var(--fg);
	border-color: var(--fg);
}

/* 選ぶもの(普通 / 速い など) */
.set-choice {
	display: inline-flex;
	flex-wrap: wrap;
	justify-content: flex-end;
	gap: 4px;
}

.set-opt {
	min-height: 40px;
	padding: 0 10px;
	color: var(--sub);
	background: var(--bg-1);
	border: 1px solid var(--line);
	font: inherit;
	font-size: var(--fs-s);
	white-space: nowrap;
	cursor: pointer;
}

.set-opt[aria-checked="true"] {
	color: var(--fg-hi);
	background: var(--bg-2);
	border-color: var(--fg);
	box-shadow: inset 0 -2px 0 var(--fg);
}

.set-sw:hover,
.set-opt:hover { border-color: var(--fg); }

.set-sw:focus-visible,
.set-opt:focus-visible,
.set-range:focus-visible {
	outline: 1px dashed var(--fg-hi);
	outline-offset: 2px;
}

.set-sw[aria-disabled="true"],
.set-opt[aria-disabled="true"] {
	opacity: .45;
	cursor: not-allowed;
}

.set-rangewrap {
	display: flex;
	align-items: center;
	gap: 8px;
}

.set-range {
	width: 160px;
	accent-color: var(--fg);
}

.set-range:disabled { opacity: .45; }

.set-num {
	min-width: 3ch;
	color: var(--sub);
	font-size: var(--fs-xs);
	white-space: pre;
}

/* 曲の試聴(サウンドテスト): 曲の一覧 + 鳴らす / 止める */
.set-test {
	display: grid;
	justify-items: end;
	gap: 4px;
	min-width: 0;
}

.set-test-row {
	display: flex;
	flex-wrap: wrap;
	justify-content: flex-end;
	gap: 6px;
	min-width: 0;
}

.set-select {
	max-width: 100%;
	min-width: 0;
	box-sizing: border-box;
	min-height: 40px;
	padding: 0 6px;
	color: var(--fg-hi);
	background: var(--bg-1);
	border: 1px solid var(--line-hi);
	font: inherit;
	font-size: var(--fs-s);
}

.set-select:focus-visible {
	outline: 1px dashed var(--fg-hi);
	outline-offset: 2px;
}

.set-select:disabled,
.set-play[aria-disabled="true"] { opacity: .45; }

.set-test .btn { min-height: 40px; }
.set-now { margin: 0; color: var(--fg); }

/* 狭い画面: 名前と説明の下に操作を置く(選ぶものが3つ以上でも収まるように) */
@media (max-width: 559px) {
	.set-row { grid-template-columns: minmax(0, 1fr); }
	.set-row:has(.set-sw) { grid-template-columns: minmax(0, 1fr) auto; }
	.set-ctl { justify-content: flex-start; }
	.set-row:has(.set-sw) .set-ctl { justify-content: flex-end; }
	.set-choice { justify-content: flex-start; }
	.set-rangewrap { width: 100%; }
	.set-range { flex: 1 1 auto; width: auto; min-width: 0; }
	.set-test { justify-items: start; grid-template-columns: minmax(0, 1fr); width: 100%; min-width: 0; }
	.set-test-row { width: 100%; }
	.set-test-row { justify-content: flex-start; }
	.set-select { flex: 1 1 100%; }
}

/* 近道ボタンの中身(settings.js の fabEditor。2026-11-12 制作者の決定 D): 名前と説明の下に、候補の一覧を全幅で。
   選んだものは上に並び順で(番号・↑・↓)、選んでいないものはその下に。押しやすい高さ 40px */
.set-row[data-id="fabItems"] { grid-template-columns: minmax(0, 1fr); }
.set-row[data-id="fabItems"] .set-ctl { justify-content: stretch; }
.set-fab { display: grid; gap: 6px; width: 100%; max-width: 520px; }
.set-fab-count { margin: 0; }
.set-fab-list {
	display: grid;
	gap: 3px;
	margin: 0;
	padding: 0;
	list-style: none;
}
.set-fab-row {
	display: grid;
	grid-template-columns: 2ch minmax(0, 1fr) auto;
	align-items: center;
	gap: 6px;
	min-height: 40px;
	padding: 0 6px;
	border: 1px solid var(--line);
	background: var(--bg-1);
}
.set-fab-row.is-on { border-color: var(--line-hi); }
.set-fab-row:not(.is-on) { opacity: .75; }
/* 印を付けた/外したときに行の高さが変わらないようにする(押した行の下が上下にずれない。2026-11-22。docs/ui-design.md §3.19):
   行は並びを替えない・選んだ行と残りの間の隙間は付けない・名前と「(8個まで)」は折り返さず、収まらなければ「…」で切る */
.set-fab-n { color: var(--fg-hi); font-size: var(--fs-xs); text-align: right; }
.set-fab-label {
	display: flex;
	align-items: center;
	gap: 6px;
	min-width: 0;
	min-height: 38px;
	overflow: hidden;
	white-space: nowrap;
	cursor: pointer;
}
.set-fab-label > span:not(.pi) { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.set-fab-label > .set-fab-cb, .set-fab-label > .pi { flex: none; }
.set-fab-label .pi { margin: 0; }
.set-fab-cb { width: 18px; height: 18px; margin: 0; accent-color: var(--fg); }
.set-fab-why { font-size: var(--fs-xs); flex: 0 1 auto; }
.set-fab-btns { display: flex; gap: 4px; }
.set-fab-mv { min-width: 40px; min-height: 36px; padding: 0; }
.set-fab-mv:disabled { opacity: .35; }
.set-fab-foot { display: flex; justify-content: flex-start; }
.set-fab-reset { min-height: 40px; }
