.song-lesson .stages {border-bottom: 1px solid var(--editorial-line);}
.blues-studio .song-lesson button.primary:hover:not(:disabled) {background: #d3ed9f; color: #152325;}
.song-lesson :is(input[type="text"], input[type="number"]) {min-height: 34px; background: var(--editorial-rail); border: 1px solid var(--editorial-line); color: var(--editorial-text); border-radius: 3px; font: inherit; padding: .3rem .5rem;}
.song-lesson textarea {width: 100%; min-width: 0; font: inherit;}
.song-lesson input::placeholder, .song-lesson textarea::placeholder {color: var(--editorial-muted); opacity: 1;}

.song-write {display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 1.15fr); gap: 1.35rem;}
.song-title-field {display: grid; gap: .3rem; max-width: 31rem; font-weight: 700;}
.lyric-editor {display: grid; gap: .35rem; margin-top: .5rem;}
.lyric-editor .blues-answer {margin: 0;}
.lyric-editor .blues-answer > span, .second-lyric > small, .model-verse small {color: var(--editorial-muted);}
.lyric-editor textarea {min-height: 53px;}
.second-lyric button {margin-top: .3rem;}
.second-lyric > small {display: inline-block; margin: .2rem .4rem;}
.song-write > aside li {margin-bottom: .3rem;}
.model-verse {display: grid; list-style: none; margin: .7rem 0; padding: 0; gap: .45rem;}
.model-verse li {display: grid; grid-template-columns: 7.4rem minmax(0, 1fr); column-gap: .6rem; align-items: baseline; padding: .4rem .55rem; border-left: 3px solid var(--editorial-line); background: var(--editorial-charcoal);}
.model-verse li[aria-current] {border-color: var(--blues-amber); background: #3c3327;}
.model-verse li strong {color: var(--blues-amber);}
.model-verse li small {grid-column: 2;}

.song-sections {display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .45rem;}
.song-section {min-width: 0; display: grid; align-content: start; gap: .2rem; padding: .38rem .45rem; border: 1px solid var(--editorial-line); background: var(--editorial-charcoal);}
.song-section.selected {border-color: var(--editorial-accent);}
.song-section[aria-current] {border-color: var(--blues-amber);}
.song-section > button {justify-self: start;}
.blues-studio .song-section > button {min-height: 30px; padding: .17rem .45rem; font-size: .9rem;}
.section-lyric {min-height: 2.05rem; overflow-wrap: anywhere; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; white-space: pre-line; color: var(--editorial-text); font-size: .87rem; line-height: 1.17;}
.section-lyric.placeholder {color: var(--editorial-muted);}
.song-chords {display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .15rem;}
.blues-studio .song-lesson .song-chords > :is(button, div) {display: flex; flex-direction: column; align-items: center; justify-content: center; min-width: 0; min-height: 34px; padding: .12rem .16rem; font-size: .81rem; line-height: 1; text-align: center;}
.song-chords > div {border: 1px solid var(--editorial-line);}
.song-chords > * > span {display: block; font-size: .69rem; color: var(--editorial-muted);}
.song-chords > *[aria-current] {border-color: var(--blues-amber); background: #3c3327;}
.song-chords .song-marks {display: flex; min-height: .24rem; gap: .15rem; margin: .17rem auto 0; justify-content: center;}
.song-marks i {display: block; width: .43rem; min-height: .24rem; border-radius: .1rem;}
.song-marker {display: inline-block; padding: .1rem .35rem; margin: .25rem 0 0; border-radius: .2rem; color: #102221; font-weight: 700; font-size: .78rem;}
.melody-mark {background: #b5e977;}
.reply-mark {background: #a4d5ea;}

.song-transport, .song-tool-row, .song-key-controls, .song-record, .song-mode-buttons {display: flex; flex-wrap: wrap; align-items: center; gap: .38rem .65rem;}
.song-transport {padding: .4rem 0; border-bottom: 1px solid var(--editorial-line);}
.song-tool-row {padding: .35rem 0;}
#beatPosition {min-width: 4rem; color: var(--blues-amber); font-weight: 750;}
#beatPosition.recording {color: #ffad9d;}
.song-key-legend {margin-left: auto;}
.beat-lights {display: inline-flex; gap: .24rem;}
.beat-lights i {width: .8rem; aspect-ratio: 1; border: 1px solid var(--editorial-line); border-radius: 50%; background: #253a3e;}
.beat-lights i.on {background: var(--blues-amber); border-color: var(--blues-amber);}
.song-mode-buttons button[aria-pressed="true"] {border-color: var(--editorial-accent); color: var(--editorial-accent);}
.song-keys {padding: .35rem .55rem .2rem; border: 1px solid var(--editorial-line); background: var(--editorial-charcoal);}
.song-keys #keyboardHelp {margin: .15rem 0 .35rem; color: var(--editorial-muted); font-size: .9rem;}
.song-keys .improv-piano {max-width: none; margin: .42rem 0 .35rem; height: clamp(105px, 17vh, 143px);}
.song-keys .improv-piano:focus-within {outline: 2px solid var(--editorial-accent); outline-offset: 2px;}
.song-record > p {margin: .15rem 0; font-size: .92rem;}
.song-take {margin-top: .45rem; padding: .45rem .65rem; border: 1px solid var(--editorial-line); background: var(--editorial-charcoal);}
.song-take h2 {margin: 0 0 .2rem;}
.song-take ul {margin: .4rem 0; padding-left: 1.15rem;}
.song-take li {margin: .2rem 0;}
.song-take p {margin: .18rem 0;}
.song-take button {margin-right: .2rem;}

.song-grid-help {color: var(--editorial-muted); font-size: .9rem; margin: .25rem 0 .35rem;}
.song-lesson #composer .arr-matrix {min-width: calc(var(--label) + var(--bars) * 39px);}
.song-lesson #composer .bar-number {display: grid; justify-items: center; line-height: 1.1;}
.song-lesson #composer .bar-chord {color: var(--blues-amber);}
.song-lesson #composer .head-track {top: 34px;}
.song-lesson #composer .pattern {display: flex; flex-direction: column;}
.song-lesson #composer .score-scroll {order: 1;}
.song-lesson #composer .key-help {order: 2;}
.song-lesson #composer .note-tools input {width: 4.2rem;}
.song-lesson #composer .layers {align-self: start;}
.song-lesson #composer .layers select, .song-key-controls select {max-width: 100%;}
.song-lesson #composer .note-tools select {max-width: min(15rem, 100%);}
.song-lesson #composer .cell {height: 26px;}
.song-lesson #composer .layers #instrument {width: 100%; min-width: 0;}
.song-lesson #composer .score-scroll {min-width: 0; max-width: 100%;}

.song-mix {margin-top: .45rem; border-top: 1px solid var(--editorial-line); padding: .38rem 0 0;}
.song-mix #tempo {width: 4.5rem;}
.song-mix fieldset {border: 1px solid var(--editorial-line); display: flex; flex-wrap: wrap; gap: .4rem .8rem; padding: .4rem .55rem; margin: .4rem 0;}
.song-mix legend {padding-inline: .2rem;}
.song-mix input[type="range"] {width: 6rem;}
.song-mix .mix-control {display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: .2rem .45rem;}
.song-mix .mix-control > label {display: flex; align-items: center; gap: .2rem;}
.song-headphones {margin: .35rem 0;}
.song-coach {display: flex; flex-wrap: wrap; gap: .3rem .9rem; justify-content: space-between; align-items: center; padding: .4rem .65rem; margin: .45rem 0; border-left: 3px solid var(--editorial-accent); background: var(--editorial-charcoal);}
.song-coach h2 {font-size: 1rem; margin: .08rem 0;}
.song-coach p, .song-coach .blues-actions {margin: 0;}
.song-coach [hidden] {display: none;}
.coach-target {outline: 2px solid var(--editorial-accent); outline-offset: 2px;}
.song-review {margin-top: .35rem;}
.song-reflection {padding-top: .18rem; margin-top: .4rem;}
.song-import-fields {display: grid; gap: .35rem;}
.song-import-fields label {display: grid; gap: .2rem;}

@media (min-width: 1000px) and (max-height: 820px) {
    .song-lesson #composer .score-scroll {max-height: 268px; overflow: auto; overscroll-behavior: contain;}
    .song-lesson #composer .composer-layout {grid-template-columns: 190px minmax(0, 1fr);}
}
@media (max-width: 700px) {
    .song-write {grid-template-columns: minmax(0, 1fr); gap: .4rem;}
    .song-lesson .stages button {padding-inline: .3rem; white-space: normal;}
    .song-keys .improv-piano {min-height: 105px;}
    .song-section {padding: .28rem .24rem;}
    .song-sections {gap: .22rem;}
    .song-chords {gap: .08rem;}
    .song-section > button {white-space: normal;}
}
@media (max-width: 480px) {
    .blues-studio .song-lesson .song-chords > :is(button, div) {font-size: .71rem; padding-inline: 0;}
    .blues-studio .song-section > button {padding-inline: .25rem; font-size: .79rem;}
    .section-lyric {font-size: .8rem;}
    .song-key-controls .blues-field, .song-transport .blues-field {flex-wrap: wrap;}
    .model-verse li {grid-template-columns: 1fr;}
    .model-verse li small {grid-column: 1;}
}
@media (max-width: 355px) {
    .song-chords {grid-template-columns: repeat(2, minmax(0, 1fr));}
}
