/* Superficie de composición. Esta vista reutiliza el motor y deja el foco en
   arreglo + piano roll; los asistentes musicales viven en el inspector. */
html.compose-layout {
  --compose-side: 218px;
  --compose-inspector: 286px;
  --compose-line: rgba(255, 255, 255, 0.09);
  --compose-raised: #271d14;
}

html.compose-layout body {
  display: grid;
  grid-template-columns: var(--compose-side) minmax(0, 1fr) var(--compose-inspector);
  min-height: 100vh;
  overflow-x: hidden;
  background: #19120b;
}

html.compose-layout #sidebar,
html.compose-layout #composeInspector {
  min-width: 0;
  padding: 12px 10px;
  background: #211810;
}

html.compose-layout #sidebar {
  width: auto;
  flex-shrink: 1;
  overflow: hidden;
  border-right: 1px solid var(--compose-line);
}

html.compose-layout #sidebar .side-card:not(#albumBox):not(#mobileHarmonyPanel) {
  display: none;
}

html.compose-layout #mobileHarmonyPanel {
  display: none;
}

html.compose-layout #mobileHarmonyPanel[hidden] {
  display: none !important;
}

/* La navegación izquierda solo contiene el álbum y los temas. Los controles
   musicales del tema viven en el inspector contextual, no duplicados acá. */
html.compose-layout #trackHeader {
  display: none !important;
}

html.compose-layout #sidebar .card,
html.compose-layout #sidebar .side-card {
  padding: 8px;
  border-color: transparent;
  border-radius: 5px;
  background: transparent;
  box-shadow: none;
}

html.compose-layout #main {
  width: 100%;
  min-width: 0;
  max-width: none;
  overflow: hidden;
  padding: 14px 16px 42px;
  background: linear-gradient(90deg, rgba(255,255,255,0.018) 1px, transparent 1px) 0 0 / 76px 100%, #19120b;
}

html.compose-layout #trackPanel {
  display: flex;
  flex-direction: column;
  min-width: 0;
  gap: 0;
  padding-top: 54px;
}

html.compose-layout #trackPanel > #arrangementCard {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

html.compose-layout #arrangementCard > .daw-titlebar { display: none; }
html.compose-layout #arrangementCard > .daw-map { order: 1; }
html.compose-layout #arrangementCard > .daw-session { order: 2; }
html.compose-layout #arrangementCard > .daw-editor-surfaces { order: 3; }

html.compose-layout .daw-panel {
  border-color: var(--compose-line);
  border-radius: 5px;
  background: #21170f;
}

html.compose-layout .daw-map { padding: 8px 10px; }
html.compose-layout .daw-map .daw-panel-head { display: none; }
.compose-workspace-bar { display: flex; align-items: center; gap: 9px; margin-bottom: 7px; }
.compose-view-switch { display: inline-flex; gap: 3px; padding: 2px; border: 1px solid var(--compose-line); border-radius: 4px; background: #1a120b; }
.compose-view-switch button { min-height: 25px; padding: 3px 8px; border: 0; border-radius: 3px; background: transparent; color: var(--text-dim); cursor: pointer; font-size: 0.66rem; }
.compose-view-switch button.on { background: rgba(91,209,205,0.15); color: var(--accent); }
.compose-workspace-bar .fine { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
html.compose-layout .arr-track {
  min-height: 58px;
  padding: 7px;
  border-radius: 4px;
  background: linear-gradient(90deg, rgba(126, 169, 211, 0.08) 1px, transparent 1px) 0 0 / 64px 100%, #1b120b;
}
html.compose-layout .arr-head { margin-bottom: 5px; }
html.compose-layout .arr-block { min-height: 38px; border-radius: 3px; }
html.compose-layout #arrangementStrip,
html.compose-layout #arrTools,
html.compose-layout .daw-session > .daw-panel-head,
html.compose-layout .daw-session > #progToolbar { display: none !important; }

html.compose-layout .daw-editor-surfaces { min-width: 0; min-height: 250px; }
html.compose-layout #arrangementCard:not(.compose-editor-view) > .daw-editor-surfaces { display: none; }
html.compose-layout #arrangementCard.compose-editor-view > .daw-session { display: none; }
html.compose-layout #pianoRoll { min-width: 0; max-width: 100%; margin: 0; border-color: rgba(91, 209, 205, 0.35); background: #1a120b; }
html.compose-layout #pianoRoll .roll-bar { padding: 1px 0 7px; }
html.compose-layout #pianoRoll .roll-bar-hint { display: none; }
html.compose-layout #pianoRoll .roll-scroll { max-width: 100%; overflow-x: auto; }

/* Editor: una superficie sin paneles de composición alrededor. La barra
   superior global sigue disponible; el botón ← Canción devuelve al arreglo. */
html.compose-layout.compose-editor-open body {
  grid-template-columns: minmax(0, 1fr);
}
html.compose-layout.compose-editor-open #sidebar,
html.compose-layout.compose-editor-open #composeInspector {
  display: none !important;
}
html.compose-layout.compose-editor-open #main {
  padding: 8px 10px 18px;
}
html.compose-layout.compose-editor-open #trackPanel {
  padding-top: 52px;
}
html.compose-layout.compose-editor-open #arrangementCard.compose-editor-view {
  gap: 0;
  min-height: calc(100vh - 70px);
}
html.compose-layout.compose-editor-open #arrangementCard.compose-editor-view > .daw-map {
  display: none;
}
html.compose-layout.compose-editor-open .daw-editor-surfaces {
  flex: 1;
  min-height: 0;
}
html.compose-layout.compose-editor-open #pianoRoll {
  height: calc(100vh - 78px);
  display: flex;
  flex-direction: column;
  border: 1px solid rgba(91, 209, 205, 0.35);
  border-radius: 5px;
}
html.compose-layout.compose-editor-open #pianoRoll .roll-bar {
  display: grid;
  gap: 6px;
  padding: 7px 8px;
  margin: 0;
  border-bottom: 1px solid var(--compose-line);
}
html.compose-layout.compose-editor-open .roll-bar-top,
html.compose-layout.compose-editor-open .roll-bar-workspace {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}
html.compose-layout.compose-editor-open .roll-bar-top {
  min-height: 34px;
  padding-bottom: 6px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
html.compose-layout.compose-editor-open .roll-transport-group,
html.compose-layout.compose-editor-open .roll-context-actions,
html.compose-layout.compose-editor-open .roll-tool-group {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
}
html.compose-layout.compose-editor-open .roll-transport-group {
  padding-left: 6px;
  border-left: 1px solid var(--compose-line);
}
html.compose-layout.compose-editor-open .roll-context-actions { margin-left: auto; }
html.compose-layout.compose-editor-open .roll-bar-workspace {
  flex-wrap: nowrap;
  overflow-x: auto;
  padding-bottom: 1px;
  scrollbar-width: thin;
}
html.compose-layout.compose-editor-open .roll-track-tabs { flex: 0 0 auto; }
html.compose-layout.compose-editor-open .roll-tool-group {
  flex: 0 0 auto;
  padding-left: 6px;
  border-left: 1px solid var(--compose-line);
}
html.compose-layout.compose-editor-open .roll-grid-tools .btn,
html.compose-layout.compose-editor-open .roll-melody-tools .btn { min-width: 29px; }
html.compose-layout.compose-editor-open .roll-close { margin-left: 2px; }
html.compose-layout.compose-editor-open #pianoRoll .roll-scroll {
  flex: 1;
  max-width: none;
  overflow: auto;
  overscroll-behavior: contain;
}
.roll-editor-back { border-color: rgba(91, 209, 205, 0.42) !important; color: var(--accent); }
.roll-zoom-group {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 27px;
  padding-left: 7px;
  border-left: 1px solid var(--compose-line);
  color: var(--text-dim);
  font-size: 0.72rem;
}
.roll-zoom-axis { display: inline-grid; grid-template-columns: 22px 28px 38px 28px; align-items: center; gap: 3px; }
.roll-zoom-label { display: grid; place-items: center; height: 27px; }
.roll-zoom-group .btn { width: 28px; min-width: 28px; padding-inline: 0; }
.roll-zoom-group output { min-width: 32px; text-align: center; font-size: 0.66rem; color: var(--text-dim); }

