/**
 * Trang Nhạc lý: tra cứu hợp âm (không Tailwind, không style="").
 */

.hah-nhac-ly {
	--hah-nl-admin: 0px;
	--hah-nl-tabs-h: 3.25rem;
	--hah-nl-toolbar-h: 9.5rem;
	--hah-nl-sticky-top: calc(var(--hah-nl-admin) + var(--hah-header-offset, 64px));
	display: grid;
	gap: 1.35rem;
	color: var(--hah-ink, #1a1c1e);
	text-align: center;
	min-width: 0;
}

body.admin-bar .hah-nhac-ly {
	--hah-nl-admin: 32px;
}

@media (max-width: 782px) {
	body.admin-bar .hah-nhac-ly {
		--hah-nl-admin: 46px;
	}
}

#hah-nl-comma,
#hah-nl-iv-find,
.hah-nhac-ly-section {
	scroll-margin-top: calc(var(--hah-nl-sticky-top) + var(--hah-nl-tabs-h) + 0.35rem);
}

.hah-nhac-ly-lede {
	max-width: 62ch;
	margin: 0 auto;
	font-size: 1.05rem;
	line-height: 1.55;
	color: var(--hah-ink-muted, #5c636a);
}

.hah-nl-nav {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: center;
	gap: 0.35rem;
	padding: 0.35rem 0.55rem 0.45rem;
	margin: 0;
	position: sticky;
	top: var(--hah-nl-sticky-top);
	z-index: 40;
	background: color-mix(in srgb, var(--hah-surface-muted, #eef1f4) 88%, var(--hah-surface, #fff));
	border: 1px solid var(--hah-border, #e3e6ea);
	border-radius: var(--hah-radius, 10px);
}

.hah-nl-nav-toggle {
	appearance: none;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 0.55rem;
	margin: 0;
	padding: 0.35rem 0.75rem 0.4rem;
	border: 0;
	border-radius: var(--hah-radius-sm, 6px);
	background: transparent;
	cursor: pointer;
	color: inherit;
	font: inherit;
	text-align: center;
	max-width: 100%;
}

.hah-nl-nav-toggle:hover,
.hah-nl-nav-toggle:focus-visible {
	background: color-mix(in srgb, var(--hah-surface, #fff) 70%, transparent);
	outline: none;
}

.hah-nl-nav-toggle[aria-expanded='true'] {
	background: color-mix(in srgb, var(--hah-surface, #fff) 85%, transparent);
}

.hah-nl-nav-chevron {
	flex: 0 0 auto;
	width: 0.55rem;
	height: 0.55rem;
	border-right: 2px solid var(--hah-ink-muted, #5c636a);
	border-bottom: 2px solid var(--hah-ink-muted, #5c636a);
	transform: rotate(45deg) translateY(-0.12rem);
	transition: transform 0.18s ease, border-color 0.15s ease;
}

.hah-nl-nav-toggle[aria-expanded='true'] .hah-nl-nav-chevron {
	transform: rotate(225deg) translateY(-0.08rem);
	border-color: var(--hah-brand, #d83030);
}

.hah-nl-nav-toggle:hover .hah-nl-nav-chevron,
.hah-nl-nav-toggle:focus-visible .hah-nl-nav-chevron {
	border-color: var(--hah-brand, #d83030);
}

.hah-nl-nav-now {
	margin: 0;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 0.05rem;
	min-width: 0;
	line-height: 1.2;
}

.hah-nl-nav-now-lab {
	font-size: 0.72rem;
	font-weight: 600;
	color: var(--hah-ink-muted, #5c636a);
	text-transform: uppercase;
	letter-spacing: 0.04em;
}

.hah-nl-nav-now strong {
	font-size: 1.05rem;
	font-weight: 800;
	color: var(--hah-brand, #d83030);
	letter-spacing: -0.02em;
}

.hah-nl-menu {
	flex: 1 1 100%;
	padding: 0.45rem 0.15rem 0.2rem;
	border-top: 1px solid var(--hah-border, #e3e6ea);
}

.hah-nl-menu[hidden] {
	display: none !important;
}

.hah-nl-menu-grid.hah-nhac-ly-tabs {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(8.5rem, 1fr));
	justify-content: center;
	justify-items: stretch;
	gap: 0.4rem;
	padding: 0;
	margin: 0 auto;
	max-width: 42rem;
	position: static;
	top: auto;
	background: transparent;
	border: 0;
	border-radius: 0;
	overflow: visible;
	scroll-snap-type: none;
	box-shadow: none;
}

.hah-nl-menu-grid.hah-nhac-ly-tabs.is-overflow::after {
	display: none;
}

.hah-nl-menu-item.hah-nhac-ly-tab {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 0.12rem;
	padding: 0.55rem 0.65rem;
	white-space: normal;
	text-align: left;
	scroll-snap-align: none;
	border: 1px solid var(--hah-border, #e3e6ea);
	background: var(--hah-surface, #fff);
	min-height: 3.4rem;
}

.hah-nl-menu-title {
	font-size: 0.92rem;
	font-weight: 800;
	color: var(--hah-ink, #1a1c1e);
	line-height: 1.15;
}

.hah-nl-menu-desc {
	font-size: 0.72rem;
	font-weight: 600;
	color: var(--hah-ink-muted, #5c636a);
	line-height: 1.2;
}

.hah-nl-menu-item.is-active {
	border-color: color-mix(in srgb, var(--hah-brand, #d83030) 55%, var(--hah-border, #e3e6ea));
	box-shadow: 0 0 0 1px color-mix(in srgb, var(--hah-brand, #d83030) 25%, transparent);
}

.hah-nl-menu-item.is-active .hah-nl-menu-title {
	color: var(--hah-brand, #d83030);
}

/* Luyện: quiz nhận diện gam */
.hah-nl-drill {
	display: grid;
	gap: 0.75rem;
	padding: 0.85rem 0.9rem 1rem;
	border: 1px solid var(--hah-border, #e3e6ea);
	border-radius: var(--hah-radius, 10px);
	background: var(--hah-surface, #fff);
}

.hah-nl-drill-head {
	display: flex;
	flex-wrap: wrap;
	justify-content: space-between;
	gap: 0.35rem 1rem;
	font-size: 0.85rem;
	font-weight: 700;
	color: var(--hah-ink-muted, #5c636a);
}

.hah-nl-drill-q {
	margin: 0;
	font-size: 1.35rem;
	font-weight: 800;
	letter-spacing: -0.02em;
	color: var(--hah-ink, #1a1c1e);
}

.hah-nl-drill-kb-wrap {
	overflow-x: auto;
	padding: 0.35rem 0 0.15rem;
}

.hah-nl-drill-kb {
	display: block;
	width: min(100%, 36rem);
	height: auto;
	margin: 0 auto;
}

.hah-nl-drill-wk {
	fill: #f4f5f6;
	stroke: #c9ced4;
	stroke-width: 0.04;
}

.hah-nl-drill-bk {
	fill: #2a2e33;
	stroke: #1a1c1e;
	stroke-width: 0.03;
}

.hah-nl-drill-wk.is-on {
	fill: #3d9a5f;
	stroke: #2f7a4a;
	cursor: pointer;
}

.hah-nl-drill-bk.is-on {
	fill: #2f7a4a;
	stroke: #24603a;
	cursor: pointer;
}

.hah-nl-drill-wk.is-on.is-picked,
.hah-nl-drill-bk.is-on.is-picked,
.hah-nl-drill-note.is-picked {
	outline: 2px solid var(--hah-brand, #d83030);
	outline-offset: 1px;
}

.hah-nl-drill-wk.is-on.is-now,
.hah-nl-drill-bk.is-on.is-now {
	fill: var(--hah-brand, #d83030);
	stroke: var(--hah-brand-deep, #9e1f1f);
}

.hah-nl-drill-play {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.4rem 0.5rem;
}

.hah-nl-drill-play[hidden] {
	display: none !important;
}

.hah-nl-drill-play-hint {
	margin: 0;
	flex: 1 1 100%;
	font-size: 0.78rem;
	font-weight: 600;
	color: var(--hah-ink-muted, #5c636a);
}

.hah-nl-drill-staff-wrap {
	margin: 0;
	padding: 0.55rem 0.4rem 0.35rem;
	border-radius: var(--hah-radius-sm, 6px);
	background: #fafbfc;
	border: 1px solid var(--hah-border, #e3e6ea);
	overflow-x: auto;
}

.hah-nl-abc-host {
	width: 100%;
	min-height: 4rem;
}

.hah-nl-abc-host svg {
	display: block;
	max-width: 100%;
	height: auto;
	margin: 0 auto;
}

.hah-nl-abc-note,
.hah-nl-abc-host .abcjs-notehead {
	cursor: pointer;
}

.hah-nl-abc-note.is-picked,
.hah-nl-abc-host .abcjs-notehead.is-picked {
	fill: var(--hah-brand, #d83030) !important;
	stroke: var(--hah-brand-deep, #9e1f1f) !important;
}

.hah-nl-abc-note.is-now,
.hah-nl-abc-host .abcjs-notehead.is-now,
.hah-nl-staff-note.is-now {
	fill: var(--hah-brand, #d83030) !important;
	stroke: var(--hah-brand-deep, #9e1f1f) !important;
}

.hah-nl-drill-brace {
	stroke: #5c636a;
	stroke-width: 2.2;
}

.hah-nl-drill-bar {
	stroke: #5c636a;
	stroke-width: 1.4;
}

.hah-nl-drill-clef {
	fill: #5c636a;
	font-family: "Noto Music", "Segoe UI Symbol", "DejaVu Sans", serif;
}

.hah-nl-drill-clef.treble {
	font-size: 34px;
}

.hah-nl-drill-clef.bass {
	font-size: 28px;
}

.hah-nl-drill-note {
	fill: #1a1c1e;
	stroke: #1a1c1e;
	stroke-width: 0.4;
	cursor: pointer;
}

.hah-nl-drill-note:hover,
.hah-nl-drill-note:focus-visible {
	fill: var(--hah-brand, #d83030);
	stroke: var(--hah-brand, #d83030);
	outline: none;
}

.hah-nl-drill-note.is-now {
	fill: var(--hah-brand, #d83030);
	stroke: var(--hah-brand-deep, #9e1f1f);
}

.hah-nl-drill-lab {
	font-size: 0.32px;
	font-weight: 700;
	fill: #fff;
	pointer-events: none;
	text-anchor: middle;
}

.hah-nl-drill-lab.is-black {
	font-size: 0.26px;
}

.hah-nl-drill-choices {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr));
	gap: 0.45rem;
}

.hah-nl-drill-choice {
	appearance: none;
	border: 1px solid var(--hah-border, #e3e6ea);
	border-radius: var(--hah-radius-sm, 6px);
	background: var(--hah-surface, #fff);
	padding: 0.65rem 0.75rem;
	font: inherit;
	font-size: 0.92rem;
	font-weight: 700;
	text-align: left;
	cursor: pointer;
	color: var(--hah-ink, #1a1c1e);
}

.hah-nl-drill-choice:hover,
.hah-nl-drill-choice:focus-visible {
	border-color: var(--hah-brand, #d83030);
	outline: none;
}

.hah-nl-drill-choice.is-correct {
	border-color: #2f7a4a;
	background: #e8f5ec;
	color: #1e5a35;
}

.hah-nl-drill-choice.is-wrong {
	border-color: var(--hah-brand, #d83030);
	background: var(--hah-mark-soft, #f6eef1);
	color: var(--hah-brand-deep, #9e1f1f);
}

.hah-nl-drill-choice:disabled {
	cursor: default;
	opacity: 0.95;
}

.hah-nl-drill-feedback {
	margin: 0;
	font-size: 0.92rem;
	font-weight: 700;
}

.hah-nl-drill-feedback.is-ok {
	color: #1e5a35;
}

.hah-nl-drill-feedback.is-bad {
	color: var(--hah-brand-deep, #9e1f1f);
}

.hah-nl-drill-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 0.4rem;
}

.hah-nhac-ly-tabs {
	display: flex;
	flex-wrap: nowrap;
	justify-content: flex-start;
	gap: 0.15rem;
	padding: 0.28rem;
	margin: 0;
	position: sticky;
	top: var(--hah-nl-sticky-top);
	z-index: 40;
	background: color-mix(in srgb, var(--hah-surface-muted, #eef1f4) 88%, var(--hah-surface, #fff));
	border: 1px solid var(--hah-border, #e3e6ea);
	border-radius: var(--hah-radius, 10px);
	box-shadow: none;
	overflow-x: auto;
	-webkit-overflow-scrolling: touch;
	overscroll-behavior-x: contain;
	scroll-snap-type: x proximity;
	scrollbar-width: none;
	min-width: 0;
	max-width: 100%;
}

.hah-nhac-ly-tabs::-webkit-scrollbar {
	display: none;
}

.hah-nhac-ly-tabs.is-overflow::after {
	content: "";
	position: sticky;
	right: 0;
	flex: 0 0 1.25rem;
	align-self: stretch;
	margin-left: -1.25rem;
	background: linear-gradient(to left, var(--hah-surface-muted, #eef1f4), transparent);
	pointer-events: none;
}

@media (min-width: 721px) {
	.hah-nhac-ly-tabs {
		justify-content: center;
		padding: 0.32rem;
	}

	.hah-nhac-ly-tabs.is-overflow {
		justify-content: flex-start;
	}
}

.hah-nhac-ly-tab {
	appearance: none;
	border: 1px solid transparent;
	background: transparent;
	color: var(--hah-ink-muted, #5c636a);
	border-radius: calc(var(--hah-radius-sm, 6px) + 1px);
	padding: 0.42rem 0.72rem;
	font: inherit;
	font-size: 0.9rem;
	font-weight: 600;
	cursor: pointer;
	flex: 0 0 auto;
	scroll-snap-align: center;
	white-space: nowrap;
	transition: color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}

.hah-nhac-ly-tab:hover,
.hah-nhac-ly-tab:focus-visible {
	color: var(--hah-ink, #1a1c1e);
	background: color-mix(in srgb, var(--hah-surface, #fff) 55%, transparent);
}

.hah-nhac-ly-tab.is-active {
	background: var(--hah-surface, #fff);
	border-color: color-mix(in srgb, var(--hah-border-strong, #cfd4da) 70%, transparent);
	color: var(--hah-brand, #d83030);
	box-shadow: 0 1px 2px rgba(26, 28, 30, 0.06);
}

.hah-nhac-ly-section {
	display: grid;
	gap: 1rem;
	min-width: 0;
}

.hah-nhac-ly-section[hidden] {
	display: none;
}

.hah-nhac-ly-section h2 {
	margin: 0;
	font-size: 1.45rem;
	letter-spacing: -0.02em;
	color: var(--hah-ink, #1a1c1e);
}

.hah-nhac-ly-section h3 {
	margin: 0.4rem 0 0;
	font-size: 1.05rem;
}

.hah-nhac-ly-copy {
	margin: 0 auto;
	max-width: 68ch;
	line-height: 1.55;
}

.hah-nhac-ly-hint {
	margin: 0;
	font-size: 0.92rem;
	font-weight: 600;
	color: var(--hah-ink-muted, #5c636a);
}

.hah-nhac-ly[data-mode="notes"] .hah-nhac-ly-hint {
	color: var(--hah-brand-deep, #9e1f1f);
}

.hah-nhac-ly-mode,
.hah-nhac-ly-example,
.hah-nhac-ly-submit {
	appearance: none;
	border: 1px solid var(--hah-border-strong, #cfd4da);
	background: var(--hah-surface, #fff);
	color: var(--hah-ink, #1a1c1e);
	border-radius: var(--hah-radius-sm, 6px);
	padding: 0.45rem 0.85rem;
	font: inherit;
	font-weight: 600;
	cursor: pointer;
}

.hah-nhac-ly-mode.is-active,
.hah-nhac-ly-submit {
	background: var(--hah-brand, #d83030);
	border-color: var(--hah-brand, #d83030);
	color: #fff;
}

.hah-nhac-ly-submit {
	min-width: 4.6rem;
	white-space: nowrap;
}

.hah-nhac-ly-mode:active,
.hah-nhac-ly-submit:active,
.hah-nhac-ly-example:active,
.hah-nhac-ly-chip:active,
.hah-nhac-ly-tab:active {
	transform: translateY(1px);
}

.hah-nhac-ly-submit:hover,
.hah-nhac-ly-submit:focus {
	background: var(--hah-brand-hover, #b82525);
	color: #fff;
}

.hah-nhac-ly-example {
	font-weight: 500;
}

.hah-nhac-ly-panel {
	display: grid;
	gap: 0.85rem;
}

.hah-nhac-ly-form {
	display: grid;
	grid-template-columns: 1fr;
	gap: 0.5rem;
	align-items: center;
}

.hah-nl-lookup-field {
	position: relative;
	min-width: 0;
}

.hah-nl-lookup-clear {
	position: absolute;
	z-index: 2;
	top: 50%;
	right: 0.7rem;
	transform: translateY(-50%);
	appearance: none;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 1.5rem;
	height: 1.5rem;
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: 999px;
	background: #e8eaed;
	color: #3a4046;
	font: inherit;
	font-size: 1.05rem;
	font-weight: 700;
	line-height: 1;
	cursor: pointer;
}

.hah-nl-lookup-field:not(.is-filled) .hah-nl-lookup-clear {
	display: none;
}

.hah-nl-lookup-clear:hover,
.hah-nl-lookup-clear:focus-visible {
	color: var(--hah-brand, #d83030);
	background: var(--hah-mark-soft, #f6eef1);
	outline: none;
}

.hah-nhac-ly.has-player {
	padding-bottom: calc(5.75rem + env(safe-area-inset-bottom, 0px));
}

.hah-nhac-ly.has-player:has(.hah-nl-player.is-arp-open) {
	padding-bottom: calc(13.5rem + env(safe-area-inset-bottom, 0px));
}

.hah-nl-player {
	position: fixed;
	left: 0;
	right: 0;
	bottom: 0;
	z-index: 45;
	display: flex;
	flex-direction: column;
	gap: 0.35rem;
	padding: 0.45rem 0.75rem calc(0.45rem + env(safe-area-inset-bottom, 0px));
	background: var(--hah-surface, #fff);
	border-top: 1px solid var(--hah-border, #e3e6ea);
	box-shadow: 0 -8px 24px -12px rgba(26, 28, 30, 0.28);
}

.hah-nl-player-sheet {
	max-width: 42rem;
	margin: 0 auto;
	padding: 0.15rem 0 0.2rem;
}

.hah-nl-player-sheet[hidden] {
	display: none !important;
}

.hah-nl-player-tune {
	flex: 0 0 auto;
	appearance: none;
	border: 1px solid var(--hah-border-strong, #cfd4da);
	border-radius: 999px;
	background: var(--hah-surface, #fff);
	color: var(--hah-ink, #1a1c1e);
	padding: 0.35rem 0.7rem;
	font: inherit;
	font-size: 0.82rem;
	font-weight: 700;
	cursor: pointer;
}

.hah-nl-player-tune[hidden] {
	display: none !important;
}

.hah-nl-player-tune.is-on,
.hah-nl-player-tune[aria-expanded="true"] {
	background: var(--hah-brand, #d83030);
	border-color: var(--hah-brand, #d83030);
	color: #fff;
}

.hah-nl-player[hidden] {
	display: none !important;
}

.hah-nl-player-card {
	display: flex;
	align-items: center;
	gap: 0.65rem;
	max-width: 42rem;
	margin: 0 auto;
}

.hah-nl-player-play {
	flex: 0 0 auto;
	width: 44px;
	height: 44px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: 999px;
	background: var(--hah-brand, #d83030);
	color: #fff;
	cursor: pointer;
}

.hah-nl-player-play:hover,
.hah-nl-player-play:focus-visible,
.hah-nl-player-pause:hover,
.hah-nl-player-pause:focus-visible {
	background: var(--hah-brand-deep, #9e1f1f);
	outline: none;
}

.hah-nl-player-pause {
	flex: 0 0 auto;
	width: 44px;
	height: 44px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: 999px;
	background: var(--hah-ink, #1a1c1e);
	color: #fff;
	cursor: pointer;
}

.hah-nl-player-pause:disabled {
	opacity: 0.35;
	cursor: default;
}

.hah-nl-player.is-paused .hah-nl-player-pause {
	background: var(--hah-brand, #d83030);
}

.hah-nl-player-tempo {
	display: grid;
	gap: 0.35rem;
	margin: 0 0 0.45rem;
}

.hah-nl-player-tempo-row {
	display: flex;
	align-items: baseline;
	gap: 0.35rem;
}

.hah-nl-player-bpm {
	min-width: 1.8rem;
	font-variant-numeric: tabular-nums;
	font-weight: 800;
	color: var(--hah-ink, #1a1c1e);
}

.hah-nl-player-range {
	width: 100%;
	height: 0.4rem;
	margin: 0;
	accent-color: var(--hah-brand, #d83030);
	display: block;
}

.hah-nl-player-ico {
	width: 1.35rem;
	height: 1.35rem;
}

.hah-nl-player.is-playing .hah-nl-player-ico-play,
.hah-nl-player-ico-stop {
	display: none;
}

.hah-nl-player.is-playing .hah-nl-player-ico-stop {
	display: block;
}

.hah-nl-player-copy {
	flex: 1 1 auto;
	min-width: 0;
}

.hah-nl-player-title,
.hah-nl-player-sub {
	margin: 0;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.hah-nl-player-title {
	font-size: 0.98rem;
	font-weight: 800;
}

.hah-nl-player-sub {
	font-size: 0.78rem;
	color: var(--hah-ink-muted, #5c636a);
}

.hah-nl-player-styles {
	display: flex;
	flex: 0 0 auto;
	gap: 0.3rem;
}

.hah-nl-player-styles[hidden] {
	display: none !important;
}

.hah-nl-player-styles button {
	appearance: none;
	border: 1px solid var(--hah-border-strong, #cfd4da);
	border-radius: 999px;
	background: var(--hah-surface, #fff);
	color: var(--hah-ink, #1a1c1e);
	padding: 0.35rem 0.7rem;
	font: inherit;
	font-size: 0.82rem;
	font-weight: 700;
	cursor: pointer;
}

.hah-nl-player-styles button.is-on {
	background: var(--hah-brand, #d83030);
	border-color: var(--hah-brand, #d83030);
	color: #fff;
}

.hah-nhac-ly-input,
.hah-nhac-ly-select {
	width: 100%;
	min-height: 2.6rem;
	padding: 0.5rem 0.75rem;
	border: 1px solid var(--hah-border, #e3e6ea);
	border-radius: var(--hah-radius-sm, 6px);
	background: var(--hah-surface, #fff);
	color: var(--hah-ink, #1a1c1e);
	font: inherit;
}

.hah-nhac-ly-input:focus,
.hah-nhac-ly-select:focus {
	outline: 2px solid rgba(var(--hah-brand-rgb, 216, 48, 48), 0.35);
	border-color: var(--hah-brand, #d83030);
}

.hah-nhac-ly-field {
	display: grid;
	gap: 0.35rem;
}

.hah-nhac-ly-field label {
	font-weight: 600;
	font-size: 0.92rem;
}

.hah-nhac-ly-form .hah-nhac-ly-input {
	text-align: center;
	padding-left: 2.35rem;
	padding-right: 2.35rem;
}

.hah-nhac-ly-examples {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 0.4rem;
}

.hah-nhac-ly-pad {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 0.4rem;
}

/* Vòng 12 nốt: C trên đỉnh, nối polygon khi chọn ≥2 */
.hah-nl-circle.hah-nhac-ly-pad {
	--hah-nl-circle-size: min(22.5rem, 94vw);
	display: block;
	position: relative;
	width: var(--hah-nl-circle-size);
	height: var(--hah-nl-circle-size);
	margin: 0.65rem auto 0.35rem;
	flex-wrap: nowrap;
	gap: 0;
}

.hah-nl-circle-svg {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	pointer-events: none;
	z-index: 0;
}

.hah-nl-circle-ring {
	stroke: var(--hah-border, #e3e6ea);
	stroke-width: 0.35;
}

.hah-nl-circle-guide {
	stroke: var(--hah-border, #e3e6ea);
	stroke-width: 0.28;
	stroke-dasharray: 0.9 0.7;
	opacity: 0.85;
}

	.hah-nl-circle-poly {
	fill: var(--hah-brand, #d83030);
	fill-opacity: 0.12;
	stroke: var(--hah-brand, #d83030);
	stroke-width: 0.55;
	stroke-linejoin: round;
}

.hah-nl-circle-nodes {
	position: absolute;
	inset: 0;
	z-index: 1;
}

.hah-nl-circle-slot {
	position: absolute;
	left: 50%;
	top: 50%;
	width: 0;
	height: 0;
	/* pc 0 = C trên đỉnh; mỗi bước +30° theo chiều kim đồng hồ */
	transform: rotate(calc(var(--pc) * 30deg));
}

.hah-nl-circle-stack {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 0.12rem;
	position: relative;
	transform: translate(-50%, -50%) translateY(calc(var(--hah-nl-circle-size) * -0.38))
		rotate(calc(var(--pc) * -30deg));
}

.hah-nl-circle-slot.is-open {
	z-index: 6;
}

.hah-nl-circle .hah-nhac-ly-chip {
	position: relative;
	min-width: 2.1rem;
	padding: 0.28rem 0.38rem;
	font-size: 0.82rem;
	line-height: 1.1;
	box-shadow: 0 0 0 2px var(--hah-surface, #fff);
}

.hah-nl-circle .hah-nhac-ly-chip[data-ord]::after {
	content: attr(data-ord);
	position: absolute;
	top: -0.45rem;
	right: -0.4rem;
	min-width: 1rem;
	height: 1rem;
	padding: 0 0.15rem;
	border-radius: 999px;
	background: var(--hah-brand, #d83030);
	color: #fff;
	font-size: 0.62rem;
	font-weight: 800;
	line-height: 1rem;
	text-align: center;
	box-shadow: 0 0 0 1.5px var(--hah-surface, #fff);
}

.hah-nl-spell-pop {
	position: absolute;
	top: calc(100% + 0.2rem);
	left: 50%;
	transform: translateX(-50%);
	display: flex;
	flex-direction: column;
	gap: 0.15rem;
	min-width: 3.1rem;
	padding: 0.28rem;
	border: 1px solid var(--hah-border, #e3e6ea);
	border-radius: var(--hah-radius-sm, 6px);
	background: var(--hah-surface, #fff);
	box-shadow: 0 6px 18px rgba(26, 28, 30, 0.14);
	z-index: 8;
}

.hah-nl-spell-pop[hidden] {
	display: none !important;
}

.hah-nl-spell-opt {
	appearance: none;
	border: 1px solid transparent;
	background: transparent;
	border-radius: 4px;
	padding: 0.22rem 0.35rem;
	font: inherit;
	font-size: 0.78rem;
	font-weight: 700;
	line-height: 1.15;
	color: var(--hah-ink, #1a1c1e);
	cursor: pointer;
	white-space: nowrap;
	text-align: center;
}

.hah-nl-spell-opt:hover,
.hah-nl-spell-opt:focus-visible {
	border-color: var(--hah-brand, #d83030);
	background: var(--hah-mark-soft, #f6eef1);
	outline: none;
}

.hah-nl-spell-opt.is-current {
	border-color: var(--hah-brand, #d83030);
	background: var(--hah-mark-soft, #f6eef1);
	color: var(--hah-brand-deep, #9e1f1f);
}

.hah-nl-spell-remove {
	appearance: none;
	margin-top: 0.1rem;
	border: 0;
	border-top: 1px solid var(--hah-border, #e3e6ea);
	border-radius: 0 0 4px 4px;
	background: transparent;
	padding: 0.28rem 0.35rem 0.18rem;
	font: inherit;
	font-size: 0.72rem;
	font-weight: 700;
	color: var(--hah-brand, #d83030);
	cursor: pointer;
	white-space: nowrap;
}

.hah-nl-spell-remove[hidden] {
	display: none !important;
}

.hah-nl-spell-remove:hover,
.hah-nl-spell-remove:focus-visible {
	background: var(--hah-mark-soft, #f6eef1);
	outline: none;
}

/* Thanh thứ tự chọn + nút × xóa nốt */
.hah-nl-note-order {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.45rem 0.65rem;
	margin: 0.15rem 0 0.55rem;
	padding: 0.45rem 0.55rem;
	border: 1px solid var(--hah-border, #e3e6ea);
	border-radius: var(--hah-radius-sm, 6px);
	background: var(--hah-surface-2, #f7f8fa);
}

.hah-nl-note-order[hidden] {
	display: none !important;
}

.hah-nl-note-order-lab {
	margin: 0;
	font-size: 0.78rem;
	font-weight: 700;
	color: var(--hah-ink-muted, #5c636a);
	white-space: nowrap;
}

.hah-nl-note-order-list {
	display: flex;
	flex-wrap: wrap;
	gap: 0.35rem;
	flex: 1 1 auto;
	min-width: 0;
}

.hah-nl-note-order-item {
	display: inline-flex;
	align-items: center;
	gap: 0.2rem;
	padding: 0.15rem 0.2rem 0.15rem 0.4rem;
	border: 1px solid var(--hah-border, #e3e6ea);
	border-radius: 999px;
	background: var(--hah-surface, #fff);
	font-size: 0.8rem;
	line-height: 1.2;
}

.hah-nl-note-order-item b {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 1rem;
	height: 1rem;
	border-radius: 999px;
	background: var(--hah-brand, #d83030);
	color: #fff;
	font-size: 0.62rem;
	font-weight: 800;
}

.hah-nl-note-order-name {
	font-weight: 700;
}

.hah-nl-note-order-x {
	appearance: none;
	border: 0;
	background: transparent;
	color: var(--hah-ink-muted, #5c636a);
	cursor: pointer;
	font-size: 1.05rem;
	line-height: 1;
	padding: 0.05rem 0.35rem 0.1rem;
	border-radius: 999px;
}

.hah-nl-note-order-x:hover,
.hah-nl-note-order-x:focus-visible {
	color: var(--hah-brand, #d83030);
	background: var(--hah-mark-soft, #f6eef1);
	outline: none;
}

.hah-nl-note-order-clear {
	margin-left: auto;
}

@media (max-width: 520px) {
	.hah-nl-circle.hah-nhac-ly-pad {
		--hah-nl-circle-size: min(19.5rem, 96vw);
	}

	.hah-nl-circle .hah-nhac-ly-chip {
		min-width: 1.85rem;
		padding: 0.22rem 0.28rem;
		font-size: 0.74rem;
	}

	.hah-nl-spell-opt {
		font-size: 0.72rem;
	}
}

.hah-nhac-ly-chip {
	appearance: none;
	min-width: 2.35rem;
	border: 1px solid var(--hah-border, #e3e6ea);
	background: var(--hah-surface, #fff);
	color: var(--hah-ink, #1a1c1e);
	border-radius: var(--hah-radius-sm, 6px);
	padding: 0.35rem 0.45rem;
	font: inherit;
	font-weight: 700;
	cursor: pointer;
}

.hah-nhac-ly-example.is-on,
.hah-nhac-ly-chip.is-on {
	background: var(--hah-mark-soft, #f6eef1);
	border-color: var(--hah-brand, #d83030);
	color: var(--hah-brand-deep, #9e1f1f);
}

.hah-nhac-ly-answer {
	padding: 1rem 1.1rem;
	border: 1px solid var(--hah-border, #e3e6ea);
	border-radius: var(--hah-radius, 10px);
	background: var(--hah-surface, #fff);
}

.hah-nhac-ly-answer.is-empty {
	color: var(--hah-ink-muted, #5c636a);
}

.hah-nhac-ly-answer-kicker {
	margin: 0 0 0.35rem;
	color: var(--hah-ink-muted, #5c636a);
	text-align: center;
}

.hah-nl-mode-row.is-src {
	box-shadow: inset 3px 0 0 var(--hah-brand, #d83030);
}

.hah-nhac-ly-answer-notes {
	margin: 0.15rem 0 0;
	font-size: 2.85rem;
	line-height: 1.15;
	font-weight: 800;
	letter-spacing: 0.06em;
	font-variant-numeric: tabular-nums;
	text-align: center;
}

/* Tên hợp âm tách riêng, đứng dưới dòng "Công thức", to ngang nốt.
   Chân tên (foot bar) là affordance mở menu tên cùng chất. */
.hah-nhac-ly-answer-name {
	margin: 0.5rem 0 0;
	font-size: 3.3rem;
	line-height: 1.1;
	font-weight: 800;
	letter-spacing: 0.02em;
	text-align: center;
}
.hah-nhac-ly-answer-name .hah-nl-chord-name-trigger {
	display: inline-flex;
	flex-direction: column;
	align-items: stretch;
	gap: 0;
	min-height: 0;
	margin: 0;
	padding: 0;
	font: inherit;
	letter-spacing: inherit;
	text-align: center;
	color: var(--hah-brand-deep, #9e1f1f);
	background: transparent;
	border: 0;
	border-radius: 12px;
}
.hah-nhac-ly-answer-name .hah-nl-chord-name-trigger::after {
	content: '⌄';
	display: block;
	margin-top: 0.09em;
	padding: 0.05em 0 0.11em;
	font-size: 0.3em;
	line-height: 1;
	color: var(--hah-brand, #d83030);
	background: color-mix(in srgb, var(--hah-brand, #d83030) 16%, transparent);
	border-radius: 999px;
}
.hah-nhac-ly-answer-name .hah-nl-chord-name-trigger:hover,
.hah-nhac-ly-answer-name .hah-nl-chord-name-trigger:focus-visible {
	background: transparent;
}
.hah-nhac-ly-answer-name .hah-nl-chord-name-trigger:hover::after,
.hah-nhac-ly-answer-name .hah-nl-chord-name-trigger:focus-visible::after {
	color: var(--hah-surface, #fff);
	background: var(--hah-brand, #d83030);
}

.hah-nl-spelling-note {
	max-width: 44rem;
	margin: 0.75rem auto 0;
	padding: 0.65rem 0.8rem;
	font-size: 0.88rem;
	line-height: 1.5;
	color: #5c472d;
	background: #fff8e8;
	border: 1px solid #ead7ae;
	border-radius: 9px;
}

.hah-nl-chord-name-trigger {
	display: inline-flex;
	gap: 0.35em;
	align-items: center;
	max-width: 100%;
	min-height: 44px;
	margin: -0.35rem 0;
	padding: 0.25rem 0.55rem;
	font: inherit;
	font-weight: 800;
	line-height: 1.2;
	text-align: start;
	overflow-wrap: anywhere;
	cursor: pointer;
	color: var(--hah-brand-deep, #9e1f1f);
	background: var(--hah-mark-soft, #f6eef1);
	border: 1px solid color-mix(in srgb, var(--hah-brand, #d83030) 30%, transparent);
	border-radius: 999px;
}
.hah-nl-chord-name-trigger::after { content: '⌄'; flex: 0 0 auto; font-size: 0.9em; }
.hah-nl-chord-name-trigger:hover { border-color: var(--hah-brand, #d83030); }

.hah-nl-chord-dialog {
	width: min(44rem, calc(100% - 2rem));
	max-width: none;
	max-height: min(82vh, 50rem);
	max-height: min(82dvh, 50rem);
	margin: auto;
	padding: 0;
	color: var(--hah-ink, #1a1c1e);
	background: var(--hah-surface, #fff);
	border: 0;
	border-radius: 18px;
	box-shadow: 0 24px 80px rgb(15 20 26 / 32%);
}
.hah-nl-chord-dialog::backdrop {
	background: rgb(20 25 31 / 52%);
	backdrop-filter: blur(3px);
}
.hah-nl-chord-dialog-shell {
	display: flex;
	flex-direction: column;
	max-height: min(82vh, 50rem);
	max-height: min(82dvh, 50rem);
}
.hah-nl-chord-dialog-head {
	display: flex;
	flex: 0 0 auto;
	gap: 1rem;
	align-items: start;
	justify-content: space-between;
	padding: 1rem 1rem 0.75rem;
	border-bottom: 1px solid var(--hah-border, #e3e6ea);
}
.hah-nl-chord-dialog-eyebrow {
	margin: 0 0 0.15rem;
	font-size: 0.75rem;
	font-weight: 800;
	letter-spacing: 0.05em;
	text-transform: uppercase;
	color: var(--hah-brand-deep, #9e1f1f);
}
.hah-nl-chord-dialog h3 {
	margin: 0;
	font-size: 1.2rem;
	line-height: 1.25;
	overflow-wrap: anywhere;
}
.hah-nl-chord-dialog-close {
	display: grid;
	flex: 0 0 44px;
	place-items: center;
	width: 44px;
	height: 44px;
	padding: 0;
	font: inherit;
	font-size: 1.5rem;
	line-height: 1;
	cursor: pointer;
	color: var(--hah-ink-muted, #5c636a);
	background: var(--hah-surface-muted, #f5f6f7);
	border: 1px solid var(--hah-border, #e3e6ea);
	border-radius: 999px;
}
.hah-nl-chord-dialog-copy {
	flex: 0 0 auto;
	margin: 0;
	padding: 0.75rem 1rem;
	font-size: 0.85rem;
	line-height: 1.45;
	color: var(--hah-ink-muted, #5c636a);
}
.hah-nl-chord-dialog-list {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 0.55rem;
	min-height: 0;
	padding: 0 1rem 1rem;
	overflow-y: auto;
	overscroll-behavior: contain;
}
.hah-nhac-ly .hah-nl-chord-choice {
	display: grid;
	gap: 0.2rem;
	min-width: 0;
	min-height: 58px;
	padding: 0.6rem 0.75rem;
	font: inherit;
	text-align: start;
	cursor: pointer;
	color: var(--hah-ink, #1a1c1e);
	background: var(--hah-surface, #fff);
	border: 1px solid var(--hah-border, #e3e6ea);
	border-radius: 10px;
}
.hah-nl-chord-choice strong { font-size: 1rem; line-height: 1.25; overflow-wrap: anywhere; }
.hah-nl-chord-choice span { font-size: 0.75rem; color: var(--hah-ink-muted, #5c636a); overflow-wrap: anywhere; }
.hah-nl-chord-choice:hover,
.hah-nl-chord-choice:focus-visible { border-color: var(--hah-brand, #d83030); background: var(--hah-mark-soft, #f6eef1); }
.hah-nl-chord-choice.is-current {
	color: var(--hah-brand-deep, #9e1f1f);
	background: var(--hah-mark-soft, #f6eef1);
	border-color: var(--hah-brand, #d83030);
	box-shadow: inset 3px 0 0 var(--hah-brand, #d83030);
}

.hah-nhac-ly-iv,
.hah-nhac-ly-hitlist {
	margin: 0.75rem 0 0;
	padding: 0;
	list-style: none;
	display: grid;
	gap: 0.35rem;
}

.hah-nhac-ly-iv li,
.hah-nhac-ly-hitlist li {
	display: flex;
	flex-wrap: wrap;
	gap: 0.45rem 0.8rem;
	align-items: baseline;
	justify-content: center;
	padding: 0.35rem 0;
	border-top: 1px solid var(--hah-border, #e3e6ea);
}

.hah-nhac-ly-iv span,
.hah-nhac-ly-hitlist span {
	color: var(--hah-ink-muted, #5c636a);
}

.hah-nhac-ly-best {
	color: var(--hah-brand, #d83030);
	font-weight: 700;
	font-size: 0.82rem;
}

.hah-nhac-ly-aliases {
	margin: 0.85rem 0 0;
	color: var(--hah-ink-muted, #5c636a);
}

.hah-nhac-ly-catalog {
	display: grid;
	gap: 0.65rem;
}

.hah-nhac-ly-toolbar {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 0.7rem;
	position: sticky;
	top: calc(var(--hah-nl-sticky-top) + var(--hah-nl-tabs-h) + 0.35rem);
	z-index: 30;
	padding: 0.5rem 0 0.6rem;
	background: color-mix(in srgb, var(--hah-surface, #fff) 94%, transparent);
	border-bottom: 1px solid var(--hah-border, #e3e6ea);
	box-shadow: none;
	text-align: start;
}

.hah-nl-toolbar-row {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	align-items: end;
	gap: 0.65rem 0.85rem;
	width: 100%;
	max-width: 46rem;
}

.hah-nl-toolbar-filters {
	display: grid;
	grid-template-columns: minmax(5.5rem, 7.5rem) minmax(7rem, 9.5rem) minmax(12rem, 1fr);
	width: min(100%, 40rem);
	max-width: 40rem;
	gap: 0.55rem 0.65rem;
	align-items: end;
}

.hah-nl-toolbar-play {
	gap: 0.85rem 1.35rem;
}

.hah-nhac-ly-toolbar .hah-nhac-ly-field {
	min-width: 0;
}

.hah-nl-toolbar-play .hah-nhac-ly-field {
	text-align: center;
}

.hah-nhac-ly-toolbar .hah-nhac-ly-field-label {
	display: block;
	font-weight: 600;
	font-size: 0.92rem;
	line-height: 1.2;
	margin-bottom: 0.35rem;
}

.hah-nl-ico-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 0.35rem;
	white-space: nowrap;
}

.hah-nl-ico-btn .fas {
	flex: 0 0 auto;
	width: 0.95em;
	height: 0.95em;
}

@media (min-width: 1100px) {
	.hah-nhac-ly {
		--hah-nl-toolbar-h: 9.5rem;
	}
}

.hah-nhac-ly-scroll {
	border: 1px solid var(--hah-border, #e3e6ea);
	border-radius: var(--hah-radius, 10px);
	background: var(--hah-surface, #fff);
	/* Cấm overflow:auto/hidden/clip vì tạo scrollport khiến sticky thead
	   bám mép wrapper (header kẹt giữa bảng, hàng lộ phía trên). */
	overflow: visible;
	min-width: 0;
	max-width: 100%;
}

.hah-nhac-ly-table {
	width: 100%;
	border-collapse: separate;
	border-spacing: 0;
	font-variant-numeric: tabular-nums;
}

.hah-nhac-ly-table th,
.hah-nhac-ly-table td {
	text-align: left;
	padding: 0.55rem 0.75rem;
	border-bottom: 1px solid var(--hah-border, #e3e6ea);
	vertical-align: top;
}

.hah-nhac-ly-table thead th {
	position: sticky;
	top: calc(var(--hah-nl-sticky-top) + var(--hah-nl-tabs-h));
	z-index: 20;
	background: var(--hah-surface-muted, #eef1f4);
	font-size: 0.82rem;
	font-weight: 700;
	box-shadow: 0 1px 0 var(--hah-border, #e3e6ea);
}

.hah-nhac-ly-catalog .hah-nhac-ly-table thead th {
	top: calc(var(--hah-nl-sticky-top) + var(--hah-nl-tabs-h) + var(--hah-nl-toolbar-h));
}

.hah-nhac-ly-table tbody tr:last-child td {
	border-bottom: 0;
}

.hah-nl-bang-row {
	cursor: pointer;
}

.hah-nl-bang-row:hover,
.hah-nl-bang-row:focus-visible {
	background: color-mix(in srgb, var(--hah-brand, #c45c48) 8%, transparent);
	outline: none;
}

.hah-nl-bang-row.is-playing {
	background: color-mix(in srgb, var(--hah-brand, #c45c48) 14%, transparent);
}

.hah-nl-bang-name {
	text-decoration: underline;
	text-decoration-color: color-mix(in srgb, var(--hah-brand, #c45c48) 45%, transparent);
	text-underline-offset: 0.15em;
}

.hah-nl-strum-speeds {
	display: inline-flex;
	flex-wrap: nowrap;
	align-items: center;
	gap: 0.25rem;
	max-width: 100%;
}

.hah-nl-strum-speeds .hah-nhac-ly-example {
	flex: 0 0 auto;
	white-space: nowrap;
	padding: 0.4rem 0.7rem;
}

.hah-nl-bang-inline-host {
	/* Chỉ chỗ đỗ panel khi tbody rebuild, không hiện ngoài bảng. */
	display: none !important;
}

.hah-nl-bang-inline-panel[hidden] {
	display: none !important;
}

.hah-nl-bang-inline-panel {
	display: grid;
	gap: 0.55rem;
	width: 100%;
	padding: 0.6rem 0.7rem 0.7rem;
	border: 1px solid var(--hah-border, #e3e6ea);
	border-radius: var(--hah-radius, 10px);
	background: var(--hah-surface-muted, #eef1f4);
	text-align: start;
}

.hah-nl-bang-panel-head {
	display: grid;
	gap: 0.2rem;
	justify-items: center;
	text-align: center;
}

.hah-nl-bang-tuning {
	margin: 0;
	font-size: 0.78rem;
	font-weight: 700;
	color: var(--hah-ink-muted, #5c636a);
}

.hah-nl-strum-status {
	margin: 0;
	font-size: 0.86rem;
	color: #5c5654;
	text-align: center;
}

.hah-nl-strum-status.is-err {
	color: #a33;
}

tr.hah-nl-bang-inline > td {
	padding: 0.35rem 0.55rem 0.65rem;
	background: color-mix(in srgb, var(--hah-surface-muted, #eef1f4) 55%, var(--hah-surface, #fff));
	border-bottom: 1px solid var(--hah-border, #e3e6ea);
	vertical-align: top;
}

.hah-nl-bang-voicing-dock {
	display: grid;
	gap: 0.5rem;
	justify-items: stretch;
	width: 100%;
}

.hah-nl-bang-voicing-dock[hidden] {
	display: none !important;
}

.hah-nl-bang-voicing-slider {
	display: grid;
	grid-template-columns: auto minmax(0, 1fr) auto;
	align-items: center;
	gap: 0.3rem;
	width: 100%;
}

.hah-nl-voicing-nav {
	min-width: 2.25rem;
	padding: 0.45rem 0.55rem;
	align-self: stretch;
}

.hah-nl-bang-voicing-track {
	display: flex;
	align-items: stretch;
	gap: 0.65rem;
	overflow-x: auto;
	overflow-y: hidden;
	scroll-snap-type: x mandatory;
	scroll-padding-inline: 6%;
	-webkit-overflow-scrolling: touch;
	overscroll-behavior-x: contain;
	scrollbar-width: none;
	touch-action: pan-x;
	padding: 0.2rem 0.15rem 0.35rem;
	min-width: 0;
}

.hah-nl-bang-voicing-track::-webkit-scrollbar {
	display: none;
}

.hah-nl-voicing-slide {
	flex: 0 0 min(86%, 11.25rem);
	scroll-snap-align: center;
	scroll-snap-stop: always;
	display: grid;
	gap: 0.3rem;
	justify-items: center;
	align-content: start;
	padding: 0.45rem 0.4rem 0.55rem;
	border: 1px solid var(--hah-border, #e3e6ea);
	border-radius: var(--hah-radius, 10px);
	background: var(--hah-surface, #fff);
	color: var(--hah-ink, #1a1c1e);
	cursor: pointer;
	text-align: center;
	transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

.hah-nl-voicing-slide:hover,
.hah-nl-voicing-slide:focus-visible {
	border-color: color-mix(in srgb, var(--hah-brand, #c45c48) 55%, var(--hah-border, #e3e6ea));
	outline: none;
}

.hah-nl-voicing-slide:active {
	transform: scale(0.985);
}

.hah-nl-voicing-slide.is-on {
	border-color: var(--hah-brand, #c45c48);
	box-shadow: 0 0 0 1px color-mix(in srgb, var(--hah-brand, #c45c48) 28%, transparent);
}

.hah-nl-voicing-slide-cap {
	font-size: 0.72rem;
	font-weight: 700;
	color: var(--hah-ink-muted, #5c636a);
}

.hah-nl-voicing-slide.is-on .hah-nl-voicing-slide-cap {
	color: var(--hah-brand, #c45c48);
}

.hah-nl-bang-jtab {
	margin: 0 auto;
	min-height: 5.5rem;
}

.hah-nl-bang-jtab svg {
	max-width: 9.5rem;
	height: auto;
	display: block;
	margin-inline: auto;
}

.hah-nl-bang-sounding {
	display: grid;
	gap: 0.35rem;
	justify-items: center;
	width: 100%;
	padding: 0.45rem 0.4rem;
	border: 1px solid var(--hah-border, #e3e6ea);
	border-radius: var(--hah-radius, 10px);
	background: var(--hah-surface, #fff);
}

.hah-nl-bang-sounding[hidden] {
	display: none !important;
}

.hah-nl-bang-sounding-lab {
	font-size: 0.74rem;
	font-weight: 700;
	color: var(--hah-ink-muted, #5c636a);
}

.hah-nl-bang-strings {
	display: grid;
	grid-template-columns: repeat(6, minmax(0, 1fr));
	gap: 0.28rem;
	width: 100%;
	max-width: 28rem;
}

.hah-nl-bang-string {
	display: grid;
	gap: 0.08rem;
	justify-items: center;
	padding: 0.32rem 0.15rem;
	border: 1px solid var(--hah-border, #e3e6ea);
	border-radius: calc(var(--hah-radius-sm, 6px) + 1px);
	background: color-mix(in srgb, var(--hah-surface-muted, #eef1f4) 70%, #fff);
	font-variant-numeric: tabular-nums;
	transition: background 0.12s ease, border-color 0.12s ease, color 0.12s ease, transform 0.12s ease;
}

.hah-nl-bang-string b {
	font-size: 0.68rem;
	color: var(--hah-ink-muted, #5c636a);
}

.hah-nl-bang-string i {
	font-style: normal;
	font-size: 0.82rem;
	font-weight: 700;
}

.hah-nl-bang-string em {
	font-style: normal;
	font-size: 0.7rem;
	font-weight: 600;
	color: var(--hah-ink-muted, #5c636a);
}

.hah-nl-bang-string.is-muted {
	opacity: 0.42;
}

.hah-nl-bang-string.is-open em,
.hah-nl-bang-string.is-fretted em {
	color: var(--hah-ink, #1a1c1e);
}

.hah-nl-bang-string.is-ringing {
	border-color: var(--hah-brand, #c45c48);
	background: color-mix(in srgb, var(--hah-brand, #c45c48) 14%, #fff);
	color: var(--hah-brand, #c45c48);
	transform: translateY(-1px);
	opacity: 1;
}

.hah-nl-bang-string.is-ringing b,
.hah-nl-bang-string.is-ringing em {
	color: inherit;
}

.hah-nl-bang-voicing-meta {
	display: grid;
	gap: 0.3rem;
	justify-items: center;
	text-align: center;
	width: 100%;
}

.hah-nl-bang-voicing-label {
	font-size: 0.82rem;
	font-weight: 600;
	color: var(--hah-ink, #1a1c1e);
	max-width: 100%;
	overflow-wrap: anywhere;
}

.hah-nl-bang-voicing-dots {
	display: inline-flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 0.28rem;
}

.hah-nl-bang-voicing-dot {
	display: block;
	width: 0.38rem;
	height: 0.38rem;
	border-radius: 999px;
	background: color-mix(in srgb, var(--hah-ink-muted, #5c636a) 35%, transparent);
}

.hah-nl-bang-voicing-dot.is-on {
	background: var(--hah-brand, #c45c48);
	transform: scale(1.15);
}

@media (max-width: 720px) {
	tr.hah-nl-bang-inline > td {
		padding: 0.35rem 0.3rem 0.5rem;
	}

	.hah-nl-bang-inline-panel {
		padding: 0.5rem 0.4rem 0.55rem;
		gap: 0.45rem;
	}

	.hah-nl-strum-status {
		font-size: 0.78rem;
	}

	.hah-nl-voicing-slide {
		flex-basis: min(92%, 10.75rem);
		padding: 0.4rem 0.3rem 0.45rem;
	}

	.hah-nl-bang-jtab svg {
		max-width: 8.75rem;
	}

	.hah-nl-bang-strings {
		gap: 0.2rem;
	}

	.hah-nl-bang-string {
		padding: 0.28rem 0.1rem;
	}

	.hah-nl-bang-voicing-label {
		font-size: 0.76rem;
		white-space: nowrap;
		overflow: hidden;
		text-overflow: ellipsis;
	}
}

.hah-nhac-ly-table code {
	font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
	font-size: 0.92em;
}

.hah-nhac-ly-catalog,
.hah-nhac-ly-toolbar,
.hah-nhac-ly-table,
.hah-nhac-ly-field,
.hah-nhac-ly-rules,
.hah-nhac-ly-article {
	text-align: left;
}

.hah-nhac-ly-article {
	display: grid;
	gap: 0.95rem;
}

.hah-nhac-ly-article .hah-nhac-ly-copy {
	margin: 0;
	max-width: none;
}

.hah-nhac-ly-article h3 {
	margin: 0.85rem 0 0;
	font-size: 1.18rem;
	letter-spacing: -0.02em;
}

.hah-nhac-ly-article h4 {
	margin: 0.35rem 0 0;
	font-size: 1rem;
	font-weight: 700;
}

.hah-nhac-ly-article .hah-nhac-ly-rules {
	margin: 0;
	max-width: none;
}

.hah-nhac-ly-article .hah-nhac-ly-example {
	display: inline-flex;
	margin: 0 0.15rem;
	vertical-align: baseline;
}

.hah-nhac-ly-rules {
	margin: 0 auto;
	padding-left: 1.15rem;
	max-width: 68ch;
	display: grid;
	gap: 0.4rem;
}

.hah-nhac-ly-mini {
	width: 100%;
}

@media (max-width: 720px) {
	.hah-nhac-ly {
		--hah-nl-tabs-h: 2.55rem;
		--hah-nl-toolbar-h: 0px;
		gap: 1rem;
	}

	.hah-nhac-ly-lede {
		font-size: 0.98rem;
		text-align: left;
	}

	.hah-nhac-ly-section {
		text-align: left;
	}

	.hah-nhac-ly-section h2 {
		text-align: center;
		font-size: 1.3rem;
	}

	.hah-nhac-ly-copy,
	.hah-nhac-ly-hint {
		text-align: left;
	}

	/*
	 * iPhone / mobile: tắt mọi sticky trong tool Nhạc lý.
	 * Header site (sticky+transform hide) + tabs sticky + thead sticky
	 * chồng nhau → tab đè logo, chữ bị cắt, thead kẹt giữa bảng.
	 */
	.hah-nhac-ly-tabs {
		position: static;
		top: auto;
		z-index: auto;
		margin-inline: calc(-1 * var(--hah-page-gutter, 14px));
		border-radius: 0;
		border-left: 0;
		border-right: 0;
		padding: 0.22rem 0.35rem;
		background: var(--hah-surface-muted, #eef1f4);
		overflow-x: auto;
		-webkit-overflow-scrolling: touch;
	}

	.hah-nhac-ly-tab {
		padding: 0.38rem 0.62rem;
		font-size: 0.86rem;
	}

	.hah-nhac-ly-toolbar {
		position: static;
		top: auto;
		z-index: auto;
		background: var(--hah-surface, #fff);
		box-shadow: none;
		align-items: stretch;
	}

	.hah-nl-toolbar-filters {
		grid-template-columns: 1fr;
		width: 100%;
		max-width: none;
	}

	.hah-nl-toolbar-play {
		justify-content: flex-start;
	}

	.hah-nl-toolbar-play .hah-nhac-ly-field {
		text-align: start;
	}

	.hah-nhac-ly-table thead th,
	.hah-nhac-ly-catalog .hah-nhac-ly-table thead th {
		position: static;
		top: auto;
		z-index: auto;
		box-shadow: none;
	}

	.hah-nhac-ly-scroll {
		overflow-x: auto;
		overflow-y: visible;
		-webkit-overflow-scrolling: touch;
	}

	.hah-nhac-ly-table th,
	.hah-nhac-ly-table td {
		padding: 0.45rem 0.5rem;
		font-size: 0.86rem;
	}

	.hah-nhac-ly-table thead th {
		font-size: 0.75rem;
		white-space: nowrap;
	}

	.hah-nl-mode-pad {
		grid-template-columns: repeat(4, minmax(0, 1fr));
	}

	.hah-nl-mode-pad .hah-nhac-ly-example {
		min-height: 2.65rem;
		font-size: 0.8rem;
	}

	.hah-nl-mode-pair {
		font-size: 1.45rem;
		text-align: center;
	}

	.hah-nl-mode-actions {
		display: grid;
		grid-template-columns: 1fr 1fr;
	}

	.hah-nl-mode-actions .hah-nhac-ly-submit {
		grid-column: 1 / -1;
	}

	.hah-nhac-ly-answer-notes {
		font-size: 2.05rem;
	}

	.hah-nhac-ly-answer-name {
		font-size: 2.45rem;
	}
}

.hah-nhac-ly-section h4 {
	margin: 0.85rem 0 0;
	font-size: 1rem;
}

.hah-nl-ruler {
	margin: 1rem auto 0;
	max-width: 44rem;
	text-align: center;
}

.hah-nl-ruler-caption {
	margin: 0 0 0.35rem;
	font-size: 0.86rem;
	font-weight: 700;
	color: var(--hah-ink-muted, #5c636a);
}

.hah-nl-ruler-track {
	--span: 12;
	--plot: 6.8rem;
	position: relative;
	height: calc(var(--plot) + 3.6rem);
	margin: 0.35rem 1.1rem 0;
	border-bottom: 2px solid var(--hah-ink, #1a1c1e);
	background-image:
		repeating-linear-gradient(
			to right,
			color-mix(in srgb, var(--hah-ink, #1a1c1e) 16%, transparent) 0 1px,
			transparent 1px calc(100% / var(--span))
		),
		repeating-linear-gradient(
			to top,
			color-mix(in srgb, var(--hah-ink, #1a1c1e) 10%, transparent) 0 1px,
			transparent 1px calc(var(--plot) / 4)
		);
	background-position: 0 0, 0 bottom;
	background-size: 100% 100%, 100% var(--plot);
	background-repeat: no-repeat;
}

.hah-nl-ruler-track.is-span-24 {
	--span: 24;
}

.hah-nl-ruler-tick {
	--bar-h: max(0.55rem, calc(var(--plot) * var(--n) / var(--span)));
	position: absolute;
	bottom: 0;
	left: calc(100% * var(--n) / var(--span));
	transform: translateX(-50%);
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: flex-end;
	gap: 0.08rem;
	width: calc(100% / var(--span) * 0.68);
	max-width: 2.15rem;
	min-width: 1.15rem;
	height: calc(var(--bar-h) + 3.35rem);
	color: var(--hah-nl-col, var(--hah-ink, #1a1c1e));
}

.hah-nl-ruler-tick::after {
	content: "";
	width: 100%;
	height: var(--bar-h);
	border-radius: 4px 4px 1px 1px;
	background: var(--hah-nl-col, var(--hah-ink, #1a1c1e));
}

.hah-nl-ruler-tick.is-extra {
	color: var(--hah-brand, #d83030);
}

.hah-nl-ruler-tick.is-extra::after {
	background: repeating-linear-gradient(
		-55deg,
		var(--hah-brand, #d83030) 0 0.28rem,
		color-mix(in srgb, var(--hah-brand, #d83030) 62%, #fff) 0.28rem 0.55rem
	);
}

.hah-nl-ruler-tick.is-missing {
	color: #8a8584;
}

.hah-nl-ruler-tick.is-missing::after {
	background: transparent;
	border: 2px dashed currentColor;
	box-sizing: border-box;
}

.hah-nl-ruler-iv {
	font-size: 0.92rem;
	font-weight: 800;
	letter-spacing: 0.02em;
	line-height: 1.1;
}

.hah-nl-ruler-note {
	font-size: 0.68rem;
	font-weight: 600;
	line-height: 1.1;
	opacity: 0.78;
}

.hah-nl-ruler-st {
	font-size: 0.64rem;
	font-variant-numeric: tabular-nums;
	opacity: 0.8;
	line-height: 1.1;
}

.hah-nl-ruler-ends {
	display: flex;
	justify-content: space-between;
	margin: 0.2rem 1.1rem 0;
	font-size: 0.72rem;
	font-variant-numeric: tabular-nums;
	color: var(--hah-ink-muted, #5c636a);
}

.hah-nl-ruler-legend {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 0.65rem 1rem;
	margin: 0.65rem 0 0;
	padding: 0;
	list-style: none;
	font-size: 0.8rem;
	color: var(--hah-ink-muted, #5c636a);
}

.hah-nl-ruler-legend li::before {
	content: "";
	display: inline-block;
	width: 0.7rem;
	height: 0.7rem;
	margin-right: 0.35rem;
	vertical-align: -0.1rem;
	border-radius: 2px;
	background: var(--hah-ink, #1a1c1e);
}

.hah-nl-ruler-legend .is-extra::before {
	background: var(--hah-brand, #d83030);
}

.hah-nl-ruler-legend .is-missing::before {
	background: transparent;
	border: 2px dashed #8a8584;
	box-sizing: border-box;
}

.hah-nl-st-0 { --n: 0; --hah-nl-col: #1a1c1e; }
.hah-nl-st-1 { --n: 1; --hah-nl-col: #4e6578; }
.hah-nl-st-2 { --n: 2; --hah-nl-col: #1c6d88; }
.hah-nl-st-3 { --n: 3; --hah-nl-col: #2b6a3d; }
.hah-nl-st-4 { --n: 4; --hah-nl-col: #c45c14; }
.hah-nl-st-5 { --n: 5; --hah-nl-col: #4a478f; }
.hah-nl-st-6 { --n: 6; --hah-nl-col: #8a6e16; }
.hah-nl-st-7 { --n: 7; --hah-nl-col: #0e6b5b; }
.hah-nl-st-8 { --n: 8; --hah-nl-col: #9a3a5c; }
.hah-nl-st-9 { --n: 9; --hah-nl-col: #b45309; }
.hah-nl-st-10 { --n: 10; --hah-nl-col: #c42a2a; }
.hah-nl-st-11 { --n: 11; --hah-nl-col: #2c4a8c; }
.hah-nl-st-12 { --n: 12; --hah-nl-col: #1a1c1e; }
.hah-nl-st-13 { --n: 13; --hah-nl-col: #4e6578; }
.hah-nl-st-14 { --n: 14; --hah-nl-col: #1c6d88; }
.hah-nl-st-15 { --n: 15; --hah-nl-col: #2b6a3d; }
.hah-nl-st-16 { --n: 16; --hah-nl-col: #c45c14; }
.hah-nl-st-17 { --n: 17; --hah-nl-col: #4a478f; }
.hah-nl-st-18 { --n: 18; --hah-nl-col: #8a6e16; }
.hah-nl-st-19 { --n: 19; --hah-nl-col: #0e6b5b; }
.hah-nl-st-20 { --n: 20; --hah-nl-col: #9a3a5c; }
.hah-nl-st-21 { --n: 21; --hah-nl-col: #b45309; }
.hah-nl-st-22 { --n: 22; --hah-nl-col: #c42a2a; }
.hah-nl-st-23 { --n: 23; --hah-nl-col: #2c4a8c; }
.hah-nl-st-24 { --n: 24; --hah-nl-col: #1a1c1e; }

/* Catalog: Quãng (st) = biểu đồ ngang (cao→thấp), dài = st */
.hah-nl-ivcell {
	min-width: 11.5rem;
	vertical-align: middle;
}

.hah-nl-ivchart-wrap {
	margin: 1rem auto 0;
	max-width: 28rem;
	text-align: center;
}

.hah-nl-ivchart-caption {
	margin: 0 0 0.45rem;
	font-size: 0.86rem;
	font-weight: 700;
	color: var(--hah-ink-muted, #5c636a);
}

.hah-nl-ivchart {
	--span: 12;
	display: flex;
	flex-direction: column;
	gap: 0.22rem;
	width: 100%;
	max-width: 18rem;
	margin: 0 auto;
	text-align: left;
}

.hah-nl-ivchart-wrap .hah-nl-ivchart {
	max-width: none;
}

.hah-nl-ivchart.is-span-24 {
	--span: 24;
}

.hah-nl-ivbar {
	display: grid;
	grid-template-columns: 2.35rem minmax(0, 1fr) 2.1rem;
	align-items: center;
	gap: 0.35rem;
	color: var(--hah-nl-col, var(--hah-ink, #1a1c1e));
	font-size: 0.78rem;
	font-variant-numeric: tabular-nums;
	line-height: 1.1;
}

.hah-nl-ivbar.has-note {
	grid-template-columns: 2.35rem minmax(0, 1fr) 1.65rem 2.1rem;
}

.hah-nl-ivbar-lab {
	font-weight: 800;
	letter-spacing: 0.02em;
	text-align: right;
}

.hah-nl-ivbar-track {
	position: relative;
	height: 0.42rem;
	border-radius: 2px;
	background: color-mix(in srgb, var(--hah-ink, #1a1c1e) 8%, transparent);
	overflow: hidden;
}

.hah-nl-ivbar-fill {
	display: block;
	height: 100%;
	width: max(0.28rem, calc(100% * var(--n) / var(--span)));
	border-radius: 2px;
	background: var(--hah-nl-col, var(--hah-ink, #1a1c1e));
}

.hah-nl-ivbar.hah-nl-st-0 .hah-nl-ivbar-fill {
	width: 0.28rem;
	border-radius: 50%;
}

.hah-nl-ivbar-note {
	font-size: 0.68rem;
	font-weight: 600;
	opacity: 0.78;
}

.hah-nl-ivbar-st {
	font-size: 0.68rem;
	font-weight: 600;
	opacity: 0.78;
	text-align: left;
}

.hah-nl-ivbar.is-extra {
	color: var(--hah-brand, #d83030);
}

.hah-nl-ivbar.is-extra .hah-nl-ivbar-fill {
	background: repeating-linear-gradient(
		-55deg,
		var(--hah-brand, #d83030) 0 0.28rem,
		color-mix(in srgb, var(--hah-brand, #d83030) 62%, #fff) 0.28rem 0.55rem
	);
}

.hah-nl-ivbar.is-missing {
	color: #8a8584;
}

.hah-nl-ivbar.is-missing .hah-nl-ivbar-fill {
	background: transparent;
	border: 2px dashed currentColor;
	box-sizing: border-box;
}

@media (max-width: 720px) {
	.hah-nl-ivcell {
		min-width: 9.5rem;
	}

	.hah-nl-ivbar {
		grid-template-columns: 2rem minmax(0, 1fr) 1.85rem;
		gap: 0.25rem;
		font-size: 0.72rem;
	}

	.hah-nl-ivbar.has-note {
		grid-template-columns: 2rem minmax(0, 1fr) 1.35rem 1.85rem;
	}
}

.hah-nhac-ly-diff {
	margin: 0.55rem 0 0;
	font-size: 0.92rem;
	color: var(--hah-ink-muted, #5c636a);
}

.hah-nhac-ly-diff b {
	color: var(--hah-ink, #1a1c1e);
}

/* Tra cứu notes: đáp án (C6) hero; ứng viên (Cmaj13…) phụ */
.hah-nhac-ly-verdict-name {
	margin: 0.1rem 0 0.35rem;
	text-align: center;
	color: var(--hah-ink, #1a1c1e);
}

.hah-nhac-ly-verdict-meta {
	margin: 0;
	text-align: center;
	font-size: 0.98rem;
	line-height: 1.45;
	color: var(--hah-ink, #1a1c1e);
}

.hah-nhac-ly-verdict-meta b {
	font-weight: 800;
}

.hah-nhac-ly-observed {
	margin: 0.45rem 0 0;
	text-align: center;
	font-size: 0.9rem;
	color: var(--hah-ink-muted, #5c636a);
}

.hah-nhac-ly-observed code {
	font-family: inherit;
	font-weight: 700;
	letter-spacing: 0.02em;
	color: var(--hah-ink, #1a1c1e);
}

.hah-nhac-ly-alts-kicker {
	margin-top: 1.15rem;
	padding-top: 0.85rem;
	border-top: 1px solid var(--hah-border, #e3e6ea);
}

.hah-nhac-ly-hitlist-alts {
	margin-top: 0.35rem;
}

.hah-nhac-ly-hitlist-alts li {
	justify-content: flex-start;
	font-size: 0.9rem;
	border-top-color: transparent;
	padding: 0.2rem 0;
}

.hah-nhac-ly-hitlist-alts li b {
	font-weight: 650;
	min-width: 5.5rem;
}

.hah-nhac-ly-hitlist-alts span {
	font-size: 0.86rem;
}

.hah-nl-stacks code {
	font-family: inherit;
	font-weight: 700;
	letter-spacing: 0.03em;
}

.hah-nl-stacks tr.is-named td:last-child {
	font-weight: 700;
}

.hah-nl-stacks tr.is-unnamed td:last-child {
	color: var(--hah-ink-muted, #5c636a);
}

.hah-nl-fail-roots {
	display: grid;
	gap: 0.85rem;
	margin-top: 0.35rem;
}

.hah-nl-fail-root {
	display: grid;
	gap: 0.35rem;
	padding: 0.7rem 0.75rem 0.55rem;
	border: 1px solid var(--hah-border, #e3e6ea);
	border-radius: var(--hah-radius-sm, 6px);
	background: var(--hah-surface, #fff);
}

.hah-nl-fail-root h3 {
	margin: 0;
	font-size: 1rem;
}

.hah-nl-fail-why {
	margin: 0;
	font-size: 0.9rem;
	line-height: 1.45;
	color: var(--hah-ink, #1a1c1e);
}

.hah-nhac-ly-hitlist code {
	font-family: inherit;
	font-weight: 700;
	letter-spacing: 0.02em;
	color: var(--hah-ink, #1a1c1e);
}

.hah-nl-piano-box {
	margin: 1.15rem auto 0;
	max-width: 52rem;
	padding-top: 0.9rem;
	border-top: 1px solid var(--hah-border, #e3e6ea);
}

.hah-nl-piano-actions {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 0.4rem;
	margin: 0.35rem 0 0;
}

.hah-nl-piano-line {
	margin: 0.5rem 0 0;
	font-size: 0.88rem;
	line-height: 1.45;
	color: var(--hah-ink-muted, #5c636a);
	overflow-wrap: anywhere;
}

.hah-nl-piano-line b {
	color: var(--hah-ink, #1a1c1e);
}

.hah-nl-kb {
	display: block;
	width: 100%;
	height: auto;
	margin: 0.8rem auto 0;
	border: 1px solid var(--hah-ink, #1a1c1e);
	background: #f4f1ea;
	touch-action: manipulation;
}

.hah-nl-wk {
	fill: #fbfaf7;
	stroke: #1a1c1e;
	stroke-width: 0.045;
	cursor: pointer;
}

.hah-nl-bk {
	fill: #1a1c1e;
	stroke: #1a1c1e;
	stroke-width: 0.03;
	cursor: pointer;
}

.hah-nl-piano-hint {
	margin: 0.35rem 0 0;
	font-size: 0.86rem;
	color: var(--hah-ink-muted, #5c636a);
}

.hah-nl-piano-speed {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	align-items: center;
	gap: 0.4rem;
	margin: 0.55rem 0 0;
}

.hah-nl-piano-speed-lab {
	font-size: 0.86rem;
	font-weight: 700;
	color: var(--hah-ink, #1a1c1e);
}

.hah-nl-arp-grid {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 0.28rem;
	max-height: 12.5rem;
	overflow: auto;
	margin: 0.45rem 0 0;
	padding: 0.2rem 0.1rem;
}

.hah-nl-arp-style {
	appearance: none;
	width: 2.7rem;
	padding: 0.28rem 0.22rem 0.18rem;
	border: 1px solid var(--hah-border, #e3e6ea);
	background: var(--hah-surface, #fff);
	color: var(--hah-ink, #1a1c1e);
	border-radius: var(--hah-radius-sm, 6px);
	cursor: pointer;
}

.hah-nl-arp-style.is-on {
	border-color: var(--hah-brand, #d83030);
	background: var(--hah-mark-soft, #f6eef1);
	color: var(--hah-brand-deep, #9e1f1f);
}

.hah-nl-arp-svg {
	display: block;
	width: 100%;
	height: auto;
	pointer-events: none;
}

.hah-nl-arp-svg polyline {
	fill: none;
	stroke: currentColor;
	stroke-width: 0.45;
	stroke-linecap: round;
	stroke-linejoin: round;
}

.hah-nl-wk.is-span {
	fill: #f3efe4;
}

.hah-nl-wk.is-arp {
	fill: #f3cfc9;
}

.hah-nl-wk.is-block,
.hah-nl-wk.is-arp.is-block {
	fill: #e8a39c;
}

.hah-nl-wk.is-end {
	stroke: var(--hah-brand, #d83030);
	stroke-width: 0.14;
}

.hah-nl-bk.is-span {
	fill: #3a3333;
}

.hah-nl-bk.is-end {
	stroke: var(--hah-brand, #d83030);
	stroke-width: 0.1;
}

.hah-nl-wk.is-pick,
.hah-nl-bk.is-pick {
	fill: #e8c44a;
}

.hah-nl-bk.is-arp {
	fill: #6a3333;
}

.hah-nl-bk.is-block,
.hah-nl-bk.is-arp.is-block {
	fill: var(--hah-brand, #d83030);
}

.hah-nl-wk.is-now,
.hah-nl-bk.is-now {
	fill: #e8c44a;
}

.hah-nl-comma-hero {
	margin: 0;
	padding: 1rem 1.1rem 1.1rem;
	border: 1px solid var(--hah-border, #e3e6ea);
	border-radius: var(--hah-radius, 10px);
	background: var(--hah-surface, #fff);
	box-shadow: 0 8px 22px -18px rgba(26, 28, 30, 0.28);
}

.hah-nl-comma-hero h3 {
	margin-top: 0;
}

.hah-nl-comma-vi {
	margin: 0 0 0.5rem;
	font-size: 1.05rem;
	line-height: 1.5;
	color: var(--hah-ink, #1a1c1e);
}

.hah-nl-comma-vi b {
	color: var(--hah-brand, #d83030);
}

.hah-nl-comma {
	display: grid;
	gap: 0.85rem;
	margin: 0.35rem auto 0;
	max-width: 44rem;
	text-align: center;
}

.hah-nl-comma-octave {
	margin: 0.5rem auto 0;
	max-width: 44rem;
}

.hah-nl-comma-caption,
.hah-nl-comma-meter-lab {
	margin: 0 0 0.35rem;
	font-size: 0.86rem;
	font-weight: 700;
	color: var(--hah-ink-muted, #5c636a);
}

.hah-nl-comma-octave-track {
	display: grid;
	grid-template-columns: 9fr 9fr 4fr 9fr 9fr 9fr 4fr;
	gap: 0.18rem;
	align-items: stretch;
}

.hah-nl-comma-step {
	display: grid;
	align-content: center;
	gap: 0.12rem;
	min-height: 4.4rem;
	padding: 0.35rem 0.2rem;
	border-radius: var(--hah-radius-sm, 6px);
	font-size: 0.78rem;
	line-height: 1.2;
}

.hah-nl-comma-step b {
	font-size: 0.92rem;
}

.hah-nl-comma-step.is-tone {
	background: var(--hah-surface-muted, #eef1f4);
	color: var(--hah-ink, #1a1c1e);
}

.hah-nl-comma-step.is-dia {
	background: var(--hah-mark-soft, #f6eef1);
	color: var(--hah-brand-deep, #9e1f1f);
}

.hah-nl-comma-ends {
	display: flex;
	justify-content: space-between;
	margin: 0.3rem 0 0;
	font-size: 0.8rem;
	font-weight: 700;
	color: var(--hah-ink-muted, #5c636a);
}

.hah-nl-comma-form {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 0.5rem;
	text-align: left;
}

.hah-nl-comma-answer {
	margin: 0;
	padding: 0.85rem 1rem;
	border: 1px solid var(--hah-border, #e3e6ea);
	border-radius: var(--hah-radius, 10px);
	background: var(--hah-surface, #fff);
	text-align: center;
}

.hah-nl-comma-answer p {
	margin: 0;
	line-height: 1.45;
}

.hah-nl-comma-answer .hah-nl-comma-nums {
	margin: 0.35rem 0 0;
	font-size: 1.35rem;
	font-weight: 800;
	letter-spacing: -0.02em;
}

.hah-nl-unit {
	margin: 1.1rem 0 1.25rem;
	padding-bottom: 1.1rem;
	border-bottom: 1px solid var(--hah-border, #e3e6ea);
}

.hah-nl-unit h3 {
	margin: 0 0 0.35rem;
	text-align: center;
}

.hah-nl-unit > .hah-nhac-ly-copy {
	max-width: 44rem;
	margin-left: auto;
	margin-right: auto;
	text-align: center;
}

.hah-nl-unit-form {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 0.5rem;
	text-align: left;
	max-width: 44rem;
	margin: 0 auto 0.55rem;
	width: 100%;
}

.hah-nl-unit-answer {
	margin: 0.55rem auto 0;
	padding: 0.85rem 1rem;
	border: 1px solid var(--hah-border, #e3e6ea);
	border-radius: var(--hah-radius, 10px);
	background: var(--hah-surface, #fff);
	text-align: center;
	max-width: 44rem;
}

.hah-nl-unit-head {
	margin: 0 0 0.55rem;
}

.hah-nl-unit-grid {
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: 0.45rem;
}

.hah-nl-unit-grid div {
	display: grid;
	gap: 0.15rem;
	padding: 0.45rem 0.3rem;
	border-radius: var(--hah-radius-sm, 6px);
	background: var(--hah-mark-soft, #f6eef1);
}

.hah-nl-unit-grid span {
	font-size: 0.75rem;
	color: var(--hah-ink-muted, #5c636a);
}

.hah-nl-unit-grid b {
	font-size: 1.25rem;
	font-weight: 800;
	color: var(--hah-brand, #d83030);
}

.hah-nl-unit-eq {
	margin: 0.55rem 0 0;
	font-size: 0.92rem;
	line-height: 1.4;
	color: var(--hah-ink-muted, #5c636a);
}

.hah-nl-comma-meters {
	display: grid;
	gap: 0.35rem;
	text-align: left;
}

.hah-nl-comma-meter {
	display: grid;
	gap: 0;
	height: 1.2rem;
	overflow: hidden;
	border: 1px solid var(--hah-border-strong, #cfd4da);
	border-radius: var(--hah-radius-sm, 6px);
	background: var(--hah-surface-muted, #eef1f4);
}

.hah-nl-comma-meter.is-st {
	grid-template-columns: repeat(12, minmax(0, 1fr));
}

.hah-nl-comma-meter.is-cm {
	grid-template-columns: repeat(53, minmax(0, 1fr));
}

.hah-nl-comma-cell {
	min-width: 0;
	background: transparent;
}

.hah-nl-comma-cell.is-on {
	background: var(--hah-brand, #d83030);
}

.hah-nl-mode-parallel {
	margin-bottom: 1rem;
	padding-bottom: 1rem;
	border-bottom: 1px solid var(--hah-border, #e3e6ea);
}

.hah-nl-mode-parallel h3 {
	margin: 0 0 0.35rem;
	text-align: center;
}

.hah-nl-mode-parallel > .hah-nhac-ly-copy {
	max-width: 44rem;
	margin-left: auto;
	margin-right: auto;
	text-align: center;
}

.hah-nl-mode-parallel-bar {
	display: grid;
	grid-template-columns: minmax(0, 1fr) auto;
	gap: 0.5rem;
	align-items: end;
	max-width: 44rem;
	margin: 0 auto 0.65rem;
	width: 100%;
}

.hah-nl-mode-parallel-field {
	display: grid;
	gap: 0.2rem;
}

.hah-nl-mode-parallel-field span {
	font-size: 0.85rem;
	color: var(--hah-muted, #5c6570);
}

.hah-nl-mode-relative-title {
	margin: 0 0 0.35rem;
	text-align: center;
}

.hah-nl-mode-form {
	max-width: 18rem;
	margin: 0 auto;
	width: 100%;
}

.hah-nl-mode-form .hah-nhac-ly-input {
	text-align: center;
}

.hah-nl-mode-pads {
	display: grid;
	gap: 0.35rem;
}

.hah-nl-mode-pad-lab {
	margin: 0.35rem 0 0;
	font-size: 0.86rem;
	font-weight: 700;
	color: var(--hah-ink-muted, #5c636a);
}

.hah-nl-mode-pad {
	display: grid;
	grid-template-columns: repeat(6, minmax(0, 1fr));
	gap: 0.32rem;
	justify-items: stretch;
}

.hah-nl-mode-pad .hah-nhac-ly-example {
	min-height: 2.45rem;
	padding: 0.35rem 0.2rem;
	font-size: 0.84rem;
}

.hah-nl-mode-pad .hah-nhac-ly-example.is-on {
	background: var(--hah-brand, #d83030);
	border-color: var(--hah-brand, #d83030);
	color: #fff;
}

.hah-nl-mode-pair {
	margin: 0.15rem 0 0;
	font-size: 2.05rem;
	font-weight: 800;
	letter-spacing: -0.03em;
	line-height: 1.15;
}

.hah-nl-mode-pair + .hah-nhac-ly-hint {
	margin-top: 0.15rem;
}

.hah-nl-mode-actions {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 0.4rem;
}

.hah-nl-mode-list {
	display: grid;
	gap: 0.45rem;
	text-align: left;
	max-width: 44rem;
	margin: 0 auto;
	width: 100%;
}

.hah-nl-mode-row {
	display: grid;
	grid-template-columns: 8.2rem 1fr auto;
	gap: 0.45rem 0.65rem;
	align-items: center;
	padding: 0.55rem 0.7rem;
	border: 1px solid var(--hah-border, #e3e6ea);
	border-radius: var(--hah-radius-sm, 6px);
	background: var(--hah-surface, #fff);
	transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.hah-nl-mode-row.is-ionian,
.hah-nl-mode-row.is-aeolian {
	border-color: var(--hah-brand, #d83030);
	background: var(--hah-mark-soft, #f6eef1);
}

.hah-nl-mode-row.is-playing {
	border-color: var(--hah-brand, #d83030);
	box-shadow: 0 0 0 2px rgba(216, 48, 48, 0.28);
	background: #fff8f8;
}

.hah-nl-mode-name {
	margin: 0;
	font-weight: 700;
	line-height: 1.25;
}

.hah-nl-mode-name b {
	display: inline;
}

.hah-nl-mode-name small {
	display: block;
	font-weight: 600;
	font-size: 0.78rem;
	color: var(--hah-ink-muted, #5c636a);
}

.hah-nl-mode-notes {
	margin: 0;
	font-size: 0.95rem;
	line-height: 1.5;
	overflow-wrap: anywhere;
	display: flex;
	flex-wrap: wrap;
	gap: 0.2rem 0.35rem;
	align-items: baseline;
}

.hah-nl-mode-note {
	display: inline-block;
	padding: 0.05rem 0.28rem;
	border-radius: 4px;
	font-weight: 700;
	letter-spacing: 0.02em;
	transition: background 0.12s ease, color 0.12s ease, transform 0.12s ease;
}

.hah-nl-mode-note.is-now {
	background: var(--hah-brand, #d83030);
	color: #fff;
	transform: translateY(-1px);
}

.hah-nl-mode-staff {
	grid-column: 1 / -1;
	margin: 0.1rem 0 0;
	padding: 0.15rem 0.2rem 0.05rem;
	border-radius: var(--hah-radius-sm, 6px);
	background: #fafbfc;
	border: 1px solid var(--hah-border, #e3e6ea);
	overflow: hidden;
}

.hah-nl-mode-staff-svg {
	display: block;
	width: 100%;
	height: auto;
}

.hah-nl-mode-staff .hah-nl-abc-host {
	min-height: 3.2rem;
}

.hah-nl-staff-line {
	stroke: #9aa3ad;
	stroke-width: 0.7;
}

.hah-nl-staff-ledger {
	stroke: #9aa3ad;
	stroke-width: 0.65;
}

.hah-nl-staff-clef {
	font-size: 28px;
	fill: #5c636a;
	font-family: "Noto Music", "Segoe UI Symbol", "DejaVu Sans", serif;
}

.hah-nl-staff-acc {
	font-size: 9px;
	fill: #5c636a;
	font-weight: 700;
}

.hah-nl-staff-note {
	fill: var(--hah-ink, #1a1c1e);
	transition: fill 0.12s ease;
}

.hah-nl-staff-note.is-now {
	fill: var(--hah-brand, #d83030);
}

.hah-nl-mode-xchg {
	grid-column: 1 / -1;
	margin: 0;
	padding-top: 0.15rem;
	font-size: 0.82rem;
	line-height: 1.45;
	color: var(--hah-ink-muted, #5c636a);
}

.hah-nl-mode-xchg b {
	font-weight: 700;
	color: var(--hah-ink, #1a1c1e);
}

.hah-nl-mode-parallel-bar .hah-nhac-ly-example.is-on,
.hah-nl-mode-actions .hah-nhac-ly-example.is-on,
.hah-nl-mode-actions .hah-nhac-ly-submit.is-on,
.hah-nl-mode-row .hah-nhac-ly-example.is-on {
	background: var(--hah-mark-soft, #f6eef1);
	border-color: var(--hah-brand, #d83030);
	color: var(--hah-brand-deep, #9e1f1f);
}

@media (max-width: 720px) {
	.hah-nl-ruler-track {
		--plot: 7.4rem;
		height: calc(var(--plot) + 3.9rem);
	}

	.hah-nl-ruler-tick {
		width: calc(100% / var(--span) * 0.78);
	}

	.hah-nl-ruler-iv {
		font-size: 0.8rem;
	}

	.hah-nl-ruler-note {
		font-size: 0.62rem;
	}

	.hah-nl-comma-step {
		min-height: 3.15rem;
		padding: 0.28rem 0.08rem;
		font-size: 0.62rem;
	}

	.hah-nl-comma-step b {
		font-size: 0.72rem;
	}

	.hah-nl-comma-step-kind {
		display: none;
	}

	.hah-nl-comma-step-cm {
		font-size: 0.68rem;
	}

	.hah-nl-mode-row {
		grid-template-columns: 1fr auto;
	}

	.hah-nl-mode-notes {
		grid-column: 1 / -1;
	}

	.hah-nl-mode-pair {
		font-size: 1.7rem;
	}

	.hah-nl-comma-form {
		grid-template-columns: 1fr 1fr;
	}

	.hah-nl-unit-form {
		grid-template-columns: 1fr;
	}

	.hah-nl-unit-grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

/* Mobile Nhạc lý: readable controls and bounded, opt-in playback settings. */
.hah-nl-player-card,
.hah-nl-player-sheet {
	width: 100%;
	min-width: 0;
}
.hah-nl-player-sheet {
	max-height: 35vh;
	max-height: 35dvh;
	overflow-y: auto;
	overscroll-behavior: contain;
}
.hah-nl-player-tune,
.hah-nl-player-styles button {
	min-height: 44px;
}
.hah-nl-player-range { min-height: 44px; }
.hah-nhac-ly button:focus-visible,
.hah-nhac-ly a:focus-visible {
	outline: 2px solid var(--hah-brand, #d83030);
	outline-offset: 3px;
}
@media (max-width: 1024px) {
	.hah-nl-nav { position: static; }
	.hah-nhac-ly > *,
	.hah-nhac-ly-section > *,
	.hah-nhac-ly-field { min-width: 0; }
	.hah-nhac-ly-copy,
	.hah-nhac-ly-answer-name,
	.hah-nhac-ly-answer-notes,
	.hah-nl-mode-notes { overflow-wrap: anywhere; }
	.hah-nhac-ly input:not([type="range"]),
	.hah-nhac-ly select { font-size: max(16px, 1rem); max-width: 100%; }
	.hah-nhac-ly button { min-height: 44px; }
	.hah-nl-player { padding-inline: max(10px, env(safe-area-inset-left)); }
	.hah-nl-player-card {
		display: grid;
		grid-template-columns: 44px 44px minmax(0, 1fr);
		gap: 6px;
	}
	.hah-nl-player-copy { text-align: start; }
	.hah-nl-player-styles { grid-column: 1 / 3; flex-wrap: wrap; }
	.hah-nl-player-styles button { flex: 1; padding-inline: 0.35rem; }
	.hah-nl-player-tune { grid-column: 3; justify-self: end; max-width: 100%; }
	.hah-nhac-ly.has-player { padding-bottom: calc(11rem + env(safe-area-inset-bottom, 0px)); }
	.hah-nhac-ly.has-player:has(.hah-nl-player.is-arp-open) {
		padding-bottom: calc(11rem + 35vh + env(safe-area-inset-bottom, 0px));
	}
	.hah-nl-player-sheet .hah-nl-piano-speed { justify-content: flex-start; }
	.hah-nl-drill-choices { grid-template-columns: repeat(auto-fit, minmax(min(100%, 11rem), 1fr)); }
	.hah-nl-menu { max-width: 100%; }
	.hah-nl-mode-pad { grid-template-columns: repeat(auto-fit, minmax(min(100%, 5rem), 1fr)); }
	.hah-nl-comma-form { grid-template-columns: repeat(auto-fit, minmax(min(100%, 9rem), 1fr)); }
}
@media (max-height: 500px) and (pointer: coarse) {
	.hah-nl-player { position: static; }
	.hah-nhac-ly.has-player,
	.hah-nhac-ly.has-player:has(.hah-nl-player.is-arp-open) { padding-bottom: 1rem; }
}
@media (max-width: 1024px) {
	.hah-nl-player-card { grid-template-columns: 44px 44px minmax(0, 1fr); }
	.hah-nl-player-styles { grid-column: 1 / -1; grid-row: 2; flex-wrap: nowrap; padding-right: 5rem; }
	.hah-nl-player-tune { grid-column: 3; grid-row: 2; }
	.hah-nl-toolbar-play .hah-nhac-ly-field { max-width: 100%; }
	.hah-nl-toolbar-play .hah-nl-piano-speed { flex-wrap: wrap; }
	.hah-nl-toolbar-filters { grid-template-columns: minmax(0, 1fr); }
	.hah-nhac-ly-article,
	.hah-nl-comma,
	.hah-nl-comma-octave { min-width: 0; max-width: 100%; }
	.hah-nl-comma-octave { overflow-x: auto; text-align: start; }
	.hah-nl-comma-octave-track { min-width: 22rem; }
	.hah-nl-menu-grid.hah-nhac-ly-tabs { grid-template-columns: repeat(auto-fit, minmax(min(100%, 8.5rem), 1fr)); }
}
@media (max-width: 1024px) {
	.hah-nhac-ly-catalog { grid-template-columns: minmax(0, 1fr); }
	.hah-nl-strum-speeds { min-width: 0; flex-wrap: wrap; }
	.hah-nl-player-styles { min-width: 0; }
	.hah-nl-player-copy { grid-column: 3; grid-row: 1; }
	.hah-nl-player-play { grid-column: 1; grid-row: 1; }
	.hah-nl-player-pause { grid-column: 2; grid-row: 1; }
}
.hah-nhac-ly,
.hah-nhac-ly *,
.hah-nhac-ly *::before,
.hah-nhac-ly *::after { box-sizing: border-box; }
@media (max-width: 1024px) {
	.hah-nhac-ly-section,
	.hah-nhac-ly-form { grid-template-columns: minmax(0, 1fr); }
	.hah-nl-player { width: 100%; max-width: 100vw; }
}
@media (max-width: 1024px) {
	.hah-nl-circle.hah-nhac-ly-pad {
		--hah-nl-circle-size: min(19.5rem, calc(100vw - 2 * var(--hah-page-gutter, 14px) - 1rem));
	}
}

@media (max-width: 1024px) {
 .hah-nhac-ly-scroll { overflow-x: auto; }
 .hah-nhac-ly-toolbar { position: static; }
 .hah-nhac-ly-table thead th,
 .hah-nhac-ly-catalog .hah-nhac-ly-table thead th { position: static; }
}
/* Keep wide theory tables inside their own scroll region at large text sizes. */
.hah-nhac-ly-scroll { overflow-x: auto; }

/* Tìm quãng: staff-first trong tab Quãng. */
.hah-nl-iv-find {
	display: grid;
	gap: 0.85rem;
	padding: 1rem 1.1rem 1.15rem;
	border: 1px solid var(--hah-border, #e3e6ea);
	border-radius: var(--hah-radius, 10px);
	background: var(--hah-surface, #fff);
	text-align: center;
	min-width: 0;
}
.hah-nl-iv-find > h3 {
	margin: 0;
	font-size: 1.15rem;
}
.hah-nl-iv-find-lede {
	margin: 0 auto;
	max-width: 52ch;
}
.hah-nl-iv-find-toolbar {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	align-items: center;
	gap: 0.65rem 1rem;
}
.hah-nl-iv-find-clefs,
.hah-nl-iv-find-lines,
.hah-nl-iv-find-keysig {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: center;
	gap: 0.35rem;
}
.hah-nl-iv-find-lines {
	gap: 0.25rem;
}
.hah-nl-iv-find-lab {
	font-size: 0.82rem;
	font-weight: 650;
	color: var(--hah-ink-muted, #5c636a);
	margin-inline-end: 0.15rem;
}
.hah-nl-iv-slot.is-space {
	min-width: 1.65rem;
	padding-inline: 0.35rem;
	opacity: 0.92;
	font-weight: 800;
	letter-spacing: 0;
}
.hah-nl-iv-slot.is-line {
	min-width: 2rem;
}
.hah-nl-iv-find-acc-count select {
	min-height: 2.1rem;
	padding: 0.2rem 0.45rem;
	border: 1px solid var(--hah-border, #e3e6ea);
	border-radius: var(--hah-radius-sm, 6px);
	background: var(--hah-surface, #fff);
	color: var(--hah-ink, #1a1c1e);
}
.hah-nl-iv-find-acc-count select:disabled {
	opacity: 0.45;
}
.hah-nl-iv-find-acc-preview {
	min-width: 4ch;
	font-size: 0.85rem;
	font-variant-numeric: tabular-nums;
	color: var(--hah-ink-muted, #5c636a);
}
.hah-nl-iv-find-staff-wrap {
	margin: 0.15rem auto 0;
	width: min(100%, 36rem);
	padding: 0.35rem 0.5rem 0.5rem;
	border: 1px solid var(--hah-border, #e3e6ea);
	border-radius: var(--hah-radius, 10px);
	background: var(--hah-surface, #fff);
	cursor: crosshair;
}
.hah-nl-iv-find-staff {
	min-height: 7.5rem;
	margin: 0 auto;
	cursor: crosshair;
}
.hah-nl-iv-find-staff .abcjs-container {
	margin: 0 auto;
}
.hah-nl-iv-find-staff .hah-nl-abc-note {
	cursor: pointer;
}
.hah-nl-iv-find-answer {
	min-height: 3.5rem;
}
.hah-nl-iv-find-answer-empty {
	margin: 0;
	color: var(--hah-ink-muted, #5c636a);
}
.hah-nl-iv-find-answer-code {
	margin: 0;
	font-size: 2.6rem;
	line-height: 1.1;
	font-weight: 800;
	letter-spacing: 0.02em;
	color: var(--hah-brand-deep, #9e1f1f);
}
.hah-nl-iv-find-answer-name {
	margin: 0.25rem 0 0;
	font-size: 1.05rem;
	font-weight: 650;
	color: var(--hah-ink, #1a1c1e);
}
.hah-nl-iv-find-answer-meta {
	margin: 0.2rem 0 0;
	font-size: 0.92rem;
	color: var(--hah-ink-muted, #5c636a);
}
.hah-nl-iv-find-piano {
	display: grid;
	gap: 0.45rem;
	justify-items: center;
	min-width: 0;
	max-width: 100%;
	width: 100%;
}
.hah-nl-iv-find-piano .hah-nl-input-octave {
	justify-content: center;
}
.hah-nl-iv-find-piano .hah-nl-piano-scroll,
.hah-nl-iv-piano-scroll {
	width: 100%;
	max-width: 100%;
	margin-inline: 0;
	overflow-x: auto;
}
.hah-nl-iv-find-piano .hah-nl-input-keyboard {
	margin-inline: auto;
}
.hah-nl-iv-find-piano .hah-nl-input-key {
	font-size: 0;
	color: transparent;
	line-height: 0;
}
.hah-nl-iv-find-piano .hah-nl-iv-spell {
	width: min(100%, 36rem);
	justify-self: center;
}
.hah-nl-iv-find-piano .hah-nhac-ly-hint {
	max-width: 100%;
	padding-inline: 0.25rem;
	overflow-wrap: anywhere;
	text-align: center;
}
.hah-nl-iv-find-picks {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: center;
	gap: 0.45rem;
}
.hah-nl-iv-find-pick {
	display: inline-flex;
	align-items: center;
	gap: 0.35rem;
	min-height: 2.1rem;
	padding: 0.2rem 0.65rem;
	border: 1px solid var(--hah-border, #e3e6ea);
	border-radius: var(--hah-radius-sm, 6px);
	font-weight: 700;
	font-variant-numeric: tabular-nums;
	background: var(--hah-surface, #fff);
}
.hah-nl-iv-find-pick.is-empty {
	font-weight: 550;
	color: var(--hah-ink-muted, #5c636a);
}
.hah-nl-iv-find-pick button {
	margin: 0;
	padding: 0;
	border: 0;
	background: transparent;
	color: var(--hah-brand, #d83030);
	font: inherit;
	font-weight: 800;
	cursor: pointer;
}
.hah-nl-iv-find-hint {
	margin: 0 auto;
	max-width: 48ch;
	font-size: 0.88rem;
	line-height: 1.45;
	color: var(--hah-ink-muted, #5c636a);
}

@media (max-width: 720px) {
	.hah-nl-iv-find-toolbar {
		flex-direction: column;
		align-items: stretch;
		gap: 0.55rem;
	}
	.hah-nl-iv-find-clefs,
	.hah-nl-iv-find-lines,
	.hah-nl-iv-find-keysig {
		justify-content: center;
	}
	.hah-nl-iv-find-answer-code {
		font-size: 2.05rem;
	}
	.hah-nl-iv-find-staff-wrap {
		width: 100%;
	}
}

/* Note entry instruments: independent of the playback/range-selection keyboard. */
.hah-nl-instrument-input {
	width: min(100%, 70rem);
	min-width: 0;
	margin: 1rem auto 0;
	padding: 0 1rem 1rem;
	border: 1px solid var(--hah-border, #d8dce1);
	border-radius: 14px;
	text-align: start;
	background: var(--hah-surface, #fff);
	box-shadow: 0 6px 20px rgb(20 27 35 / 5%);
}
.hah-nl-instrument-input summary {
	display: flex;
	align-items: center;
	min-height: 48px;
	margin-inline: -1rem;
	padding: 0.65rem 1rem;
	cursor: pointer;
	font-weight: 750;
	border-radius: 13px;
}
.hah-nl-instrument-input[open] summary {
	margin-bottom: 0.85rem;
	border-bottom: 1px solid var(--hah-border, #d8dce1);
	border-radius: 13px 13px 0 0;
	background: var(--hah-surface-muted, #f5f6f7);
}
.hah-nl-input-toolbar,
.hah-nl-input-modes,
.hah-nl-input-octave {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
	align-items: center;
}
.hah-nl-input-toolbar {
	justify-content: space-between;
	margin-bottom: 0.85rem;
}
.hah-nl-input-modes .hah-nhac-ly-example,
.hah-nl-input-toolbar > .hah-nhac-ly-example { min-height: 44px; }
.hah-nl-input-octave { margin-bottom: 0.45rem; }
.hah-nl-input-octave select,
.hah-nl-input-transform select {
	width: auto;
	min-height: 44px;
	padding: 0.45rem 2.1rem 0.45rem 0.65rem;
	font: inherit;
	color: var(--hah-ink, #20252a);
	background-color: var(--hah-surface, #fff);
	border: 1px solid #9aa2aa;
	border-radius: 8px;
}
.hah-nl-instrument-input [hidden] { display: none !important; }
.hah-nhac-ly[data-mode="notes"] .hah-nl-instrument-input .hah-nhac-ly-hint {
	margin: 0 0 0.6rem;
	color: var(--hah-muted, #5e6670);
	font-size: 0.9rem;
	font-weight: 550;
	line-height: 1.45;
}
.hah-nl-input-scroll {
	max-width: 100%;
	overflow-x: auto;
	padding: 0.3rem 0 0.55rem;
	overscroll-behavior-x: contain;
	-webkit-overflow-scrolling: touch;
	scrollbar-color: #aeb4ba transparent;
	scrollbar-width: thin;
}
.hah-nl-input-scroll:focus-visible {
	outline: 3px solid color-mix(in srgb, var(--hah-brand, #d83030) 40%, transparent);
	outline-offset: 3px;
}
.hah-nl-piano-scroll {
	width: fit-content;
	margin-inline: auto;
}
.hah-nl-input-keyboard {
	display: flex;
	width: max-content;
	padding-right: 0.2rem;
	filter: drop-shadow(0 5px 5px rgb(20 27 35 / 10%));
}
.hah-nl-input-key-pair { position: relative; flex: 0 0 3.75rem; width: 3.75rem; }
.hah-nl-input-key {
	display: flex;
	align-items: end;
	justify-content: center;
	width: 100%;
	height: 9.5rem;
	min-width: 44px;
	min-height: 44px;
	padding: 0.45rem 0.2rem;
	font: inherit;
	font-size: 0.9rem;
	font-weight: 650;
	cursor: pointer;
	color: #20252a;
	background: linear-gradient(#fff, #fafafa);
	border: 1px solid #8e969e;
	border-radius: 0 0 7px 7px;
}
.hah-nl-input-key.is-black {
	position: absolute;
	top: 0;
	right: -1.3rem;
	z-index: 2;
	width: 2.6rem;
	height: 5.85rem;
	color: #fff;
	background: linear-gradient(90deg, #1d2228, #343b42 62%, #171b20);
	border-color: #11161a;
}
.hah-nl-input-key.is-on,
.hah-nl-input-modes .is-on { background: var(--hah-brand, #d83030); color: #fff; box-shadow: inset 0 0 0 2px currentColor; }
.hah-nl-input-fretboard {
	--hah-string: #78664f;
	width: max-content;
	margin: 0 auto;
	border: 1px solid #9f8768;
	border-collapse: separate;
	border-spacing: 0;
	border-radius: 10px;
	overflow: hidden;
	background: #ead9bc;
	box-shadow: inset 0 0 0 2px rgb(255 255 255 / 28%), 0 5px 14px rgb(63 44 22 / 11%);
}
.hah-nl-input-fretboard th {
	height: 2rem;
	padding: 0.2rem;
	font-size: 0.78rem;
	font-weight: 700;
	text-align: center;
	white-space: nowrap;
	color: #62543f;
	background: var(--hah-surface, #fff);
}
.hah-nl-input-fretboard thead th:not(:first-child) { min-width: 3.75rem; }
.hah-nl-input-fretboard thead th.is-marker::after {
	content: '';
	display: block;
	width: 0.34rem;
	height: 0.34rem;
	margin: 0.05rem auto 0;
	border-radius: 50%;
	background: #a88b63;
}
.hah-nl-input-fretboard thead th.is-double::after { box-shadow: 0.58rem 0 #a88b63, -0.58rem 0 #a88b63; }
.hah-nl-input-fretboard tbody th {
	position: sticky;
	left: 0;
	z-index: 4;
	width: 4.25rem;
	min-width: 4.25rem;
	color: #30363c;
	background: #fff;
	border-right: 1px solid #c8cdd2;
}
.hah-nl-input-fretboard tbody th span {
	display: inline-grid;
	place-items: center;
	width: 1.45rem;
	height: 1.45rem;
	margin-right: 0.3rem;
	color: #fff;
	background: #3a4148;
	border-radius: 50%;
}
.hah-nl-input-fretboard thead th:first-child {
	position: sticky;
	left: 0;
	z-index: 6;
	width: 4.25rem;
	min-width: 4.25rem;
}
.hah-nl-input-fretboard thead th:nth-child(2) {
	position: sticky;
	left: 4.25rem;
	z-index: 6;
	background: #f0f2f4;
}
.hah-nl-input-fretboard td {
	position: relative;
	height: 3.15rem;
	padding: 0;
}
.hah-nl-input-fretboard td.is-mute {
	position: sticky;
	left: 4.25rem;
	z-index: 4;
	min-width: 3.75rem;
	background: #f0f2f4;
	border-right: 3px solid #756550;
}
.hah-nl-input-fretboard td.is-fret {
	min-width: 3.75rem;
	background: linear-gradient(90deg, rgb(255 255 255 / 8%), rgb(112 80 42 / 5%));
	border-right: 2px solid #b6a17f;
}
.hah-nl-input-fretboard td.is-open {
	background: #f9f4e9;
	border-right: 4px solid #79674f;
}
.hah-nl-input-fretboard td.is-fret::after {
	content: '';
	position: absolute;
	top: 50%;
	left: 0;
	right: 0;
	height: 1px;
	background: var(--hah-string);
	box-shadow: 0 1px rgb(255 255 255 / 45%);
}
.hah-nl-input-fretboard tbody tr:nth-child(n + 4) td.is-fret::after { height: 2px; }
.hah-nl-input-fret {
	position: relative;
	z-index: 2;
	display: grid;
	place-items: center;
	width: 100%;
	height: 100%;
	min-width: 44px;
	min-height: 44px;
	padding: 0.2rem;
	font: inherit;
	font-size: 0.76rem;
	font-weight: 650;
	cursor: pointer;
	color: #514634;
	background: transparent;
	border: 0;
	border-radius: 0;
}
.hah-nl-input-fret span {
	display: grid;
	place-items: center;
	min-width: 2rem;
	height: 2rem;
	padding-inline: 0.2rem;
	border-radius: 999px;
	background: rgb(255 250 241 / 82%);
}
.hah-nl-input-fret:hover span { background: #fff; box-shadow: 0 1px 5px rgb(40 28 14 / 18%); }
.hah-nl-input-fret:focus-visible { outline: 3px solid var(--hah-brand, #d83030); outline-offset: -3px; }
.hah-nl-input-fret.is-on span {
	color: #fff;
	background: var(--hah-brand, #d83030);
	box-shadow: 0 0 0 3px #fff, 0 2px 7px rgb(80 15 15 / 28%);
}
.hah-nl-input-fret[data-input-fret="-1"] { color: #59616a; }
.hah-nl-input-fret[data-input-fret="-1"] span { background: transparent; }
.hah-nl-input-fret[data-input-fret="-1"].is-on span {
	color: #343b43;
	background: #fff;
	box-shadow: inset 0 0 0 2px #89929b;
}
.hah-nl-input-selection {
	margin: 0.8rem auto 0;
	overflow-wrap: anywhere;
	font-size: 0.95rem;
	font-weight: 650;
}
.hah-nl-input-transform {
	margin-top: 0.65rem;
	padding: 0.75rem;
	border: 1px solid #e2d7c8;
	border-radius: 10px;
	background: #fcfaf7;
}
.hah-nl-input-transform-fields {
	display: flex;
	flex-wrap: wrap;
	gap: 0.55rem;
	align-items: end;
}
.hah-nl-input-transform-fields label {
	display: grid;
	gap: 0.3rem;
	font-size: 0.8rem;
	font-weight: 700;
	color: var(--hah-muted, #5e6670);
}
.hah-nl-input-transform select { min-width: 8.2rem; color: var(--hah-ink, #20252a); }
.hah-nl-input-transform-arrow { padding-bottom: 0.65rem; color: #7b838b; font-weight: 800; }
.hah-nl-input-transpose { min-height: 44px; }
.hah-nl-input-transpose:disabled { cursor: not-allowed; opacity: 0.48; }
.hah-nl-input-transform-note {
	margin: 0.55rem 0 0;
	font-size: 0.82rem;
	line-height: 1.4;
	color: var(--hah-muted, #5e6670);
}
.hah-nl-input-spell-picker {
	margin-top: 0.65rem;
	padding: 0.65rem;
	border: 1px solid var(--hah-border, #d8dce1);
	border-radius: 8px;
	background: var(--hah-surface-muted, #f5f6f7);
}
.hah-nl-input-spell-picker[hidden] { display: none !important; }
.hah-nl-input-spell-title { margin: 0 0 0.45rem; font-weight: 700; }
.hah-nl-input-spell-options { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.hah-nl-input-spell-options button { min-height: 44px; }
/* Avoid delayed/double-tap click handling while preserving pan and pinch zoom. */
.hah-nhac-ly button { touch-action: manipulation; }

@media (max-width: 600px) {
	.hah-nl-chord-dialog {
		width: 100%;
		max-height: 86vh;
		max-height: 86dvh;
		margin: auto 0 0;
		border-radius: 18px 18px 0 0;
	}
	.hah-nl-chord-dialog-shell {
		max-height: 86vh;
		max-height: 86dvh;
		padding-bottom: env(safe-area-inset-bottom, 0px);
	}
	.hah-nl-chord-dialog-list { grid-template-columns: minmax(0, 1fr); }
	.hah-nl-chord-name-trigger { border-radius: 10px; }
	.hah-nhac-ly.is-instrument-input-open .hah-nl-player { display: none !important; }
	.hah-nhac-ly.has-player.is-instrument-input-open,
	.hah-nhac-ly.has-player.is-instrument-input-open:has(.hah-nl-player.is-arp-open) { padding-bottom: 1rem; }
	.hah-nl-instrument-input {
		margin-top: 0.75rem;
		padding-inline: 0.75rem;
		border-radius: 12px;
	}
	.hah-nl-instrument-input summary {
		margin-inline: -0.75rem;
		padding-inline: 0.75rem;
	}
	.hah-nl-input-toolbar { align-items: stretch; }
	.hah-nl-input-toolbar > .hah-nhac-ly-example { margin-left: auto; }
	.hah-nl-input-key-pair { flex-basis: 3.45rem; width: 3.45rem; }
	.hah-nl-input-key { height: 8.5rem; }
	.hah-nl-input-key.is-black { right: -1.2rem; width: 2.4rem; height: 5.3rem; }
	.hah-nl-input-fretboard thead th:nth-child(2),
	.hah-nl-input-fretboard td.is-mute { position: static; }
	.hah-nl-input-transform-fields {
		display: grid;
		grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
		align-items: end;
	}
	.hah-nl-input-transform-fields label,
	.hah-nl-input-transform select { width: 100%; min-width: 0; }
	.hah-nl-input-transform-arrow { display: none; }
	.hah-nl-input-transpose { grid-column: 1 / -1; width: 100%; }
}
@media (max-width: 420px) {
	.hah-nl-input-transform-fields { grid-template-columns: minmax(0, 1fr); }
}
