body[data-page="mappingPage"] .midi-pill {
  display: none;
}

#mappingPage {
  min-height: calc(100dvh - 78px);
  overflow-y: auto;
  padding-top: 24px;
  padding-bottom: 16px;
}

#mappingPage h1 {
  font-size: clamp(38px, 4vw, 58px);
}

#mappingPage .lead {
  margin: 10px 0 14px;
}

#mappingPage .mapping-layout {
  display: flex;
  flex-direction: column;
  gap: 16px;
  flex: 1 1 auto;
  min-height: 0;
}

#mappingPage .mapping-layout aside {
  flex: 0 0 auto;
  width: 100%;
  padding: 0 0 10px;
  border: 0;
  border-bottom: 1px solid var(--line);
}

#mappingPage .mapping-layout h2 {
  margin: 0 0 8px;
}

#mappingPage #instrumentBank {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
}

#mappingPage .bank-item {
  min-width: 0;
  min-height: 76px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 4px 8px;
  border: 0;
  background: transparent;
}

#mappingPage .bank-item.selected {
  background: rgba(178, 53, 44, .045);
}

#mappingPage .bank-item .instrument {
  width: 66px;
  height: 66px;
  flex-basis: 66px;
}

#mappingPage .bank-item span {
  white-space: nowrap;
}

#mappingPage .hint {
  margin: 6px 0 0;
  text-align: center;
}

#mappingPage .stage-wrap {
  flex: 1 0 300px;
  width: 100%;
  max-width: none;
  min-height: 300px;
  margin: 0;
}

#mappingPage .slot-grid {
  height: 100%;
  min-height: 0;
  margin: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr;
  gap: 12px 16px;
}

#mappingPage .slot,
#mappingPage .slot:nth-child(1),
#mappingPage .slot:nth-child(2) {
  min-height: 140px;
  margin: 0;
  padding: 30px 16px 10px;
  border: 1px solid rgba(23, 23, 19, .16);
  background: transparent;
  overflow: hidden;
}

#mappingPage .slot.drag {
  border-color: var(--red);
  background: rgba(178, 53, 44, .035);
}

#mappingPage .slot .position {
  top: 10px;
  left: 12px;
  color: var(--ink);
  letter-spacing: .12em;
}

#mappingPage .slot-empty {
  display: grid;
  place-items: center;
  gap: 4px;
  color: rgba(23, 23, 19, .28);
}

#mappingPage .slot-empty strong {
  font: 300 34px/1 system-ui;
  color: rgba(23, 23, 19, .22);
}

#mappingPage .slot-empty small {
  margin: 0;
  color: rgba(23, 23, 19, .38);
}

#mappingPage .slot-instrument {
  width: 100%;
  height: 100%;
  min-height: 0;
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto auto;
  place-items: center;
}

#mappingPage .slot-image {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 0;
}

#mappingPage .slot-image img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  transform: scale(var(--mapping-scale, .78));
  transform-origin: center;
  pointer-events: none;
  user-select: none;
  -webkit-user-drag: none;
}

#mappingPage .slot-instrument strong {
  font-size: 18px;
  line-height: 1.1;
}

#mappingPage .slot-instrument small {
  margin-top: 2px;
  color: var(--muted);
  font: 9px system-ui;
  letter-spacing: .12em;
}

#mappingPage .slot[data-instrument="ban"] { --mapping-scale: .82; }
#mappingPage .slot[data-instrument="danpigu"] { --mapping-scale: .72; }
#mappingPage .slot[data-instrument="naobo"] { --mapping-scale: .78; }
#mappingPage .slot[data-instrument="daluo"] { --mapping-scale: .66; }
#mappingPage .slot[data-instrument="xiaoluo"] { --mapping-scale: .62; }

#mappingPage .drop-state {
  display: none;
  position: absolute;
  inset: 0;
  place-items: center;
  z-index: 3;
  color: var(--red);
  font: 12px system-ui;
  letter-spacing: .18em;
  background: rgba(241, 238, 229, .82);
  pointer-events: none;
}

#mappingPage .slot.drag .drop-state {
  display: grid;
}

@media (max-width: 750px) {
  #mappingPage {
    height: auto;
    min-height: calc(100dvh - 78px);
    overflow: visible;
  }

  #mappingPage #instrumentBank {
    display: flex;
    overflow-x: auto;
  }

  #mappingPage .bank-item {
    min-width: 132px;
  }

  #mappingPage .stage-wrap {
    min-height: 460px;
  }
}