html.compose-layout .daw-session { padding: 0; overflow: hidden; }
html.compose-layout .daw-session > .daw-panel-head { min-height: 35px; padding-inline: 10px; }
html.compose-layout .daw-session > #progToolbar { padding: 6px 10px; background: #281d14; }
html.compose-layout .lane { border-radius: 0; border-inline: 0; }
html.compose-layout .lane:not(.active) { opacity: 0.7; }
html.compose-layout .lane-head { min-height: 42px; padding-inline: 10px; }
html.compose-layout .lane.active { background: rgba(91, 209, 205, 0.07); }
html.compose-layout .lane.expanded .progression { background: #1f150d; }

@media (max-width: 700px) {
  html.compose-layout.compose-editor-open #main { padding-inline: 0; }
  html.compose-layout.compose-editor-open #trackPanel { padding-top: 116px; }
  html.compose-layout.compose-editor-open #arrangementCard.compose-editor-view { padding-top: 10px; }
  html.compose-layout.compose-editor-open #pianoRoll {
    height: calc(100vh - 132px);
    border-inline: 0;
    border-radius: 0;
  }
  html.compose-layout.compose-editor-open #pianoRoll .roll-bar { gap: 5px; }
  html.compose-layout.compose-editor-open .roll-bar-top { padding-bottom: 5px; }
  /* En pantalla angosta, las pistas, herramientas y zoom son franjas fijas.
     Así no hay que buscar el zoom dentro de una barra que se desplaza. */
  html.compose-layout.compose-editor-open .roll-bar-workspace {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 7px 8px;
    overflow: visible;
  }
  html.compose-layout.compose-editor-open .roll-track-tabs {
    grid-row: 1;
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 4px;
    width: 100%;
    overflow: visible;
    padding: 0;
  }
  html.compose-layout.compose-editor-open .roll-track-tabs .btn {
    width: 100%;
    min-width: 0;
    height: 38px;
    padding: 4px 2px;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  html.compose-layout.compose-editor-open .roll-melody-tools,
  html.compose-layout.compose-editor-open .roll-grid-tools {
    grid-row: 2;
    border-left: 0;
    padding-left: 0;
  }
  html.compose-layout.compose-editor-open .roll-melody-tools {
    grid-column: 1;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    width: 100%;
  }
  html.compose-layout.compose-editor-open .roll-melody-tools.roll-chord-tools {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  html.compose-layout.compose-editor-open .roll-grid-tools {
    grid-column: 2;
    display: grid;
    grid-template-columns: minmax(74px, 1fr) repeat(3, 38px);
    width: 100%;
  }
  html.compose-layout.compose-editor-open .roll-melody-tools .btn,
  html.compose-layout.compose-editor-open .roll-grid-tools .btn {
    width: 100%;
    min-width: 0;
    height: 38px;
    padding: 3px;
  }
  html.compose-layout.compose-editor-open .roll-grid-tools .roll-bar-lbl {
    min-width: 0;
    height: 38px;
    padding: 0 5px;
    border: 1px solid rgba(255,255,255,0.11);
    border-radius: 4px;
    background: #291e14;
  }
  html.compose-layout.compose-editor-open .roll-grid-tools .roll-bar-lbl select {
    min-width: 0;
    width: 100%;
    border: 0;
    padding-inline: 3px;
  }
  html.compose-layout.compose-editor-open .roll-zoom-group {
    grid-row: 3;
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    width: 100%;
    margin-left: 0;
    border-left: 0;
    padding-left: 0;
  }
  html.compose-layout.compose-editor-open .roll-zoom-axis {
    grid-template-columns: 30px 42px minmax(42px, 1fr) 42px;
    gap: 4px;
    min-width: 0;
  }
  html.compose-layout.compose-editor-open .roll-zoom-axis .btn {
    width: 42px;
    height: 38px;
  }
  html.compose-layout.compose-editor-open .roll-zoom-axis output {
    min-width: 0;
  }
  html.compose-layout.compose-editor-open .roll-editor-back { padding-inline: 7px; }
  html.compose-layout.compose-editor-open .roll-bar-title { font-size: 0.76rem; }
}

/* Hoja de sesión: el centro lee la canción completa; la edición vive en el
   instrumento y en el modo Editor. */
.lead-sheet { display: grid; gap: 7px; padding: 9px; background: #1d140c; }
.lead-sheet-head { display: flex; align-items: center; gap: 8px; min-height: 26px; color: var(--text-dim); }
.lead-sheet-title { font-size: 0.68rem; font-weight: 700; letter-spacing: 0.09em; text-transform: uppercase; }
.lead-song-map { display: flex; min-width: 70px; height: 21px; flex: 1; gap: 2px; overflow: hidden; }
.lead-song-map-item { position: relative; overflow: hidden; min-width: 18px; flex: var(--section-weight) 1 0; padding: 0 4px; border: 1px solid rgba(255,255,255,0.1); border-radius: 2px; background: #291e14; color: var(--text-dim); cursor: pointer; font-size: 0.5rem; text-align: left; }
.lead-song-map-item span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lead-song-map-item:hover { border-color: rgba(91,209,205,0.55); color: var(--text); }
.lead-song-map-item.active { border-color: rgba(91,209,205,0.48); background: rgba(91,209,205,0.1); color: var(--accent); }
.lead-song-map-item.playing { border-color: var(--accent); background: var(--accent); color: #082024; box-shadow: 0 0 7px rgba(91,209,205,0.34); }
.lead-song-map-item.variant { border-left-style: dashed; opacity: 0.82; }
.lead-compare, .lead-rhythm-plan-toggle, .lead-sheet-add, .lead-sheet-tool { display: grid; width: 24px; height: 22px; place-items: center; padding: 0; border: 1px solid var(--compose-line); border-radius: 3px; background: transparent; color: var(--text-dim); cursor: pointer; font-size: 0.7rem; }
.lead-sheet-tool:hover { border-color: var(--accent); color: var(--accent); }
.lead-compare.on { border-color: var(--accent); background: rgba(91,209,205,0.16); color: var(--accent); }
.lead-rhythm-plan-toggle.on { border-color: var(--accent); color: var(--accent); }
.lead-compare-status { min-width: 18px; color: var(--accent); font-size: 0.58rem; font-variant-numeric: tabular-nums; }
.lead-sheet-add { margin-left: auto; border: 1px solid var(--compose-line); color: var(--text); font-size: 1rem; }
.lead-section { position: relative; display: grid; gap: 4px; min-width: 0; padding: 7px; border: 1px solid rgba(255,255,255,0.08); border-left: 2px solid rgba(91,209,205,0.2); border-radius: 4px; background: #241910; }
.lead-section.active { border-left-color: var(--accent); background: rgba(91,209,205,0.055); }
.lead-section.playing { border-color: rgba(91,209,205,0.68); box-shadow: inset 0 0 0 1px rgba(91,209,205,0.12); }
.lead-section-head { display: flex; align-items: center; gap: 7px; min-width: 0; }
.lead-section-name { overflow: hidden; max-width: 40%; padding: 0; border: 0; background: transparent; color: var(--text); cursor: pointer; font-size: 0.78rem; font-weight: 700; text-align: left; text-overflow: ellipsis; white-space: nowrap; }
.lead-section.active .lead-section-name { color: var(--accent); }
.lead-section-meta { overflow: hidden; color: var(--text-dim); font-size: 0.6rem; text-overflow: ellipsis; white-space: nowrap; }
.lead-section-timbre { flex: 0 0 auto; padding: 2px 5px; border: 1px solid rgba(91,209,205,0.28); border-radius: 3px; color: var(--accent); font-size: 0.52rem; font-weight: 700; text-transform: uppercase; }
.lead-section-actions { display: flex; gap: 3px; margin-left: auto; }
.lead-section-actions button { display: grid; width: 24px; height: 22px; place-items: center; padding: 0; border: 1px solid rgba(255,255,255,0.11); border-radius: 3px; background: #2d2117; color: var(--text-dim); cursor: pointer; font-size: 0.64rem; }
.lead-section-actions button:hover { border-color: var(--accent); color: var(--accent); }
.lead-band-drafts { min-width: 0; border-block: 1px solid rgba(91,209,205,0.15); background: rgba(91,209,205,0.035); }
.lead-band-drafts > summary { display: flex; min-height: 25px; align-items: center; justify-content: space-between; gap: 8px; padding: 3px 5px; color: var(--text-dim); cursor: pointer; font-size: 0.55rem; list-style: none; }
.lead-band-drafts > summary::-webkit-details-marker { display: none; }
.lead-band-drafts > summary span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lead-band-drafts > summary b { color: var(--accent); font-variant-numeric: tabular-nums; }
.lead-band-drafts > summary i { flex: 0 0 auto; color: var(--accent); font-size: 0.52rem; font-style: normal; }
.lead-band-drafts[open] > summary i::after { content: ' ↑'; }
.lead-band-draft-list { display: flex; min-width: 0; gap: 4px; padding: 4px; overflow-x: auto; overscroll-behavior-x: contain; scrollbar-width: thin; -webkit-overflow-scrolling: touch; }
.lead-band-draft { display: grid; min-width: 238px; max-width: 320px; grid-template-columns: 20px minmax(0,1fr) auto; align-items: center; gap: 5px; padding: 4px; border: 1px solid rgba(255,255,255,0.1); border-radius: 3px; background: #251a10; }
.lead-band-draft.previewing { border-color: var(--accent); background: rgba(91,209,205,0.09); }
.lead-band-draft > b { display: grid; width: 20px; height: 20px; place-items: center; border-radius: 2px; background: rgba(91,209,205,0.14); color: var(--accent); font-size: 0.58rem; }
.lead-band-draft > span { display: grid; min-width: 0; gap: 1px; }
.lead-band-draft strong, .lead-band-draft small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lead-band-draft strong { color: var(--text); font-size: 0.56rem; }
.lead-band-draft small { color: var(--text-dim); font-size: 0.48rem; }
.lead-band-draft > div { display: flex; gap: 2px; }
.lead-band-draft button { display: grid; width: 23px; height: 22px; place-items: center; padding: 0; border: 1px solid rgba(255,255,255,0.11); border-radius: 3px; background: #2d2117; color: var(--text-dim); cursor: pointer; font-size: 0.58rem; }
.lead-band-draft button:hover, .lead-band-draft button.on { border-color: var(--accent); color: var(--accent); }
.lead-band-draft [data-band-draft-apply] { color: var(--accent); }
.lead-song-rhythm-plan { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 7px; padding: 5px; border: 1px solid rgba(91,209,205,0.22); border-radius: 4px; background: rgba(91,209,205,0.045); }
.lead-song-rhythm-sequence { display: flex; min-width: 0; gap: 4px; overflow-x: auto; scrollbar-width: thin; }
.lead-song-rhythm-sequence .lead-song-rhythm-step { position: relative; display: grid; min-width: 116px; grid-template-columns: 5px minmax(0, 1fr); gap: 1px 5px; padding: 3px 5px; border: 1px solid rgba(255,255,255,0.09); border-radius: 3px; color: var(--text-dim); font-size: 0.48rem; }
.lead-song-rhythm-step > i { width: 4px; height: calc(var(--energy) * 6px); align-self: end; grid-row: 1 / span 3; border-radius: 1px; background: var(--accent); opacity: calc(0.38 + var(--energy) * 0.18); }
.lead-song-rhythm-sequence strong { color: var(--text); font-size: 0.54rem; }
.lead-song-rhythm-step small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lead-song-rhythm-step select { min-width: 0; height: 19px; padding: 0 3px; border: 1px solid rgba(255,255,255,0.09); border-radius: 2px; background: #1d140c; color: var(--text-dim); font-size: 0.48rem; }
.lead-song-rhythm-transitions { display: flex; min-width: 0; gap: 3px; grid-column: 2; }
.lead-song-rhythm-transitions select { flex: 1; width: 0; }
.lead-song-rhythm-actions { display: flex; align-items: center; gap: 4px; color: var(--accent); font-size: 0.52rem; }
.lead-song-rhythm-actions label { display: flex; align-items: center; gap: 4px; }
.lead-song-rhythm-actions select { height: 25px; max-width: 112px; padding: 2px 18px 2px 5px; border: 1px solid rgba(255,255,255,0.11); border-radius: 3px; background: #1d140c; color: var(--text); font-size: 0.52rem; }
.lead-song-rhythm-actions button { min-height: 25px; padding: 3px 7px; border: 1px solid rgba(255,255,255,0.11); border-radius: 3px; background: #291e14; color: var(--text); cursor: pointer; font-size: 0.55rem; }
.lead-rhythm-quick { display: flex; min-width: 0; min-height: 24px; align-items: center; gap: 5px; padding: 3px 4px; border-top: 1px solid rgba(255,255,255,0.06); color: var(--text-dim); font-size: 0.55rem; }
.lead-rhythm-current { flex: 0 0 auto; color: var(--text); }
.lead-rhythm-arrow { color: var(--accent); }
.lead-rhythm-suggestion { overflow: hidden; min-width: 0; flex: 1; text-overflow: ellipsis; white-space: nowrap; }
.lead-rhythm-suggestion strong { color: var(--accent); }
.lead-rhythm-actions { display: flex; flex: 0 0 auto; gap: 3px; }
.lead-rhythm-actions button { display: grid; width: 25px; height: 22px; place-items: center; padding: 0; border: 1px solid rgba(255,255,255,0.1); border-radius: 3px; background: #291e14; color: var(--text-dim); cursor: pointer; font-size: 0.6rem; }
.lead-rhythm-actions button:hover { border-color: var(--accent); color: var(--accent); }
.rack-track { display: grid; grid-template-columns: 24px 24px minmax(0, 1fr) 74px; align-items: center; gap: 6px; }
.rack-track + .rack-track { margin-top: 4px; }
.rack-mute, .rack-solo { width: 24px; height: 22px; padding: 0; font-size: 0.6rem; }
.rack-mute.on { border-color: var(--warn); background: rgba(251,191,36,0.16); color: var(--warn); }
.rack-solo.on { border-color: var(--accent); background: rgba(91,209,205,0.18); color: var(--accent); }
.rack-track-name { min-width: 0; color: var(--text); font-size: 0.64rem; font-weight: 650; }
.rack-track.muted .rack-track-name, .rack-track.muted input[type="range"] { opacity: 0.45; }
.rack-track input[type="range"] { width: 100%; min-width: 0; }
.lead-section-group { display: grid; gap: 0; }
.lead-section-group .lead-section-parent { border-bottom-left-radius: 0; border-bottom-right-radius: 0; border-bottom: 0; padding-bottom: 5px; }
.lead-section-group .lead-section-variant { border-top: 1px dashed rgba(255,255,255,0.14); border-top-left-radius: 0; border-top-right-radius: 0; margin-top: 0; padding-top: 5px; background: rgba(91,209,205,0.035); }
.lead-section-variant .lead-section-head::before { content: '↳'; flex: 0 0 auto; color: var(--text-dim); font-size: 0.72rem; }
.lead-section-variant .lead-section-name { font-size: 0.72rem; font-weight: 600; }
.lead-chord-grid { display: grid; min-width: 0; min-height: 48px; gap: 2px; padding: 2px; border-radius: 3px; background: linear-gradient(90deg, rgba(255,255,255,0.05) 1px, transparent 1px) 0 0 / 12.5% 100%, #181009; overflow-x: auto; overflow-y: hidden; overscroll-behavior-x: contain; scrollbar-width: thin; touch-action: pan-y; -webkit-overflow-scrolling: touch; }
.lead-chord { position: relative; display: flex; min-width: 0; min-height: 44px; flex-direction: column; justify-content: space-between; padding: 4px 5px; border: 1px solid color-mix(in srgb, var(--lead-color) 48%, #4d3f33); border-radius: 3px; background: color-mix(in srgb, var(--lead-color) 13%, #281d13); color: var(--text); cursor: grab; text-align: left; }
.lead-chord:active { cursor: grabbing; }
.lead-chord:hover, .lead-chord.selected { border-color: var(--accent); background: rgba(91,209,205,0.15); }
.lead-chord.playing { outline: 1px solid #f3faf9; box-shadow: 0 0 10px rgba(91,209,205,0.42); }
.lead-chord.dragging { opacity: 0.4; }
.lead-chord.drop-target { border-color: #f5c85c; }
.lead-chord.compare-a, .lead-chord.compare-b { border-color: var(--accent); box-shadow: inset 0 0 0 1px rgba(91,209,205,0.35); }
.lead-chord.compare-a::after, .lead-chord.compare-b::after { position: absolute; top: 2px; right: 3px; display: grid; width: 12px; height: 12px; place-items: center; border-radius: 2px; background: var(--accent); color: #072026; content: 'A'; font-size: 0.5rem; font-weight: 800; }
.lead-chord.compare-b::after { background: #9aaeff; color: #2b1d10; content: 'B'; }
.lead-chord-top { display: flex; align-items: center; justify-content: space-between; gap: 3px; min-width: 0; }
.lead-chord-top small { overflow: hidden; color: var(--text-dim); font-size: 0.48rem; text-overflow: ellipsis; white-space: nowrap; }
.lead-chord strong { overflow: hidden; color: var(--text); font-size: clamp(0.58rem, 1vw, 0.78rem); text-overflow: ellipsis; white-space: nowrap; }
.lead-chord-visual { color: color-mix(in srgb, var(--lead-color) 74%, white); font-size: 0.78rem; line-height: 1; }
.lead-chord-visual.triad { display: grid; width: 16px; height: 16px; place-items: center; }
.lead-chord-visual.triad svg { width: 16px; height: 16px; }
.lead-chord-visual.guitar { font-size: 0.72rem; }
.lead-chord-visual.piano { font-size: 0.76rem; }
.lead-empty { display: grid; place-items: center; color: var(--text-dim); font-size: 0.65rem; }
.lead-melody { display: grid; grid-template-columns: 45px minmax(0, 1fr); align-items: center; min-width: 0; height: 22px; padding: 0 4px; border: 0; border-radius: 3px; background: #1f150c; color: var(--text-dim); cursor: pointer; text-align: left; }
.lead-melody > span:first-child { font-size: 0.56rem; }
.lead-voice-badge { display: inline-block; margin-left: 4px; color: var(--accent); font-size: 0.52rem; vertical-align: 1px; }
.lead-melody-notes { position: relative; display: block; height: 14px; border-left: 1px solid rgba(255,255,255,0.1); background: repeating-linear-gradient(90deg, transparent 0 calc(12.5% - 1px), rgba(255,255,255,0.08) calc(12.5% - 1px) 12.5%); }
.lead-melody-notes i { position: absolute; top: 1px; overflow: hidden; height: 12px; min-width: 8px; padding: 0 2px; border-radius: 2px; background: #6b97c7; color: #e9f4ff; font-size: 0.48rem; font-style: normal; line-height: 12px; text-align: center; text-overflow: clip; white-space: nowrap; }
.lead-melody.empty .lead-melody-notes { padding-left: 5px; color: rgba(255,255,255,0.23); font-size: 0.62rem; line-height: 14px; }
.lead-harmony-map { display: grid; grid-template-columns: 96px minmax(0, 1fr) minmax(150px, 0.8fr); align-items: center; gap: 9px; min-width: 0; padding: 8px; border: 1px solid rgba(91,209,205,0.18); border-radius: 4px; background: #22180f; }
.lead-harmony-map header { display: flex; flex-direction: column; gap: 2px; color: var(--text-dim); font-size: 0.58rem; letter-spacing: 0.07em; text-transform: uppercase; }
.lead-harmony-map header span { color: var(--text); font-size: 0.68rem; font-weight: 700; }
.lead-harmony-map header small { color: var(--accent); font-size: 0.56rem; letter-spacing: 0; text-transform: none; }
.lead-harmony-map-body { display: grid; min-width: 0; place-items: center; }
.lead-harmony-map-body svg { width: min(100%, 220px); height: auto; max-height: 190px; }
.lead-harmony-map-legend { display: flex; flex-wrap: wrap; align-content: center; gap: 4px; }
.lead-harmony-map-legend button { min-width: 0; padding: 3px 6px; border: 1px solid var(--chip-color); border-radius: 999px; background: transparent; color: var(--chip-color); cursor: pointer; font-size: 0.6rem; }
.lead-harmony-map-legend button.active { background: color-mix(in srgb, var(--chip-color) 22%, transparent); color: #fff; }
.ctx-substitution { display: flex; align-items: stretch; gap: 3px; }
.ctx-substitution > button:not(.ctx-chip) { width: 25px; padding: 0; border: 1px solid rgba(255,255,255,0.13); border-radius: 4px; background: #291e14; color: var(--text-dim); cursor: pointer; }
.ctx-substitution > button:not(.ctx-chip):hover { border-color: var(--accent); color: var(--accent); }

@media (max-width: 760px) {
  .lead-sheet { gap: 5px; padding: 6px; }
  .lead-sheet-head { gap: 4px; }
  .lead-sheet-title { font-size: 0.58rem; }
  .lead-song-map { height: 19px; gap: 1px; }
  .lead-song-map-item { min-width: 12px; padding-inline: 2px; font-size: 0.44rem; }
  .lead-section { padding: 5px; }
  .lead-section-name { max-width: 33%; font-size: 0.68rem; }
  .lead-section-meta { font-size: 0.52rem; }
  .lead-band-drafts > summary { min-height: 23px; padding-inline: 3px; font-size: 0.5rem; }
  .lead-band-draft { min-width: 220px; }
  .lead-rhythm-quick { gap: 3px; padding-inline: 2px; }
  .lead-rhythm-current { max-width: 72px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .lead-rhythm-suggestion { font-size: 0.5rem; }
  .lead-song-rhythm-plan { grid-template-columns: minmax(0, 1fr); gap: 4px; }
  .lead-song-rhythm-actions { justify-content: flex-end; }
  .lead-chord { min-height: 38px; padding: 3px; }
  .lead-chord strong { font-size: 0.56rem; }
  .lead-chord-visual { font-size: 0.66rem; }
  .lead-chord-top small { display: none; }
  .lead-harmony-map { grid-template-columns: 1fr; gap: 5px; }
  .lead-harmony-map header { flex-direction: row; justify-content: space-between; }
  .lead-harmony-map-body svg { max-height: 150px; }
}

html.compose-layout #harmonizedCard,
html.compose-layout #wheelCard { display: none; }

html.compose-layout .app-transport-bar {
  left: var(--compose-side);
  right: var(--compose-inspector);
  min-height: 46px;
  border-radius: 0;
  border-color: rgba(91, 209, 205, 0.23);
  background: rgba(32, 23, 15, 0.97);
}
html.compose-layout .transport-bank .btn,
html.compose-layout .export-strip .btn { border-radius: 4px; }

html.compose-layout #composeInspector {
  display: flex !important;
  flex-direction: column;
  gap: 10px;
  border-left: 1px solid var(--compose-line);
  overflow-y: auto;
}
html.compose-layout .compose-inspector-head {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 5px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--compose-line);
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
html.compose-layout .compose-inspector-head > span { margin-right: auto; }
html.compose-layout .compose-inspector-context { overflow: hidden; max-width: 100%; color: var(--accent); font-size: 0.58rem; font-weight: 600; letter-spacing: 0; text-overflow: ellipsis; text-transform: none; white-space: nowrap; }
html.compose-layout .compose-inspector-head .btn { padding: 3px 5px; font-size: 0.62rem; }
html.compose-layout .compose-inspector-pane > .card,
html.compose-layout .compose-inspector-pane > .side-card {
  width: 100%;
  margin: 0;
  padding: 9px;
  border-color: var(--compose-line);
  border-radius: 5px;
  background: var(--compose-raised);
  box-shadow: none;
}
html.compose-layout #composeInspector #harmonizedCard,
html.compose-layout #composeInspector #wheelCard { display: block; }

/* ---- Panel Selección (inspector contextual) ---- */
html.compose-layout #composeContextHost { display: flex; flex-direction: column; gap: 10px; }
html.compose-layout #composeContextHost[hidden] { display: none; }
.ctx-panel {
  display: flex;
  flex-direction: column;
  gap: 9px;
  padding: 10px;
  border: 1px solid var(--compose-line);
  border-radius: 6px;
  background: var(--compose-raised);
}
.ctx-chord { border-color: color-mix(in srgb, var(--pop-color, var(--accent)) 45%, transparent); }
.ctx-kicker {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-dim);
}
.ctx-clear {
  background: none;
  border: 1px solid var(--compose-line);
  border-radius: 4px;
  color: var(--text-dim);
  cursor: pointer;
  font-size: 0.7rem;
  padding: 1px 6px;
}
.ctx-clear:hover { color: var(--text); border-color: var(--text-dim); }
.ctx-note-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ctx-note-name { font-size: 1.5rem; font-weight: 700; line-height: 1; }
.ctx-note-name sub { font-size: 0.75rem; color: var(--text-dim); }
.ctx-tag {
  font-size: 0.64rem;
  padding: 3px 7px;
  border-radius: 999px;
  border: 1px solid var(--compose-line);
  color: var(--text-dim);
}
.ctx-tag.tone { border-color: rgba(91, 209, 205, 0.6); color: #5bd1cd; }
.ctx-tag.color { border-color: rgba(126, 169, 211, 0.6); color: #7ea9d3; }
.ctx-tag.chromatic, .ctx-tag.ext { border-color: rgba(251, 191, 36, 0.55); color: var(--warn); }
.ctx-meta { display: flex; flex-wrap: wrap; gap: 4px 10px; font-size: 0.66rem; color: var(--text-dim); }
.ctx-block { display: flex; flex-direction: column; gap: 6px; }
.voice-take-block { padding-top: 2px; border-top: 1px solid rgba(255,255,255,0.07); }
.sound-rack-block { padding: 6px; border: 1px solid rgba(91,209,205,0.18); border-radius: 5px; background: rgba(91,209,205,0.035); }
.midi-routing { display: grid; gap: 7px; margin-top: 8px; padding-top: 8px; border-top: 1px solid rgba(172,183,199,0.18); }
.midi-routing-head { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.midi-routing-head > div { display: flex; gap: 5px; }
.midi-direction { display: grid; gap: 6px; padding: 7px; border: 1px solid rgba(255,255,255,0.10); border-radius: 5px; background: rgba(18,12,7,0.28); }
.midi-direction > header { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.midi-direction > header strong { color: var(--text); font-size: 0.68rem; letter-spacing: 0.04em; }
.midi-direction > header span { color: var(--text-dim); font-size: 0.58rem; text-align: right; }
.midi-out { border-left: 3px solid rgba(91,209,205,0.55); }
.midi-in { border-left: 3px solid rgba(148,163,255,0.55); }
.midi-part-routing { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 5px; margin-top: 4px; }
.midi-part-routing label { display: grid; grid-template-columns: auto minmax(0, 1fr) 34px; align-items: center; gap: 4px; color: var(--muted); font-size: 11px; }
.midi-part-routing select, .midi-part-routing input { min-width: 0; width: 100%; }
.midi-input-row { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(72px, 0.8fr); align-items: end; gap: 5px; }
.midi-input-row .btn { min-height: 29px; }
.midi-input-tools { display: flex; align-items: end; gap: 5px; flex-wrap: wrap; }
.midi-input-modes { display: inline-flex; flex-wrap: wrap; gap: 2px; padding: 2px; border: 1px solid rgba(255,255,255,0.1); border-radius: 5px; }
.midi-input-modes .btn { border: 0; min-height: 27px; }
.midi-input-modes .btn.active { color: var(--accent); background: rgba(91,209,205,0.14); }
.midi-grid-field { width: 76px; }
.midi-input-tools > .btn:last-child { margin-left: auto; min-height: 31px; }
.voice-take-controls { display: flex; align-items: center; gap: 5px; flex-wrap: wrap; }
.voice-take-controls .btn { min-width: 31px; padding-inline: 8px; }
.voice-take-controls .rec-on { border-color: var(--danger); color: var(--danger); animation: recPulse 1s ease-in-out infinite; }
.voice-countin { display: inline-flex; align-items: center; gap: 4px; min-height: 28px; color: var(--text-dim); font-size: 0.62rem; white-space: nowrap; }
.voice-countin input { accent-color: var(--accent); }
.voice-draft-actions { display: flex; align-items: center; gap: 5px; }
.voice-draft-actions .btn:first-child { border-color: rgba(91,209,205,0.45); color: var(--accent); }
.voice-tempo-actions { display: flex; align-items: center; gap: 5px; flex-wrap: wrap; }
.voice-tempo-actions .btn:not(:last-child) { min-width: 37px; border-color: rgba(126,169,211,0.5); color: #a8c8e8; }
.ctx-chips { display: flex; flex-wrap: wrap; gap: 5px; }
.ctx-chip {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1px;
  padding: 5px 8px;
  border: 1px solid var(--compose-line);
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
  cursor: pointer;
  font-size: 0.74rem;
  font-weight: 600;
  text-align: left;
}
.ctx-chip span { font-size: 0.58rem; font-weight: 400; color: var(--text-dim); }
.ctx-chip:hover { border-color: var(--accent); background: rgba(232, 165, 88, 0.12); }
.ctx-grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
.ctx-field { display: flex; flex-direction: column; gap: 3px; font-size: 0.66rem; color: var(--text-dim); }
.ctx-field select,
.ctx-field input[type="text"],
.ctx-field input[type="number"] {
  width: 100%;
  min-height: 28px;
  padding: 3px 6px;
  border: 1px solid var(--compose-line);
  border-radius: 5px;
  background: #1a120b;
  color: var(--text);
  font-size: 0.76rem;
}
.ctx-field input[type="range"] { width: 100%; accent-color: var(--accent); }
.ctx-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.ctx-panel .groove-lbl { display: flex; align-items: center; gap: 6px; font-size: 0.66rem; color: var(--text-dim); }
.ctx-panel .groove-lbl input[type="range"] { flex: 1; accent-color: var(--accent); }
/* el cuerpo compartido del editor de acorde hereda los estilos .roll-pop-* */
.ctx-panel .roll-pop-head strong { font-size: 1.05rem; }
.ctx-panel .roll-pop-grid { grid-template-columns: 1fr 1fr; }
html.compose-layout #composeInspector #harmonizedCard > h3 { font-size: 0.78rem; }
html.compose-layout #composeInspector #harmonizedCard > h3 .fine { display: none; }
html.compose-layout #composeInspector #harmonizedTables { max-height: 48vh; overflow: auto; }
html.compose-layout #composeInspector .scale-chip { font-size: 0.63rem; padding: 4px 6px; }
html.compose-layout #composeInspector .scale-chip.focus { box-shadow: inset 0 0 0 1px #dffffb; }
html.compose-layout #composeInspector .hz-chord-actions { min-width: 74px; }
html.compose-layout #composeInspector .hz-chord { min-width: 0; padding-inline: 5px; white-space: nowrap; }
html.compose-layout #composeInspector .hz-insert { min-width: 22px; }
html.compose-layout #composeInspector #wheelCard .acc-head { min-height: 36px; }
html.compose-layout #composeInspector #mandalaBig svg { max-width: 100%; height: auto; }

/* ---- Instrumento de acordes: foco completo, inspirado en pads de DAW ---- */
#chordInstrument[hidden] { display: none; }
body.instrument-open { overflow: hidden; }
#chordInstrument {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  grid-template-rows: 56px minmax(0, 1fr) auto;
  background: #171009;
  color: var(--text);
}
.instrument-topbar {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0 18px;
  border-bottom: 1px solid rgba(255,255,255,0.09);
  background: #221810;
}
.instrument-title { display: flex; align-items: baseline; gap: 8px; min-width: 0; }
.instrument-title > span { font-size: 0.64rem; color: var(--text-dim); letter-spacing: 0.08em; text-transform: uppercase; }
.instrument-title strong { font-size: 0.94rem; }
.instrument-title small { overflow: hidden; color: var(--text-dim); font-size: 0.72rem; text-overflow: ellipsis; white-space: nowrap; }
.instrument-transport { display: flex; align-items: center; gap: 6px; min-width: 0; margin-left: auto; }
.instrument-transport .btn { min-width: 34px; padding-inline: 8px; }
.instrument-transport .instrument-loop-btn { display: inline-flex; min-width: 64px; align-items: center; justify-content: center; gap: 5px; }
.instrument-loop-btn.on { border-color: var(--accent); background: rgba(91,209,205,0.16); color: var(--accent); box-shadow: inset 0 -2px 0 rgba(91,209,205,0.46); }
.instrument-transport .btn.on { border-color: var(--accent); background: rgba(91,209,205,0.16); color: var(--accent); box-shadow: inset 0 -2px 0 rgba(91,209,205,0.46); }
.instrument-tempo { display: flex; align-items: center; gap: 6px; min-width: 150px; color: var(--text-dim); font-size: 0.62rem; }
.instrument-tempo input { width: clamp(64px, 10vw, 138px); accent-color: var(--accent); }
.instrument-tempo output { min-width: 24px; color: var(--text); font-size: 0.76rem; font-variant-numeric: tabular-nums; }
.instrument-workspace { display: grid; grid-template-columns: minmax(0, 1fr) 300px; min-height: 0; }
.instrument-matrix-wrap { min-width: 0; padding: 20px; overflow: auto; }
.instrument-matrix-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 0 0 12px; color: var(--text-dim); font-size: 0.75rem; }
.instrument-rows { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; min-width: 0; }
.instrument-row {
  padding: 10px;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 7px;
  background: #21170f;
}
.instrument-row > header { display: grid; grid-template-columns: 20px minmax(0, 1fr) 28px; align-items: center; gap: 7px; margin-bottom: 9px; color: var(--text-dim); font-size: 0.7rem; }
.instrument-row > header select { min-width: 0; width: 100%; padding: 4px 6px; border-color: rgba(255,255,255,0.12); border-radius: 4px; background: #19110a; color: var(--text); }
.instrument-row > header select[data-inst-mode] { grid-column: 2 / 4; }
.instrument-row > header select[data-inst-tonic] { grid-column: 2; }
.instrument-octaves { display: flex; grid-column: 2 / 4; gap: 2px; }
.instrument-octaves button { min-width: 0; flex: 1; min-height: 22px; padding: 2px 3px; border: 1px solid rgba(255,255,255,0.11); border-radius: 3px; background: #291e14; color: var(--text-dim); cursor: pointer; font-size: 0.58rem; }
.instrument-octaves button.on { border-color: var(--accent); background: rgba(91,209,205,0.14); color: var(--accent); }
.instrument-row > header > span:last-child { display: none; }
.instrument-row-num { display: grid; width: 20px; height: 20px; place-items: center; border-radius: 3px; background: rgba(91, 209, 205, 0.14); color: var(--accent); font-size: 0.65rem; font-weight: 700; }
.instrument-sevenths { grid-column: 3; min-width: 28px; height: 27px; padding: 2px; border: 1px solid rgba(255,255,255,0.12); border-radius: 4px; background: #291e14; color: var(--text-dim); cursor: pointer; font-size: 0.72rem; font-weight: 800; }
.instrument-sevenths.on { border-color: rgba(91,209,205,0.65); background: rgba(91,209,205,0.15); color: var(--accent); }
.instrument-pads { display: grid; grid-template-columns: 1fr; gap: 6px; }
.instrument-pad { position: relative; min-width: 0; }
.instrument-pad-main {
  display: flex;
  width: 100%; min-height: 49px;
  flex-direction: column; align-items: flex-start; justify-content: space-between;
  padding: 7px 10px;
  border: 1px solid rgba(255,255,255,0.10); border-radius: 5px;
  background: rgba(255,255,255,0.035); color: var(--text); cursor: pointer;
  text-align: left;
}
.instrument-pad-main span { color: var(--text-dim); font-size: 0.66rem; }
.instrument-pad-main strong { font-size: 0.92rem; }
.instrument-pad-roman { color: var(--accent); font-size: 0.62rem; font-style: normal; font-weight: 700; letter-spacing: 0.02em; }
.instrument-pad.share-two .instrument-pad-main { border-color: rgba(91,209,205,0.34); background: rgba(91,209,205,0.075); }
.instrument-pad.share-one .instrument-pad-main { border-color: rgba(148,163,255,0.28); background: rgba(148,163,255,0.055); }
.instrument-pad-main:hover, .instrument-pad.armed .instrument-pad-main { border-color: var(--accent); background: rgba(91,209,205,0.14); }
.instrument-pad.locked .instrument-pad-main { border-color: rgba(251,191,36,0.5); }
.instrument-pad-lock { position: absolute; top: 5px; right: 6px; color: var(--warn); font-size: 0.58rem; pointer-events: none; }
.bass-instrument-open .instrument-workspace { grid-template-columns: minmax(0, 1fr) 260px; }
.bass-instrument-open .instrument-rows { display: block; min-width: 0; }
.bass-instrument-surface { display: grid; width: 100%; max-width: 1480px; margin: 18px auto; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; gap: 12px; }
.rhythm-track-panel { display: grid; min-width: 0; gap: 11px; padding: 13px; border: 1px solid rgba(255,255,255,0.1); border-radius: 7px; background: #21170f; box-shadow: 0 8px 24px rgba(0,0,0,0.16); }
.bass-track-panel { border-color: rgba(226,176,99,0.28); }
.drum-track-panel { border-color: rgba(91,209,205,0.3); }
.rhythm-track-head { display: flex; min-width: 0; align-items: end; justify-content: space-between; gap: 10px; padding-bottom: 10px; border-bottom: 1px solid rgba(255,255,255,0.08); }
.rhythm-track-head > div { display: grid; min-width: 0; gap: 2px; }
.rhythm-track-head > div > span { color: #e2b063; font-size: 0.55rem; font-weight: 800; letter-spacing: 0.1em; }
.rhythm-track-head strong { font-size: 0.88rem; }
.rhythm-track-head small { color: var(--text-dim); font-size: 0.57rem; }
.bass-track-panel > header { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.bass-track-panel > header div:first-child { color: var(--text-dim); font-size: 0.7rem; }
.bass-track-panel > header strong { color: var(--text); font-size: 0.86rem; }
.bass-octaves { display: flex; gap: 3px; min-width: 156px; }
.bass-octaves button { min-height: 30px; }
.bass-instrument-controls { margin-top: 2px; }
.bass-note-grid { min-width: 0; }
.bass-instrument-open .bass-note-grid.is-fourths { display: block; }
.bass-fourths-grid { display: grid; grid-template-columns: 22px repeat(7, minmax(0, 1fr)); gap: 4px; }
.bass-string-label { display: grid; min-height: 52px; place-items: center; color: var(--text-dim); font-size: 0.64rem; font-weight: 700; }
.bass-scale-picker { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; min-width: 0; }
.bass-scale-picker select { max-width: 46vw; padding: 5px 7px; border: 1px solid rgba(255,255,255,0.14); border-radius: 5px; background: #21170f; color: var(--text); font-size: 0.74rem; }
.bass-scale-picker strong { font-size: 0.9rem; }
.bass-fourths-grid .instrument-note-pad { min-height: 52px; }
.bass-fourths-grid .instrument-note-pad.selected { border-color: var(--accent); background: rgba(91,209,205,0.22); color: #e7ffff; }
.bass-timeline-grid { position: relative; min-height: 42px; }
.bass-timeline-note { z-index: 1; }
.bass-timeline-note.with-kick { border-color: rgba(91,209,205,0.82); background-color: rgba(91,209,205,0.25); box-shadow: inset 0 -2px 0 rgba(91,209,205,0.42); }
.rhythm-instrument-surface { margin-block: 18px; }
/* Vista exclusiva por pet: cada músico ve sólo su instrumento. */
#chordInstrument.rhythm-focus-drums .bass-instrument-surface,
#chordInstrument.rhythm-focus-bass .bass-instrument-surface { grid-template-columns: minmax(0, 1fr); max-width: 860px; }
#chordInstrument.rhythm-focus-drums .bass-track-panel { display: none; }
#chordInstrument.rhythm-focus-bass .drum-track-panel { display: none; }
.rhythm-focus-switch { grid-column: 1 / -1; display: inline-flex; gap: 4px; margin: 0 auto 4px; padding: 3px; border: 1px solid rgba(255,255,255,0.1); border-radius: 999px; background: #1d140c; }
.rhythm-focus-switch button { display: inline-flex; align-items: center; gap: 7px; padding: 6px 14px; border: 0; border-radius: 999px; background: transparent; color: var(--text-dim); font-size: 0.7rem; font-weight: 700; cursor: pointer; transition: background 0.15s, color 0.15s; }
.rhythm-focus-switch button.on { background: rgba(255,255,255,0.08); color: var(--text); }
.rhythm-focus-switch .pet-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--pet-accent, #888); box-shadow: 0 0 0 2px color-mix(in srgb, var(--pet-accent, #888) 30%, transparent); }
.rhythm-drum-panel { padding-top: 12px; border-top: 1px solid rgba(255,255,255,0.09); }
.drum-kit-heading { display: flex; align-items: end; justify-content: space-between; gap: 10px; }
.drum-kit-heading > div { display: flex; min-width: 0; flex-direction: column; gap: 2px; }
.drum-kit-heading strong { color: var(--text); font-size: 0.76rem; }
.drum-kit-heading small { color: var(--text-dim); font-size: 0.59rem; }
.drum-kit-heading .drum-kit-selectors { display: grid; width: min(440px, 64%); grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
.drum-kit-selectors label { display: grid; min-width: 0; gap: 2px; }
.drum-kit-selectors span { color: var(--text-dim); font-size: 0.52rem; }
.drum-kit-heading select { width: 100%; min-width: 0; padding: 5px 7px; }
.drum-kit-stage { position: relative; width: 100%; min-height: 210px; margin-top: 8px; border: 1px solid rgba(91,209,205,0.2); border-radius: 6px; background: radial-gradient(ellipse at 50% 68%, rgba(91,209,205,0.16), transparent 48%), linear-gradient(180deg, #1e140b, #1a110a); overflow: hidden; }
.drum-kit-piece-slot { position: absolute; }
.drum-kit-piece { position: relative; display: flex; width: 100%; height: 100%; min-width: 0; flex-direction: column; align-items: center; justify-content: center; gap: 1px; padding: 4px; border: 1px solid rgba(255,255,255,0.14); background: #2d2116; color: var(--text); cursor: pointer; touch-action: manipulation; }
.drum-kit-piece span { color: var(--text-dim); font-size: 0.5rem; }
.drum-kit-piece strong { overflow: hidden; max-width: 100%; font-size: 0.59rem; font-weight: 650; text-overflow: ellipsis; white-space: nowrap; }
.drum-kit-piece:hover, .drum-kit-piece.part-selected { border-color: rgba(91,209,205,0.44); background: rgba(91,209,205,0.09); }
.drum-kit-piece.selected { border-color: var(--accent); background: rgba(91,209,205,0.23); color: var(--accent); box-shadow: 0 0 0 1px rgba(91,209,205,0.24); }
.drum-kit-mute { position: absolute; z-index: 2; top: 3px; right: 3px; display: grid; width: 24px; height: 24px; min-height: 24px; place-items: center; padding: 0; border: 1px solid rgba(255,255,255,0.2); border-radius: 50%; background: rgba(18,12,7,0.82); color: var(--text-dim); cursor: pointer; font-size: 0.58rem; font-weight: 800; touch-action: manipulation; }
.drum-kit-mute.on { border-color: rgba(248,113,113,0.72); background: rgba(118,40,45,0.92); color: #ffd9dc; }
.drum-kit-piece-slot.muted .drum-kit-piece { opacity: 0.42; filter: saturate(0.35); }
.drum-kit-piece-slot.crash, .drum-kit-piece-slot.ride { top: 6%; width: 21%; height: 27%; }
.drum-kit-piece-slot.crash .drum-kit-piece, .drum-kit-piece-slot.ride .drum-kit-piece { border-radius: 50%; background: #242321; border-color: rgba(229,193,108,0.35); }
.drum-kit-piece-slot.crash { left: 3%; }
.drum-kit-piece-slot.ride { right: 3%; }
.drum-kit-piece-slot.hat, .drum-kit-piece-slot.open-hat { left: 5%; width: 15%; height: 23%; }
.drum-kit-piece-slot.hat .drum-kit-piece, .drum-kit-piece-slot.open-hat .drum-kit-piece { border-radius: 50%; }
.drum-kit-piece-slot.hat { top: 39%; }
.drum-kit-piece-slot.open-hat { top: 67%; height: 22%; }
.drum-kit-piece-slot.tom-hi, .drum-kit-piece-slot.tom-mid { top: 18%; width: 17%; height: 25%; }
.drum-kit-piece-slot.tom-hi .drum-kit-piece, .drum-kit-piece-slot.tom-mid .drum-kit-piece { border-radius: 50%; }
.drum-kit-piece-slot.tom-hi { left: 31%; }
.drum-kit-piece-slot.tom-mid { left: 52%; }
.drum-kit-piece-slot.snare { top: 48%; left: 24%; width: 19%; height: 28%; }
.drum-kit-piece-slot.snare .drum-kit-piece { border-radius: 50%; }
.drum-kit-piece-slot.rim { top: 78%; left: 27%; width: 13%; height: 15%; }
.drum-kit-piece-slot.rim .drum-kit-piece { border-radius: 10px; }
.drum-kit-piece-slot.tom-floor { top: 50%; right: 10%; width: 19%; height: 32%; }
.drum-kit-piece-slot.tom-floor .drum-kit-piece { border-radius: 50%; }
.drum-kit-piece-slot.kick { top: 48%; left: 43%; width: 26%; height: 45%; }
.drum-kit-piece-slot.kick .drum-kit-piece { border-radius: 50% 50% 12px 12px; background: #2e2116; }
.drum-part-mixer { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 5px; margin-top: 8px; }
.drum-part-mixer-head { grid-column: 1 / -1; display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.drum-part-mixer-head strong { font-size: 0.67rem; }
.drum-part-mixer-head small { color: var(--text-dim); font-size: 0.56rem; }
.drum-part-control { display: grid; align-content: start; gap: 4px; padding: 5px; border: 1px solid rgba(255,255,255,0.09); border-radius: 5px; background: #251a10; }
.drum-part-control.active { border-color: rgba(91,209,205,0.54); background: rgba(91,209,205,0.08); }
.drum-part-control > strong { overflow: hidden; font-size: 0.59rem; text-overflow: ellipsis; white-space: nowrap; }
.drum-part-control label { display: grid; grid-template-columns: minmax(0, 1fr) 30px; align-items: center; gap: 3px; }
.drum-part-control span { overflow: hidden; color: var(--text-dim); font-size: 0.5rem; text-overflow: ellipsis; white-space: nowrap; }
.drum-part-control input { grid-column: 1 / -1; width: 100%; min-width: 0; }
.drum-part-control em { grid-column: 2; grid-row: 1; color: var(--text); font-size: 0.52rem; font-style: normal; text-align: right; }
.drum-part-control .drum-musical-control { display: grid; grid-template-columns: minmax(0, 1fr); gap: 3px; padding-top: 5px; border-top: 1px solid rgba(255,255,255,0.07); }
.drum-musical-control select { width: 100%; min-width: 0; min-height: 28px; padding: 3px 5px; border-radius: 4px; font-size: 0.57rem; }
/* La Banda: panel de chat de un pet (el Baterista es el primero). Mismo look
   de tarjeta que el resto de la sección rítmica; el log scrollea solo. */
.band-pet-panel { margin-top: 10px; padding: 10px; border: 1px solid rgba(91,209,205,0.22); border-radius: 8px; background: rgba(29,20,12,0.85); }
.band-pet-head { display: flex; align-items: center; gap: 10px; }
.band-pet-head > div { min-width: 0; }
.band-pet-avatar { position: relative; display: inline-block; flex: 0 0 auto; width: 44px; height: 44px; overflow: hidden; border: 1px solid rgba(91,209,205,0.42); border-radius: 50%; background-color: #23180f; box-shadow: inset 0 0 0 1px rgba(255,255,255,0.035), 0 5px 14px rgba(0,0,0,0.24); image-rendering: pixelated; }
.band-pet-avatar > img { position: absolute; inset-block: 0; left: 0; display: block; width: 400%; max-width: none; height: 100%; object-fit: fill; pointer-events: none; }
.band-avatar-semantic { transform: translateX(calc(var(--band-frame, 0) * -25%)); }
.band-avatar-playing { visibility: hidden; transform: translateX(0); }
.band-pet-avatar[data-band-state="playing"] .band-avatar-semantic { visibility: hidden; }
.band-pet-avatar[data-band-state="playing"] .band-avatar-playing { visibility: visible; animation: band-avatar-playing-strip 0.64s linear infinite; }
.band-pet-avatar.compact { width: 22px; height: 22px; border-color: rgba(91,209,205,0.28); box-shadow: none; }
.band-pet-avatar[data-band-state="idle"] { animation: band-pet-breathe 2.8s ease-in-out infinite; }
.band-pet-avatar[data-band-state="playing"] { animation: band-pet-groove 0.58s ease-in-out infinite alternate; border-color: var(--accent); }
.band-pet-avatar[data-band-state="celebrating"] { animation: band-pet-celebrate 0.42s ease-out 3; border-color: #f2bd67; }
.band-pet-avatar[data-band-state="listening"] { animation: band-pet-listen 1.25s ease-in-out infinite alternate; }
.band-pet-head strong { display: block; font-size: 0.74rem; }
.band-pet-head small { color: var(--text-dim); font-size: 0.58rem; }
.band-pet-sound { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 9px; margin-top: 9px; padding: 7px 8px; border: 1px solid rgba(255,255,255,0.08); border-radius: 6px; background: rgba(255,255,255,0.025); }
.band-pet-sound span { color: var(--text-dim); font-size: 0.57rem; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; }
.band-pet-sound select { width: 100%; min-width: 0; min-height: 30px; padding: 4px 7px; border: 1px solid rgba(255,255,255,0.12); border-radius: 5px; background: #181009; color: var(--text); font-size: 0.64rem; }
.band-settings-toggle { margin-left: auto; }
.band-settings-toggle.on { border-color: var(--accent); color: var(--accent); }
.band-settings { display: grid; gap: 6px; margin-top: 8px; padding: 8px; border: 1px solid rgba(255,255,255,0.09); border-radius: 6px; background: #181009; }
.band-settings label { display: grid; gap: 2px; font-size: 0.58rem; color: var(--text-dim); }
.band-settings input, .band-settings select { min-height: 28px; padding: 3px 6px; border: 1px solid rgba(255,255,255,0.12); border-radius: 4px; background: #1d140c; color: var(--text); font-size: 0.64rem; }
.band-settings small { color: var(--text-dim); font-size: 0.54rem; }
.band-chat-log { max-height: 250px; margin-top: 8px; padding-right: 3px; overflow-y: auto; scrollbar-width: thin; display: grid; gap: 7px; }
.band-chat-empty { margin: 0; color: var(--text-dim); font-size: 0.62rem; }
.band-msg { padding: 6px 8px; border-radius: 7px; background: rgba(255,255,255,0.05); font-size: 0.66rem; }
.band-msg strong { display: block; margin-bottom: 2px; font-size: 0.56rem; color: var(--text-dim); }
.band-msg-author { display: flex !important; align-items: center; gap: 6px; min-height: 22px; }
.band-msg p { margin: 0; white-space: pre-wrap; }
.band-msg.user { background: rgba(91,209,205,0.1); }
.band-msg.notice { border-left: 2px solid rgba(242,189,103,0.7); background: rgba(242,189,103,0.07); }
.band-msg.pet.thinking p { color: var(--text-dim); font-style: italic; }
.band-proposal { margin-top: 6px; padding: 6px 8px; border: 1px solid rgba(91,209,205,0.3); border-radius: 6px; background: rgba(91,209,205,0.07); }
.band-proposal-set { display: grid; gap: 7px; margin-top: 6px; }
.band-proposal-set .band-proposal { margin-top: 0; }
.band-proposal > header { display: grid; gap: 2px; }
.band-proposal > header > span { color: var(--accent); font-size: 0.61rem; font-weight: 800; }
.band-proposal > header > small { color: var(--text-dim); font-size: 0.55rem; line-height: 1.35; }
.band-proposal > span { display: block; font-size: 0.52rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--accent); }
.band-proposal ul { margin: 4px 0; padding-left: 15px; font-size: 0.62rem; }
.band-proposal.applied { border-color: rgba(255,255,255,0.14); background: rgba(255,255,255,0.04); }
.band-proposal.previewing { border-color: rgba(91,209,205,0.78); background: rgba(91,209,205,0.12); box-shadow: inset 3px 0 0 var(--accent); }
.band-proposal small { color: var(--text-dim); font-size: 0.55rem; }
.band-proposal-buttons { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)) 30px; gap: 6px; }
.band-proposal-buttons .btn { min-width: 0; padding-inline: 7px; }
.band-proposal-loop.on { border-color: var(--accent); background: rgba(91,209,205,0.16); color: var(--accent); }
.band-proposal-target { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 7px; margin: 6px 0; }
.band-proposal-target > span { color: var(--text-dim); font-size: 0.56rem; }
.band-proposal-target select { width: 100%; min-width: 0; min-height: 28px; padding: 3px 6px; border: 1px solid rgba(255,255,255,0.12); border-radius: 4px; background: #181009; color: var(--text); font-size: 0.61rem; }
.band-followup { display: flex; gap: 6px; margin-top: 6px; }
.band-followup [data-band-followup] { flex: 1; border-color: rgba(242,189,103,0.38); }
.band-followup [data-band-followup-dismiss] { min-width: 30px; padding-inline: 7px; }
.band-chat-form { display: grid; grid-template-columns: 34px minmax(0, 1fr) auto; gap: 6px; margin-top: 8px; }
.band-chat-form input { min-width: 0; min-height: 30px; padding: 4px 8px; border: 1px solid rgba(255,255,255,0.12); border-radius: 5px; background: #181009; color: var(--text); font-size: 0.66rem; }
.band-chat-voice { display: grid; width: 34px; min-width: 34px; min-height: 30px; place-items: center; padding: 0; color: var(--text-dim); font-size: 0.76rem; }
.band-chat-voice.recording { border-color: #f07178; background: rgba(240,113,120,0.14); color: #ff8e94; box-shadow: inset 0 0 0 1px rgba(240,113,120,0.2); animation: band-voice-pulse 1.1s ease-in-out infinite; }
.band-voice-status { grid-column: 1 / -1; min-height: 12px; color: var(--text-dim); font-size: 0.53rem; line-height: 1.25; }
@keyframes band-voice-pulse { 0%,100% { opacity: 0.72; } 50% { opacity: 1; } }
@keyframes band-pet-breathe { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-1px); } }
@keyframes band-pet-groove { from { transform: translateY(1px) rotate(-1deg); } to { transform: translateY(-2px) rotate(1deg); } }
@keyframes band-pet-celebrate { 0%,100% { transform: translateY(0) scale(1); } 50% { transform: translateY(-5px) scale(1.05); } }
@keyframes band-pet-listen { from { transform: rotate(-1.5deg); } to { transform: rotate(1.5deg); } }
@keyframes band-avatar-playing-strip {
  0%, 24.99% { transform: translateX(0); }
  25%, 49.99% { transform: translateX(-25%); }
  50%, 74.99% { transform: translateX(-50%); }
  75%, 100% { transform: translateX(-75%); }
}
@media (prefers-reduced-motion: reduce) {
  .band-pet-avatar, .band-avatar-playing { animation: none !important; }
}
.rhythm-fixed-scale, .rhythm-patterns { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 5px; }
.bass-pattern-generator { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 5px; }
.bass-pattern-generator select { min-width: 0; }
.rhythm-patterns { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.rhythm-patterns .btn.on { border-color: var(--accent); background: rgba(91,209,205,0.16); color: var(--accent); }
/* Intérprete de bajo: el eje X decide cuánto se mueve la línea y el Y su
   articulación. Comparte proporciones con la batería para sentirse parte del
   mismo instrumento, pero usa un acento cálido para distinguir las pistas. */
.bass-performance-section, .drum-performance-section { padding-top: 10px; border-top: 1px solid rgba(255,255,255,0.09); }
.bass-generate-line { width: 100%; border-color: rgba(226,176,99,0.42); color: #f4cd92; }
.bass-style-pads { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 5px; }
.bass-style-pads .btn, .bass-phrase-pads .btn { min-width: 0; min-height: 29px; padding: 4px 5px; font-size: 0.62rem; }
.bass-style-pads .btn.on, .bass-phrase-pads .btn.on { border-color: rgba(226,176,99,0.92); background: rgba(226,176,99,0.14); color: #f4cd92; }
.bass-performance-pad { position: relative; width: 100%; aspect-ratio: 1.85; border: 1px solid rgba(226,176,99,0.32); border-radius: 7px; background: linear-gradient(135deg, rgba(226,176,99,0.04), rgba(226,176,99,0.18)); cursor: crosshair; touch-action: none; user-select: none; }
.bass-perf-dot { position: absolute; width: 15px; height: 15px; border-radius: 50%; background: #e2b063; border: 2px solid rgba(6,12,18,0.9); box-shadow: 0 0 0 2px rgba(226,176,99,0.32), 0 2px 8px rgba(0,0,0,0.5); transform: translate(-50%, -50%); pointer-events: none; }
.bass-perf-corner { position: absolute; left: 7px; font-size: 0.58rem; letter-spacing: 0.04em; color: var(--text-dim); opacity: 0.8; pointer-events: none; }
.bass-perf-corner.tl { top: 5px; }
.bass-perf-corner.bl { bottom: 5px; }
.bass-perf-axis { display: flex; justify-content: space-between; margin-top: -2px; color: var(--text-dim); font-size: 0.58rem; letter-spacing: 0.04em; opacity: 0.8; }
.bass-phrase-pads { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 5px; }
.bass-phrase-pads .btn:first-child { grid-column: auto; }
.bass-phrase-pads .btn:last-child { grid-column: 1 / -1; }
.bass-feel-label { display: grid; grid-template-columns: auto minmax(0, 1fr) 40px; align-items: center; gap: 8px; color: var(--text-dim); font-size: 0.68rem; }
.bass-feel-label input[type="range"] { width: 100%; min-width: 0; }
.bass-feel-label em { color: var(--text); font-style: normal; text-align: right; }
.bass-perf-hint { color: var(--text-dim); font-size: 0.6rem; line-height: 1.3; }
/* Pad intérprete (batería): X = complejidad, Y = intensidad */
.drum-performance-pad { position: relative; width: 100%; aspect-ratio: 1.55; border: 1px solid rgba(255,255,255,0.14); border-radius: 8px; background: linear-gradient(135deg, rgba(91,209,205,0.05), rgba(91,209,205,0.16)); cursor: crosshair; touch-action: none; user-select: none; }
.drum-perf-dot { position: absolute; width: 15px; height: 15px; border-radius: 50%; background: var(--accent); border: 2px solid rgba(6,12,18,0.9); box-shadow: 0 0 0 2px rgba(91,209,205,0.35), 0 2px 8px rgba(0,0,0,0.5); transform: translate(-50%, -50%); pointer-events: none; }
.drum-perf-corner { position: absolute; left: 7px; font-size: 0.58rem; letter-spacing: 0.04em; color: var(--text-dim); opacity: 0.8; pointer-events: none; }
.drum-perf-corner.tl { top: 5px; }
.drum-perf-corner.bl { bottom: 5px; }
.drum-perf-axis { display: flex; justify-content: space-between; font-size: 0.58rem; letter-spacing: 0.04em; color: var(--text-dim); opacity: 0.8; margin-top: -2px; }
.drum-feel-label { display: grid; grid-template-columns: auto minmax(0, 1fr) 40px; align-items: center; gap: 8px; font-size: 0.68rem; }
.drum-feel-label input[type="range"] { width: 100%; min-width: 0; }
.drum-feel-label em { font-style: normal; text-align: right; color: var(--text); }
.drum-perf-hint { font-size: 0.6rem; opacity: 0.65; }
.drum-part-editor label { display: grid; grid-template-columns: minmax(0, 1fr) 40px; align-items: center; gap: 8px; }
.drum-part-editor input[type="range"] { width: 100%; min-width: 0; }
.drum-part-editor em { color: var(--text); font-size: 0.68rem; font-style: normal; text-align: right; }
.drum-part-editor small { display: block; margin-top: 4px; color: var(--text-dim); font-size: 0.58rem; line-height: 1.3; }
.rhythm-variations { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 5px; }
.rhythm-variations .btn { min-height: 30px; padding: 5px 3px; font-size: 0.62rem; }
.rhythm-variations .btn.on { border-color: var(--accent); background: rgba(91,209,205,0.16); color: var(--accent); }
.rhythm-candidates { display: grid; gap: 4px; }
.rhythm-intensity { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px; }
.rhythm-intensity button { min-height: 27px; border: 1px solid rgba(255,255,255,0.1); border-radius: 4px; background: #21170f; color: var(--text-dim); cursor: pointer; font-size: 0.6rem; }
.rhythm-intensity button.on { border-color: var(--accent); background: rgba(91,209,205,0.14); color: var(--accent); }
.rhythm-candidate { display: grid; grid-template-columns: minmax(0, 1fr) 30px auto; align-items: center; gap: 6px; padding: 5px; border: 1px solid rgba(255,255,255,0.08); border-radius: 4px; background: #21170f; }
.rhythm-candidate.best { border-color: rgba(91,209,205,0.34); background: rgba(91,209,205,0.06); }
.rhythm-candidate.best::before { content: 'RECOMENDADA'; grid-column: 1 / -1; color: var(--accent); font-size: 0.5rem; font-weight: 800; letter-spacing: 0.08em; }
.rhythm-alternatives { border-top: 1px solid rgba(255,255,255,0.08); }
.rhythm-alternatives summary { padding: 8px 5px 4px; color: var(--text-dim); cursor: pointer; font-size: 0.61rem; font-weight: 700; }
.rhythm-alternatives[open] summary { color: var(--accent); }
.rhythm-alternative-list { display: grid; gap: 4px; padding-top: 4px; }
.rhythm-alternative-list .rhythm-candidate { background: #1d140c; }
.rhythm-advice { display: flex; min-width: 0; flex-direction: column; align-items: flex-start; gap: 2px; }
.rhythm-advice strong { color: var(--accent); font-size: 0.64rem; line-height: 1.2; }
.rhythm-advice small { color: var(--text-dim); font-size: 0.58rem; line-height: 1.25; }
.rhythm-candidate .btn, .rhythm-copy .btn { min-height: 30px; padding: 5px 8px; font-size: 0.62rem; }
.rhythm-candidate .rhythm-preview { width: 30px; padding: 0; }
.rhythm-copy { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px; }
.rhythm-patterns .btn, .rhythm-action { min-height: 30px; padding: 5px; font-size: 0.65rem; }
.rhythm-sounds label { display: grid; grid-template-columns: 48px minmax(0, 1fr); align-items: center; gap: 6px; }
.rhythm-lane { display: grid; grid-template-columns: 34px minmax(0, 1fr); align-items: center; gap: 5px; margin-top: 3px; }
.rhythm-lane > span { color: var(--text-dim); font-size: 0.56rem; font-weight: 700; text-transform: uppercase; }
.rhythm-lane .instrument-timeline-grid { min-height: 32px; }
.rhythm-lane .instrument-chord-block { height: 29px; }
.rhythm-drum-note { border-color: rgba(248,113,113,0.32); background-color: rgba(248,113,113,0.08); }
.rhythm-drum-note strong { font-size: 0.58rem; }
.rhythm-drum-row.muted { opacity: 0.45; }
.rhythm-drum-row.muted > span { color: #ef9b9b; }
.rhythm-lanes-head { display: flex; min-height: 25px; align-items: center; justify-content: space-between; gap: 8px; color: var(--text-dim); font-size: 0.58rem; }
.rhythm-play-position { min-width: 42px; padding: 2px 5px; border: 1px solid rgba(91,209,205,0.32); border-radius: 3px; color: var(--accent); font-size: 0.58rem; font-variant-numeric: tabular-nums; text-align: center; }
.rhythm-groove-status { display: flex; min-width: 0; flex-wrap: wrap; gap: 4px; }
.rhythm-groove-status i { padding: 2px 5px; border: 1px solid rgba(255,255,255,0.10); border-radius: 3px; color: var(--text-dim); font-style: normal; white-space: nowrap; }
.rhythm-groove-status .together { border-color: rgba(91,209,205,0.4); color: var(--accent); }
.rhythm-groove-status .kick-only { border-color: rgba(248,113,113,0.34); color: #ef9b9b; }
.rhythm-lanes-head button { width: 28px; height: 24px; border: 1px solid rgba(255,255,255,0.12); border-radius: 4px; background: #291e14; color: var(--text-dim); cursor: pointer; }
.rhythm-velocity { display: flex; gap: 3px; margin-left: auto; }
.rhythm-lanes-head .rhythm-velocity button { width: auto; min-width: 44px; padding-inline: 6px; font-size: 0.54rem; }
.rhythm-velocity button.on { border-color: var(--accent); background: rgba(91,209,205,0.13); color: var(--accent); }
.rhythm-lanes-body[hidden] { display: none; }
.rhythm-drum-sequencer { display: grid; grid-template-columns: 34px minmax(0, 1fr); gap: 5px; margin-top: 3px; }
.rhythm-drum-sequencer > span { align-self: center; color: var(--text-dim); font-size: 0.56rem; font-weight: 700; text-transform: uppercase; }
.rhythm-drum-row { display: grid; grid-template-columns: 36px minmax(0, 1fr); align-items: center; gap: 4px; margin-top: 2px; }
.rhythm-drum-row > span { color: var(--text-dim); font-size: 0.52rem; text-align: right; }
.drum-step-grid { display: grid; width: max(100%, calc(var(--inst-columns) * var(--inst-col-width))); min-height: 24px; grid-template-columns: repeat(var(--inst-columns), minmax(var(--inst-col-width), 1fr)); gap: 2px; padding: 3px; border-radius: 4px; background: #181009; }
.rhythm-drum-step { min-width: 0; height: 18px; padding: 0; border: 1px solid rgba(255,255,255,0.10); border-radius: 2px; background: #261c13; cursor: pointer; }
.rhythm-drum-step.beat-start { border-left-color: rgba(91,209,205,0.48); }
.rhythm-drum-step:hover { border-color: var(--accent); background: rgba(91,209,205,0.18); }
.rhythm-drum-step.active { border-color: rgba(248,113,113,0.82); background: #e36b74; box-shadow: inset 0 -2px 0 rgba(0,0,0,0.22); opacity: calc(0.38 + var(--step-strength) * 0.62); }
.rhythm-drum-step.active.supports-bass { border-color: #83ddd8; box-shadow: inset 0 -2px 0 rgba(0,0,0,0.22), 0 0 0 1px rgba(91,209,205,0.5); }
.instrument-editor { min-width: 0; padding: 14px; border-left: 1px solid rgba(255,255,255,0.09); background: #21170f; overflow: auto; }
.instrument-empty { margin: 0; color: var(--text-dim); font-size: 0.78rem; line-height: 1.5; }
.instrument-selected-head { display: flex; flex-direction: column; gap: 5px; padding-bottom: 12px; border-bottom: 1px solid rgba(255,255,255,0.09); }
.instrument-selected-head span { color: var(--accent); font-size: 0.68rem; }
.instrument-selected-chord { display: flex; align-items: baseline; gap: 9px; min-width: 0; }
.instrument-selected-head strong { font-size: 1.55rem; }
.instrument-selected-chord small { overflow: hidden; color: var(--text-dim); font-size: 0.68rem; text-overflow: ellipsis; white-space: nowrap; }
.rhythm-arrangement-head { padding: 4px 0 13px; }
.rhythm-arrangement-head .instrument-selected-chord { align-items: center; }
.rhythm-arrangement-head strong { color: var(--text); }
.rhythm-arrangement-head small { padding: 3px 7px; border: 1px solid rgba(91,209,205,0.22); border-radius: 3px; background: rgba(91,209,205,0.07); color: var(--accent); }
.instrument-lock-toggle { display: grid; width: 28px; height: 28px; flex: 0 0 auto; margin-left: auto; place-items: center; border: 1px solid rgba(255,255,255,0.12); border-radius: 4px; background: #291e14; color: var(--text); cursor: pointer; }
.instrument-lock-toggle:hover { border-color: var(--accent); }
.instrument-melody-companion { margin-top: 14px; padding: 10px; border: 1px solid rgba(91,209,205,0.22); border-radius: 5px; background: rgba(91,209,205,0.045); }
.instrument-section-title { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; color: var(--text-dim); font-size: 0.7rem; }
.instrument-section-title small { overflow: hidden; color: var(--accent); font-size: 0.62rem; text-overflow: ellipsis; white-space: nowrap; }
.instrument-scale-label { display: block; overflow: hidden; margin-top: 3px; color: var(--accent); font-size: 0.62rem; text-overflow: ellipsis; white-space: nowrap; }
.instrument-label-switch { display: flex; gap: 3px; }
.instrument-label-switch button { min-height: 21px; padding: 2px 5px; border: 1px solid rgba(255,255,255,0.11); border-radius: 3px; background: #291e14; color: var(--text-dim); cursor: pointer; font-size: 0.56rem; }
.instrument-label-switch button:hover, .instrument-label-switch button.on { border-color: rgba(91,209,205,0.62); color: var(--accent); }
.instrument-melody-tabs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px; margin-top: 8px; }
.instrument-melody-tabs button { min-height: 26px; padding: 4px; border: 1px solid rgba(255,255,255,0.12); border-radius: 4px; background: #291e14; color: var(--text-dim); cursor: pointer; font-size: 0.66rem; }
.instrument-melody-tabs button:hover, .instrument-melody-tabs button.on { border-color: var(--accent); color: var(--accent); background: rgba(91,209,205,0.1); }
.instrument-layout-tabs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px; margin-top: 5px; }
.instrument-layout-tabs button { min-height: 24px; padding: 3px; border: 1px solid rgba(255,255,255,0.10); border-radius: 4px; background: transparent; color: var(--text-dim); cursor: pointer; font-size: 0.62rem; }
.instrument-layout-tabs button:hover, .instrument-layout-tabs button.on { border-color: rgba(91,209,205,0.6); color: var(--accent); }
.instrument-note-grid { margin-top: 8px; }
.instrument-note-grid.is-fourths { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 3px; }
.instrument-note-pad { display: flex; min-width: 0; min-height: 28px; flex-direction: column; align-items: center; justify-content: center; gap: 1px; padding: 2px; border: 1px solid rgba(255,255,255,0.08); border-radius: 3px; background: #21170f; color: var(--text-dim); cursor: pointer; }
.instrument-note-pad strong { font-size: 0.62rem; font-weight: 600; }
.instrument-note-pad span { display: none; }
.instrument-note-pad.in-scale { color: var(--text); background: #2b1f15; }
.instrument-note-pad.chord-tone { border-color: rgba(91,209,205,0.48); background: rgba(91,209,205,0.13); color: var(--accent); }
.instrument-note-pad.root-tone { border-color: var(--accent); box-shadow: inset 0 0 0 1px rgba(91,209,205,0.24); }
.instrument-note-pad.chord-root { border-color: var(--accent); background: rgba(91,209,205,0.3); color: #e7ffff; box-shadow: 0 0 8px rgba(91,209,205,0.45); }
.instrument-note-pad.live-chord-tone { border-color: rgba(239,180,92,0.82); background: rgba(239,180,92,0.17); color: #ffdca4; box-shadow: inset 0 0 0 1px rgba(239,180,92,0.16); opacity: 1; }
.instrument-note-pad.live-chord-root { border-color: #ffd083; background: rgba(239,180,92,0.32); color: #fff3dd; box-shadow: 0 0 9px rgba(239,180,92,0.38); opacity: 1; }
.instrument-note-pad.outside-scale { opacity: 0.34; }
.instrument-note-pad:hover { border-color: var(--accent); color: var(--accent); opacity: 1; }
.instrument-piano { position: relative; height: 88px; overflow: hidden; border: 1px solid rgba(255,255,255,0.10); border-radius: 4px; background: #110c08; }
.instrument-piano-whites { display: grid; height: 100%; grid-template-columns: repeat(12, minmax(0, 1fr)); }
.instrument-piano .instrument-note-pad { min-height: 0; border-width: 0 1px 0 0; border-radius: 0; background: #d7dde1; color: #2b1f14; }
.instrument-piano .instrument-note-pad.in-scale { background: #edf3f4; }
.instrument-piano .instrument-note-pad.chord-tone { background: #8adbd7; color: #062126; box-shadow: inset 0 -3px 0 #3a9694; }
.instrument-piano .instrument-note-pad.outside-scale { opacity: 0.52; }
.instrument-piano .instrument-note-pad.root-tone { box-shadow: inset 0 -4px 0 #168a8a; }
.instrument-piano .instrument-note-pad.live-chord-tone { background: #f3cd8f; color: #2b1b08; box-shadow: inset 0 -3px 0 #bd7a21; opacity: 1; }
.instrument-piano .instrument-note-pad.live-chord-root { background: #ffd78f; box-shadow: inset 0 -5px 0 #a85f12, 0 0 8px rgba(239,180,92,0.42); }
.instrument-piano .piano-black { position: absolute; z-index: 2; top: 0; left: calc((var(--piano-x) + 1) * (100% / 12)); width: 6.5%; height: 47%; transform: translateX(-50%); border: 1px solid #061017; border-radius: 0 0 3px 3px; background: #2d2116; color: #cbd5df; }
.instrument-piano .piano-black strong { display: none; }
.instrument-piano .piano-black.in-scale { background: #473628; }
.instrument-piano .piano-black.chord-tone { background: #226f72; color: #e5ffff; box-shadow: inset 0 -2px 0 #63d4d0; }
.instrument-section { display: flex; flex-direction: column; gap: 7px; margin-top: 16px; color: var(--text-dim); font-size: 0.72rem; }
.instrument-section select { min-height: 32px; border-color: rgba(255,255,255,0.12); border-radius: 5px; background: #181009; color: var(--text); }
.instrument-pills { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px; }
.instrument-pills button { min-width: 0; min-height: 28px; padding: 5px 7px; border: 1px solid rgba(255,255,255,0.12); border-radius: 4px; background: #291e14; color: var(--text); cursor: pointer; text-align: left; }
.instrument-pills button:hover, .instrument-pills button.on { border-color: var(--accent); color: var(--accent); }
.instrument-voicings { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px; }
.instrument-voicings button { min-height: 29px; padding: 5px 6px; border: 1px solid rgba(255,255,255,0.12); border-radius: 4px; background: #291e14; color: var(--text); cursor: pointer; font-size: 0.7rem; }
.instrument-voicings button:first-child { grid-column: 1 / -1; }
.instrument-voicings button:hover, .instrument-voicings button.on { border-color: var(--accent); color: var(--accent); background: rgba(91,209,205,0.1); }
.instrument-section-dock { min-width: 0; padding: 7px 10px 9px; border-top: 1px solid rgba(91,209,205,0.25); background: #1e150d; }
.instrument-dock-head { display: grid; grid-template-columns: minmax(92px, 150px) 58px 62px 48px auto 62px minmax(50px, 1fr) auto; align-items: center; gap: 6px; }
.instrument-dock-head select, .instrument-bars-control input { min-width: 0; height: 29px; padding: 3px 6px; border: 1px solid rgba(255,255,255,0.12); border-radius: 4px; background: #181009; color: var(--text); font-size: 0.67rem; }
.instrument-bars-control { display: flex; align-items: center; gap: 3px; min-width: 0; color: var(--text-dim); font-size: 0.6rem; }
.instrument-bars-control input { width: 100%; }
.instrument-record-mode { display: flex; gap: 3px; }
.instrument-record-mode button, .instrument-dock-tools button { min-width: 30px; height: 29px; padding: 3px 7px; border: 1px solid rgba(255,255,255,0.11); border-radius: 4px; background: #291e14; color: var(--text-dim); cursor: pointer; }
.instrument-record-mode button.on { border-color: var(--accent); color: var(--accent); background: rgba(91,209,205,0.1); }
#instrumentDockStatus { overflow: hidden; color: var(--text-dim); font-size: 0.66rem; text-overflow: ellipsis; white-space: nowrap; }
.instrument-dock-tools { display: flex; gap: 3px; }
.instrument-dock-tools .instrument-duration-step { min-width: 32px; border-color: rgba(91,209,205,0.38); background: rgba(91,209,205,0.1); color: var(--accent); font-size: 0.9rem; }
.instrument-dock-tools button:disabled { cursor: default; opacity: 0.28; }
.instrument-dock-tools button.on { border-color: var(--warn); background: rgba(251,191,36,0.14); color: var(--warn); }
.instrument-chord-lane { min-height: 46px; margin-top: 7px; overflow-x: auto; overflow-y: hidden; scrollbar-width: thin; }
.instrument-timeline-grid { display: grid; width: max(100%, calc(var(--inst-columns) * var(--inst-col-width, 26px))); min-height: 42px; grid-template-columns: repeat(var(--inst-columns), minmax(calc(var(--inst-col-width, 26px) * 0.85), 1fr)); gap: 2px; padding: 2px; border-radius: 4px; background-color: #181009; background-image: linear-gradient(90deg, rgba(91,209,205,0.22) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,0.09) 1px, transparent 1px); background-size: calc(100% / var(--inst-quarter-columns)) 100%, calc(100% / var(--inst-columns)) 100%; }
.instrument-chord-block { position: relative; display: flex; min-width: 0; height: 39px; flex-direction: column; align-items: flex-start; justify-content: center; padding: 4px 10px 4px 7px; border: 1px solid rgba(255,255,255,0.11); border-radius: 4px; background-color: #291e14; background-image: linear-gradient(90deg, transparent calc(100% - 1px), rgba(255,255,255,0.14) calc(100% - 1px)); background-size: calc(100% / var(--inst-units)) 100%; color: var(--text); cursor: pointer; text-align: left; }
.instrument-zoom-control { display: flex; gap: 3px; margin-left: auto; }
.instrument-zoom-control button { min-width: 30px; height: 29px; padding: 3px 7px; border: 1px solid rgba(255,255,255,0.11); border-radius: 4px; background: #291e14; color: var(--text-dim); cursor: pointer; font-size: 0.9rem; }
.instrument-zoom-control button:hover { border-color: var(--accent); color: var(--accent); }
.instrument-chord-block span { color: var(--text-dim); font-size: 0.52rem; }
.instrument-chord-block i { font-style: normal; }
.instrument-chord-block strong { font-size: 0.76rem; }
.instrument-chord-block:hover, .instrument-chord-block.selected { border-color: var(--accent); background-color: rgba(91,209,205,0.12); }
.instrument-chord-block.resizing { border-color: var(--warn); }
.instrument-chord-block.playing { border-color: var(--accent); background-color: rgba(91,209,205,0.24); box-shadow: 0 0 8px rgba(91,209,205,0.4); }
.instrument-timeline-grid, .drum-step-grid { position: relative; }
.instrument-playhead { position: absolute; z-index: 4; top: 0; bottom: 0; width: 3px; border-radius: 1px; background: #d9ffff; box-shadow: 0 0 0 1px rgba(5,19,23,0.72), 0 0 9px rgba(91,209,205,0.95); pointer-events: none; }
.instrument-chord-resize { position: absolute; top: 5px; right: 2px; bottom: 5px; width: 5px; border-right: 2px dotted rgba(255,255,255,0.32); cursor: ew-resize; }
.instrument-chord-resize:hover { border-color: var(--accent); }
.instrument-lane-empty { display: flex; align-items: center; color: var(--text-dim); font-size: 0.68rem; }

@media (max-width: 1240px) {
  .bass-instrument-surface { grid-template-columns: minmax(0, 1fr); max-width: 860px; }
}

@media (max-width: 900px) {
  .bass-instrument-open .instrument-workspace { grid-template-columns: minmax(0, 1fr) 210px; }
  .bass-instrument-surface { grid-template-columns: minmax(0, 1fr); margin-block: 18px; padding: 0; }
  .bass-fourths-grid .instrument-note-pad, .bass-string-label { min-height: 44px; }
  .instrument-workspace { grid-template-columns: minmax(0, 1fr) 210px; overflow: auto; }
  .instrument-matrix-wrap { padding: 10px; overflow: auto; }
  .instrument-rows { min-width: 384px; gap: 5px; }
  .instrument-row { padding: 7px; }
  .instrument-row > header { gap: 4px; margin-bottom: 5px; }
  .instrument-row > header select { padding: 3px 4px; font-size: 0.68rem; }
  .instrument-pads { gap: 4px; }
  .instrument-pad-main { min-height: 34px; padding: 4px 7px; }
  .instrument-pad-main span { font-size: 0.56rem; }
  .instrument-pad-main strong { font-size: 0.76rem; }
  .instrument-section { margin-top: 10px; }
  .instrument-melody-companion { margin-top: 10px; padding: 7px; }
  .instrument-note-grid { margin-top: 6px; }
  .instrument-note-pad { min-height: 25px; }
  .instrument-note-pad strong { font-size: 0.56rem; }
  .instrument-piano { height: 78px; }
  .instrument-pills button { min-height: 25px; padding-block: 3px; font-size: 0.72rem; }
  .instrument-voicings button { min-height: 25px; padding-block: 3px; font-size: 0.66rem; }
  .instrument-editor { padding: 10px; }
  .instrument-topbar { padding-inline: 10px; }
  .instrument-title small { display: none; }
  .instrument-transport { gap: 4px; }
  .instrument-transport .btn { min-width: 29px; padding-inline: 5px; }
  .instrument-transport .instrument-loop-btn { min-width: 58px; }
  .instrument-tempo { min-width: 108px; gap: 3px; }
  .instrument-tempo input { width: 66px; }
  .instrument-section-dock { padding: 5px 8px 6px; }
  .instrument-dock-head { grid-template-columns: minmax(78px, 115px) 50px 54px 42px auto 54px minmax(24px, 1fr) auto; gap: 4px; }
  .instrument-dock-head select, .instrument-bars-control input { height: 26px; padding-inline: 4px; font-size: 0.61rem; }
  .instrument-bars-control { font-size: 0.52rem; }
  .instrument-record-mode button, .instrument-dock-tools button, .instrument-zoom-control button { min-width: 25px; height: 26px; padding: 2px 4px; font-size: 0.61rem; }
  .instrument-dock-tools .instrument-duration-step { min-width: 29px; font-size: 0.85rem; }
  #instrumentDockStatus { display: none; }
  .instrument-chord-lane { min-height: 40px; margin-top: 5px; --inst-col-width: 42px; }
  .instrument-chord-block { height: 35px; }
}

@media (max-width: 900px) and (orientation: landscape) {
  /* En un iPhone acostado (~390px de alto) el header fijo (46px) más el dock
     inferior "auto" (secuenciador de batería: puede pasar los 400px con las
     diez piezas) superan la altura del viewport. Con el grid de 3 filas
     original, la fila del medio (minmax(0,1fr)) queda en 0px y el dock se
     sale del contenedor fijo sin scroll propio: nada es tocable de verdad,
     aunque el contenido se siga pintando (desborda, no hace overflow real).
     La solución es la misma que en portrait: un solo scroll para TODO el
     instrumento en vez de repartir la altura entre filas de grid. Acá,
     a diferencia de portrait, el ancho alcanza para mantener paletas y
     editor lado a lado (columnas), solo cambia cómo se reparte el alto. */
  #chordInstrument { display: block; overflow-y: auto; }
  .instrument-topbar { position: sticky; top: 0; z-index: 5; }
  .instrument-topbar { gap: 8px; }
  .instrument-topbar .btn { min-height: 30px; padding: 4px 8px; font-size: 0.72rem; }
  .instrument-transport .btn { min-width: 27px; padding-inline: 4px; }
  .instrument-transport .instrument-loop-btn { min-width: 54px; font-size: 0.64rem; }
  .instrument-tempo { min-width: 92px; font-size: 0.54rem; }
  .instrument-tempo input { width: 52px; }
  .instrument-workspace { overflow: visible; }
  .instrument-matrix-wrap, .instrument-editor { overflow: visible; }
  .instrument-matrix-wrap { padding: 7px; }
  .instrument-matrix-head { margin-bottom: 6px; font-size: 0.66rem; }
  .instrument-row { padding: 5px; }
  .instrument-pad-main { min-height: 29px; padding: 3px 6px; }
  .instrument-pad-main strong { font-size: 0.7rem; }
  .instrument-editor { padding: 7px; }
  .instrument-selected-head strong { font-size: 1.25rem; }
  .instrument-melody-companion { margin-top: 7px; padding: 5px; }
  .instrument-piano { height: 62px; }
  .bass-instrument-surface { margin-block: 8px; gap: 8px; padding: 0; }
  .bass-fourths-grid .instrument-note-pad, .bass-string-label { min-height: 38px; }
  .rhythm-instrument-surface { margin-block: 0; }
  .rhythm-track-panel { padding: 9px; }
  .drum-kit-stage { min-height: 172px; }
  .drum-kit-piece strong { font-size: 0.54rem; }
  .drum-part-control { padding: 4px; }
  .bass-style-pads .btn, .bass-phrase-pads .btn { min-height: 26px; font-size: 0.57rem; }
  .bass-performance-pad { aspect-ratio: 2.15; }
}

@media (max-width: 620px) and (orientation: portrait) {
  /* Sin esto la columna implícita del grid se estira al ancho de la barra de
     transporte y todo el instrumento desborda el viewport. */
  #chordInstrument { grid-template-columns: minmax(0, 1fr); }
  .instrument-topbar { gap: 6px; overflow-x: auto; }
  .instrument-topbar > * { flex: 0 0 auto; }
  .instrument-title > span { display: none; }
  /* Una sola columna con UN solo scroll: paletas arriba, editor abajo,
     sin paneles anidados que scrollean por separado. */
  .instrument-workspace { display: block; overflow-y: auto; }
  .instrument-matrix-wrap, .instrument-editor { overflow: visible; }

  /* Vertical: las tres escalas armonizadas conviven lado a lado (igual que en
     horizontal) — cada paleta es una columna de grados, sin scroll para
     comparar y tocar recomendaciones. */
  .instrument-matrix-wrap { padding: 7px; }
  .instrument-rows { min-width: 0; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px; }
  .bass-instrument-open .instrument-rows { display: block; }
  .instrument-row { padding: 4px; }
  .instrument-row > header { grid-template-columns: 16px minmax(0, 1fr); gap: 3px; margin-bottom: 4px; }
  .instrument-row > header select { padding: 2px; font-size: 0.6rem; }
  .instrument-row-num { width: 16px; height: 16px; font-size: 0.56rem; }
  .instrument-pads { gap: 3px; }
  .instrument-pad-main { min-height: 34px; padding: 3px 5px; }
  .instrument-pad-main span { font-size: 0.5rem; }
  .instrument-pad-main strong { font-size: 0.72rem; }

  /* El editor queda debajo de las paletas: el color del acorde primero
     (siempre a la vista), después el compañero melódico y el voicing. */
  .instrument-editor { border-top: 1px solid rgba(255,255,255,0.09); border-left: 0; }
  #chordInstrumentSelection { display: flex; flex-direction: column; gap: 8px; }
  #chordInstrumentSelection > .instrument-selected-head { order: 0; padding-bottom: 6px; }
  #chordInstrumentSelection > .rhythm-arrangement-head { padding: 8px 0 12px; }
  #chordInstrumentSelection > .instrument-section { order: 1; margin-top: 0; }
  #chordInstrumentSelection > .instrument-melody-companion { order: 2; margin-top: 0; }
  #chordInstrumentSelection > .instrument-section:last-of-type { order: 3; }
  .instrument-pills { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .instrument-pills button { padding: 4px 2px; font-size: 0.64rem; text-align: center; }
  .instrument-voicings { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .instrument-voicings button { font-size: 0.6rem; }
  .instrument-voicings button:first-child { grid-column: auto; }
  .bass-instrument-open .instrument-workspace { display: block; }
  .bass-instrument-surface { max-width: none; margin-block: 0; padding: 0; }
  .bass-track-panel > header { align-items: flex-start; }
  .rhythm-track-panel { padding: 9px; }
  .rhythm-track-head { align-items: stretch; flex-direction: column; }
  .bass-octaves { min-width: 132px; }
  .bass-fourths-grid { gap: 3px; }
  .bass-fourths-grid .instrument-note-pad, .bass-string-label { min-height: 42px; }
  .drum-kit-heading { align-items: stretch; flex-direction: column; }
  .drum-kit-heading .drum-kit-selectors { width: 100%; }
  .drum-kit-stage { min-height: 250px; }
  .drum-part-mixer { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .drum-part-control:last-child { grid-column: 1 / -1; }

  /* El dock de sección tiene demasiados controles para una sola línea. */
  .instrument-dock-head { display: flex; flex-wrap: wrap; }
  .instrument-dock-head > select:first-child { flex: 1 1 110px; }
}

@media (max-width: 1080px) {
  html.compose-layout body { grid-template-columns: 190px minmax(0, 1fr); }
  html.compose-layout #composeInspector {
    display: flex !important;
    grid-column: 1 / -1;
    grid-row: 2;
    max-height: 360px;
    border-top: 1px solid var(--compose-line);
    border-left: 0;
  }
  html.compose-layout .app-transport-bar { right: 0; left: 190px; }
}

@media (max-width: 760px) {
  html.compose-layout body { display: block; }
  html.compose-layout #sidebar { border-right: 0; border-bottom: 1px solid var(--compose-line); }
  html.compose-layout #main { padding: 9px; }
  html.compose-layout #composeInspector {
    max-height: none;
    border-top: 1px solid var(--compose-line);
  }
  html.compose-layout .app-transport-bar { left: 0; right: 0; }
  html.compose-layout .daw-map { overflow-x: auto; }

  /* El móvil usa la barra superior como navegación compacta + visualizador.
     La biblioteca se revela sólo cuando se toca el resumen del álbum. */
  html.compose-layout #sidebar { padding: 100px 8px 8px; }
  html.compose-layout #sidebar #albumBox { padding: 0; }
  html.compose-layout #sidebar #albumToggle {
    min-height: 36px;
    padding: 7px 4px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    font-size: 0.72rem;
  }
  html.compose-layout #sidebar #albumBody { padding: 5px 0 2px; }
  html.compose-layout #sidebar #albumBody .album-name { display: none; }
  html.compose-layout #sidebar #albumBody .sidebar-hint { margin: 3px 4px; font-size: 0.52rem; }
  html.compose-layout #sidebar #albumBody .track-item { min-height: 34px; padding: 6px 8px; font-size: 0.72rem; }
  html.compose-layout #sidebar #albumBody .io-row { gap: 5px; }
  html.compose-layout #sidebar #albumBody .io-row .btn,
  html.compose-layout #sidebar #albumBody #addTrack { min-height: 31px; padding: 5px 7px; font-size: 0.64rem; }

  html.compose-layout #mobileHarmonyPanel {
    display: block;
    margin: 4px 0 0;
    padding: 6px 4px 4px;
    border: 1px solid rgba(91,209,205,0.18);
    background: #22180f;
  }
  html.compose-layout .mobile-harmony-head { display: grid; width: 100%; min-height: 30px; grid-template-columns: auto 1fr auto; align-items: center; gap: 6px; padding: 4px; border: 0; background: transparent; color: var(--text-dim); cursor: pointer; font-size: 0.56rem; letter-spacing: 0.07em; text-align: left; text-transform: uppercase; }
  html.compose-layout .mobile-harmony-head small { overflow: hidden; color: var(--accent); font-size: 0.56rem; letter-spacing: 0; text-align: right; text-overflow: ellipsis; text-transform: none; white-space: nowrap; }
  html.compose-layout .mobile-harmony-chevron { transition: transform 160ms ease; }
  html.compose-layout .mobile-harmony-head:not(.open) .mobile-harmony-chevron { transform: rotate(-90deg); }
  html.compose-layout #mobileHarmonyBody[hidden] { display: none; }
  html.compose-layout #mobileHarmonyMap { display: grid; min-height: 120px; place-items: center; }
  html.compose-layout #mobileHarmonyMap svg { width: min(100%, 184px); height: auto; max-height: 154px; }
  html.compose-layout #mobileHarmonyMap .fine { padding: 14px 4px; font-size: 0.62rem; }

  /* El mismo mapa ya está visible junto a la canción; no lo duplicamos. */
  html.compose-layout .lead-harmony-map { display: none; }
  html.compose-layout #composeExploreHost #vizCard { display: none !important; }
}

/* ===== El Estudio: piel de instrumentos (docs/DESIGN-BRIEF.md) ===== */

/* --- Migui: mástil de madera con cuerdas de verdad --- */
.bass-note-grid.is-fourths { padding: 12px 10px; border-radius: 10px; background: linear-gradient(180deg, #3a2415, #2a1a0d 55%, #241608); box-shadow: inset 0 2px 10px rgba(0,0,0,0.45), var(--top-light); }
.bass-fourths-grid { gap: 6px 0; }
.bass-fourths-grid .instrument-note-pad { position: relative; overflow: hidden; border: 0; border-right: 3px solid rgba(226,205,164,0.13); border-radius: 0; background: transparent; }
.bass-fourths-grid .instrument-note-pad::before { content: ''; position: absolute; right: 0; left: 0; top: 50%; transform: translateY(-50%); height: 2px; background: linear-gradient(180deg, #efe0bd, #93815d); box-shadow: 0 2px 3px rgba(0,0,0,0.55); opacity: 0.8; pointer-events: none; }
/* grosor por cuerda: G (arriba) fina → E (abajo) gruesa */
.bass-fourths-grid > *:nth-child(-n+8)::before { height: 1px; }
.bass-fourths-grid > *:nth-child(n+9):nth-child(-n+16)::before { height: 2px; }
.bass-fourths-grid > *:nth-child(n+17):nth-child(-n+24)::before { height: 3px; }
.bass-fourths-grid > *:nth-child(n+25)::before { height: 4px; }
.bass-fourths-grid .instrument-note-pad strong { position: relative; z-index: 1; text-shadow: 0 1px 2px rgba(0,0,0,0.8); }
.bass-fourths-grid .instrument-note-pad.in-scale { background: rgba(255,238,205,0.045); }
/* fuera de escala: se apaga la nota, no la cuerda */
.bass-fourths-grid .instrument-note-pad.outside-scale { opacity: 1; }
.bass-fourths-grid .instrument-note-pad.outside-scale strong { opacity: 0.28; }
.bass-fourths-grid .instrument-note-pad.selected,
.bass-fourths-grid .instrument-note-pad.chord-root,
.bass-fourths-grid .instrument-note-pad.live-chord-root { border-radius: 8px; }
.bass-string-label { text-shadow: 0 1px 2px rgba(0,0,0,0.7); }

/* --- Richi: parches, aros y bronce --- */
.drum-kit-piece-slot.snare .drum-kit-piece,
.drum-kit-piece-slot.tom-hi .drum-kit-piece,
.drum-kit-piece-slot.tom-mid .drum-kit-piece,
.drum-kit-piece-slot.tom-floor .drum-kit-piece {
  background: radial-gradient(circle at 50% 36%, #4a3a27, #2b2013 72%);
  box-shadow: inset 0 0 0 2px rgba(0,0,0,0.5), inset 0 0 0 4px rgba(228,206,168,0.13), 0 3px 6px rgba(0,0,0,0.35);
}
.drum-kit-piece-slot.crash .drum-kit-piece,
.drum-kit-piece-slot.ride .drum-kit-piece {
  background:
    repeating-radial-gradient(circle at 50% 44%, transparent 0 7px, rgba(0,0,0,0.14) 7px 8px),
    radial-gradient(circle at 46% 40%, #7c612c, #443312 74%);
  box-shadow: inset 0 0 0 1px rgba(0,0,0,0.4), 0 3px 7px rgba(0,0,0,0.4);
}
.drum-kit-piece-slot.hat .drum-kit-piece,
.drum-kit-piece-slot.open-hat .drum-kit-piece {
  background: radial-gradient(circle at 46% 40%, #6b5426, #3c2d10 76%);
  box-shadow: inset 0 0 0 1px rgba(0,0,0,0.4), 0 2px 5px rgba(0,0,0,0.35);
}
.drum-kit-piece-slot.kick .drum-kit-piece {
  background: radial-gradient(circle at 50% 46%, #3e2d1a, #221507 78%);
  box-shadow: inset 0 0 0 3px rgba(0,0,0,0.5), inset 0 0 0 5px rgba(228,206,168,0.1), 0 4px 8px rgba(0,0,0,0.4);
}
/* feedback por encima de la piel */
.drum-kit-piece-slot .drum-kit-piece:hover { filter: brightness(1.2); }
.drum-kit-piece-slot .drum-kit-piece.part-selected { filter: brightness(1.12); }
.drum-kit-piece-slot .drum-kit-piece.selected { filter: brightness(1.25); box-shadow: 0 0 0 2px rgba(91,209,205,0.6), 0 0 14px rgba(91,209,205,0.35); }

/* --- Horacio: madera sutil detrás del piano roll de melodía --- */
.melody-grid { border-radius: 8px; background: linear-gradient(180deg, rgba(53,33,19,0.5), rgba(30,18,8,0.5)); box-shadow: inset 0 2px 8px rgba(0,0,0,0.3); }

/* --- Selector de canal de ampli: LED en los estilos del intérprete --- */
.bass-style-pads .btn, .bass-phrase-pads .btn, .rhythm-patterns .btn { position: relative; padding-left: 22px; }
.bass-style-pads .btn::before, .bass-phrase-pads .btn::before, .rhythm-patterns .btn::before {
  content: ''; position: absolute; left: 9px; top: 50%; transform: translateY(-50%);
  width: 6px; height: 6px; border-radius: 50%;
  background: #352817; box-shadow: inset 0 1px 1px rgba(0,0,0,0.6);
}
.bass-style-pads .btn.on::before, .bass-phrase-pads .btn.on::before, .rhythm-patterns .btn.on::before {
  background: #ffd083; box-shadow: 0 0 7px rgba(255, 208, 131, 0.85);
}

/* ===== Horacio: mástil de guitarra para practicar escalas ===== */
/* min-width: 0 porque el panel es ítem de una grilla: con el `auto` que trae por
   defecto crecía hasta el ancho del mástil (734px en una pista de 351px) y el
   diapasón se salía de la pantalla en vez de desplazarse dentro de su caja. */
.guitar-practice { min-width: 0; margin-top: 14px; padding: 12px 12px 10px; border: 1px solid rgba(237,123,114,0.24); border-radius: 10px; background: linear-gradient(180deg, rgba(42,28,18,0.55), rgba(26,16,9,0.55)); box-shadow: var(--top-light); }
.gp-head { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 10px; }
.gp-head strong { display: block; font-size: 0.95rem; }
/* los botones de la cabecera son varios y en pantalla angosta no entran en una
   fila: sin wrap se desbordaban del panel en vez de bajar de renglón */
.gp-head-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 6px; min-width: 0; }
.gp-head > div { min-width: 0; }
.gp-label-switch { display: inline-flex; overflow: hidden; border: 1px solid rgba(255,255,255,0.12); border-radius: 6px; }
.gp-label-switch button { padding: 5px 9px; border: 0; background: transparent; color: var(--text-dim); font-size: 0.62rem; font-weight: 700; cursor: pointer; }
.gp-label-switch button.on { background: rgba(237,123,114,0.2); color: var(--text); }
.gp-controls { display: flex; flex-wrap: wrap; align-items: end; gap: 8px; margin: 10px 0 4px; }
.gp-controls label { display: grid; gap: 2px; color: var(--text-dim); font-size: 0.58rem; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; }
.gp-controls select { padding: 5px 7px; border: 1px solid rgba(255,255,255,0.14); border-radius: 5px; background: #1c1208; color: var(--text); font-size: 0.72rem; }
.gp-tempo { align-items: center; }
.gp-tempo input { width: 108px; }
.gp-tempo output { color: var(--text); font-size: 0.7rem; font-weight: 700; }
.gp-play.on { background: #c2603f; border-color: #c2603f; }
.gp-hint { display: block; margin-bottom: 8px; color: var(--text-dim); font-size: 0.6rem; }

.gp-neck-wrap { overflow-x: auto; padding-bottom: 4px; -webkit-overflow-scrolling: touch; }
.gp-neck {
  display: grid;
  grid-template-columns: 24px 30px repeat(22, 34px);
  min-width: min-content;
  padding: 7px 0;
  border-radius: 7px;
  background: linear-gradient(180deg, #3a2415, #2a1a0d 55%, #241608);
  box-shadow: inset 0 2px 10px rgba(0,0,0,0.45), var(--top-light);
}
/* display:contents deja agrupar por cuerda sin romper la grilla del mástil */
.gp-row { display: contents; }
.gp-string-label { display: grid; height: 34px; place-items: center; color: var(--text-dim); font-size: 0.6rem; font-weight: 700; text-shadow: 0 1px 2px rgba(0,0,0,0.7); }
.gp-cell { position: relative; display: grid; height: 34px; place-items: center; border-right: 2px solid rgba(226,205,164,0.15); }
.gp-cell.open { border-right: 3px solid rgba(243,232,206,0.6); } /* la cejuela */
.gp-cell::before {
  content: '';
  position: absolute;
  right: 0; left: 0; top: 50%;
  height: var(--gp-thick, 2px);
  transform: translateY(-50%);
  background: linear-gradient(180deg, #efe0bd, #93815d);
  box-shadow: 0 1px 2px rgba(0,0,0,0.5);
  opacity: 0.7;
  pointer-events: none;
}
.gp-cell.dim::before { opacity: 0.28; }
.gp-note {
  position: relative;
  z-index: 1;
  display: grid;
  width: 25px; height: 25px;
  place-items: center;
  border-radius: 50%;
  background: #2f2317;
  box-shadow: inset 0 0 0 1px rgba(255,232,196,0.28), 0 2px 4px rgba(0,0,0,0.5);
  color: #f2e9da;
  font-size: 0.58rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform 90ms ease, box-shadow 120ms ease;
}
.gp-note:hover { transform: scale(1.12); }
.gp-note.root { background: #b8593c; box-shadow: inset 0 0 0 1px rgba(255,214,180,0.5), 0 2px 6px rgba(0,0,0,0.5); color: #fff2e6; }
.gp-cell.dim .gp-note { opacity: 0.2; }
/* la próxima nota, un aro celeste que no compite con el dorado de "sonando":
   colores distintos para que nunca se confundan, y el aro solo (sin relleno)
   para que se lea como "hacia acá vas", no como "esto ya sonó" */
.gp-note.next { box-shadow: 0 0 0 3px rgba(91,209,205,0.75); }
.gp-cell.dim .gp-note.next { opacity: 0.55; }
.gp-note.sounding { background: #ffd083; color: #2a1a0d; box-shadow: 0 0 0 3px rgba(255,208,131,0.35), 0 0 14px rgba(255,208,131,0.6); transform: scale(1.18); }

.gp-fretnums { display: grid; grid-template-columns: 24px 30px repeat(22, 34px); min-width: min-content; margin-top: 3px; }
.gp-fretnum { display: grid; place-items: center; color: var(--text-dim); font-size: 0.55rem; }
.gp-fretnum.inlay { color: var(--text); font-weight: 800; }
.gp-fretnum.inlay::before { content: '●'; display: block; margin-bottom: -2px; font-size: 0.42rem; opacity: 0.65; }
.gp-fretnum.double::before { content: '● ●'; letter-spacing: -1px; }

@media (max-width: 720px) {
  .gp-neck, .gp-fretnums { grid-template-columns: 22px 26px repeat(22, 30px); }
  .gp-note { width: 22px; height: 22px; font-size: 0.54rem; }
  /* en el celular alcanza con el ícono: el texto es lo que hacía desbordar */
  .gp-btn-text { display: none; }
}

/* Pantalla completa del mástil: para practicar con la guitarra en la mano, el
   mástil ocupa todo el ancho sin scroll y se lee desde lejos. */
body.gp-fullscreen-open { overflow: hidden; }
/* el modo práctica se queda con la pantalla: la barra de transporte es fixed
   con z-index 70 y se colaba por encima del mástil */
body.gp-fullscreen-open .app-transport-bar { display: none; }
.guitar-practice.gp-fullscreen {
  position: fixed;
  z-index: 80;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  margin: 0;
  padding: 16px clamp(10px, 3vw, 40px);
  border: 0;
  border-radius: 0;
  background: linear-gradient(180deg, #241a11, #150d07);
  overflow-y: auto;
}
.gp-fullscreen .gp-neck-wrap { overflow-x: visible; }
/* los trastes se reparten el ancho: se ve el mástil entero de una */
.gp-fullscreen .gp-neck,
.gp-fullscreen .gp-fretnums {
  grid-template-columns: 30px 38px repeat(22, minmax(0, 1fr));
  min-width: 0;
  width: 100%;
}
.gp-fullscreen .gp-cell,
.gp-fullscreen .gp-string-label { height: min(clamp(30px, 7.4vh, 68px), 5vw); }
.gp-fullscreen .gp-note {
  width: min(clamp(18px, 4.6vh, 42px), 3.5vw);
  height: min(clamp(18px, 4.6vh, 42px), 3.5vw);
  font-size: min(1.6vh, 1.4vw);
}
.gp-fullscreen .gp-string-label { font-size: 0.8rem; }
.gp-fullscreen .gp-fretnum { font-size: 0.7rem; }
.gp-fullscreen .gp-head strong { font-size: 1.3rem; }
body.gp-fullscreen-open .melody-agent-panel { display: none; }

@media (orientation: landscape) and (max-height: 560px) {
  .gp-fullscreen { padding: 8px 10px; }
  .gp-fullscreen .gp-head, .gp-fullscreen .gp-hint { display: none; } /* el mástil manda */
  .gp-fullscreen .gp-controls { margin: 0 0 6px; }
}

/* En vertical los 22 trastes no entran legibles: repartirlos por el ancho de un
   celular deja notas de 13px que no se leen. Acá el mástil conserva su tamaño y
   se desplaza — la vista se corre sola hasta la caja activa (scrollNeckToActive). */
@media (orientation: portrait) and (max-width: 720px) {
  .gp-fullscreen { justify-content: flex-start; padding: 10px; }
  .gp-fullscreen .gp-head, .gp-fullscreen .gp-hint { display: none; }
  .gp-fullscreen .gp-controls { margin: 0 0 8px; }
  .gp-fullscreen .gp-neck-wrap { overflow-x: auto; }
  .gp-fullscreen .gp-neck,
  .gp-fullscreen .gp-fretnums {
    grid-template-columns: 26px 30px repeat(22, 40px);
    min-width: min-content;
    width: auto;
  }
  .gp-fullscreen .gp-cell,
  .gp-fullscreen .gp-string-label { height: 46px; }
  .gp-fullscreen .gp-note { width: 32px; height: 32px; font-size: 0.74rem; }
  .gp-fullscreen .gp-string-label { font-size: 0.7rem; }
}

/* Selector de cuerdas para saltos: la 6ta a la izquierda, como se numeran */
.gp-strings-picker { align-items: start; }
.gp-string-toggles, .gp-skip-presets { display: flex; gap: 3px; }
.gp-string-toggles button, .gp-skip-presets button {
  min-width: 26px;
  padding: 5px 6px;
  border: 1px solid rgba(255,255,255,0.14);
  border-radius: 5px;
  background: #1c1208;
  color: var(--text-dim);
  font-size: 0.66rem;
  font-weight: 700;
  cursor: pointer;
}
.gp-skip-presets button { min-width: 34px; }
.gp-string-toggles button.on, .gp-skip-presets button.on {
  border-color: #c2603f;
  background: rgba(194,96,63,0.28);
  color: #ffd8c4;
}
.gp-mode-switch button.on { background: rgba(91,209,205,0.22); }
.gp-dir-switch button { padding: 5px 8px; font-size: 0.7rem; }
.gp-dir-switch button.on { background: rgba(237,123,114,0.22); }

/* ===== Campell: teclado de piano para practicar ===== */
.piano-practice { grid-column: 1 / -1; margin-top: 14px; padding: 12px 12px 14px; border: 1px solid rgba(210,107,217,0.24); border-radius: 10px; background: linear-gradient(180deg, rgba(42,28,18,0.55), rgba(26,16,9,0.55)); box-shadow: var(--top-light); }
.pk-keyboard { position: relative; width: 100%; margin-top: 6px; padding: 8px 8px 10px; border-radius: 8px; background: linear-gradient(180deg, #2a1c10, #1b1108); box-shadow: inset 0 2px 10px rgba(0,0,0,0.5), var(--top-light); }
.pk-whites { display: grid; grid-template-columns: repeat(var(--pk-whites), minmax(0, 1fr)); gap: 2px; }
.pk-blacks { position: absolute; inset: 8px 8px 10px; pointer-events: none; }
.pk-key { position: relative; display: flex; align-items: flex-end; justify-content: center; padding-bottom: 7px; border: 0; cursor: pointer; transition: background 90ms ease, box-shadow 120ms ease; }
.pk-key.white {
  height: clamp(86px, 15vh, 150px);
  border-radius: 0 0 5px 5px;
  background: linear-gradient(180deg, #f4ecdc, #ddd0b8);
  box-shadow: inset 0 -3px 0 rgba(0,0,0,0.16), 0 2px 3px rgba(0,0,0,0.35);
  color: #3a2a17;
  font-size: 0.62rem;
  font-weight: 800;
}
.pk-key.black {
  position: absolute;
  z-index: 2;
  top: 0;
  width: calc(100% / var(--pk-whites) * 0.62);
  height: 62%;
  transform: translateX(-50%);
  border-radius: 0 0 4px 4px;
  background: linear-gradient(180deg, #33251a, #150d06);
  box-shadow: inset 0 -3px 0 rgba(255,255,255,0.08), 0 3px 5px rgba(0,0,0,0.5);
  color: #f2e9da;
  font-size: 0.56rem;
  font-weight: 800;
  pointer-events: auto;
}
/* Tres capas que NO pueden competir entre sí:
   escala = tinte neutro de fondo · tónica = punto, no relleno ·
   acorde de las paletas = violeta de Campell · sonando = ámbar, la más fuerte.
   Antes tónica y notas sonando eran los dos naranjas y se confundían. */
.pk-key.white.in-run, .pk-key.white.in-scale { background: linear-gradient(180deg, #fbf3e4, #e8dcc4); }
.pk-key.black.in-run, .pk-key.black.in-scale { background: linear-gradient(180deg, #4a3826, #251a10); }
.pk-key.root::after {
  content: '';
  position: absolute;
  bottom: 22px;
  left: 50%;
  width: 7px;
  height: 7px;
  transform: translateX(-50%);
  border-radius: 50%;
  background: #d2803f;
  box-shadow: 0 0 0 2px rgba(210,128,63,0.28);
}
.pk-key.black.root::after { bottom: 14px; background: #f0a86a; }
.pk-key.white.preview { background: linear-gradient(180deg, #efc7f2, #d79ede); color: #2c1030; }
.pk-key.black.preview { background: linear-gradient(180deg, #8d4b96, #5a2a62); color: #f8e8fa; }
/* mismo par de colores que en el mástil: celeste = hacia acá vas, dorado =
   esto suena. El !important de sounding ya gana si una tecla es las dos cosas. */
.pk-key.next::before { content: ''; position: absolute; inset: 3px; border: 2px solid rgba(91,209,205,0.85); border-radius: 3px; pointer-events: none; }
.pk-key.black.next::before { inset: 2px; }
.pk-key.sounding { background: linear-gradient(180deg, #ffd083, #f2a94e) !important; color: #2a1a0d !important; box-shadow: 0 0 0 2px rgba(255,208,131,0.55), 0 0 16px rgba(255,208,131,0.6); }
.pk-key span { position: relative; pointer-events: none; }

/* La foto de la escala: una octava quieta, para mirar mientras se practica.
   Angosta a propósito — es una referencia, no el teclado con el que se toca. */
.pk-card { margin-top: 12px; padding: 10px 12px 12px; border-top: 1px solid rgba(210,107,217,0.18); }
.pk-card .strip-eyebrow { display: block; margin-bottom: 4px; }
.pk-keyboard.pk-mini { max-width: 340px; margin-top: 4px; padding: 6px 6px 7px; }
.pk-mini .pk-blacks { inset: 6px 6px 7px; }
.pk-mini .pk-key { height: 62px; padding-bottom: 5px; font-size: 0.6rem; }
.pk-mini .pk-key.black { height: 38px; }
/* el punto de la tónica va arriba del número, no encima: en la versión chica
   la tecla mide menos y con el mismo valor se pisaban */
.pk-mini .pk-key.root::after { bottom: 18px; width: 6px; height: 6px; }
.pk-mini .pk-key.black.root::after { bottom: 12px; }
/* Acá el color es el que hace el trabajo: la escala encendida en dorado y el
   resto de las teclas apagadas, para que la forma se vea de un vistazo. La
   tónica va más fuerte porque es la referencia de todo lo demás. */
.pk-card .pk-key.in-scale { color: #2a1a0d; }
.pk-card .pk-key.white.in-scale { background: linear-gradient(180deg, #f7dfa8, #e7c374); }
.pk-card .pk-key.black.in-scale { background: linear-gradient(180deg, #a07a38, #6b4f1e); color: #fff3d8; }
.pk-card .pk-key.white.root { background: linear-gradient(180deg, #f6b478, #e08c46); }
.pk-card .pk-key.black.root { background: linear-gradient(180deg, #d1854a, #9c5b2b); color: #fff3e6; }
/* apagadas sin dejar de ser piano: bajarles la opacidad las oscurecía tanto que
   una blanca se leía como negra, así que se apagan cambiándoles el color */
.pk-card .pk-key.white.off { background: linear-gradient(180deg, #cec6b7, #aca392); }
.pk-card .pk-key.black.off { background: linear-gradient(180deg, #3b3529, #241f16); }
.pk-card .pk-key.off { box-shadow: inset 0 -2px 0 rgba(0,0,0,0.14), 0 1px 2px rgba(0,0,0,0.3); }

.pk-chips { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 8px; }
.pk-chip {
  display: grid; grid-template-columns: auto auto; grid-template-areas: 'note deg' 'note fing';
  align-items: center; gap: 0 5px; padding: 3px 7px;
  border: 1px solid rgba(255,255,255,0.1); border-radius: 6px; background: rgba(255,255,255,0.03);
}
/* la tira usa los mismos colores que el teclado de arriba: dorado la escala,
   naranja la tónica, así se leen como una sola cosa */
.pk-chip { border-color: rgba(231,195,116,0.4); background: rgba(231,195,116,0.1); }
.pk-chip.root { border-color: rgba(240,168,106,0.6); background: rgba(240,168,106,0.18); }
.pk-chip b { grid-area: note; color: var(--text); font-size: 0.86rem; font-weight: 800; }
.pk-chip i { grid-area: deg; color: var(--text-dim); font-size: 0.55rem; font-style: normal; font-weight: 700; }
/* el dedo es el dato que se busca de reojo: va marcado, no en gris */
.pk-chip em { grid-area: fing; color: #f0a86a; font-size: 0.62rem; font-style: normal; font-weight: 800; }
.pk-card-legend { display: block; margin-top: 6px; color: var(--text-dim); font-size: 0.58rem; }
