.vocal-lesson {
  display: grid;
  gap: clamp(18px, 3vw, 31px);
  margin-top: clamp(15px, 2.5vw, 25px);
}

.vocal-lesson h2 {
  font-size: clamp(1.16rem, 1.75vw, 1.64rem);
  font-weight: 750;
  letter-spacing: -.028em;
  line-height: 1.18;
  text-wrap: balance;
}

.vocal-intro {
  max-width: 66ch;
  margin-top: 5px;
  color: var(--muted);
  font-size: .9rem;
  line-height: 1.45;
}

.vocal-examples, .vocal-voice-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin: 11px 0 0;
  padding: 0;
  list-style: none;
}

.vocal-example, .vocal-voice {
  display: grid;
  min-width: 0;
  align-content: start;
  gap: 4px;
  padding: clamp(9px, 1.2vw, 14px);
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  background: var(--white);
}

.vocal-example {
  grid-template-rows: auto minmax(2.6em, 1fr) auto auto;
}

.vocal-example h3, .vocal-voice h3, .vocal-voice h4 {
  font-size: .94rem;
  font-weight: 760;
  line-height: 1.2;
}

.vocal-example p, .vocal-voice-note {
  color: var(--muted);
  font-size: .79rem;
  line-height: 1.35;
}

.vocal-example-trace {
  display: block;
  width: 100%;
  height: 48px;
}

.vocal-example-band { fill: var(--target-pale); }
.vocal-example-target, .vocal-example-voice { fill: none; vector-effect: non-scaling-stroke; }
.vocal-example-target { stroke: var(--pitch-target); stroke-dasharray: 4 4; }
.vocal-example-voice { stroke: var(--accent); stroke-width: 2.5px; stroke-linecap: round; }

.vocal-listen {
  min-height: 44px;
  justify-self: start;
  padding-inline: 10px;
  font-size: .82rem;
}

.vocal-example .vocal-listen { width: 100%; }
.vocal-example:has([data-vocal-playing]), .vocal-voice:has([data-vocal-playing]) { border-color: var(--accent); }
.vocal-listen[data-vocal-playing] { background: var(--accent-pale); }

.vocal-credit {
  margin-top: 7px;
  color: var(--muted);
  font-size: .73rem;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.vocal-credit a { text-underline-offset: 2px; }

.vocal-timbre { margin-top: 14px; }
.vocal-timbre h3 { font-size: 1rem; line-height: 1.2; }
.vocal-timbre-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }

.vocal-practice {
  min-width: 0;
  padding: clamp(11px, 2vw, 20px);
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--white);
  scroll-margin-block: 14px;
}

.vocal-practice-header {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  justify-content: space-between;
  gap: 9px 16px;
  margin-bottom: 10px;
}

.vocal-selection {
  display: grid;
  max-width: 100%;
  gap: 3px;
}

.vocal-selection label {
  color: var(--muted);
  font-size: .74rem;
  font-weight: 700;
}

.vocal-selection select {
  min-height: 44px;
  max-width: 100%;
  padding: 4px 9px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: var(--white);
  color: var(--ink);
  font-size: .85rem;
}

.vocal-steps {
  margin: 0 0 14px;
  padding-inline-start: 1.35em;
  color: var(--muted);
  font-size: .88rem;
  line-height: 1.5;
}

.vocal-steps li + li { margin-top: 4px; }
.vocal-reference { margin: 7px 0 0; color: var(--muted); font-size: .8rem; }

.vocal-controls .button { min-height: 44px; }

.vocal-progress {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-top: 10px;
  color: var(--muted);
  font-size: .76rem;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.vocal-progress progress {
  width: 100%;
  min-width: 0;
  height: .52rem;
  accent-color: var(--pitch-target);
}

.vocal-progress [data-vocal-time] { min-width: 7ch; text-align: right; }
.vocal-status { min-height: 1.4em; margin-top: 5px; color: var(--muted); font-size: .84rem; }

.vocal-result {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.vocal-result h3 { font-size: 1.04rem; font-weight: 760; line-height: 1.2; }

.vocal-result-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 13rem), 1fr));
  gap: 6px 8px;
  margin: 8px 0 0;
}

