/* Scoped to the two earlier lesson documents; shared keyboards retain their geometry. */
.cwEarlyTimeline{margin:7px 0;padding:5px 6px;border:1px solid #35445c;border-radius:6px;background:#0b1320}
.cwEarlyTimeline[hidden],#accompMelodyMotionLabel[hidden]{display:none!important}
.cwEarlyRuler,.cwEarlyLane{display:grid;grid-template-columns:62px minmax(0,1fr);gap:6px;align-items:center;font-size:10px}
.cwEarlyRuler>div{height:18px;position:relative}.cwEarlyRuler b{position:absolute;font-size:9px;color:#c7d7ed;white-space:nowrap}
.cwEarlyTrack{position:relative;height:35px;background:repeating-linear-gradient(90deg,transparent 0,transparent calc(6.25% - 1px),#32435b55 calc(6.25% - 1px),#32435b55 6.25%)}
.cwEarlyLane+.cwEarlyLane{border-top:1px solid #35445c}
html.cwLearningSystem.cwMelodyFamily #foundationTimeline button.cwEarlyEvent{position:absolute;top:4px;height:26px!important;min-height:0!important;min-width:0!important;padding:0 2px!important;background:#44365c!important;border:1px solid #c294ed!important;color:#f5e7ff!important;border-radius:3px!important;font-size:10px!important;line-height:1.1!important;overflow:hidden;white-space:nowrap;cursor:pointer}
html.cwLearningSystem.cwMelodyFamily #foundationTimeline button.harmony{background:#213d60!important;border-color:#6292cf!important;color:#d4e5ff!important}
html.cwLearningSystem.cwMelodyFamily #foundationTimeline button.bass{background:#504727!important;border-color:#d9bc53!important;color:#ffe9a0!important}
html.cwLearningSystem.cwMelodyFamily #foundationTimeline button.passing{background:#794820!important;border-color:#f3aa52!important}
html.cwLearningSystem.cwMelodyFamily #foundationTimeline button.neighbour{background:#174b46!important;border-color:#5fd6c8!important}
html.cwLearningSystem.cwMelodyFamily #foundationTimeline button.borrowed{background:#783d33!important;border-color:#ff927c!important}
html.cwLearningSystem.cwMelodyFamily #foundationTimeline button.tension{background:#643346!important;border-color:#ef869c!important}
html.cwLearningSystem.cwMelodyFamily #foundationTimeline button.sounding{box-shadow:inset 0 0 0 2px white!important;z-index:3}
.cwEarlyEvent:hover,.cwEarlyEvent:focus-visible{outline:2px solid white;z-index:4}
.cwEarlyBarBoundary{position:absolute;top:0;bottom:0;border-left:2px solid #91a4be;pointer-events:none;z-index:2}
.cwEarlyCursor{position:absolute;top:0;bottom:0;border-left:1px solid #ffffffbb;pointer-events:none;z-index:4}
html.cwMelodyFamily .cwEarlyTimeline:not([hidden])~.melodyNoteStrip{display:none}
html.cwMelodyFamily .cwEarlyTimeline:not([hidden])~.melodyStatus{min-height:30px!important;padding:6px!important}
html.cwAccompanimentFamily .accompRuler b{font-size:9px;white-space:nowrap}
@media(min-width:901px){html.cwLearningSystem.cwAccompanimentFamily .melodyControls:has(#accompMelodyMotionLabel:not([hidden])){grid-template-columns:.5fr 1.4fr 1fr 1.1fr 1.4fr 1fr;gap:8px!important}}
@media(max-height:800px) and (min-width:901px){.cwEarlyTrack{height:28px}html.cwLearningSystem.cwMelodyFamily #foundationTimeline button.cwEarlyEvent{height:22px!important;top:3px}html.cwEarlyMelodyTimelines:has(#foundationTimeline:not([hidden])) .lesson-content{padding-top:8px!important}html.cwEarlyMelodyTimelines:has(#foundationTimeline:not([hidden])) .lesson-intro{margin-bottom:6px!important}html.cwEarlyMelodyTimelines:has(#foundationTimeline:not([hidden])) .explanation{padding:8px 10px!important}html.cwEarlyMelodyTimelines:has(#foundationTimeline:not([hidden])) .explanation summary{font-size:13px!important}}
@media(max-width:900px){.cwEarlyRuler,.cwEarlyLane{grid-template-columns:47px minmax(0,1fr);gap:3px}.cwEarlyRuler b{font-size:8px}.cwEarlyTimeline{padding:4px}html.cwLearningSystem.cwMelodyFamily #foundationTimeline button.cwEarlyEvent{font-size:8px!important}}

/* Four complete, equal bars remain fixed; extra ending sustain has its own beat-scaled strip. */
.cwEarlyEndingTail{display:grid;grid-template-columns:62px minmax(0,1fr);gap:6px;align-items:center;margin-top:3px;padding-top:3px;border-top:1px dashed #6685ad;font-size:9px;line-height:11px;color:#bdd0eb}
.cwEarlyTailTrack{position:relative;height:40px}.cwEarlyTailLane{position:absolute;left:0;right:0;height:9px}
.cwEarlyTailBeat{position:absolute;top:0;font-size:8px;font-weight:500}.cwEarlyTailCursor{position:absolute;top:8px;bottom:0;border-left:1px solid white;pointer-events:none;z-index:5}
html.cwLearningSystem.cwMelodyFamily #foundationTimeline .cwEarlyEndingTail button.cwEarlyEvent{top:0;height:9px!important;font-size:8px!important;border-radius:1px!important;line-height:8px!important}
@media(max-width:900px){.cwEarlyEndingTail{grid-template-columns:47px minmax(0,1fr);gap:3px}}
@media(max-height:800px) and (min-width:901px){.cwEarlyTimeline:has(.cwEarlyEndingTail) .cwEarlyTrack{height:25px}html.cwLearningSystem.cwMelodyFamily #foundationTimeline:has(.cwEarlyEndingTail) .cwEarlyTrack button.cwEarlyEvent{height:20px!important;top:2px}}
