.chord-sheet-viewport {
	position: absolute;
	top: 0;
	left: 0;
	box-sizing: border-box;
	width: 100%;
	height: 100%;
	display: flex;
	flex-direction: column;
	overflow: auto;
	overflow-anchor: none;
	touch-action: pan-x pan-y;
	padding: 2.75rem clamp(0.75rem, 3vmin, 2rem) 1rem;
	color: #171717;
}

@media (max-width: 599px), (max-height: 599px) {
	.chord-sheet-viewport {
		padding-inline: 0.25rem;
		padding-bottom: 0.25rem;
	}
}

.chord-sheet-focused {
	padding-top: 1rem;
}

@media (max-width: 599px), (max-height: 599px) {
	.chord-sheet-focused {
		padding-top: 0.25rem;
	}
}

.chord-sheet-focused .chord-sheet-aside,
.chord-sheet-focused .chord-sheet-tone-comment,
.chord-sheet-focused .chord-sheet-row-hidden-in-focus,
.chord-sheet-focused header :is(.chord-sheet-credits, .chord-sheet-capo),
#popup:has(.chord-sheet-focused) :is(.chord-transpose-controls, .popup-close) {
	display: none;
}

.chord-sheet-sideways {
	top: 50%;
	left: 50%;
	width: 100vh;
	height: 100vw;
	width: 100dvh;
	height: 100dvw;
	transform: translate(-50%, -50%) rotate(90deg);
}

.chord-sheet-import-notice {
	flex: none;
	margin: 0;
	padding-bottom: 0.75em;
	color: #6c4e1f;
	font-size: 0.875rem;
	text-align: center;
}

.chord-sheet {
	flex: none;
	width: max-content;
	min-width: 12em;
	margin: auto;
	font-size: 1rem;
	line-height: 1.35;
}

.chord-sheet header {
	display: flex;
	align-items: baseline;
	gap: 0.65em;
	margin-bottom: 0.9em;
	contain: inline-size;
	white-space: nowrap;
	color: #16704b;
}

.chord-sheet h2,
.chord-sheet-tone-comment {
	font-family: Arial, sans-serif;
}

.chord-sheet h2 {
	flex: none;
	margin: 0;
	color: #171717;
	font-size: 1.25em;
}

.chord-sheet-credits {
	flex: 1 0 auto;
	text-align: center;
}

.chord-sheet-capo {
	flex: none;
	text-align: right;
}

.chord-sheet-row {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 1em;
	min-height: 1.35em;
}

.chord-sheet-main {
	white-space: pre;
	font-family: ui-monospace, monospace;
	font-variant-ligatures: none;
}

.chord-sheet-aside {
	white-space: pre;
	text-align: right;
	font-size: 0.78em;
	color: #5f5537;
}

.chord-sheet-note {
	font-size: 0.85em;
}

.chord-sheet-note .chord-sheet-main {
	flex: 1;
	min-width: 0;
	contain: inline-size;
	font-family: inherit;
}

.chord-sheet-note .chord-sheet-aside {
	font-size: 0.92em;
}

.chord-sheet-note-start {
	padding-top: 0.8em;
}

.chord-sheet-note-end {
	padding-bottom: 0.8em;
}

.chord-sheet-chords,
.chord-sheet-tone-chords {
	color: #00649e;
}

.chord-sheet-chords:has(+ .chord-sheet-lyrics) {
	margin-bottom: -0.2em;
}

.chord-sheet-lyrics + .chord-sheet-chords {
	margin-top: var(--chord-pair-gap, 0px);
}

.chord-sheet-note,
.chord-sheet-tone-note {
	color: #a61b1b;
}

.chord-sheet-tone-alternate {
	color: #62ace6;
}

.chord-sheet-tone-detail {
	color: #16704b;
}

.chord-sheet-tone-comment {
	color: #757575;
	font-weight: normal;
}

.chord-sheet-pitch,
.chord-sheet-tone-pitch {
	color: #806000;
}

.chord-sheet-aside.chord-sheet-tone-pitch {
	color: #bf8f00;
}

.chord-sheet-main sup {
	font-size: inherit;
	line-height: 0;
}
