/* Teacher examples use the site’s paper, engraving and playback tokens. */
.ft {
  --ft-lh: #2f6690;
  --ft-lh-soft: #d9e7f2;
  --ft-rh-soft: #fadbd0;
  --ft-ivory: #faf9f6;
  --ft-ivory-edge: #e4e1d9;
  --ft-ebony: #1a191f;
  overflow-x: clip;
}
/* ── Act 2: Before / After showcase cards ─────────────────────────────────────────────────────────────────────── */

.ft-panel {
  display: grid;
  gap: var(--space-6);
}

.ft-panel[hidden] {
  display: none;
}

.ft-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--space-4);
}

.ft-card-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--space-4);
}

.ft-card-title {
  display: grid;
  gap: var(--space-1);
}

.ft-meta {
  margin: 0;
  font-size: 14px;
  line-height: var(--lh-snug);
  color: var(--muted);
}

/* Segmented Before / After switch (edge-to-edge press areas; 44px on touch screens). */
.ft-switch,
.ft-seg {
  display: inline-flex;
  align-items: stretch;
  padding: 4px;
  border-radius: var(--radius-md);
  background: var(--layer-2);
  box-shadow: var(--ring);
}

.ft-switch-btn,
.ft-seg-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: 8px 16px;
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  font-family: var(--sans);
  font-size: 14px;
  font-weight: 500;
  line-height: 1;
  color: var(--muted);
  cursor: pointer;
  white-space: nowrap;
  transition:
    background-color 0.2s var(--ease),
    color 0.2s var(--ease),
    box-shadow 0.2s var(--ease);
}

@media (pointer: coarse) {
  .ft-switch-btn::before,
  .ft-seg-btn::before {
    content: "";
    position: absolute;
    inset: -4px 0;
  }
}

.ft-switch-btn:hover,
.ft-seg-btn:hover {
  color: var(--ink);
}

.ft-switch-btn.is-on,
.ft-seg-btn.is-on {
  background: var(--white);
  color: var(--ink);
  box-shadow: var(--ring);
}

.ft-switch-btn:focus-visible,
.ft-seg-btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* Engraved music sheet paper surface */
.ft-sheet {
  padding: var(--space-4);
  border-radius: var(--radius-md);
  background: var(--layer-1);
  overflow-x: auto;
}

.ft-song-sheet:focus-visible {
  outline: 2px solid var(--ai-mark);
  outline-offset: -2px;
}
.ft-sheet-hint {
  display: none;
}
@media (max-width: 640px) {
  .ft-song-sheet {
    padding-inline: var(--space-6);
  }
  .ft-workbench [data-compare="song"] .ft-song-sheet .engraved {
    min-width: 608px;
  }
  .ft-sheet-hint {
    display: block;
    margin: 0;
    color: var(--muted);
    font-size: 13px;
    text-wrap: pretty;
  }
}

.ft-layer[hidden] {
  display: none;
}

.ft-sheet .engraved,
.ft-sheet-img {
  display: block;
  width: auto;
  max-width: 100%;
  max-height: 248px;
  height: auto;
  margin-inline: auto;
}

.ft-sheet-img-jianpu {
  width: 400px;
  max-height: 148px;
}

[data-panel="guitar-ukulele"] .ft-sheet .engraved {
  max-height: 296px;
}

[data-panel="arranging"] .ft-sheet-img {
  max-height: 280px;
}

.ft-practice-score .engraved {
  display: block;
  width: auto;
  max-width: 100%;
  max-height: 204px;
  margin-inline: auto;
}

/* Preserve editorial Piano/Guitar/Ukulele chord diagram fills & strokes cleanly against styles.css .engraved rules. */
.engraved .chord-diagram rect:not([stroke]),
.engraved .chord-diagram path:not([stroke]),
.engraved .chord-diagram circle:not([stroke]) {
  stroke: none;
}

.engraved .chord-diagram rect[stroke] {
  stroke: var(--ink-soft);
}

.ft-card-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-3) var(--space-4);
}

.ft-play {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  min-height: 44px;
  padding: 0 16px;
  border: 0;
  border-radius: var(--radius-sm);
  background: var(--white);
  box-shadow: var(--ring);
  font-family: var(--sans);
  font-size: 14px;
  font-weight: 500;
  line-height: 1;
  color: var(--ink);
  cursor: pointer;
  transition:
    background-color 0.2s var(--ease),
    color 0.2s var(--ease);
}

.ft-play:hover {
  background: var(--ink);
  color: var(--white);
}

.ft-play.is-playing {
  background: var(--accent);
  color: var(--white);
  box-shadow: none;
}

.ft-play .icon {
  width: 16px;
  height: 16px;
}

