:root {
  --ink: #242722;
  --muted: #62655f;
  --floor: #eeede7;
  --case: #d9d8d0;
  --line: #b8bab1;
  --paper: #eeeee6;
  --orange: #f45d2f;
  --blue: #4186a2;
  --green: #7b9470;
  --screen: #19241e;
  --glow: #c2df9b;
  font-family: Arial,Helvetica,sans-serif;
  color: var(--ink);
  background: var(--floor);
  font-synthesis: none;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: #babdb3;
}
button,
input,
select {
  font: inherit;
}
button,
a,
input,
select {
  touch-action: manipulation;
}
button {
  cursor: pointer;
}
button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 3px solid #1c799f;
  outline-offset: 4px;
}
button {
  color: inherit;
  border: 1px solid #b8b9b0;
  border-radius: 5px;
  background: var(--paper);
  padding: 10px 13px;
  box-shadow: 0 2px 0 #aeb0a6;
  font-size: 12px;
  font-weight: 600;
  transition: background .12s,transform .12s;
}
button:hover {
  background: #fafaf4;
}
button:active {
  transform: translateY(2px);
  box-shadow: none;
}
button:disabled {
  opacity: .45;
  cursor: default;
}
a {
  color: inherit;
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}
input,
select {
  color: inherit;
}
select {
  border: 1px solid var(--line);
  padding: 8px;
  border-radius: 4px;
  background: var(--paper);
}
input[type=range] {
  accent-color: var(--ink);
  max-width: 100%;
  cursor: pointer;
}
input[type=number] {
  width: 72px;
}
input[type=text],
input:not([type]) {
  min-width: 0;
}
kbd {
  font-family: monospace;
  font-size: 11px;
}
h1,
h2,
p {
  margin: 0;
}
h2 {
  font-size: 18px;
  letter-spacing: -.5px;
  font-weight: 600;
}
.frame {
  width: 100%;
  min-height: 100dvh;
  padding: 6px;
}
.device {
  height: calc(100dvh - 12px);
  min-height: 760px;
  display: flex;
  flex-direction: column;
  padding: 8px 16px 6px;
  background: var(--case);
  border: 1px solid #9ca294;
  border-radius: 9px;
  box-shadow: inset 0 1px #f8f9f0,0 2px 0 #92998c;
}
.section-label {
  font-size: 10px;
  letter-spacing: 1.3px;
  color: var(--muted);
  text-transform: uppercase;
  font-weight: 600;
}
.bridge {
  display: grid;
  grid-template-columns: 150px minmax(280px,1fr) 250px;
  gap: 20px;
  flex: 0 0 178px;
  height: 178px;
  padding: 0 0 8px;
}
.transport {
  display: flex;
  flex-direction: column;
  gap: 7px;
  justify-content: center;
}
.play {
  height: 43px;
  flex-shrink: 0;
  font-size: 16px;
  background: var(--orange);
  border-color: #d95229;
  box-shadow: 0 3px 0 #c24725;
  display: flex;
  align-items: center;
  gap: 14px;
  justify-content: center;
}
.play:hover {
  background: #ff7951;
}
.play span {
  font-size: 20px;
}
.transport-note {
  display: none;
}
.tempo {
  display: flex;
  gap: 6px;
  align-items: center;
  font-size: 11px;
  margin-top: 0;
}
.tempo input {
  background: transparent;
  border: 0;
  border-bottom: 1px solid #9da294;
  font-family: monospace;
  font-size: 20px;
  padding: 2px;
  width: 68px;
}
.tempo span {
  font-size: 10px;
}
.display {
  background: var(--screen);
  color: var(--glow);
  border: 4px solid #bfc2b6;
  border-radius: 7px;
  box-shadow: inset 0 2px 5px #0008,0 1px 0 #ffffffe3;
  min-width: 0;
  display: flex;
  flex-direction: column;
  padding: 8px 13px;
  position: relative;
  overflow: hidden;
}
.display-top,
.display-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-family: monospace;
  font-size: 10px;
  gap: 8px;
}
.display-top {
  min-height: 23px;
}
.display-modes {
  display: flex;
  gap: 3px;
}
.display-modes button {
  font-family: monospace;
  font-size: 10px;
  padding: 5px 7px;
  box-shadow: none;
  border: 0;
  background: transparent;
  color: #92a385;
  border-radius: 2px;
}
.display-modes button[aria-pressed=true] {
  background: #33432e;
  color: #daedba;
}
#scope {
  width: 100%;
  height: 0;
  display: block;
  margin: 3px 0;
  flex: 1;
  min-height: 100px;
  /* Its bitmap follows its box; the box never follows its bitmap. */
  contain: size;
}
.display-bottom {
  font-size: 10px;
  padding-bottom: 5px;
}
.display-progress {
  height: 4px;
  background: #3e4d34;
  position: relative;
}
.display-progress:after {
  content: '';
  position: absolute;
  width: var(--progress,0%);
  height: 100%;
  background: var(--glow);
}
.dials {
  display: grid;
  grid-template-columns: repeat(3,1fr);
  gap: 12px;
  align-content: center;
  padding: 2px 0;
}
.dials .section-label {
  display: none;
}
.dial {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  font-size: 11px;
}
.knob {
  --rotation: -130deg;
  display: block;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: linear-gradient(120deg,#444a41,#20261f);
  border: 4px solid #3c4238;
  box-shadow: 2px 4px 4px #32392655,0 0 0 4px #c6c8be;
  position: relative;
  transform: rotate(var(--rotation));
}
.knob:before {
  content: '';
  position: absolute;
  width: 3px;
  height: 12px;
  background: #d9dfcf;
  top: 2px;
  left: 17px;
  border-radius: 2px;
}
.orange .knob {
  background: #ed623b;
  border-color: #e65a33;
}
.blue .knob {
  background: #4d91a8;
  border-color: #448499;
}
.dial input {
  width: 65px;
  margin: 0;
}
.dial output {
  font-family: monospace;
  font-size: 11px;
}
.project-bar {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 7px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  flex-shrink: 0;
}
.project-name {
  flex: 1;
  min-width: 130px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.project-name label,
.preset-label {
  font-size: 10px;
  letter-spacing: .5px;
  color: var(--muted);
}
.project-name label {
  display: block;
}
.project-name input {
  border: 0;
  background: transparent;
  font-size: 17px;
  letter-spacing: -.4px;
  padding: 4px 0;
  width: 100%;
  outline-offset: 1px;
}
.preset-label {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 8px;
}
.preset-label select {
  font-size: 12px;
  padding: 6px 8px;
}
.dark {
  background: #333a30;
  color: #f4f4ec;
  border-color: #333a30;
}
.dark:hover {
  background: #4b5545;
}
.orange-button {
  background: var(--orange);
  border-color: #df5931;
}
.orange-button:hover {
  background: #ff7a50;
}
.sequencer {
  display: flex;
  flex-direction: column;
  flex: 1 0 auto;
}
.section-head {
  display: flex;
  gap: 18px;
  justify-content: space-between;
  align-items: center;
  margin: 7px 0 6px;
}
.pattern-tabs,
.pattern-tools {
  display: flex;
  align-items: center;
  gap: 7px;
}
.pattern-tabs button {
  width: 32px;
  height: 30px;
  padding: 0;
  font-family: monospace;
  font-size: 15px;
}
.pattern-tabs button[aria-pressed=true] {
  background: var(--orange);
  border-color: #dc5932;
}
.pattern-tools {
  font-size: 11px;
  gap: 10px;
}
.pattern-tools button {
  font-size: 11px;
  padding: 7px 9px;
}
.pattern-tools select {
  font-size: 11px;
  padding: 5px;
}
.grid-scroll {
  overflow: auto;
  padding: 3px 3px 5px;
  margin: 0 -3px;
  display: flex;
  flex: 1;
  min-height: 0;
}
#grid {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
}
.step-row {
  display: grid;
  grid-template-columns: 105px repeat(var(--steps,32),minmax(20px,1fr));
  gap: 4px;
  min-width: 950px;
  min-height: 28px;
  margin-bottom: 4px;
  flex: 1;
}
.step-row.sixteen {
  min-width: 650px;
}
.track-label {
  padding: 0 8px;
  background: transparent;
  box-shadow: none;
  border: 0;
  text-align: left;
  font-size: 11px;
  display: flex;
  align-items: center;
  gap: 7px;
}
.track-label i {
  display: block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--track);
}
.track-label[aria-pressed=true] {
  background: #c7cbbf;
}
.step {
  padding: 0;
  min-height: 24px;
  height: auto;
  border: 1px solid #b9bcb1;
  border-radius: 3px;
  background: #c8cbc1;
  box-shadow: 0 2px 0 #a9afa2;
  position: relative;
}
.step.beat {
  background: #dfe1d6;
}
.step[aria-pressed=true] {
  background: var(--track);
  border-color: var(--track);
  box-shadow: 0 2px 0 #747969;
}
.step.selected {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
  z-index: 1;
}
.step.playhead:after {
  content: '';
  position: absolute;
  inset: -3px;
  border: 2px solid #fff;
  border-radius: 5px;
  box-shadow: 0 0 6px #fff9;
}
.step:before {
  content: '';
  position: absolute;
  bottom: 3px;
  left: 3px;
  right: 3px;
  height: calc(var(--velocity,0)*14px);
  border-radius: 1px;
  background: #ffffff45;
}
.steps-header {
  flex: 0 0 auto;
  min-height: 0;
  font-family: monospace;
  font-size: 9px;
  color: var(--muted);
  text-align: center;
  margin-bottom: 6px;
}
.steps-header span:first-child {
  text-align: left;
  padding: 0 8px;
}
.editor {
  padding: 5px 0 6px;
  border-bottom: 1px solid var(--line);
  display: flex;
  gap: 16px;
  align-items: center;
  justify-content: space-between;
  font-size: 11px;
  color: var(--muted);
}
.editor > div {
  display: flex;
  gap: 15px;
  align-items: center;
}
.editor label {
  display: flex;
  align-items: center;
  gap: 7px;
}
.editor input {
  width: 85px;
}
.editor select {
  font-size: 11px;
  padding: 3px;
}
.hint {
  font-size: 10px;
}
.lower {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 28px;
  min-height: 134px;
  flex: .3 0 auto;
}
.arranger,
.performance {
  display: flex;
  flex-direction: column;
}
.lower .chain,
.lower .pads {
  flex: 1;
}
.lower .section-head,
.lower .sub {
  flex-shrink: 0;
}
.lower > section {
  min-width: 0;
}
.sub {
  font-size: 11px;
  color: var(--muted);
  line-height: 1.6;
}
.chain {
  display: grid;
  grid-template-columns: repeat(8,1fr);
  gap: 6px;
  margin: 8px 0 5px;
}
.chain button {
  font-family: monospace;
  font-size: 18px;
  min-height: 39px;
  height: auto;
  position: relative;
  background: #c7cbbf;
}
.chain button small {
  position: absolute;
  top: 3px;
  left: 5px;
  font-size: 8px;
  color: #68715f;
}
.chain button.current {
  background: var(--orange);
}
#mode[aria-pressed=true],
#record[aria-pressed=true] {
  background: var(--orange);
}
.pads {
  display: grid;
  grid-template-columns: repeat(8,1fr);
  gap: 6px;
  margin: 8px 0 5px;
}
.pad {
  min-height: 51px;
  height: auto;
  padding: 5px 3px;
  position: relative;
  font-size: 9px;
  border-top: 4px solid var(--track);
  border-radius: 4px;
}
.pad b {
  display: block;
  font-size: 15px;
  margin-bottom: 5px;
}
.pad.active {
  background: var(--track);
  transform: translateY(2px);
}
.mixers {
  display: grid;
  grid-template-columns: repeat(8,1fr);
  gap: 9px;
}
.mixer {
  border: 0;
  margin: 0;
  min-height: 112px;
}
.strip {
  background: #cdd0c5;
  border: 1px solid #b7bcad;
  padding: 8px 10px;
  border-radius: 5px;
  min-width: 0;
}
.strip.selected {
  border-color: #6b7761;
}
.strip-name {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  margin-bottom: 7px;
}
.strip-name i {
  width: 8px;
  height: 8px;
  background: var(--track);
  border-radius: 50%;
}
.strip label {
  font-size: 10px;
  color: var(--muted);
  display: grid;
  grid-template-columns: 28px 1fr 22px;
  gap: 3px;
  align-items: center;
  margin-top: 2px;
}
.strip input {
  width: 100%;
  margin: 0;
  display: block;
  accent-color: var(--track);
  grid-column: 2;
  grid-row: 1;
  height: 12px;
}
.strip output {
  font-family: monospace;
  grid-column: 3;
  grid-row: 1;
  text-align: right;
  font-size: 9px;
}
.strip-buttons {
  display: flex;
  gap: 5px;
  margin-top: 7px;
}
.strip-buttons button {
  flex: 1;
  font-size: 10px;
  padding: 4px 2px;
  box-shadow: none;
  min-height: 24px;
}
.strip-buttons button[aria-pressed=true] {
  background: var(--track);
}
.device-footer {
  margin-top: 0;
  padding-top: 6px;
  border: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  font-size: 10px;
  color: var(--muted);
}
dialog {
  width: min(560px,calc(100% - 32px));
  border: 1px solid #a6ad9b;
  border-radius: 12px;
  background: var(--floor);
  color: var(--ink);
  padding: 24px;
  box-shadow: 0 25px 80px #0005;
}
dialog::backdrop {
  background: #18201199;
  backdrop-filter: blur(4px);
}
.modal-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 22px;
}
.modal-head button {
  font-size: 22px;
  box-shadow: none;
  padding: 3px 10px;
}
.modal-row {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  padding: 13px 0;
  border-bottom: 1px solid var(--line);
}
.modal-row strong {
  font-size: 14px;
}
.modal-row p {
  font-size: 11px;
  color: var(--muted);
  margin-top: 5px;
}
.modal-prose {
  font-size: 14px;
  line-height: 1.7;
}
.modal-prose p {
  margin: 12px 0;
}
.modal-prose kbd {
  padding: 2px 6px;
  background: var(--case);
}
.exports {
  display: grid;
  gap: 14px;
}
.exports button {
  padding: 20px;
  text-align: left;
  font-size: 15px;
}
.exports small {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 400;
  margin-top: 7px;
}
.error {
  color: #a13c22;
}
#save-status {
  max-width: 50%;
}
.transport .section-label {
  display: none;
}
.project-bar > button {
  padding: 8px 12px;
}
.workspace-tabs {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 0;
}
.workspace-tabs button {
  padding: 5px 12px;
  box-shadow: none;
  background: transparent;
}
.workspace-tabs button[aria-pressed=true] {
  background: #333a30;
  border-color: #333a30;
  color: #f4f4ec;
}
.workspace-tabs .sub {
  margin-left: auto;
}
[hidden] {
  display: none!important;
}
.lower .section-head {
  margin: 0 0 6px;
}
.lower .section-head button {
  padding: 6px 10px;
}
.mixer > .section-head {
  display: none;
}
.workspace-tabs[hidden] ~ .mixer > .section-head {
  display: flex;
  margin: 6px 0;
}
.footer-actions {
  display: flex;
  gap: 12px;
  align-items: center;
  white-space: nowrap;
}
.footer-actions button {
  font-size: 10px;
  padding: 5px;
  background: transparent;
  border: 0;
  box-shadow: none;
  color: var(--muted);
}
#tap {
  padding: 4px 8px;
  min-height: 23px;
}
.device > :not(.bridge) {
  flex-shrink: 0;
}
#tempo-slider {
  width: 100%;
  height: 24px;
  margin: 0;
  accent-color: var(--orange);
}
@media (max-width:1100px) {
  .device {
    padding: 10px 12px 8px;
  }
  .bridge {
    grid-template-columns: 140px minmax(260px,1fr) 210px;
    gap: 14px;
  }
  .mixers {
    gap: 5px;
  }
  .strip {
    padding: 8px 6px;
  }
  .strip label {
    grid-template-columns: 25px 1fr 20px;
  }
  .strip-name {
    font-size: 10px;
  }
  .hint {
    display: none;
  }
  .project-bar {
    gap: 7px;
  }
  .project-bar > button {
    padding: 8px 10px;
  }
  .step-row {
    min-width: 960px;
  }
  .lower {
    gap: 22px;
  }
}
@media (max-width:800px) {
  .sequencer,
  .lower {
    flex: none;
  }
  .grid-scroll {
    display: block;
    flex: none;
  }
  #grid {
    display: block;
  }
  .step-row {
    min-height: 0;
  }

  .frame {
    padding: 4px;
  }
  .device {
    height: auto;
    min-height: calc(100dvh - 8px);
    padding: 12px 12px 8px;
  }

  .bridge {
    grid-template-columns: 105px 1fr;
    height: auto;
    flex: none;
    min-height: 0;
    gap: 10px;
  }
  .display {
    min-height: 190px;
  }
  .dials {
    grid-column: 1/-1;
    display: flex;
    justify-content: space-between;
    padding: 4px 0 2px;
  }
  .dial {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
  }
  .knob {
    display: none;
  }
  .dial input {
    width: 90px;
  }
  .dial output {
    font-size: 10px;
  }
  .project-bar {
    flex-wrap: wrap;
  }
  .project-name {
    flex-basis: 43%;
  }
  .preset-label {
    flex: 1;
  }
  .preset-label select {
    width: 100%;
  }
  .project-bar > button {
    flex: 1;
    min-height: 36px;
  }
  .section-head {
    gap: 8px;
    flex-wrap: wrap;
  }
  .pattern-tools {
    margin-left: auto;
    gap: 6px;
  }
  .pattern-tools label {
    white-space: nowrap;
  }
  .step-row {
    min-width: 1080px;
    grid-template-columns: 90px repeat(var(--steps,32),minmax(26px,1fr));
    gap: 5px;
    margin-bottom: 8px;
  }
  .step-row.sixteen {
    min-width: 680px;
  }
  .step {
    height: 36px;
  }
  .track-label {
    position: sticky;
    left: 0;
    background: var(--case);
    z-index: 2;
  }
  .editor {
    flex-wrap: wrap;
    gap: 9px;
    padding: 8px 0;
  }
  .editor > span {
    width: 100%;
  }
  .editor select {
    padding: 7px;
  }
  .workspace-tabs {
    padding: 10px 0;
  }
  .workspace-tabs .sub {
    display: none;
  }
  .workspace-tabs button {
    min-height: 36px;
  }
  .mixers {
    grid-template-columns: repeat(4,1fr);
    gap: 8px;
  }
  .strip {
    padding: 10px;
  }
  .strip-name {
    font-size: 11px;
  }
  .strip label {
    display: block;
    margin-top: 8px;
  }
  .strip output {
    float: right;
    font-size: 10px;
  }
  .strip input {
    margin-top: 4px;
    height: 22px;
  }
  .strip-buttons button {
    min-height: 32px;
  }
  .lower {
    grid-template-columns: 1fr;
    gap: 18px;
  }
  .chain button {
    height: 45px;
  }
  .pads .pad {
    height: 62px;
  }
  .pad b {
    font-size: 18px;
  }
  .device-footer {
    flex-wrap: wrap;
    gap: 5px;
    margin-top: 14px;
  }
  .device-footer > span:nth-child(2) {
    display: none;
  }
  .footer-actions {
    margin-left: auto;
  }
  .footer-actions button {
    min-height: 30px;
  }
  #save-status {
    max-width: 100%;
    flex-basis: 100%;
  }
}
@media (max-width:500px) {
  .device {
    padding: 10px 8px 6px;
  }
  .bridge {
    grid-template-columns: 95px 1fr;
    gap: 8px;
  }
  .display {
    padding: 6px 7px;
  }
  .display-top {
    font-size: 9px;
    align-items: flex-start;
    flex-direction: column;
    gap: 0;
  }
  .display-modes {
    align-self: flex-end;
  }
  .display-modes button {
    font-size: 9px;
    padding: 4px;
  }
  .display-bottom {
    font-size: 9px;
  }
  .dials {
    gap: 8px;
  }
  .dial {
    display: flex;
    gap: 5px;
    font-size: 10px;
  }
  .dial input {
    width: 90px;
  }
  .play {
    font-size: 13px;
    gap: 6px;
  }
  .play span {
    font-size: 17px;
  }

  .tempo {
    gap: 4px;
    font-size: 10px;
    flex-wrap: wrap;
  }
  .tempo input {
    font-size: 18px;
    width: 46px;
  }
  .project-bar {
    gap: 6px;
  }
  .project-name {
    min-width: 120px;
  }
  .project-name input {
    font-size: 16px;
  }
  .project-name label,
  .preset-label {
    font-size: 9px;
  }
  .preset-label {
    gap: 5px;
  }
  .preset-label select {
    max-width: 165px;
    font-size: 11px;
  }
  .project-bar > button {
    font-size: 11px;
    padding: 7px 6px;
  }
  .section-head > .section-label {
    font-size: 9px;
  }
  .pattern-tools {
    width: 100%;
    justify-content: flex-end;
  }
  .mixers {
    gap: 6px;
  }
  .strip {
    padding: 8px 6px;
  }
  .strip-name {
    font-size: 10px;
  }
  .strip-buttons button {
    font-size: 10px;
  }
  .workspace-tabs button {
    font-size: 11px;
  }
  .sub {
    font-size: 10px;
  }
  .footer-actions {
    gap: 9px;
  }
}
@media (prefers-reduced-motion:reduce) {
  * {
    transition: none!important;
  }
}
