.solo {
  --solo-scale-color: #67c4b7;
  --solo-chord-color: #ffd275;
  --solo-min-key: 38px;
  min-width: 0;
  margin-top: 14px;
  padding: clamp(15px, 4vw, 32px);
  border: 1px solid var(--line, #493a3b);
  border-radius: 22px;
  background: var(--surface, #252021);
}

.solo-head,
.solo-controls,
.solo-octaves,
.solo-legend {
  display: flex;
  align-items: center;
  gap: 9px;
}

.solo-head {
  justify-content: space-between;
  flex-wrap: wrap;
}

.solo-tonality {
  color: var(--solo-scale-color);
}

.solo-backing,
.solo-octaves button {
  min-height: 42px;
  padding: 5px 12px;
  color: inherit;
  background: var(--surface-down, #1d191a);
  border: 1px solid var(--line, #493a3b);
  border-radius: 10px;
}

.solo-backing:hover,
.solo-octaves button:not(:disabled):hover {
  border-color: var(--solo-chord-color);
}

.solo-controls {
  align-items: end;
  justify-content: space-between;
  margin-top: 13px;
  flex-wrap: wrap;
}

.solo-controls label {
  min-width: min(100%, 180px);
  flex: 0 1 218px;
  color: var(--muted, #ccb9b4);
  font-size: .87rem;
  font-weight: 650;
}

.solo-controls select {
  width: 100%;
  min-height: 42px;
  margin-top: 5px;
  padding: 6px 8px;
  color: inherit;
  background: var(--surface-down, #1d191a);
  border: 1px solid var(--line, #493a3b);
  border-radius: 10px;
  font-size: .88rem;
}

.solo-octaves {
  gap: 6px;
}

.solo-octaves button {
  width: 42px;
  padding: 0;
  font-size: 1.2rem;
}

.solo-octaves output {
  min-width: 56px;
  text-align: center;
  font-size: .85rem;
  font-variant-numeric: tabular-nums;
}

.solo-legend {
  margin: 12px 0 8px;
  column-gap: 16px;
  flex-wrap: wrap;
  color: var(--muted, #ccb9b4);
  font-size: .8rem;
}

.solo-legend span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.solo-scale-dot,
.solo-chord-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
}

.solo-scale-dot {
  border-radius: 50%;
  background: var(--solo-scale-color);
}

.solo-chord-dot {
  border-radius: 1px;
  background: var(--solo-chord-color);
  transform: rotate(45deg);
}

.solo-scroll {
  max-width: 100%;
  overflow-x: auto;
  padding-bottom: 3px;
  scrollbar-color: #705557 #20191b;
  scrollbar-width: thin;
}

.solo-board {
  position: relative;
  display: grid;
  grid-template-columns: repeat(var(--solo-count), minmax(0, 1fr));
  gap: 1px;
  width: 100%;
  min-width: calc(var(--solo-min-key) * var(--solo-count));
  padding: 1px;
  border-radius: 9px;
  background: #49373d;
  isolation: isolate;
}

.solo-key {
  position: relative;
  min-height: clamp(98px, 15vw, 135px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: end;
  gap: 4px;
  min-width: 0;
  padding: 4px 0 10px;
  color: #2b2123;
  background: #efe4d8;
  border: 1px solid #6a5657;
  border-radius: 2px 2px 6px 6px;
  touch-action: manipulation;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.solo-key.is-black {
  position: absolute;
  z-index: 1;
  top: 0;
  transform: translateX(-50%);
  width: calc(var(--solo-key-width) * .67);
  min-height: 0;
  height: 62%;
  padding-bottom: 5px;
  color: #f7eeee;
  background: #382e32;
  border-color: #1b151a;
  box-shadow: 0 2px 2px #130e12aa;
}

.solo-key:hover {
  border-color: var(--solo-scale-color);
}

.solo-key:focus-visible {
  outline: 2px solid #126d66;
  outline-offset: -3px;
}

.solo-note-name {
  max-width: 100%;
  font-size: clamp(.67rem, 1.4vw, .93rem);
  font-weight: 700;
  line-height: 1;
}

.solo-key.is-black .solo-note-name {
  font-size: clamp(.62rem, 1.05vw, .82rem);
}

.solo-dots {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 3px;
  min-height: 7px;
}

.solo-dots i {
  width: 6px;
  height: 6px;
  display: none;
}

.solo-key.in-gam {
  background: #e3f1ea;
}

.solo-key.in-gam.is-black {
  background: #25443f;
}

.solo-key.in-gam .solo-scale-dot,
.solo-key.in-chord .solo-chord-dot {
  display: inline-block;
}

.solo-key:not(.is-black) .solo-scale-dot {
  background: #237e74;
}

.solo-key:not(.is-black) .solo-chord-dot {
  background: #8c570c;
}

.solo-key.in-chord {
  box-shadow: inset 0 -4px #d49535;
}

.solo-key.in-chord.is-black {
  box-shadow: inset 0 -3px #d49535, 0 2px 2px #130e12aa;
}

.solo-board.is-pads {
  --solo-min-key: 36px;
  gap: 3px;
  background: none;
}

.solo-board.is-pads .solo-key {
  min-height: 72px;
  padding-bottom: 8px;
  color: #e6f5f0;
  background: #243c38;
  border-color: #42635b;
  border-radius: 7px;
}

.solo-board.is-pads .solo-scale-dot {
  background: var(--solo-scale-color);
}

.solo-board.is-pads .solo-chord-dot {
  background: var(--solo-chord-color);
}

.solo-key.is-playing,
.solo-key.is-playing.is-black,
.solo-board.is-pads .solo-key.is-playing {
  color: #2d211b;
  background: var(--solo-chord-color);
  border-color: #996b26;
  box-shadow: inset 0 -3px #996b26;
}

.solo-key.is-playing .solo-scale-dot,
.solo-key.is-playing .solo-chord-dot {
  background: #49371c;
}

@media (max-width: 620px) {
  .solo {
    --solo-min-key: 32px;
    padding-inline: 13px;
  }

  .solo-controls label {
    min-width: 0;
    flex: 1 1 140px;
  }

  .solo-board.is-pads {
    --solo-min-key: 34px;
  }
}

.solo-transport { display: flex; flex-wrap: wrap; gap: 6px; }
.solo-transport button {
  min-height: 42px;
  padding: 5px 11px;
  color: inherit;
  background: var(--surface-down, #1d191a);
  border: 1px solid var(--line, #493a3b);
  border-radius: 10px;
}
.solo-record::before { content: ''; display: inline-block; width: .55em; height: .55em; border-radius: 50%; background: #ff7984; margin-right: 5px; vertical-align: .1em; }
.solo-record[aria-pressed="true"] { background: #792736; border-color: #ff7984; }
.take-status { margin-top: 6px; color: var(--muted); font-size: .79rem; }
.solo-shortcut {
  font-family: ui-monospace, monospace;
  font-size: .65rem;
  line-height: 1;
  opacity: .77;
}
.solo-key-help { margin-top: 7px; color: var(--muted); font-size: .82rem; }
.solo-key-help p { font-size: .8rem; }
.solo-key-help summary { cursor: pointer; }
.solo-key-help kbd { color: var(--yellow); }
@media (pointer: coarse) {
  .solo-shortcut, .solo-key-help { display: none; }
}
@media (orientation: landscape) and (max-height: 560px) {
  .solo { margin-top: 6px; padding: 5px 9px 6px; border-radius: 12px; }
  .solo-head { gap: 5px; }
  .solo h2 { font-size: 1rem; }
  .solo-tonality, .take-status { font-size: .72rem; margin-top: 1px; }
  .solo-transport button { min-height: 38px; padding: 4px 7px; font-size: .77rem; }
  .solo-controls { margin-top: 2px; gap: 4px; }
  .solo-controls label { flex: 0 1 200px; font-size: .73rem; }
  .solo-controls select { min-height: 34px; margin-top: 3px; padding: 3px 5px; font-size: .76rem; }
  .solo-octaves button { min-height: 36px; width: 36px; }
  .solo-legend { margin: 4px 0; font-size: .70rem; }
  .solo-key { min-height: clamp(80px, 26dvh, 135px); }
  .solo-board.is-pads .solo-key { min-height: clamp(74px, 23dvh, 130px); }
}