.ft-play:focus-visible,
.ft-play-main:focus-visible,
.ft-pdf-link:focus-visible,
.ft-sample-card:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.ft-note {
  flex: 1 1 260px;
  margin: 0;
  font-size: 14px;
  line-height: var(--lh-ui);
  color: var(--ink-soft);
}

.ft-note[hidden] {
  display: none;
}

.ft-pdf-link {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  min-height: 44px;
  padding: 0 12px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 500;
  color: var(--ink);
  text-decoration: none;
  transition: background-color 0.2s var(--ease);
}

.ft-pdf-link:hover {
  background: var(--layer-2);
}

.ft-pdf-link .icon {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* A line under each instrument's tab: what an easier version really changes on that instrument. */
.ft-panel-lead {
  max-width: 720px;
  margin: 0;
  font-size: 16px;
  line-height: var(--lh-body);
  color: var(--ink-soft);
  text-wrap: pretty;
}

/* ── Levels: one piece checked against four levels ────────────────────────────────────────────────────────────── */

.ft-level-pick {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2) var(--space-3);
}

.ft-level-card .ft-sheet .engraved {
  max-height: 232px;
}

.ft-level-card .ft-sheet .svg-narrow {
  display: none;
}

/* A note the checker puts above the chosen level, in the accent as a marked note is elsewhere on the site. */
.ft-level-card[data-level="0"] .ft-layer[data-version="before"] [data-over~="0"],
.ft-level-card[data-level="1"] .ft-layer[data-version="before"] [data-over~="1"],
.ft-level-card[data-level="2"] .ft-layer[data-version="before"] [data-over~="2"],
.ft-level-card[data-level="3"] .ft-layer[data-version="before"] [data-over~="3"] {
  color: var(--accent);
  fill: var(--accent);
}

.ft-level-findings[hidden] {
  display: none;
}

.ft-level-findings {
  display: grid;
  gap: var(--space-2);
}

.ft-level-verdict {
  margin: 0;
  font-size: 20px;
  font-weight: 600;
  line-height: var(--lh-heading);
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

.ft-level-findings ul {
  display: grid;
  margin: 0;
  padding: 0;
  list-style: none;
}

.ft-level-findings li {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-2) var(--space-5);
  min-height: 44px;
  padding: var(--space-3) 0;
  border-top: 1px solid var(--hair-strong);
  font-size: 16px;
  line-height: var(--lh-snug);
  color: var(--ink-soft);
  text-wrap: pretty;
}

.ft-level-findings li b {
  flex: none;
  font: 500 12px / 1.3 var(--mono);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent-text);
  font-variant-numeric: tabular-nums;
}

:root:is(:lang(zh), :lang(ja), :lang(ko)) .ft-level-findings li b {
  font-family: var(--sans);
  font-size: 13px;
  letter-spacing: 0;
  text-transform: none;
}

/* The original shows the chosen level's list; the rewritten version shows its own, and no level to pick. */
.ft-level-card[data-active-version="after"] :is(.ft-level-pick, .ft-level-findings:not(.ft-level-after)),
.ft-level-card:not([data-active-version="after"]) .ft-level-after {
  display: none;
}

.ft-level-source {
  max-width: 820px;
  margin: var(--space-5) 0 0;
  font-size: 14px;
  line-height: var(--lh-body);
  color: var(--muted);
  text-wrap: pretty;
}

/* ── Questions ────────────────────────────────────────────────────────────────────────────────────────────────── */

.ft-questions {
  padding-top: var(--space-4);
  padding-bottom: var(--space-10);
  scroll-margin-top: var(--space-7);
}

.ft-questions .faq-list {
  max-width: 820px;
}

/* ── Act 3: Interactive Student Practice Link ─────────────────────────────────────────────────────────────────── */

.ft-practice-section {
  padding-top: var(--space-6);
  padding-bottom: var(--space-10);
  scroll-margin-top: var(--space-7);
}

.ft-practice {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--space-4);
}

.ft-practice-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-2) var(--space-5);
}

.ft-practice-title {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
  line-height: var(--lh-heading);
  color: var(--ink);
}

.ft-practice-by {
  margin: var(--space-1) 0 0;
  font-size: 14px;
  font-weight: 500;
  line-height: var(--lh-snug);
  color: var(--accent-text);
}

.ft-practice-hint {
  margin: 0;
  font-size: 13px;
  line-height: var(--lh-snug);
  color: var(--muted);
}

.ft-practice-score {
  padding: var(--space-4);
  border-radius: var(--radius-md);
  background: var(--layer-1);
  overflow-x: auto;
}

.ft-practice-score .engraved .note.is-playing-rh {
  color: var(--accent);
  fill: var(--accent);
}

