.song-sheet { --transport-height: 100px; }
.song-main { padding-top: 12px; padding-bottom: 32px; }
.song-sheet:has(.transport) .song-main { padding-bottom: calc(var(--transport-height) + 24px); }
.song-intro { display: grid; gap: 8px; }
.song-cover {
  display: flex; flex-direction: column; justify-content: center; align-items: flex-start;
  min-width: 0; padding: 15px 18px; border-radius: 12px; color: #fffdf0;
  background: linear-gradient(90deg, #102d29 0%, #102d29ed 31%, #132e28ac 67%, #152b2460 100%),
              url('/images/portada.jpg') center 52% / cover no-repeat, #143b34;
}
.song-cover h1 {
  margin: 0; max-width: 100%; color: inherit;
  font: 600 clamp(32px, 6.7vw, 66px)/1.02 Georgia, "Times New Roman", serif;
  letter-spacing: -.04em; overflow-wrap: anywhere; text-wrap: balance;
}
.song-artist { margin: 4px 0 0; color: #f0ead9; font-size: 15px; }
.song-facts { display: flex; flex-wrap: wrap; align-items: center; gap: 3px 0; padding: 0; margin: 11px 0 0; list-style: none; }
.song-facts:empty { display: none; }
.song-facts li { display: inline-flex; align-items: baseline; gap: 4px; font-size: 12px; font-weight: 600; }
.song-facts li + li::before { content: ""; align-self: center; width: 3px; height: 3px; border-radius: 50%; background: #e1b76d; margin: 0 7px; }
.fact-label { color: #e1d5b6; font-weight: 400; }
.song-transpose { width: 100%; margin-top: 8px; }
.transpose-row { display: flex; align-items: center; flex-wrap: wrap; gap: 2px 8px; font-size: 14px; }
.key-stepper {
  display: inline-flex; align-items: center; border: 1px solid #a5b9a9;
  border-radius: 9px; background: #183c35; color: #fffdf0;
}
.key-stepper button {
  display: grid; place-items: center; min-width: 44px; min-height: 44px; padding: 0;
  color: #ffda95; background: transparent; border: 0; border-radius: 8px;
  font-size: 22px; line-height: 1; touch-action: manipulation;
}
.key-stepper button:hover, .key-stepper button:focus-visible { background: #34584d; }
.chart-key { min-width: 78px; padding-inline: 4px; color: inherit; font-weight: 600; text-align: center; }
.key-reset {
  min-height: 44px; padding: 0 5px; border: 0; background: transparent;
  color: #ffe2ab; text-decoration: underline; text-underline-offset: 3px;
}
.recording-key { margin: 4px 0 0; color: #fff5dc; font-size: 13px; }
.recording {
  min-width: 0; overflow: hidden;
  background: #142f2b; border-radius: 12px; color: #fcfff6;
}
.recording-toggle {
  display: flex; align-items: center; gap: 9px; min-height: 44px; padding: 0 14px; cursor: pointer;
  list-style: none; border: 1px solid var(--line); border-radius: 10px; background: #eff2e9;
  color: var(--ink); font-size: 14px; font-weight: 600;
}
.recording-toggle::-webkit-details-marker { display: none; }
.recording-toggle .icon-angle-down { margin-left: auto; }
.recording[open] .recording-toggle .icon-angle-down { transform: rotate(180deg); }
.no-recording { margin: 0; font-size: 14px; color: var(--muted); }
.video-stage {
  position: relative; width: 100%; aspect-ratio: 16 / 9; min-height: 200px; overflow: hidden;
  background: linear-gradient(#12252377, #142b26bc), var(--video-poster, none) center / cover, #243c35;
}
.video-stage iframe, #song-video { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.video-message {
  position: absolute; inset: 0; display: grid; align-content: center; justify-items: center; gap: 7px;
  padding: 12px; text-align: center; color: #fff; background: #10241f88; font-size: 14px; pointer-events: none;
}
.video-message .icon-headphones { font-size: 24px; }
.recording-link {
  display: flex; align-items: center; justify-content: flex-end; gap: 7px;
  padding: 4px 12px; min-height: 36px; color: #e1e7db; font-size: 12px; text-decoration: none;
}
.recording-link:hover { color: #fff; text-decoration: underline; }

.score-heading { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 12px; padding: 16px 0 9px; }
.score-heading h2 { color: var(--ink); margin: 0; font: 600 clamp(21px, 3.5vw, 32px)/1.15 Georgia, serif; letter-spacing: -.04em; }
.score-count, .bar-number, .bar-position, .elapsed, .duration { font-variant-numeric: tabular-nums; }
.score-count { color: var(--muted); font-size: 12px; }
.score-skip:not(:focus) { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.score-skip:focus { display: inline-block; margin: 6px; color: var(--green); }
.score-grid {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1px;
  border: 1px solid var(--line); border-radius: 10px; background: var(--line); overflow: clip;
}
.score-bar {
  appearance: none; position: relative; display: flex; flex-direction: column; min-width: 0;
  min-height: 76px; padding: 6px 0 0; border: 0; border-radius: 0;
  background: #fffef9; color: var(--ink); text-align: left; touch-action: manipulation;
}
.score-bar:focus-visible { z-index: 1; outline-offset: -3px; }
.bar-number { display: block; margin-left: 8px; color: #66786d; font-size: 11px; font-weight: 600; }
.bar-music { position: relative; display: grid; grid-template-columns: repeat(var(--meter), minmax(0, 1fr)); flex: 1; width: 100%; margin-top: 2px; }
.beat-slot, .beat-note { grid-row: 1; min-width: 0; }
.beat-slot { position: relative; border-left: 1px solid #e8ece2; }
.beat-slot:first-child { border-color: transparent; }
.beat-slot::after { content: ""; position: absolute; bottom: 7px; left: 5px; width: 7px; height: 2px; border-radius: 3px; background: #c3cfbf; }
.beat-note {
  z-index: 1; align-self: center; padding: 0 1px 8px 5px; pointer-events: none;
  font-size: clamp(20px, 2.1vw, 27px); line-height: 1; letter-spacing: -.055em; overflow-wrap: anywhere;
}
.beat-note b { font-weight: 650; }
.beat-note small { font-size: .68em; font-weight: 600; letter-spacing: -.04em; }
.score-bar[aria-current="true"] { background: #164e44; color: #fffef3; box-shadow: inset 0 0 0 2px #0a362e; }
.score-bar[aria-current="true"] .bar-number { color: #e6efd9; }
.score-bar[aria-current="true"] .beat-slot { border-color: #ffffff23; }
.score-bar[aria-current="true"] .beat-slot::after { background: #92afa0; }
.score-bar[aria-current="true"] .beat-slot.is-current::after { width: 15px; height: 4px; background: #f5c779; }
.score-grid.has-lyrics { grid-template-columns: minmax(0, 1fr); }
.has-lyrics .bar-music { flex: 0 0 auto; min-height: 42px; }
.bar-lyrics {
  display: grid; grid-template-columns: repeat(var(--meter), minmax(0, 1fr));
  width: 100%; padding-bottom: 8px; font-size: 15px; line-height: 1.55;
}
.bar-lyrics > span { min-width: 0; padding-inline: 5px; overflow-wrap: anywhere; }
.lyric-word[aria-current="true"] {
  background: #f4cd89; color: #183632; border-radius: 3px;
  text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 2px;
}
.score-lyrics-outside, .lyric-text {
  margin: 8px 0; background: #fffef9; border: 1px solid var(--line); border-radius: 10px;
}
.score-lyrics-outside, .lyric-text { padding: 12px 16px; line-height: 1.65; overflow-wrap: anywhere; }
.lyric-text { white-space: pre-line; }
@media (min-width: 480px) {
  .score-grid.has-lyrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (min-width: 900px) {
  .score-grid.has-lyrics { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (hover: hover) {
  .score-bar:hover:not([aria-current="true"]) { background: #e9f0e4; }
}
.score-empty { margin: 0; padding: 20px; color: var(--muted); border: 1px solid var(--line); border-radius: 10px; }

.transport {
  position: fixed; z-index: 4; right: 0; bottom: 0; left: 0; padding-bottom: env(safe-area-inset-bottom);
  background: #142f2b; color: #fffdf3; box-shadow: 0 -2px 14px #15312720;
}
.transport-inner { position: relative; display: grid; grid-template-columns: auto auto minmax(0, 1fr); align-items: center; gap: 0 8px; padding-block: 8px 4px; }
.transport-actions { display: flex; align-items: center; gap: 4px; }
.transport button { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 44px; border: 0; font-size: 14px; font-weight: 600; }
.transport button:disabled { opacity: .6; }
.play-toggle { min-width: 116px; padding: 0 14px; border-radius: 24px; background: #f4cd89; color: #20342c; }
.play-toggle .icon-play { font-size: 12px; }
.transport-reset { min-width: 44px; padding: 0 7px; background: none; color: #f0f2e8; }
.transport-reset [class^="icon-"] { font-size: 19px; }
.tempo-menu { grid-column: 2; grid-row: 1; }
.tempo-menu summary {
  display: grid; grid-template-columns: auto auto; align-content: center; align-items: center; gap: 1px 6px;
  min-width: 70px; min-height: 44px; padding: 3px 9px; border: 1px solid #81978a; border-radius: 9px;
  color: #fffdf3; line-height: 1.05; list-style: none; cursor: pointer; font-variant-numeric: tabular-nums;
}
.tempo-menu summary::-webkit-details-marker { display: none; }
.tempo-menu summary > :first-child { grid-column: 1; color: #d4e2d6; font-size: 12px; }
.tempo-rate { grid-column: 1; font-size: 15px; }
.tempo-menu summary .icon-angle-up { grid-column: 2; grid-row: 1 / 3; }
.tempo-menu[open] summary .icon-angle-up { transform: rotate(180deg); }
.tempo-panel {
  position: absolute; z-index: 1; right: 0; bottom: calc(100% + 8px); width: min(100%, 246px);
  max-height: min(56vh, 360px); overflow: auto; overscroll-behavior: contain; padding: 10px;
  background: #fffef9; color: var(--ink); border: 1px solid var(--line); border-radius: 10px;
  box-shadow: 0 6px 22px #12332a35;
}
.tempo-status { margin: 0; padding: 4px; color: var(--muted); font-size: 14px; }
.tempo-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px; }
.tempo-options button {
  flex-direction: column; gap: 2px; padding: 5px; border-radius: 7px; background: #edf1e8;
  color: var(--ink); font-variant-numeric: tabular-nums; line-height: 1.1;
}
.tempo-options button small { font-size: 12px; font-weight: 400; }
.tempo-options button[aria-pressed="true"] { background: var(--green); color: #fff; }
.transport-timeline { grid-column: 1 / -1; grid-row: 2; display: flex; align-items: center; gap: 9px; min-width: 0; }
.elapsed, .duration { min-width: 3.2ch; color: #e1e7db; font-size: 12px; }
.song-seek {
  --played: 0%; flex: 1; min-width: 0; height: 44px; margin: 0; appearance: none; -webkit-appearance: none;
  background: transparent; cursor: pointer; accent-color: #f4cd89;
}
.song-seek::-webkit-slider-runnable-track { height: 4px; border-radius: 3px; background: linear-gradient(to right, #f4cd89 var(--played), #5a7066 var(--played)); }
.song-seek::-moz-range-track { height: 4px; border-radius: 3px; background: #5a7066; }
.song-seek::-moz-range-progress { height: 4px; background: #f4cd89; }
.song-seek::-webkit-slider-thumb { appearance: none; -webkit-appearance: none; width: 16px; height: 16px; margin-top: -6px; background: #fff9e9; border: 2px solid #243e34; border-radius: 50%; }
.song-seek::-moz-range-thumb { width: 14px; height: 14px; border: 2px solid #243e34; border-radius: 50%; background: #fff9e9; }
.bar-position { grid-column: 3; grid-row: 1; justify-self: end; text-align: right; font-size: 12px; color: #cfdbcf; }
.bar-position strong { color: #fffdf2; }
.practice-mode { display: block; color: #f4cd89; font-size: 11px; }
.transport.is-silent .play-toggle { min-width: 0; padding-inline: 11px; }
.transport.is-silent .play-label { line-height: 1.1; }
.return-to-bar { position: absolute; right: 0; bottom: calc(100% + 8px); color: #fff; background: var(--green); border-radius: 24px; padding: 0 16px; box-shadow: 0 3px 12px #133c3230; }
@media (max-width: 338px) {
  .transport-inner { gap: 0 3px; }
  .bar-position { font-size: 11px; }
  .transport button { font-size: 13px; }
  .meter-unit { display: none; }
}
@media (max-width: 440px) {
  .transport-reset .reset-label { display: none; }
  .transport.is-silent .play-toggle { max-width: 116px; }
}
@media (min-width: 680px) {
  .song-main { padding-top: 24px; }
  .song-intro:has(.recording) { grid-template-columns: minmax(0, 1fr) minmax(248px, 32%); }
  .recording[open] .recording-toggle { display: none; }
  .song-intro { gap: 12px; }
  .song-cover { min-height: 195px; padding: 28px clamp(24px, 4vw, 54px); }
  .song-artist { margin-top: 8px; font-size: 21px; }
  .song-facts { margin-top: 20px; }
  .song-facts li { font-size: 14px; }
  .song-facts li + li::before { margin: 0 11px; }
  .score-heading { padding: 26px 0 14px; }
  .score-count { font-size: 14px; }
  .score-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .score-bar { min-height: 90px; padding-top: 9px; }
  .bar-number { margin-left: 12px; font-size: 12px; }
  .beat-note { padding-left: 8px; }
  .beat-slot::after { left: 8px; bottom: 10px; }
  .transport-inner { display: flex; gap: 22px; min-height: 72px; padding-block: 8px; }
  .transport-actions { gap: 8px; }
  .tempo-menu { position: relative; }
  .tempo-panel { left: 0; right: auto; width: 246px; }
  .transport-timeline { flex: 1; gap: 12px; }
  .bar-position { white-space: nowrap; }
}
.score-title-line { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 12px; }
.loop-menu { position: relative; flex: 0 0 auto; }
.loop-menu summary {
  display: flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 6px;
  list-style: none; color: var(--green); cursor: pointer; font-size: 14px; font-weight: 600;
}
.loop-menu summary::-webkit-details-marker { display: none; }
.loop-form {
  position: absolute; z-index: 3; right: 0; top: 100%; display: grid; grid-template-columns: 1fr 1fr;
  gap: 12px; width: 246px; padding: 16px; background: #fffef9; border: 1px solid var(--line);
  border-radius: 10px; box-shadow: 0 8px 26px #12332a25;
}
.loop-form label { display: grid; gap: 4px; margin: 0; color: var(--muted); font-size: 13px; }
.loop-form input { width: 100%; min-height: 44px; padding: 7px; border: 1px solid #8c9f90; border-radius: 6px; color: var(--ink); background: #fff; font-size: 16px; }
.loop-form button { grid-column: 1 / -1; min-height: 44px; border-radius: 7px; font-weight: 600; }
.apply-loop { background: var(--green); border: 0; color: #fff; }
.apply-loop:disabled { opacity: .6; }
.clear-loop { color: var(--green); border: 1px solid var(--line); background: transparent; }
.score-bar.in-loop .bar-number::after { content: '↻'; margin-left: 4px; }
@media (max-width: 679px) {
  .meter-unit { display: none; }
  .score-heading { align-items: center; flex-wrap: nowrap; padding: 6px 0; }
  .score-title-line { display: block; }
  .score-count { display: block; font-size: 11px; }
}
