.piano-roll {
  height: 510px;
}
.keyboard-scroll {
  flex: 1;
  min-width: 0;
  overflow-x: auto;
  padding-bottom: 4px;
}
.performance-keys {
  width: 100%;
  min-width: 620px;
  max-width: none;
  height: 132px;
}
.performance-key.black {
  width: 5.8%;
}
.performance-key small {
  font-size: 11px;
}
.keyboard-note {
  min-width: 175px;
}
.capture-bar {
  display: flex;
  align-items: end;
  gap: 18px;
  flex-wrap: wrap;
  padding-top: 22px;
}
.capture-bar > div {
  flex: 1;
  min-width: 240px;
}
.capture-bar strong {
  font-size: 13px;
}
.capture-bar p {
  font-size: 11px;
  line-height: 1.8;
  margin-top: 7px;
  color: var(--muted);
}
.capture-bar label,
.placement-bar label,
.song-transport label {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 12px;
}
.capture-bar label {
  flex-direction: column;
  align-items: flex-start;
  gap: 7px;
}
.capture-bar input {
  width: 180px;
  font-size: 12px;
}
.capture-bar select {
  font-size: 12px;
}
.capture-bar button {
  font-size: 12px;
}
.arrangement-section {
  padding-top: 12px;
  border-bottom: 1px solid var(--ink);
}
.arrangement-intro {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.9;
}
.material-heading {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: center;
  margin-top: 28px;
}
.material-heading h3 {
  font-size: 14px;
  font-weight: 500;
  margin: 0;
}
.material-heading h3 span {
  display: inline-block;
  margin-left: 8px;
  font-size: 11px;
  border: 1px solid var(--line);
  padding: 2px 7px;
}
.asset-library {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding: 16px 0;
  min-height: 125px;
}
.asset-empty {
  border: 1px dashed var(--line);
  padding: 25px;
  width: 100%;
  color: var(--muted);
  font-size: 12px;
  line-height: 2;
}
.asset-card {
  width: 240px;
  min-width: 240px;
  border: 1px solid var(--line);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.asset-card > input {
  font-size: 14px;
  font-weight: 600;
  min-width: 0;
  width: 100%;
  border: 0;
  padding: 0;
  min-height: 26px;
}
.asset-meta {
  font-size: 11px;
  color: var(--muted);
  display: flex;
  justify-content: space-between;
  gap: 8px;
}
.waveform {
  width: 100%;
  height: 35px;
  display: block;
}
.waveform path {
  stroke: currentColor;
  stroke-width: 0.8;
  fill: none;
}
.asset-actions {
  display: flex;
  gap: 2px;
  justify-content: space-between;
}
.asset-actions button {
  padding: 5px 7px;
  font-size: 11px;
}
.placement-bar {
  display: flex;
  gap: 20px;
  align-items: center;
  flex-wrap: wrap;
  padding: 5px 0 23px;
  border-bottom: 1px solid var(--line);
}
.placement-bar input {
  width: 65px;
}
.placement-bar select {
  max-width: 220px;
}
.song-transport {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
  padding: 24px 0 12px;
}
.song-transport > div {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.song-transport button {
  font-size: 12px;
}
.song-transport input {
  width: 66px;
}
.song-transport output {
  font-size: 20px;
  font-variant-numeric: tabular-nums;
  margin-left: 12px;
}
.song-hint {
  display: flex;
  justify-content: space-between;
  gap: 15px;
  font-size: 11px;
  color: var(--muted);
  line-height: 1.8;
  margin-bottom: 16px;
}
.arrangement-scroll {
  position: relative;
  overflow: auto;
  max-height: 700px;
  border: 1px solid var(--line);
  background: #fff;
  --bar-width: 56px;
  --track-width: 224px;
  overscroll-behavior-x: contain;
}
.arrangement-content {
  position: relative;
  min-width: 100%;
}
.song-ruler {
  height: 32px;
  position: sticky;
  top: 0;
  z-index: 8;
  background: var(--paper);
  display: flex;
  border-bottom: 1px solid var(--line);
}
.song-ruler-spacer {
  position: sticky;
  left: 0;
  z-index: 9;
  background: var(--paper);
  width: var(--track-width);
  flex-shrink: 0;
  border-right: 1px solid var(--ink);
  padding: 8px 12px;
  font-size: 11px;
}
.song-tick {
  width: var(--bar-width);
  flex-shrink: 0;
  border: 0;
  border-left: 1px solid var(--line);
  text-align: left;
  font-size: 10px;
  padding: 7px 5px;
  min-height: 32px;
}
.song-tick:nth-child(4n + 2) {
  font-weight: 700;
  border-left-color: #777;
}
.track-row {
  height: 114px;
  display: flex;
  position: relative;
  border-bottom: 1px solid var(--line);
}
.track-row:last-child {
  border-bottom: 0;
}
.track-controls {
  position: sticky;
  left: 0;
  flex-shrink: 0;
  z-index: 5;
  width: var(--track-width);
  padding: 9px 12px;
  background: var(--paper);
  border-right: 1px solid var(--ink);
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.track-name-row {
  display: flex;
  align-items: center;
  gap: 5px;
}
.track-name-row > span {
  font-size: 10px;
  color: var(--muted);
}
.track-name-row input {
  font-size: 12px;
  font-weight: 600;
  border: 0;
  min-height: 25px;
  padding: 0 4px;
  width: 145px;
}
.track-name-row button {
  font-size: 11px;
  padding: 2px 5px;
  border: 0;
  margin-left: auto;
}
.track-mix {
  display: flex;
  gap: 8px;
}
.track-mix label {
  font-size: 10px;
  display: flex;
  align-items: center;
  gap: 4px;
  flex: 1;
  white-space: nowrap;
}
.track-mix input {
  width: 40px;
  min-width: 0;
  min-height: 16px;
  padding: 0;
}
.track-mix output {
  font-size: 9px;
  min-width: 22px;
}
.track-switches {
  display: flex;
  gap: 5px;
}
.track-switches button {
  padding: 3px 9px;
  font-size: 10px;
}
.track-lane {
  position: relative;
  flex: 1;
  background: repeating-linear-gradient(
    to right,
    #ddd 0 1px,
    transparent 1px var(--bar-width)
  );
  min-width: 0;
}
.track-lane.empty::after {
  content: "素材を配置して音を重ねる";
  position: absolute;
  top: 45px;
  left: 18px;
  color: #8d8d83;
  font-size: 11px;
  pointer-events: none;
}
.audio-clip {
  position: absolute;
  top: 10px;
  height: 93px;
  min-width: 20px;
  border: 1px solid var(--ink);
  background: #dfded5;
  color: var(--ink);
  padding: 10px;
  overflow: hidden;
  cursor: grab;
  touch-action: none;
  user-select: none;
  z-index: 1;
  text-align: left;
}
.audio-clip.selected {
  background: var(--ink);
  color: var(--paper);
  z-index: 3;
  outline: 2px solid var(--ink);
  outline-offset: 2px;
}
.audio-clip strong {
  display: block;
  font-size: 11px;
  font-weight: 500;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.audio-clip small {
  font-size: 9px;
  opacity: 0.7;
}
.audio-clip .waveform {
  height: 29px;
  margin-top: 5px;
  opacity: 0.75;
  pointer-events: none;
}
.clip-resize {
  position: absolute;
  top: 0;
  bottom: 0;
  right: 0;
  width: 9px;
  border-right: 3px solid #8a8a7e;
  cursor: ew-resize;
}
.song-playhead {
  position: absolute;
  top: 32px;
  bottom: 0;
  width: 2px;
  background: #111;
  box-shadow: 0 0 0 1px #fff9;
  z-index: 4;
  pointer-events: none;
}
.clip-inspector {
  padding: 20px 0;
  min-height: 92px;
  display: flex;
  gap: 16px;
  align-items: center;
  flex-wrap: wrap;
  border-bottom: 1px solid var(--line);
}
.clip-inspector > strong {
  font-size: 13px;
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.clip-inspector label {
  font-size: 11px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.clip-inspector input {
  width: 82px;
  font-size: 12px;
}
.clip-inspector select {
  max-width: 160px;
  font-size: 12px;
}
.clip-inspector button {
  font-size: 11px;
}
.arrangement-footer {
  display: flex;
  justify-content: space-between;
  gap: 15px;
  align-items: center;
  padding: 15px 0;
  font-size: 11px;
  color: var(--muted);
}
.arrangement-footer > div {
  display: flex;
}
.performance {
  padding-bottom: 20px;
}
.asset-card.busy {
  opacity: 0.6;
}
.song-transport button:disabled {
  opacity: 0.5;
}
@media (max-width: 650px) {
  .piano-roll {
    height: 470px;
  }
  .keyboard-scroll {
    flex-basis: 100%;
  }
  .performance-keys {
    min-width: 580px;
  }
  .capture-bar {
    gap: 14px;
  }
  .capture-bar input {
    width: 160px;
  }
  .capture-bar > div {
    flex-basis: 100%;
  }
  .capture-bar button {
    width: 100%;
  }
  .material-heading {
    align-items: flex-start;
  }
  .material-heading > .muted {
    max-width: 190px;
    font-size: 10px;
    line-height: 1.7;
  }
  .arrangement-intro {
    font-size: 12px;
  }
  .placement-bar {
    gap: 12px;
  }
  .song-hint {
    flex-direction: column;
    gap: 3px;
  }
  .song-transport {
    gap: 12px;
  }
  .song-transport output {
    font-size: 16px;
    margin-left: 0;
  }
  .arrangement-scroll {
    --track-width: 174px;
  }
  .track-controls {
    padding: 9px 7px;
  }
  .track-name-row input {
    width: 107px;
  }
  .track-mix {
    gap: 3px;
  }
  .track-mix input {
    width: 26px;
  }
  .track-mix output {
    min-width: 15px;
    font-size: 8px;
  }
  .track-mix label {
    font-size: 9px;
  }
  .clip-inspector {
    gap: 12px;
  }
  .arrangement-footer {
    align-items: flex-start;
    flex-direction: column;
  }
  .arrangement-footer > div {
    align-self: flex-end;
  }
  .section-heading > .muted {
    font-size: 10px;
  }
}