.ft-practice-score .engraved .note.is-playing-lh {
  color: var(--ft-lh);
  fill: var(--ft-lh);
}

.ft-practice-score .engraved .note.is-muted-hand {
  opacity: 0.28;
}

.ft-practice-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4) var(--space-5);
}

.ft-transport {
  display: inline-flex;
  align-items: center;
  gap: var(--space-3);
}

.ft-play-main {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: var(--radius-pill);
  background: var(--ink);
  color: var(--white);
  cursor: pointer;
  transition:
    background-color 0.2s var(--ease),
    transform 0.15s var(--ease);
}

.ft-play-main:hover {
  background: var(--ink-soft);
}

.ft-play-main.is-playing {
  background: var(--accent);
}

.ft-play-main .icon {
  width: 18px;
  height: 18px;
}

.ft-clock {
  font: 500 13px / 1 var(--mono);
  font-variant-numeric: tabular-nums;
  color: var(--muted);
}

.ft-control-group {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2) var(--space-3);
}

/* Loop: repeats the whole piece, as the student page's Loop does. */
.ft-loop-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  min-height: 36px;
  padding: 0 var(--space-3);
  border: 0;
  border-radius: var(--radius-md);
  background: var(--layer-2);
  box-shadow: var(--ring);
  font: 500 14px / 1 var(--sans);
  color: var(--muted);
  cursor: pointer;
  transition:
    background-color 0.2s var(--ease),
    color 0.2s var(--ease);
}

.ft-loop-btn .icon {
  width: 18px;
  height: 18px;
}

.ft-loop-btn:hover {
  color: var(--ink);
}

.ft-loop-btn[aria-pressed="true"] {
  background: var(--accent-tint);
  color: var(--accent-text);
  box-shadow: 0 0 0 1px rgba(232, 80, 26, 0.3);
}

.ft-loop-btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

@media (pointer: coarse) {
  .ft-loop-btn {
    min-height: 44px;
  }
}

/* A note tapped in the practice score lights its keys until play or another tap moves on. */
.ft-practice-score .engraved g.note {
  cursor: pointer;
}

/* ── Live Visual Piano Practice Keyboard (parity with PR #3165) ───────────────────────────────────────────────── */

.ft-kbd-area {
  display: grid;
  gap: var(--space-3);
  min-width: 0;
}

.ft-kbd-legend {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2) var(--space-5);
  font-size: 13px;
  line-height: var(--lh-snug);
  color: var(--muted);
}

.ft-legend-item {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  color: var(--ink-soft);
  font-weight: 500;
}

.ft-dot {
  width: 10px;
  height: 10px;
  border-radius: var(--radius-pill);
}

.ft-dot-rh {
  background: var(--accent);
}

.ft-dot-lh {
  background: var(--ft-lh);
}

.ft-legend-tip {
  margin-inline-start: auto;
  text-wrap: pretty;
}

.ft-kbd-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 4px;
}

.ft-kbd {
  position: relative;
  display: flex;
  width: 100%;
  min-width: 600px;
  height: 132px;
  padding: 4px 2px 2px;
  border-radius: var(--radius-sm);
  background: var(--ft-ebony);
  user-select: none;
  -webkit-user-select: none;
}

/* Black keys are 4.1% of the keyboard. Its touch layout scrolls with distinct 44px keys. */
@media (pointer: coarse) {
  .ft-kbd {
    min-width: 1080px;
  }
}

.ft-kbd :is(.ft-key-w, .ft-key-b):focus-visible {
  outline: 2px solid var(--ai-mark);
  outline-offset: -3px;
  z-index: 3;
}

.ft-key-w {
  position: relative;
  flex: 1 1 0;
  height: 100%;
  padding: 0;
  border: 0;
  border-right: 1px solid var(--ft-ivory-edge);
  border-bottom: 3px solid var(--ft-ivory-edge);
  border-radius: 0 0 6px 6px;
  background: var(--ft-ivory);
  cursor: pointer;
  transition:
    background-color 0.08s,
    box-shadow 0.08s;
}

.ft-key-w:first-child {
  border-radius: 2px 0 6px 6px;
}

.ft-key-w:last-of-type {
  border-right: 0;
  border-radius: 0 2px 6px 6px;
}

.ft-key-w:hover {
  background: var(--white);
}

.ft-key-w.is-rh {
  background: var(--ft-rh-soft);
  border-bottom-color: var(--accent);
}

.ft-key-w.is-lh {
  background: var(--ft-lh-soft);
  border-bottom-color: var(--ft-lh);
}

.ft-key-w.is-audition {
  background: var(--layer-2);
  border-bottom-color: var(--ink);
}