.vocal-result-metric {
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--paper);
}

.vocal-result-metric dt { color: var(--muted); font-size: .74rem; font-weight: 730; }
.vocal-result-metric dd { margin: 2px 0 0; font-size: .84rem; line-height: 1.4; }
.vocal-result-metric strong { color: var(--ink); font-size: .95rem; }
.vocal-result-metric:is([data-vocal-outcome="steady"], [data-vocal-outcome="clear"]) strong { color: var(--pitch-target); }
.vocal-result-metric p { margin-top: 3px; color: var(--muted); }
.vocal-next { margin-top: 9px; font-size: .85rem; }
.vocal-next strong { display: block; margin-bottom: 2px; }
.vocal-comparison { margin-top: 8px; color: var(--muted); font-size: .83rem; }

.vocal-voices { border-top: 1px solid var(--line-strong); }

.vocal-voices summary {
  align-content: center;
  min-height: 44px;
  width: fit-content;
  color: var(--accent-dark);
  font-size: 1rem;
  font-weight: 760;
  cursor: pointer;
}

.vocal-voice-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 5px;
  margin-top: 5px;
}

.vocal-voice-actions .text-button { min-height: 44px; }

.vocal-messiah {
  margin: 16px 0 22px;
  padding: clamp(12px, 2vw, 18px);
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--white);
}

.vocal-messiah h3 { font-size: 1.12rem; line-height: 1.2; }
.vocal-messiah-piece { margin-top: 4px; font-weight: 710; }

.vocal-messiah-parts {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-top: 11px;
}

.vocal-messiah-part { display: grid; gap: 4px; text-align: center; }
.vocal-messiah-part .button { justify-content: center; min-height: 44px; padding-inline: 8px; }

.vocal-messiah-part .button[aria-expanded="true"] {
  border-color: var(--accent);
  background: var(--accent-pale);
  color: var(--accent-dark);
}

.vocal-messiah-part a { color: var(--muted); font-size: .76rem; text-underline-offset: 2px; }
.vocal-messiah .course-recorded-player { width: min(100%, 640px); }
.vocal-messiah .course-recorded-player iframe { min-height: 200px; }
.vocal-messiah-practice { margin-top: 10px; padding-top: 5px; border-top: 1px solid var(--line); }
.vocal-messiah-practice .button { min-height: 44px; }
.vocal-messiah-practice .vocal-credit { margin-top: 0; }

.vocal-voice-list.vocal-performances {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr));
}

.vocal-performance { gap: 5px; }
.vocal-performance:has(.course-recorded-player:not([hidden])) { grid-column: 1 / -1; }
.vocal-performance-piece { font-size: .9rem; font-weight: 700; line-height: 1.3; }
.vocal-performance-cue { margin-top: 3px; font-size: .83rem; line-height: 1.4; }
.vocal-performance .course-recorded-actions { margin-top: 5px; }
.vocal-performance .button { min-height: 44px; justify-self: start; }
.vocal-performance .course-recorded-player { width: min(100%, 640px); }
.vocal-performance .course-recorded-player iframe { min-height: 200px; }

@media (max-width: 520px) {
  .vocal-messiah-parts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .vocal-example { grid-template-rows: auto; }
  .vocal-examples { grid-template-columns: 1fr; }
  .vocal-example {
    grid-template-columns: minmax(0, 1fr) minmax(72px, .7fr) auto;
    align-items: center;
    column-gap: 7px;
  }
  .vocal-example p { grid-column: 1; grid-row: 2; }
  .vocal-example-trace { grid-column: 2; grid-row: 1 / 3; height: 38px; }
  .vocal-example .vocal-listen { grid-column: 3; grid-row: 1 / 3; }
  .vocal-voice-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 365px) {
  .vocal-example .vocal-listen > [data-vocal-icon] { display: none; }
}
