.ws-chord {
	--wc-board: #4a2e1f;
	--wc-board-edge: #2c1a11;
	--wc-fret: #cfd2d6;
	--wc-string: #e9dfc9;
	--wc-inlay: rgba(255, 255, 255, .22);
	--wc-finger-line: #fff3e2;
	--wc-finger-halo: rgba(25, 14, 8, .72);
	--wc-finger-fill: rgba(112, 76, 54, .94);
	--wc-root: #d9363e;
	--wc-guide: #1f6fd1;
	--wc-tension: #16874f;
	--wc-fifth: #66707c;
	--wc-accent: #b5541c;
	container-type: inline-size;
	line-height: 1.5;
}

[data-bs-theme="dark"] .ws-chord {
	--wc-accent: #e07f42;
}

.ws-chord *,
.ws-chord *::before {
	box-sizing: border-box;
}

.wc-layout {
	display: grid;
	gap: 16px;
}

.wc-viewer {
	background-color: var(--bs-body-bg);
	padding-bottom: 8px;
	z-index: 2;
}

.wc-title {
	align-items: baseline;
	display: flex;
	flex-wrap: wrap;
	gap: .1em .6em;
	margin-bottom: 4px;
}

.wc-title b {
	font-size: 1.75rem;
	line-height: 1.2;
}

.wc-title > span {
	color: var(--bs-secondary-color);
	font-size: .875rem;
}

.wc-acc {
	font-family: "Segoe UI Symbol", "Apple Symbols", "Noto Sans Symbols 2", sans-serif;
	font-size: .9em;
}

.wc-diagram svg {
	display: block;
	height: auto;
	margin: 0 auto;
	max-height: min(68vh, 560px);
	max-width: 100%;
	width: 100%;
}

.wc-diagram text {
	font-family: system-ui, sans-serif;
	text-anchor: middle;
	dominant-baseline: central;
	user-select: none;
}

.wc-margin-text {
	fill: var(--bs-secondary-color);
	font-size: 11px;
}

.wc-mute {
	fill: var(--bs-body-color);
	font-size: 13px;
	font-weight: 700;
}

.wc-dot-label {
	fill: #fff;
	font-size: 10.5px;
	font-weight: 700;
}

.wc-finger-halo {
	fill: none;
	stroke: var(--wc-finger-halo);
	stroke-linecap: round;
	stroke-linejoin: round;
	stroke-width: 3.4;
}

.wc-finger-line {
	fill: none;
	stroke: var(--wc-finger-line);
	stroke-linecap: round;
	stroke-linejoin: round;
	stroke-width: 1.5;
}

.wc-finger-fill {
	fill: var(--wc-finger-fill);
}

.wc-finger-outer {
	fill: var(--bs-body-bg);
}

/* 操作部 */
.wc-tools {
	align-items: center;
	display: flex;
	flex-wrap: wrap;
	gap: 6px 12px;
	margin-top: 8px;
}

.wc-group {
	display: inline-flex;
	gap: 4px;
}

.wc-btn {
	background-color: transparent;
	border: 1px solid var(--bs-border-color);
	border-radius: 6px;
	color: inherit;
	cursor: pointer;
	font-size: .875rem;
	line-height: 1.2;
	min-height: 36px;
	min-width: 36px;
	padding: 4px 10px;
	transition: background-color .12s, border-color .12s;
}

.wc-btn:hover {
	border-color: var(--wc-accent);
}

.wc-btn:focus-visible {
	outline: 2px solid var(--wc-accent);
	outline-offset: 1px;
}

.wc-btn[aria-pressed="true"] {
	background-color: var(--wc-accent);
	border-color: var(--wc-accent);
	color: #fff;
}

.wc-legend {
	display: flex;
	flex-wrap: wrap;
	font-size: .75rem;
	gap: 2px 10px;
	margin-top: 8px;
}

.wc-legend i {
	border-radius: 50%;
	display: inline-block;
	height: .75em;
	margin-right: .3em;
	width: .75em;
}

/* 選択部 */
.wc-row {
	align-items: start;
	display: grid;
	gap: 6px;
	grid-template-columns: 3.75rem minmax(0, 1fr);
	margin-top: 10px;
}

.wc-heading {
	color: var(--bs-secondary-color);
	font-size: .75rem;
	font-weight: 700;
	line-height: 36px;
	white-space: nowrap;
}

.wc-keys {
	display: grid;
	gap: 4px;
	grid-template-columns: repeat(6, 1fr);
}

.wc-keys .wc-btn {
	font-weight: 700;
	min-width: 0;
	padding-left: 0;
	padding-right: 0;
}

.wc-types {
	display: flex;
	flex-wrap: wrap;
	gap: 4px;
}

.wc-forms {
	display: grid;
	gap: 6px;
	grid-template-columns: repeat(auto-fill, minmax(132px, 1fr));
}

/* トライアドは弦の組×転回形の表として並べる */
.wc-forms.is-triad {
	grid-template-columns: repeat(3, minmax(0, 168px));
}

.wc-forms.is-triad .wc-form {
	font-size: .6875rem;
	line-height: 1.25;
}

.wc-form {
	background-color: transparent;
	border: 1px solid var(--bs-border-color);
	border-radius: 6px;
	color: inherit;
	cursor: pointer;
	font-size: .75rem;
	padding: 4px 4px 2px;
}

.wc-form:hover {
	border-color: var(--wc-accent);
}

.wc-form:focus-visible {
	outline: 2px solid var(--wc-accent);
	outline-offset: 1px;
}

.wc-form[aria-pressed="true"] {
	border-color: var(--wc-accent);
	box-shadow: inset 0 0 0 1px var(--wc-accent);
}

.wc-form svg {
	display: block;
	width: 100%;
}

.wc-table {
	border-collapse: collapse;
	font-size: .8125rem;
	width: 100%;
}

.wc-table th,
.wc-table td {
	border-bottom: 1px solid var(--bs-border-color);
	padding: 3px 6px;
	text-align: left;
}

.wc-table th {
	color: var(--bs-secondary-color);
	font-weight: 500;
}

.wc-table .wc-muted {
	color: var(--bs-secondary-color);
}

@container (min-width: 560px) {
	.wc-keys {
		grid-template-columns: repeat(12, 1fr);
	}
}

/* 本文幅が狭いときは横向きの図を上に固定し、スクロールせずにコードを選べるようにする */
@container (max-width: 619px) {
	.wc-viewer.is-horizontal {
		position: sticky;
		top: 0;
	}

	.wc-detail {
		order: 1;
	}
}

@container (min-width: 620px) {
	.wc-layout {
		align-items: start;
		grid-template-columns: minmax(0, 3fr) minmax(0, 2fr);
	}

	.wc-viewer {
		grid-column: 1;
	}

	.wc-detail {
		grid-column: 2;
	}

	.wc-select {
		grid-column: 1 / -1;
	}
}