.ft-key-w.is-ghost-rh::after,
.ft-key-w.is-ghost-lh::after {
  content: "";
  position: absolute;
  inset: 4px 3px 6px;
  border-radius: 4px;
  pointer-events: none;
}

.ft-key-w.is-ghost-rh::after {
  border: 2px dashed var(--accent);
}

.ft-key-w.is-ghost-lh::after {
  border: 2px dashed var(--ft-lh);
}

.ft-key-b {
  position: absolute;
  top: 4px;
  z-index: 2;
  width: 4.1%;
  height: 60%;
  padding: 0;
  border: 0;
  border-bottom: 3px solid var(--ink);
  border-radius: 0 0 4px 4px;
  background: var(--ft-ebony);
  cursor: pointer;
  transform: translateX(-50%);
  transition: background-color 0.08s;
}

.ft-key-b.is-rh {
  background: var(--accent);
}

.ft-key-b.is-lh {
  background: var(--ft-lh);
}

.ft-key-b.is-audition {
  background: var(--muted);
}

.ft-key-b.is-ghost-rh {
  outline: 2px dashed var(--accent);
  outline-offset: -3px;
}

.ft-key-b.is-ghost-lh {
  outline: 2px dashed var(--ft-lh);
  outline-offset: -3px;
}

.ft-key-c4 {
  position: absolute;
  bottom: 8px;
  left: 50%;
  width: 6px;
  height: 6px;
  border-radius: var(--radius-pill);
  background: var(--soft);
  transform: translateX(-50%);
  pointer-events: none;
}

.ft-key-finger {
  position: absolute;
  bottom: 18px;
  left: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: var(--radius-pill);
  font: 600 12px / 1 var(--sans);
  color: var(--white);
  transform: translateX(-50%);
  pointer-events: none;
}

.ft-key-b .ft-key-finger {
  bottom: 8px;
  width: 20px;
  height: 20px;
  font-size: 11px;
}

.ft-key-w.is-rh .ft-key-finger,
.ft-key-b.is-rh .ft-key-finger {
  background: var(--accent);
}

.ft-key-w.is-lh .ft-key-finger,
.ft-key-b.is-lh .ft-key-finger {
  background: var(--ft-lh);
}

.ft-key-w.is-ghost-rh .ft-key-finger,
.ft-key-w.is-ghost-lh .ft-key-finger {
  background: var(--white);
  box-shadow: var(--ring);
}

.ft-key-w.is-ghost-rh .ft-key-finger {
  color: var(--accent-text);
}

.ft-key-w.is-ghost-lh .ft-key-finger {
  color: var(--ft-lh);
}

/* ── Bar-Synced Video + Guitar Staff & TAB (Endecha) ──────────────────────────────────────────────────────────── */

.ft-video-stage {
  min-width: 0;
}

.ft-video-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.92fr) minmax(0, 1.25fr);
  gap: var(--space-5);
  align-items: start;
}

.ft-video-pane {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-self: start;
  min-width: 0;
}

.ft-video-frame {
  position: relative;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--layer-2);
  aspect-ratio: 4 / 3;
}

.ft-video-frame video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.ft-video-bar-pill {
  position: absolute;
  top: 10px;
  left: 10px;
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: 4px 12px;
  border-radius: var(--radius-pill);
  background: rgba(15, 14, 18, 0.78);
  backdrop-filter: blur(8px);
  color: var(--on-night);
  font: 500 12px / 1 var(--sans);
  font-variant-numeric: tabular-nums;
}

.ft-video-live-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
}

.ft-video-bar {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-top: var(--space-3);
}

.ft-video-play {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--white);
  color: var(--ink);
  cursor: pointer;
  flex-shrink: 0;
}

.ft-video-play .icon {
  width: 16px;
  height: 16px;
}

.ft-video-scrubber {
  flex: 1 1 auto;
  height: 4px;
  border-radius: var(--radius-pill);
  background: var(--layer-2);
  overflow: hidden;
}

.ft-video-progress {
  height: 100%;
  width: 34%;
  background: var(--accent);
  border-radius: var(--radius-pill);
}

.ft-video-time {
  color: var(--muted);
  font: 500 12px / 1 var(--mono);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.ft-video-score-pane {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: var(--space-3);
  min-width: 0;
}

.ft-video-score-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  padding-bottom: var(--space-3);
  border-bottom: 1px solid var(--hair);
}

