.workspace {
  border-top: 2px solid var(--ink);
}
.project-line {
  display: flex;
  align-items: center;
  gap: 20px;
  min-height: 68px;
  border-bottom: 1px solid var(--line);
}
.project-title input {
  font-size: 17px;
  font-weight: 600;
  padding: 7px 0;
  border: 0;
  width: 210px;
  max-width: 100%;
}
.project-actions {
  margin-left: auto;
  display: flex;
  gap: 10px;
}
.transport {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
  padding: 20px 0;
  border-bottom: 1px solid var(--ink);
}
.transport-main {
  display: flex;
  align-items: center;
  gap: 8px;
}
.play-button {
  min-width: 100px;
}
.position {
  font-size: 25px;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.05em;
  margin-left: 16px;
}
.position span {
  color: var(--muted);
  font-size: 16px;
}
.transport-settings {
  display: flex;
  gap: 20px;
  align-items: center;
  flex-wrap: wrap;
  font-size: 11px;
}
.transport-settings > label {
  display: flex;
  align-items: center;
  gap: 8px;
}
.number-field {
  display: flex;
  align-items: center;
  border-bottom: 1px solid var(--line);
}
.number-field input {
  width: 51px;
  border: 0;
  padding: 7px 0;
  font-size: 16px;
  appearance: textfield;
}
.number-field input::-webkit-inner-spin-button {
  appearance: none;
}
.number-field small {
  color: var(--muted);
  font-size: 9px;
}
.transport-settings select {
  font-size: 12px;
  border-width: 0 0 1px 0;
  padding-left: 0;
}
.volume-label input {
  width: 65px;
  min-height: 0;
  padding: 0;
}
.section-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 15px;
  padding: 26px 0 20px;
}
.section-index {
  display: inline-block;
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 0;
  margin-right: 17px;
  vertical-align: middle;
}
.inline-label {
  font-size: 11px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.inline-label select {
  font-size: 12px;
  padding: 6px 25px 6px 9px;
}
.chord-tools {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}
.chord-section .section-heading {
  flex-wrap: wrap;
}
#chord-view {
  margin-left: auto;
  font-size: 12px;
}
.chord-position {
  margin-top: 9px;
  font-variant-numeric: tabular-nums;
}
.chord-section.compact .chord-tools,
.chord-section.compact .chord-controls,
.chord-section.compact .chord-preview {
  display: none;
}
.chord-section.compact .chord-slot {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 32px;
  padding: 5px 10px;
}
.chord-section.compact .chord-slot-top {
  flex-shrink: 0;
}
.chord-section.compact .chord-value {
  min-width: 0;
  font-size: 16px;
  line-height: 20px;
  margin: 0;
  white-space: nowrap;
}
#percussion-hint {
  margin-top: 12px;
  line-height: 1.8;
}
.performance-key small {
  max-width: 95%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.chord-tools .presets {
  flex-basis: 100%;
  margin-bottom: 5px;
}
.presets {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}
.presets > span {
  margin-right: 10px;
}
.presets button {
  border-color: transparent;
  border-bottom-color: var(--line);
  padding: 5px 14px;
  font-size: 12px;
}
.presets button.selected {
  background: var(--ink);
  color: var(--paper);
}
.chord-slots {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border-top: 1px solid var(--ink);
  border-left: 1px solid var(--line);
}
.chord-slot {
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 13px 19px 16px;
  position: relative;
  transition: background 0.15s;
}
.chord-slot.is-playing {
  background: var(--ink);
  color: var(--paper);
}
.chord-slot-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 10px;
  letter-spacing: 0.08em;
}
.chord-preview {
  border: 0;
  padding: 1px 4px;
  font-size: 15px;
}
.chord-value {
  font-size: 39px;
  font-weight: 500;
  letter-spacing: -0.06em;
  margin: 5px 0 10px;
}
.chord-controls {
  display: flex;
  gap: 5px;
}
.chord-controls select {
  font-size: 11px;
  min-height: 30px;
  padding: 4px;
  width: 45%;
}
.chord-controls select:last-child {
  width: 55%;
}
.chord-slot.is-playing select {
  background: var(--ink);
}
.melody-section {
  padding-bottom: 22px;
  border-bottom: 1px solid var(--ink);
}
.roll-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}
.roll-toolbar > div {
  display: flex;
  align-items: center;
  gap: 17px;
}
.piano-roll {
  position: relative;
  overflow: auto;
  height: 350px;
  border: 1px solid var(--line);
  background: #fff;
  overscroll-behavior-x: contain;
}
.roll-content {
  position: relative;
  min-width: 100%;
  width: calc(58px + var(--steps) * var(--step));
  height: 508px;
}
.ruler {
  position: sticky;
  top: 0;
  z-index: 6;
  margin-left: 58px;
  height: 28px;
  display: flex;
  background: var(--paper);
  border-bottom: 1px solid var(--line);
}
.ruler-tick {
  width: var(--step);
  flex-shrink: 0;
  border-left: 1px solid #dddcd5;
  font-size: 9px;
  padding: 8px 0 0 5px;
  color: var(--muted);
}
.ruler-tick.bar {
  border-left-color: #77776f;
  color: var(--ink);
  font-weight: 700;
}
.roll-keys {
  position: sticky;
  left: 0;
  width: 58px;
  z-index: 5;
  border-right: 1px solid #8d8d85;
  background: white;
}
.roll-key {
  height: var(--row);
  width: 100%;
  display: block;
  min-height: 0;
  border: 0;
  border-bottom: 1px solid #dadad5;
  text-align: right;
  padding: 0 7px;
  font-size: 9px;
  touch-action: none;
}
.roll-key.black {
  background: #33332e;
  color: #eee;
}
.roll-key.playing {
  background: #aaa99d;
  color: #111;
}
.note-grid {
  position: absolute;
  left: 58px;
  right: 0;
  top: 28px;
  height: 480px;
  touch-action: none;
  user-select: none;
  background:
    repeating-linear-gradient(
      to right,
      #77776f88 0 1px,
      transparent 1px calc(var(--step) * 16)
    ),
    repeating-linear-gradient(
      to right,
      #acaca477 0 1px,
      transparent 1px calc(var(--step) * 4)
    ),
    repeating-linear-gradient(
      to right,
      #ddddda66 0 1px,
      transparent 1px var(--step)
    ),
    repeating-linear-gradient(to bottom, transparent 0 19px, #d8d8d2 19px 20px);
  cursor: crosshair;
}
.grid-shade {
  position: absolute;
  left: 0;
  right: 0;
  height: 20px;
  background: #00000004;
  pointer-events: none;
}
.note {
  position: absolute;
  height: 17px;
  min-width: 5px;
  background: #41413b;
  color: white;
  border: 1px solid #41413b;
  border-radius: 1px;
  z-index: 2;
  cursor: grab;
  font-size: 9px;
  padding: 1px 4px;
  white-space: nowrap;
  overflow: hidden;
  touch-action: none;
}
.note.selected {
  background: #e3e2d9;
  color: #111;
  outline: 2px solid #111;
  outline-offset: -2px;
}
.note-resize {
  position: absolute;
  right: 0;
  top: 0;
  height: 100%;
  width: 8px;
  cursor: ew-resize;
  border-right: 2px solid #b3b3a6;
}
.playhead {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 2px;
  background: #111;
  z-index: 4;
  pointer-events: none;
  box-shadow: 0 0 0 1px #fff8;
}
.grid-cursor {
  position: absolute;
  width: var(--step);
  height: 20px;
  outline: 2px solid #555;
  outline-offset: -2px;
  pointer-events: none;
  z-index: 3;
}
.roll-caption {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  font-size: 10px;
  color: var(--muted);
  line-height: 1.8;
  padding-top: 10px;
}
.performance {
  padding: 25px 0 0;
}
.performance-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 15px;
  margin-bottom: 20px;
}
.performance h2 {
  font-size: 18px;
}
.performance p {
  font-size: 11px;
  color: var(--muted);
  margin-top: 8px;
}
.octave-control {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 11px;
  white-space: nowrap;
}
.octave-control button {
  padding: 4px 10px;
}
.octave-control output {
  margin-left: 6px;
}
.keyboard-wrap {
  display: flex;
  gap: 32px;
  align-items: center;
}
.performance-keys {
  position: relative;
  height: 114px;
  width: 600px;
  max-width: 100%;
  display: flex;
  border: 1px solid var(--ink);
  flex-shrink: 1;
}
.performance-key {
  height: 100%;
  border: 0;
  border-right: 1px solid #99998d;
  background: white;
  flex: 1;
  padding: 0 0 12px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: center;
  gap: 5px;
  touch-action: none;
  font-size: 13px;
  user-select: none;
}
.performance-key:last-child {
  border-right: 0;
}
.performance-key small {
  font-size: 9px;
  color: #6c6c62;
}
.performance-key.black {
  position: absolute;
  top: -1px;
  height: 67%;
  width: 8%;
  background: var(--ink);
  color: #f5f4f0;
  z-index: 2;
  border: 1px solid var(--paper);
  padding-bottom: 10px;
}
.performance-key.black small {
  color: #aaa99d;
}
.performance-key.playing {
  background: #acac9e;
  color: #111;
}
.keyboard-note {
  font-size: 12px;
  min-width: 180px;
}
.keyboard-note small {
  display: block;
  font-size: 10px;
  line-height: 2;
  color: var(--muted);
  margin-top: 12px;
}
.input-status {
  display: flex;
  justify-content: space-between;
  gap: 15px;
  align-items: center;
  margin-top: 20px;
  padding: 10px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--ink);
  font-size: 10px;
  color: var(--muted);
}
.input-status > div {
  display: flex;
  align-items: center;
  gap: 12px;
}
.input-status .text-button {
  font-size: 10px;
}
.history {
  display: flex;
  gap: 5px;
}
@media (min-width: 1700px) {
  main,
  .site-header {
    max-width: 1500px;
    margin-left: auto;
    margin-right: auto;
  }
}
@media (max-width: 1050px) {
  .transport {
    gap: 16px;
  }
  .transport-settings {
    gap: 14px;
  }
  .project-line {
    gap: 10px;
  }
  .project-line > .muted {
    display: none;
  }
  .chord-slot {
    padding: 12px;
  }
  .input-status {
    align-items: flex-start;
    flex-direction: column;
    gap: 0;
  }
}
@media (max-width: 650px) {
  .project-line {
    flex-wrap: wrap;
    padding: 10px 0;
    gap: 4px;
  }
  .project-title {
    width: 100%;
  }
  .project-actions {
    margin-left: 0;
    gap: 10px;
  }
  .project-actions button {
    padding-left: 0;
  }
  .transport-settings {
    gap: 12px;
  }
  .transport-settings > label {
    gap: 6px;
  }
  .volume-label {
    display: none !important;
  }
  .section-heading {
    align-items: flex-start;
    padding-top: 24px;
  }
  h2 {
    font-size: 16px;
  }
  .section-index {
    margin-right: 8px;
  }
  .chord-tools {
    flex-wrap: wrap;
  }
  .presets {
    gap: 4px;
  }
  .presets > span {
    font-size: 10px;
  }
  .presets button {
    padding: 5px 10px;
  }
  .chord-slots {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .chord-value {
    font-size: 34px;
  }
  .roll-toolbar {
    align-items: flex-start;
  }
  .roll-toolbar > div {
    gap: 8px;
    flex-wrap: wrap;
  }
  .roll-toolbar > div:last-child {
    justify-content: flex-end;
    min-width: 77px;
  }
  .roll-toolbar .inline-label {
    font-size: 10px;
    gap: 5px;
  }
  .roll-toolbar select {
    font-size: 11px;
    padding: 5px;
  }
  .history .text-button {
    font-size: 10px;
    padding: 3px;
  }
  .roll-caption {
    flex-direction: column;
    gap: 2px;
  }
  .performance-head {
    align-items: flex-start;
    flex-direction: column;
  }
  .performance p {
    line-height: 1.8;
  }
  .keyboard-wrap {
    gap: 10px;
    flex-wrap: wrap;
  }
  .performance-keys {
    width: 100%;
  }
  .keyboard-note {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    font-size: 11px;
  }
  .keyboard-note small {
    margin: 0;
    text-align: right;
  }
  .input-status > div {
    gap: 5px;
    flex-wrap: wrap;
  }
  .position {
    margin-left: 12px;
  }
  .piano-roll {
    height: 330px;
  }
}
