:root {
  --bg: #eeeae1;
  --paper: #f9f7f0;
  --ink: #252b28;
  --muted: #686c63;
  --line: #d5d5c9;
  --accent: #b74524;
  --mint: #b5c3ac;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font:
    14px/1.5 system-ui,
    sans-serif;
}
button,
input,
select,
a,
summary {
  touch-action: manipulation;
}
button,
input,
select {
  font: inherit;
  color: inherit;
}
button,
select,
input[type="number"],
input[type="text"] {
  border: 1px solid var(--line);
  background: var(--paper);
  border-radius: 4px;
  padding: 8px;
}
button {
  cursor: pointer;
  min-height: 38px;
}
button:hover {
  border-color: var(--ink);
  background: #e6e6da;
}
button:disabled {
  opacity: 0.45;
  cursor: default;
}
button:focus-visible,
a:focus-visible,
input:focus-visible,
summary:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}
button.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
button[aria-pressed="true"] {
  background: var(--ink);
  color: var(--paper);
}
a {
  color: inherit;
}
header {
  padding: 23px 3.4%;
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}
.brand {
  font-size: 32px;
  font-weight: 800;
  letter-spacing: -2px;
  text-decoration: none;
  display: flex;
  gap: 22px;
  align-items: center;
}
.brand span {
  font:
    10px/1.4 ui-monospace,
    monospace;
  letter-spacing: 2px;
  max-width: 120px;
}
nav {
  display: flex;
  gap: 9px;
  align-items: center;
}
nav a {
  font-size: 12px;
  padding: 10px;
}
main {
  max-width: 1600px;
  margin: auto;
  padding: 28px 3.4%;
}
.intro {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 25px;
}
.intro p {
  color: var(--muted);
}
.eyebrow {
  font:
    10px ui-monospace,
    monospace;
  letter-spacing: 2px;
  margin: 0;
}
h1 {
  font-size: clamp(32px, 4vw, 54px);
  font-weight: 500;
  letter-spacing: -2px;
  line-height: 1.1;
  margin: 8px 0;
}
.transport {
  display: flex;
  align-items: center;
  gap: 19px;
  flex-wrap: wrap;
  padding: 15px 0 23px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 22px;
}
.transport label {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
}
.transport input[type="number"] {
  width: 70px;
}
.volume {
  margin-left: auto;
}
.volume input {
  width: 90px;
}
input[type="range"] {
  accent-color: var(--accent);
  max-width: 100%;
  min-width: 0;
}
input[type="checkbox"] {
  accent-color: var(--accent);
}
.workspace {
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr) 250px;
  gap: 16px;
  align-items: start;
}
.panel {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 20px;
  min-width: 0;
}
.library {
  grid-row: 1;
}
.editor {
  grid-column: 2/4;
}
.sequence {
  grid-column: 1/3;
}
.assistant {
  grid-column: 3;
}
.section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 19px;
}
.section-title > span {
  font-size: 11px;
  color: var(--muted);
}
h2 {
  font-size: 14px;
  font-weight: 600;
  margin: 0;
}
h2 b {
  font:
    11px ui-monospace,
    monospace;
  color: var(--accent);
  padding-right: 10px;
}
.drop {
  display: block;
  border: 1px dashed #a9ac9d;
  padding: 18px 10px;
  text-align: center;
  cursor: pointer;
  font-size: 12px;
}
.drop.drag {
  background: #e0e4d6;
}
.drop input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}
.drop small {
  display: block;
  color: var(--muted);
  font-size: 10px;
  margin-top: 6px;
}
.library-actions {
  display: flex;
  gap: 6px;
  margin: 10px 0;
}
.library-actions button {
  font-size: 10px;
  flex: 1;
}
.samples {
  display: grid;
  gap: 6px;
  max-height: 355px;
  overflow: auto;
}
.sample-button {
  text-align: left;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  overflow: hidden;
  font-size: 12px;
}
.sample-button span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.sample-button small {
  font: 10px monospace;
  color: var(--muted);
}
.sample-button.selected {
  border-color: var(--accent);
  background: #f2e5d9;
}
.hint {
  font-size: 11px;
  line-height: 1.65;
  color: var(--muted);
}
.empty {
  min-height: 260px;
  display: grid;
  align-content: center;
  text-align: center;
  color: var(--muted);
}
.sample-heading {
  display: flex;
  justify-content: space-between;
  gap: 10px;
}
.sample-heading input {
  border: 0;
  background: none;
  font-size: 17px;
  font-weight: 500;
  min-width: 0;
  flex: 1;
}
canvas {
  display: block;
  width: 100%;
  height: 120px;
  background: #e6e8dd;
  border-radius: 4px;
  margin: 14px 0;
}
.edit-controls {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}
label {
  font-size: 11px;
  color: var(--muted);
}
.edit-controls label {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.edit-controls input {
  width: 100%;
  padding: 6px;
}
.edit-controls .check {
  flex-direction: row;
  align-items: center;
}
.check input {
  width: auto;
}
.toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin: 14px 0;
}
.toolbar button {
  font-size: 11px;
}
.toolbar input[type="number"] {
  width: 75px;
}
.assign {
  display: flex;
  gap: 10px;
  align-items: center;
  margin: 13px 0;
}
.assign select {
  max-width: 160px;
}
.assign button {
  font-size: 12px;
}
details {
  border-top: 1px solid var(--line);
  margin-top: 15px;
  padding-top: 13px;
}
summary {
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  min-height: 26px;
}
#cuts {
  display: block;
  width: 100%;
  margin: 6px 0;
}
#slices {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  max-height: 130px;
  overflow: auto;
}
#slices button {
  font-size: 11px;
}
.sequence {
  padding-bottom: 12px;
}
.sequence-tools {
  margin-top: 0;
}
.grid-scroll {
  overflow-x: auto;
  padding-bottom: 8px;
}
#grid {
  min-width: 660px;
}
.grid-row {
  display: grid;
  grid-template-columns: 135px repeat(16, minmax(24px, 1fr));
  gap: 4px;
  margin-bottom: 5px;
  align-items: center;
}
.grid-row .lane-label {
  display: flex;
  align-items: center;
  gap: 3px;
  font-size: 11px;
  min-width: 0;
}
.lane-label > button:first-child {
  flex: 1;
  text-align: left;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  padding: 3px;
  border: 0;
}
.lane-label button {
  font-size: 10px;
  min-height: 28px;
  padding: 3px;
}
.step {
  position: relative;
  height: 38px;
  min-height: 38px;
  background: #ecece4;
  border: 1px solid #e1e2d7;
  padding: 0;
  border-radius: 3px;
}
.step:nth-child(4n + 2) {
  border-left: 2px solid #a8ad9e;
}
.step.on {
  background: #dde3d4;
}
.step.on:after {
  content: "";
  position: absolute;
  left: 4px;
  right: 4px;
  bottom: 4px;
  height: calc(var(--v) * 26px);
  border-radius: 2px;
  background: var(--mint);
}
.grid-row:nth-child(2) .step.on:after,
.grid-row:nth-child(3) .step.on:after {
  background: var(--accent);
}
.step.now {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}
.step.editing {
  border: 2px solid var(--ink);
}
.grid-row.ticks {
  font: 9px monospace;
  color: var(--muted);
  text-align: center;
  margin-bottom: 10px;
}
#bar-tabs {
  display: flex;
  gap: 4px;
}
#bar-tabs button {
  font-size: 10px;
  min-height: 28px;
  padding: 4px 8px;
}
#bar-tabs .active {
  background: var(--ink);
  color: white;
}
.assistant {
  background: #e1e6d8;
}
.assistant > p:first-of-type {
  font-size: 19px;
  letter-spacing: -0.5px;
  margin-top: 0;
}
.assistant label {
  display: block;
  margin: 16px 0;
}
.assistant select,
.assistant input,
.assistant > .primary {
  display: block;
  width: 100%;
  margin-top: 7px;
}
.candidate-label {
  color: var(--accent);
  font-size: 12px;
}
#candidate button {
  font-size: 12px;
}
#lane-controls {
  display: grid;
  gap: 12px;
  margin-top: 12px;
}
.lane-control {
  display: flex;
  gap: 8px;
  align-items: end;
  flex-wrap: wrap;
  border-bottom: 1px solid var(--line);
  padding-bottom: 12px;
}
.lane-control strong {
  width: 100px;
  font-size: 12px;
}
.lane-control label {
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.lane-control input[type="number"] {
  width: 68px;
  padding: 5px;
}
.lane-control select {
  max-width: 125px;
  padding: 5px;
}
footer {
  display: flex;
  gap: 16px;
  justify-content: space-between;
  margin-top: 22px;
  color: var(--muted);
  font:
    10px/1.6 ui-monospace,
    monospace;
}
footer > span:last-child {
  white-space: nowrap;
}
[hidden] {
  display: none !important;
}
.reading {
  max-width: 800px;
  font-size: 16px;
  line-height: 1.8;
}
.reading h2 {
  font-size: 23px;
  margin-top: 32px;
}
.reading code {
  font-size: 13px;
}
.reading a {
  color: var(--accent);
}
@media (max-width: 1100px) {
  .workspace {
    grid-template-columns: 220px minmax(0, 1fr);
  }
  .editor {
    grid-column: 2;
  }
  .sequence {
    grid-column: 1/3;
  }
  .assistant {
    grid-column: 1/3;
  }
  .assistant label {
    display: inline-block;
    min-width: 180px;
    margin-right: 20px;
  }
  .assistant > .primary {
    width: auto;
  }
  .assistant > p:first-of-type {
    display: none;
  }
}
@media (max-width: 650px) {
  header {
    padding: 16px;
  }
  .brand {
    font-size: 27px;
  }
  .brand span {
    display: none;
  }
  nav {
    gap: 4px;
  }
  nav button,
  nav a {
    font-size: 10px;
    padding: 6px;
  }
  main {
    padding: 22px 12px;
  }
  .intro {
    align-items: start;
  }
  .intro > p {
    display: none;
  }
  .transport {
    gap: 10px;
  }
  .transport button {
    font-size: 12px;
  }
  .volume {
    margin-left: 0;
  }
  .workspace {
    display: flex;
    flex-direction: column;
  }
  .panel {
    width: 100%;
    padding: 15px;
  }
  .library .samples {
    max-height: 155px;
    grid-template-columns: 1fr 1fr;
  }
  .library .hint {
    margin-bottom: 0;
  }
  .edit-controls {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .section-title {
    margin-bottom: 12px;
  }
  .sequence-tools .hint {
    display: none;
  }
  footer {
    flex-direction: column;
  }
  .lane-control strong {
    width: 100%;
  }
  .sample-heading input {
    font-size: 14px;
  }
  .toolbar {
    gap: 6px;
  }
}
#wave {
  touch-action: none;
  cursor: crosshair;
}
.drop:focus-within {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}
.assign {
  flex-wrap: wrap;
}

.pattern-library {
  border-bottom: 1px solid var(--line);
  padding-bottom: 18px;
  margin-bottom: 20px;
}
.pattern-library h3 {
  font-size: 13px;
  margin: 0;
}
.pattern-library h3 span {
  font:
    11px ui-monospace,
    monospace;
  color: var(--muted);
}
.pattern-library label {
  min-width: 0;
  width: 100%;
  margin-right: 0;
}
.pattern-navigation {
  display: flex;
  gap: 6px;
}
.pattern-navigation button {
  flex: 1;
  font-size: 11px;
}
.pattern-library .pattern-tempo {
  display: flex;
  align-items: center;
  gap: 7px;
}
.pattern-library .pattern-tempo input {
  width: auto;
  margin: 0;
}
#pattern-preview {
  width: 100%;
  border-color: var(--ink);
}
#classic-pattern {
  max-width: 100%;
}