.ft-s-title-group {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.ft-s-piece {
  font: 600 17px / var(--lh-heading) var(--sans);
  color: var(--ink);
}

.ft-s-sub {
  font: 400 13px / var(--lh-snug) var(--sans);
  color: var(--muted);
}

.ft-video-score-svg {
  margin-block: var(--space-4);
}

.ft-video-score-svg svg {
  width: 100%;
  height: auto;
  display: block;
}

.ft-video-score-svg .svg-narrow {
  display: none !important;
}

.ft-video-score-svg .svg-wide {
  display: block !important;
}

.ft-bar-hl {
  fill: rgba(232, 80, 26, 0.08) !important;
  stroke: rgba(232, 80, 26, 0.28) !important;
  stroke-width: 24px !important;
  rx: 70;
}

.ft-beat-cursor {
  stroke: #e8501a !important;
  stroke-width: 36px !important;
  stroke-linecap: round;
}

.ft-bar-jump-strip {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
}

.ft-bar-jump-label {
  color: var(--muted);
  font: 500 12px / var(--lh-heading) var(--sans);
}

.ft-bar-jump-btn {
  position: relative;
  min-height: 32px;
  padding: 0 12px;
  border: 0;
  border-radius: var(--radius-pill);
  background: var(--layer-1);
  box-shadow: var(--ring);
  color: var(--ink-soft);
  font: 500 12px / 1 var(--sans);
  font-variant-numeric: tabular-nums;
  cursor: pointer;
}

.ft-bar-jump-btn::before {
  content: "";
  position: absolute;
  inset: -4px -5px;
}

.ft-bar-jump-btn[aria-pressed="true"] {
  background: var(--accent-tint);
  color: var(--accent-text);
  box-shadow: 0 0 0 1px rgba(232, 80, 26, 0.3);
}

.ft-sample-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: var(--space-4);
  min-height: 52px;
  padding: var(--space-2) var(--space-1);
  border-bottom: 1px solid var(--hair);
  color: var(--ink);
  text-decoration: none;
  transition: background-color 0.2s var(--ease);
}

.ft-sample-card:hover {
  background: var(--layer-1);
}

.ft-sample-card b {
  font-size: 16px;
  font-weight: 600;
  line-height: var(--lh-snug);
}

/* The instruments share one track. Both scores start at the same baseline. */
.ft-class-scores {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-5);
}
.ft-book-head {
  display: flex;
  flex-wrap: wrap;
  align-content: center;
  align-items: baseline;
  gap: var(--space-1) var(--space-3);
  min-height: 44px;
  font-size: 14px;
}
.ft-book-head span {
  color: var(--muted);
  font-size: 13px;
}
.ft-class-stage {
  display: grid;
  gap: var(--space-5);
}
.ft-book {
  display: grid;
  align-content: start;
  gap: var(--space-2);
  margin: 0;
}
.ft-book-score {
  display: grid;
  align-items: center;
  padding: var(--space-6);
  border-radius: var(--radius-md);
  background: var(--layer-1);
}
.ft-book-score img {
  display: block;
  width: 100%;
  height: auto;
}
/* Each visible part occupies the same two rows as the source. */
html.js .ft-seats {
  display: grid;
  min-width: 0;
}
html.js :is(.ft-book, .ft-seat) {
  grid-template-rows: auto 1fr;
  align-content: stretch;
}
.ft-seat[hidden] {
  display: none;
}

.ft-seat {
  display: grid;
  align-content: start;
  gap: var(--space-2);
  min-width: 0;
}

.ft-seat-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  min-height: 44px;
}

.ft-seat-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: var(--space-1) var(--space-2);
  min-width: 0;
}

.ft-seat-meta b {
  font-size: 15px;
  font-weight: 600;
  line-height: var(--lh-snug);
  color: var(--ink);
}

.ft-seat-meta span {
  font: 500 12px / var(--lh-snug) var(--mono);
  letter-spacing: 0.04em;
  color: var(--muted);
}

.ft-seat-play {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 0;
  border-radius: var(--radius-sm);
  background: var(--layer-1);
  box-shadow: var(--ring);
  color: var(--ink);
  cursor: pointer;
  transition:
    background-color 0.2s var(--ease),
    color 0.2s var(--ease);
}

@media (pointer: coarse) {
  .ft-seat-play::before {
    content: "";
    position: absolute;
    inset: -4px;
  }
}

.ft-seat-play:hover {
  background: var(--ink);
  color: var(--white);
}

.ft-seat-play.is-playing {
  background: var(--accent);
  color: var(--white);
  box-shadow: none;
}

.ft-seat-play .icon {
  width: 14px;
  height: 14px;
}

.ft-seat-play:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.ft-seat-music {
  display: grid;
  align-items: center;
  min-width: 0;
  overflow-x: auto;
  padding: var(--space-6);
  border-radius: var(--radius-md);
  background: var(--layer-1);
}

.ft-seat-music .engraved,
.ft-workbench [data-compare="song"] .ft-sheet .engraved {
  display: block;
  width: 100%;
  height: auto;
  max-height: none;
}
.ft-workbench [data-compare="song"] .ft-sheet .engraved {
  max-width: 920px;
}

/* The lesson follows the page scroll. Only the shared header sits above it. */
.ft-page {
  --ai-mark: #2f6fdb;
  --ai-tint: color-mix(in srgb, var(--ai-mark) 16%, var(--paper));
  --ft-section-space: clamp(56px, 6vw, 80px);
}
.ft-page .wrap {
  width: min(1120px, 100% - 2 * var(--gutter));
}
.ft :is(section, .ft-studio, .ft-questions, [role="tabpanel"]) {
  scroll-margin-top: calc(var(--nav-h, 72px) + 16px);
}
.ft :is(h1, h2):not(.hm-end-title) {
  margin: 0;
  font: 800 var(--display-2) / 0.98 var(--poster);
  color: var(--ink);
  text-transform: uppercase;
  text-wrap: balance;
}
.ft :is(h1, h2):not(.hm-end-title):lang(zh),
.ft :is(h1, h2):not(.hm-end-title):lang(ja),
.ft :is(h1, h2):not(.hm-end-title):lang(ko) {
  font-family: var(--display);
  font-weight: var(--weight-strong);
  line-height: var(--lh-heading);
  text-transform: none;
}
.ft h3 {
  margin: 0;
  font-size: 20px;
  line-height: var(--lh-heading);
}
.ft .ft-hero h1 {
  font-size: var(--display-1);
}
.ft .ft-hero h1:lang(zh) {
  max-width: 8em;
  font-size: var(--display-2);
}
.ft-hero {
  padding-block: 12px 0;
}
.ft-hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 0.9fr);
  gap: clamp(28px, 6vw, 96px);
  align-items: center;
  min-height: min(760px, calc(100svh - var(--nav-h, 72px) - 12px));
}
.ft-intake {
  display: grid;
  gap: var(--space-5);
}
.ft-starter-short {
  display: none;
}
.ft-intake > p {
  max-width: 52ch;
  margin: 0;
  color: var(--ink-soft);
  font-size: var(--lede);
  text-wrap: pretty;
}
/* The result is the width of the river card, below its smaller source. */
.ft-page .ft-river {
  --rv-height: clamp(480px, calc(100svh - 125px), 710px);
  --rv-w: min(88%, 416px);
  --rv-card-inset: 8px;
  height: var(--rv-height);
}
.ft-river .rv-in {
  grid-area: 1 / 1;
}
.ft-river .rv-in-video video {
  transform: none;
  aspect-ratio: 4 / 3;
}
.ft-river .rv-in-photo img {
  aspect-ratio: 4 / 3;
}
.ft-river .rv-out {
  grid-area: 2 / 1;
}
.ft-river .rv-item .st-perch {
  position: relative;
  grid-area: 2 / 1;
  align-self: start;
  justify-self: end;
  inset: auto;
  z-index: 4;
  margin-right: var(--space-4);
  width: 56px;
  translate: 0 calc(-100% + 8px);
}
.ft-river .rv-play {
  position: relative;
  grid-area: 1 / 1;
  align-self: center;
  justify-self: start;
  inset: auto;
  margin-left: calc(var(--inw-k) * 100% - 56px);
  width: 48px;
  height: 48px;
}
html.js .ft-river:not(.is-ready) .rv-item:first-child .rv-out > img {
  opacity: 1;
}
.ft-page #hero .ft-river .rv-item .rv-out {
  background-image: none;
}
html:not(.js) .ft-page .ft-river {
  height: auto;
}

.ft-section {
  padding-block: var(--ft-section-space);
}
.ft-heading {
  margin: 0 0 var(--space-6);
}
.ft-workbench {
  display: grid;
  gap: var(--space-4);
}
.ft-tabs {
  flex-wrap: wrap;
  max-width: 100%;
  margin: 0;
}
.ft-tabs button {
  padding-inline: var(--space-4);
  line-height: var(--lh-snug);
  white-space: normal;
}
html:not(.js) .ft-tabs {
  display: none;
}
.ft-panel + .ft-panel:not([hidden]) {
  margin-top: var(--space-4);
}
.ft-panel[hidden] + .ft-panel:not([hidden]) {
  margin-top: 0;
}
.ft-formats figure {
  display: grid;
  gap: var(--space-2);
  justify-items: start;
  margin: 0;
  padding: var(--space-4);
  border-radius: var(--radius-md);
  background: var(--layer-1);
}
.ft-formats img {
  display: block;
  width: min(100%, 480px);
  height: auto;
}
.ft-formats figure:last-of-type img {
  width: min(100%, 320px);
}
.ft-level-pick .ft-seg {
  flex-wrap: wrap;
}
.ft-level-findings li {
  border-color: var(--hair);
}
.ft .ft-card .ft-layer[hidden] {
  display: none;
}

.ft-demo .ft-tabs {
  margin-bottom: var(--space-4);
}
.ft-credit {
  margin: 0;
  font-size: 13px;
  color: var(--muted);
}
.ft :is(.ft-credit, .rv-credit) a {
  text-decoration: none;
}
.ft-sample-grid {
  border-top: 1px solid var(--hair);
}
.ft-sample-card .icon {
  width: 18px;
  height: 18px;
  color: var(--muted);
}
.ft-resources {
  display: grid;
  grid-template-columns: minmax(0, 0.72fr) minmax(0, 1fr);
  align-items: start;
  gap: clamp(32px, 6vw, 80px);
  margin-top: clamp(36px, 6vw, 64px);
}
.ft-studio p {
  color: var(--ink-soft);
  text-wrap: pretty;
}
.ft-tile-link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: var(--accent-text);
  font-weight: 500;
  text-decoration: none;
}
.ft-tile-link:hover {
  text-decoration: underline;
}
.ft-questions {
  padding: 0;
}
.ft-questions .faq-list {
  margin-top: var(--space-3);
}
.ft-questions .faq-list summary {
  min-height: 44px;
  font-size: 16px;
}
.ft-turn {
  padding-block: clamp(64px, 10vw, 128px);
}
.ft .ft-play-main {
  background: var(--layer-2);
  color: var(--ink);
}
.ft .ft-play-main:hover {
  background: var(--layer-3, var(--layer-2));
}
.ft :is(.ft-play, .ft-play-main, .ft-video-play, .ft-loop-btn, .ft-seat-play, .ft-bar-jump-btn) {
  min-height: 44px;
  min-width: 44px;
}
.ft :is(.ft-seg-btn, .ft-switch-btn) {
  min-width: 44px;
  min-height: 44px;
}

@media (max-width: 850px) {
  .ft-hero {
    padding-top: var(--space-6);
  }
  .ft-hero-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: var(--space-4);
  }
  .ft-page .ft-river {
    --rv-height: 430px;
    --rv-w: min(100% - 28px, 390px);
  }
  .ft-intake {
    gap: var(--space-4);
  }
}
@media (max-width: 640px) {
  .ft .ft-hero h1 {
    font-size: var(--display-1);
  }
  .ft .ft-hero h1:lang(zh) {
    font-size: var(--display-1);
  }
  .ft :is(h1, h2):not(.hm-end-title) {
    text-wrap: wrap;
  }
  .ft h2:lang(zh) {
    text-wrap: balance;
  }
  .ft-section {
    padding-block: 52px;
  }
  .ft-switch-btn,
  .ft-seg-btn {
    padding-inline: var(--space-2);
  }
  .ft-level-findings li {
    flex-wrap: wrap;
  }
  .ft-video-grid,
  .ft-resources {
    grid-template-columns: minmax(0, 1fr);
  }
  .ft-video-score-svg .svg-wide {
    display: none;
  }
  .ft-video-score-svg .svg-narrow {
    display: block;
  }
}

.ft .ft-hero h1:lang(zh) {
  max-width: none;
  font-size: var(--display-2);
}
.ft .ft-hero h1:lang(zh) span {
  display: block;
}
.ft-level-source {
  margin-top: 0;
}
.ft-level-source a {
  text-decoration: none;
}
.ft-control-label,
.ft-sample-tag {
  color: var(--muted);
  font: 500 12px / 1.4 var(--mono);
}
@media (max-width: 640px) {
  .ft .ft-hero h1:lang(zh) {
    font-size: var(--display-1);
  }
  .ft-section {
    padding-block: 40px;
  }
  .ft-class-scores {
    grid-template-columns: minmax(0, 1fr);
  }
  .ft-turn .hm-end-starters {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .ft-legend-tip {
    flex-basis: 100%;
    margin-inline-start: 0;
  }
  .ft-sample-card {
    gap: var(--space-2);
  }
}

/* The phone uses document snapping, with the same viewport and menu hooks as the homepage. */
@media (max-width: 759.98px) {
  :root.js:has(> .ft-page) {
    --ft-header-height: var(--nav-h, 72px);
    scroll-padding-top: var(--ft-header-height);
    scroll-snap-type: y mandatory;
  }
  :root.js[data-native-app]:has(> .ft-page) {
    --ft-header-height: calc(var(--nav-h, 72px) + env(safe-area-inset-top, 0px));
  }
  :root.js[data-home-footer-free]:has(> .ft-page) {
    scroll-snap-type: y proximity;
  }
  :root.js:is([data-home-composer-editing], .menu-open):has(> .ft-page),
  :root.js:has(> .ft-page [data-home-composer] .hc-input:focus) {
    scroll-snap-type: none;
  }
  :root.js[data-native-app="android"][data-home-composer-editing]:has(> .ft-page) {
    overflow-anchor: none;
  }

  :root.js > .ft-page {
    padding-top: var(--ft-header-height);
  }
  :root.js > .ft-page > .site-header {
    position: fixed;
    inset: 0 0 auto;
  }

  .js .ft > .hm-part {
    --ft-scene-pad: var(--space-6);
    display: grid;
    align-content: start;
    box-sizing: border-box;
    min-height: calc(100svh - var(--ft-header-height));
    min-height: calc(100dvh - var(--ft-header-height));
    padding-block: var(--ft-scene-pad);
    scroll-margin-top: 0;
    scroll-snap-align: start;
    scroll-snap-stop: always;
  }
  .js .ft > :is(#practice-link, #samples) > .ft-section {
    padding-block: 0;
  }
  .js .ft :is(.ft-studio, .ft-questions, [role="tabpanel"]) {
    scroll-margin-top: var(--space-4);
  }
  /* A direct link inside downloads must land there before the free-scroll state takes over. */
  .js .ft :is(#ways, #questions):target {
    scroll-snap-align: start;
  }
  .js .ft > .ft-turn {
    align-content: center;
  }
  .js .ft-page > .site-footer {
    scroll-snap-align: start;
  }

  .js .ft > .ft-hero {
    --ft-scene-pad: clamp(8px, calc(100svh - 655px), 16px);
    --ft-hero-toolbar-gap: 0px;
    --hero-river-floor: calc(
      clamp(244px, calc(100svh - var(--ft-header-height) - 284px), 352px) -
      var(--ft-hero-toolbar-gap)
    );
    align-content: stretch;
  }
  .js .ft-hero-grid {
    grid-template-rows: auto minmax(var(--hero-river-floor), 1fr) auto auto;
    min-height: 0;
    gap: var(--ft-scene-pad);
    margin-block-end: var(--ft-hero-toolbar-gap);
  }
  .js .ft-intake {
    display: contents;
  }
  .js .ft-intake > h1 {
    grid-row: 1;
  }
  .js .ft-intake > p,
  .js .ft-hero .ft-starter-full {
    display: none;
  }
  .js .ft-hero .ft-starter-short {
    display: inline;
  }
  .js .ft-hero .ft-river {
    --rv-card-inset: 8px;
    --rv-play-reach: calc(-1 * var(--space-3));
    grid-row: 2;
    min-height: 0;
    height: 100%;
    margin-inline: calc(-1 * var(--gutter));
  }
  .js .ft-intake > .hc-ask {
    grid-row: 3;
    width: 100%;
  }
  .js .ft-hero .hc-box {
    min-height: 96px;
  }
  .js .ft-hero .hc-input {
    min-height: 44px;
  }
  .js .ft-hero .hm-hero-starters {
    grid-row: 4;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: var(--space-2);
  }
  .js .ft-hero .hm-hero-starter {
    justify-content: center;
    min-height: 44px;
    padding-inline: var(--space-1);
    gap: var(--space-1);
  }
  .js .ft-hero .hm-hero-starter-icon {
    width: auto;
    height: auto;
    background: none;
  }
  .js .ft-hero .rv-pair {
    gap: var(--space-1);
  }
  .js .ft-hero .rv-say {
    padding-block: var(--space-2);
  }
  .js .ft-hero .rv-out {
    padding-block: var(--space-2);
  }
}
@media (max-width: 759.98px) and (max-height: 700px) {
  .js .ft > .ft-hero {
    --ft-scene-pad: var(--space-2);
  }
  .js .ft .ft-hero h1 {
    font-size: var(--display-2);
    text-wrap: balance;
  }
  .js .ft .ft-hero h1:lang(zh) {
    font-size: var(--display-2);
  }
  .js .ft-hero .ft-river {
    --rv-play-reach: calc(-1 * var(--space-4));
  }
}
@supports (-webkit-touch-callout: none) {
  @media (max-width: 759.98px) {
    .js .ft > .hm-part {
      --ios-bar-bleed: 0px;
      min-height: calc(100lvh - var(--ft-header-height) + var(--ios-bar-bleed));
      padding-bottom: calc(var(--ft-scene-pad) + max(0px, 100lvh - 100svh) + var(--ios-bar-bleed));
    }
    .js .ft > .ft-hero {
      /* Safari's floating toolbar can cover the bottom edge of the small viewport. */
      --ft-hero-toolbar-gap: var(--space-6);
    }
  }
  @media (max-width: 759.98px) and (min-height: 680px) {
    .js .ft > .hm-part {
      --ios-bar-bleed: 44px;
    }
  }
}
