:root {
  color-scheme: dark;
  --bg: #121214;
  --panel: #1c1c20;
  --paper: #202025;
  --line: #32323a;
  --fg: #e6e6ea;
  --dim: #a0a0ac;
  --faint: #81818e;
  --control: #26262c;
  --edge: #53535f;
  --acc: #7be0c3; /* playing, now, cut, loop region */
  --on: var(--acc);
  --on-fg: #121214;
  --sel: var(--acc);
  --mark: var(--fg);
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font:
    13px/1.4 'IBM Plex Mono',
    ui-monospace,
    SFMono-Regular,
    Menlo,
    monospace;
}
label {
  color: var(--dim);
  display: flex;
  gap: 6px;
  align-items: center;
}
input[type='number'] {
  width: 56px;
}
input,
select,
button,
textarea {
  background: var(--control);
  color: var(--fg);
  border: 1px solid var(--line);
  border-radius: 3px;
  font: inherit;
  padding: 4px 7px;
}
button {
  cursor: pointer;
}
button:hover {
  border-color: var(--fg);
}
button.pri {
  background: var(--acc);
  color: #111;
  border-color: var(--acc);
  font-weight: 600;
}
#srcmap {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: start;
  gap: 10px 18px;
  padding: 10px 18px;
  border-bottom: 1px solid var(--line);
}
#srcmap .source-card {
  width: max-content;
  padding: 0;
  border: 0;
  background: transparent;
}
#srcmap .source-card .top {
  margin-bottom: 3px;
}
@media (max-width: 650px) {
  #srcmap {
    grid-template-columns: minmax(0, 1fr);
  }
}
#srcmap .source-card .gwrap,
#srcmap .source-card .grid,
#srcmap .source-card .grid .row {
  cursor: default;
}
/* one fixed grid everywhere: 15px cells, 3px gutters; joins bridge the gutter instead of closing it, so columns always line up */
.card .grid .row {
  display: flex;
  gap: 3px;
  margin-bottom: 3px;
}
.cell.join {
  border-top-left-radius: 0;
  border-bottom-left-radius: 0;
}
.cell.joinR {
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
}
.cell.join::before {
  content: '';
  position: absolute;
  left: -3px;
  top: 0;
  bottom: 0;
  width: 3px;
  background-color: inherit;
}
.cell {
  width: 15px;
  height: 18px;
  border-radius: 2px;
  background-color: var(--step-fill, transparent);
  font-size: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--fg);
  position: relative;
  flex: none;
}
.card .cell {
  width: var(--cw, 15px);
  height: var(--ch, 18px);
}
.card .cell,
.ghost .cell {
  font-size: var(--cf, 8px);
}
.card .rp {
  height: var(--ch, 18px);
}
.cell.rest {
  --step-fill: var(--paper);
  color: var(--faint);
}
.cell.rev:not(.hs) {
  box-shadow: inset 0 0 0 2px var(--mark);
}
.reverse-run {
  position: absolute;
  inset: 0;
  border: 2px solid var(--mark);
  border-radius: inherit;
  pointer-events: none;
}
.cell.rev-join .reverse-run {
  left: -3px;
  border-left: 0;
}
.cell.rev-joinR .reverse-run {
  border-right: 0;
}
.cell.lifted .reverse-run {
  display: none;
}
.cell.rt {
  background-repeat: no-repeat;
}
.cell.nt {
  --step-fill: #9a978d;
  --mark: #fff;
  color: #fff;
}
/* every step is coloured by where it sits in the source (dark blue at the start of the break to yellow at the end);
   its text and markings take the contrasting ink */
.cell[style*='--pc'] {
  --step-fill: var(--pc);
  --mark: var(--pt, #16161a);
  color: var(--pt, #000b);
}
/* half speed: each source slice spans two steps, so its number is centred across the pair */
.cell .hn {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
  pointer-events: none;
}
.cell .hn.pair {
  width: calc(200% + 3px);
}
/* Keep a centered label above the second cell, even when both cells are selected. */
.cell:has(> .hn.pair) {
  z-index: 4;
}
.cell.pu {
  border-top: 3px solid var(--mark);
}
.cell.pd {
  border-bottom: 3px solid var(--mark);
}
/* the playhead: an orange ring with a 1px gap, so it reads on every fill, orange snares included */
.cell.now {
  outline: 2px solid var(--acc);
  outline-offset: 1px;
}
@keyframes beatPulse {
  0% {
    transform: scale(1.22);
    filter: brightness(1.35);
  }
  100% {
    transform: none;
    filter: none;
  }
}
@keyframes barPulse {
  0% {
    transform: scale(1.32);
    filter: brightness(1.6);
  }
  100% {
    transform: none;
    filter: none;
  }
}
.cell.pulse {
  animation: beatPulse 0.22s ease-out;
  z-index: 1;
}
.cell.pulseBar {
  animation: barPulse 0.3s ease-out;
  z-index: 1;
}
/* Compact legend columns. */
.key {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  row-gap: 8px;
}
.kg {
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 0 16px;
  border-left: 1px solid var(--line);
}
.kg:first-child {
  padding-left: 0;
  border-left: 0;
}
.kr {
  display: grid;
  grid-auto-flow: column;
  grid-template-rows: repeat(4, 18px);
  column-gap: 14px;
  row-gap: 3px;
}
.ki {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 10px;
  color: var(--dim);
  white-space: nowrap;
}
.kx {
  display: flex;
  align-items: center;
  gap: 3px;
  min-width: 15px;
}
.kx .cell {
  cursor: default;
}
.ki.khit,
.ki.khit .cell,
#srcmap .source-card .grid .cell {
  cursor: pointer;
}
.ki.khit:hover span {
  color: var(--fg);
}
main {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
  gap: 12px;
  padding: 14px 18px;
}
.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 3px;
  padding: 7px 8px;
}
#cards > .card {
  user-select: none;
  -webkit-user-select: none;
}
.card.playing {
  border-color: var(--acc);
}
/* one continuous pointer area across buttons, rows and the gaps between them (no cursor flicker crossing gutters) */
.gwrap {
  display: flex;
  gap: 0;
  cursor: pointer;
  position: relative;
}
.ghost {
  position: fixed;
  left: 0;
  top: 0;
  z-index: 50;
  pointer-events: none;
  will-change: transform;
  filter: drop-shadow(0 8px 14px #0008) drop-shadow(0 2px 3px #0006);
}
/* Overlap both edges of the gutter so fractional drag transforms can't expose a seam. */
.ghost .cell.join::before {
  left: -4px;
  width: 5px;
}
.ghost.cloning::after {
  content: '+';
  position: absolute;
  right: -7px;
  top: -8px;
  width: 14px;
  height: 14px;
  border-radius: 7px;
  background: var(--sel);
  color: var(--on-fg);
  font:
    700 11px/14px ui-monospace,
    monospace;
  text-align: center;
}
.ghost.flying {
  z-index: 49;
  filter: drop-shadow(0 4px 8px #0008);
}
.cell.lifted {
  background-color: var(--paper) !important;
  background-image: none !important;
  color: transparent !important;
  box-shadow: inset 0 0 0 1px var(--line) !important;
}
.cell.lifted::before {
  display: none;
}
@keyframes landed {
  0% {
    transform: scale(1.12);
    filter: brightness(1.4);
  }
  100% {
    transform: none;
    filter: none;
  }
}
.cell.landed {
  animation: landed 0.22s ease-out;
}
/* Playback controls stay docked while the slice editor follows the selection. */
#dock {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 40;
}
#selbar {
  position: fixed;
  z-index: 45;
  display: none;
  width: max-content;
  max-width: calc(100vw - 16px);
  flex-wrap: wrap;
  gap: 6px 0;
  padding: 4px 2px;
  background: var(--control);
  border: 1px solid var(--edge);
  border-radius: 7px;
  box-shadow: 0 8px 24px #000a;
}
#selbar.show {
  display: flex;
}
#selbar.offscreen {
  visibility: hidden;
}
@media (prefers-reduced-motion: no-preference) {
  #selbar.show:not(.offscreen) {
    transform-origin: var(--ax, 50%) bottom;
    animation: sbAppear 140ms cubic-bezier(0.2, 0.8, 0.2, 1);
  }
  #selbar.show.below {
    --sb-enter-y: -5px;
    transform-origin: var(--ax, 50%) top;
  }
}
@keyframes sbAppear {
  from {
    opacity: 0;
    transform: translateY(var(--sb-enter-y, 5px)) scale(0.98);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
#selbar::after {
  content: '';
  position: absolute;
  left: var(--ax, 50%);
  bottom: -5px;
  width: 8px;
  height: 8px;
  margin-left: -4px;
  background: var(--control);
  border-right: 1px solid var(--edge);
  border-bottom: 1px solid var(--edge);
  transform: rotate(45deg);
  pointer-events: none;
}
#selbar.below::after {
  bottom: auto;
  top: -5px;
  transform: rotate(225deg);
}
#selbar button,
#selbar select {
  min-width: 24px;
  height: 24px;
  padding: 0 6px;
  font-size: 10.5px;
  letter-spacing: 0.04em;
  border-radius: 3px;
  background: var(--panel);
}
#sb-repeat {
  width: 52px;
  cursor: pointer;
}
#selbar button.on {
  background: var(--on);
  color: var(--on-fg);
  border-color: var(--on);
}
#selbar .sb-section {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  min-width: 0;
  gap: 4px;
  padding: 0 7px;
  border-inline-end: 1px solid var(--line);
}
#selbar .sb-section:last-child {
  border-inline-end: 0;
}
#selbar .sb-label {
  color: var(--dim);
  font-weight: 600;
  font-size: 9.5px;
  letter-spacing: 0.1em;
  line-height: 1;
  text-transform: uppercase;
}
#selbar .sb-grp {
  display: flex;
  gap: 2px;
  align-items: center;
}
#selbar .sb-p {
  white-space: nowrap;
  min-width: 6ch;
  text-align: center;
  font-size: 10px;
  font-variant-numeric: tabular-nums;
  color: var(--fg);
}
#selbar .sb-in {
  height: 24px;
  min-width: 4ch;
  max-width: 22ch;
  padding: 0 6px;
  font-size: 11px;
  font-family: inherit;
  background: var(--panel);
  color: var(--fg);
  border: 1px solid var(--line);
  border-radius: 3px;
  outline: 0;
  text-align: center;
}
#selbar:not(.vals) .sb-in {
  display: none;
}
#selbar.one .sb-in {
  display: block;
}
#selbar.one .sb-vt {
  display: none;
}
#selbar .sb-in:focus {
  border-color: var(--sel);
}
#selbar .sb-in.bad {
  border-color: #e5484d;
  animation: sbShake 0.25s;
}
@keyframes sbShake {
  25% {
    transform: translateX(-3px);
  }
  75% {
    transform: translateX(3px);
  }
}
.marq {
  position: fixed;
  border: 1px dashed var(--sel);
  background: #7be0c31f;
  pointer-events: none;
  z-index: 5;
}
/* selection frame: drawn by ::after so a joined run (hit + tail) selected together reads as one block, with no inner edges */
.cell.sel {
  z-index: 2;
}
.cell.sel::after {
  content: '';
  position: absolute;
  inset: -1px;
  border: 2px solid var(--sel);
  border-radius: inherit;
  pointer-events: none;
}
.cell.pd.sel::after {
  bottom: -4px;
}
.cell.sel + .cell.sel.join::after {
  left: 0;
  border-left-width: 0;
}
.cell.sel.joinR:has(+ .cell.sel.join)::after {
  right: 0;
  border-right-width: 0;
}
.cell.sel + .cell.sel.join::before {
  top: -1px;
  bottom: -1px;
  box-sizing: border-box;
  border-top: 2px solid var(--sel);
  border-bottom: 2px solid var(--sel);
}
.cell.pd.sel + .cell.pd.sel.join::before {
  bottom: -4px;
}
.cell.drop {
  outline: 2px dashed var(--sel);
  outline-offset: -1px;
  z-index: 3;
}
.cell.dropbad {
  outline: 2px solid #e5533d;
  outline-offset: -1px;
}
.card.editing .grid .row {
  cursor: default;
}
.card.editing .cell.sel {
  cursor: grab;
}
.card .grid,
.card .grid .row {
  cursor: pointer;
}
.rps {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding-top: 5px;
  padding-right: 1px;
}
.rp {
  width: 14px;
  height: 18px;
  padding: 0;
  font-size: 8px;
  line-height: 1;
  border-radius: 3px;
  color: var(--dim);
  background: transparent;
  border-color: transparent;
}
.rp {
  opacity: 0;
  transition: opacity 0.12s;
  cursor: pointer;
}
.card:hover .rp {
  opacity: 0.35;
}
.card .rp.hot,
.card .rp:hover {
  opacity: 1;
  color: var(--fg);
  border-color: var(--line);
}
.rp.q,
.rp.on {
  opacity: 1 !important;
}
/* while selecting / dragging / editing, the row ▶s stay out of the way (a queued one still shows) */
.card.editing .rp:not(.q),
body.dragging .rp:not(.q) {
  opacity: 0 !important;
  pointer-events: none;
}
.rp.on {
  color: var(--fg);
  background: var(--acc);
  border-color: var(--acc);
}
.lgut {
  position: relative;
  width: 10px;
  flex: none;
  cursor: ns-resize;
  margin-right: 1px;
}
.lbr {
  position: absolute;
  left: 2px;
  width: 3px;
  border-radius: 2px;
  background: var(--acc);
  transition:
    top 0.12s ease-out,
    height 0.12s ease-out;
  pointer-events: none;
}
.lbr::before,
.lbr::after {
  content: '';
  position: absolute;
  left: 0;
  width: 7px;
  height: 2px;
  background: var(--acc);
  border-radius: 1px;
}
.lbr::before {
  top: 0;
}
.lbr::after {
  bottom: 0;
}
.lbr.full {
  opacity: 0.4;
}
.lgut:hover .lbr {
  opacity: 1;
}
.card .grid .row.outloop {
  opacity: 0.45;
}
.card .btns button.dc {
  background: var(--on);
  color: var(--on-fg);
  border-color: var(--on);
}
.rp.q {
  color: var(--acc);
  border: 1px dashed var(--acc);
  animation: qblink 0.5s steps(1) infinite;
}
@keyframes qblink {
  50% {
    border-color: var(--line);
  }
}
.card.queued {
  border-color: var(--acc);
  border-style: dashed;
  animation: qblink 0.5s steps(1) infinite;
}

.card .top {
  display: flex;
  align-items: center;
  margin-bottom: 5px;
  gap: 6px;
}
.card .top .nm {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.card .top {
  cursor: grab;
}
.card.ph {
  background: transparent;
  border: 1px dashed var(--line);
}
.card.lifting {
  box-shadow: 0 14px 34px #0008;
  border-color: var(--fg);
}
.card.swaptg {
  outline: 2px dashed var(--acc);
  outline-offset: -2px;
}
.card .pl {
  width: 26px;
  height: 26px;
  padding: 0;
  border-radius: 3px;
  display: grid;
  place-items: center;
  flex: none;
  background: var(--panel);
  border: 1px solid var(--fg);
  color: var(--fg);
}
.card .pl svg {
  width: 13px;
  height: 13px;
}
.card .pl .i-play {
  margin-left: 2px;
}
.card .pl .i-stop {
  display: none;
}
.card .pl:hover {
  border-color: var(--acc);
  color: var(--acc);
}
.card .pl.on {
  background: var(--on);
  border-color: var(--on);
  color: var(--on-fg);
}
.card .pl.on .i-play {
  display: none;
}
.card .pl.on .i-stop {
  display: block;
}
.card .pl.q {
  border: 1px dashed var(--acc);
  color: var(--acc);
  animation: qblink 0.5s steps(1) infinite;
}
.card .nm {
  font-weight: 700;
  font-size: 13px;
}
.card .ico {
  display: flex;
  gap: 1px;
}
.card .ico button {
  width: 24px;
  height: 24px;
  padding: 0;
  display: grid;
  place-items: center;
  background: none;
  border: 0;
  color: var(--dim);
  border-radius: 4px;
  cursor: pointer;
}
.card .ico button:hover {
  color: var(--fg);
  background: #ffffff12;
}
.card .ico svg {
  width: 14px;
  height: 14px;
}
.card .ico .dl:hover {
  color: #ff887f;
}
.card .ico .pn.on {
  color: var(--acc);
}
.card .ico .pn.on svg {
  fill: currentColor;
}
.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-bottom: 8px;
}
.tags span {
  font-size: 10px;
  color: var(--dim);
  background: var(--bg);
  border-radius: 3px;
  padding: 1px 6px;
}
.card .genes {
  color: var(--dim);
  font-size: 11px;
  margin-bottom: 6px;
  min-height: 15px;
}
#opts {
  display: flex;
  gap: 8px;
}
#opts label {
  gap: 3px;
}
/* beat lines behind the cells, flush against the left edge of steps 0, 4, 8, 12 (like a DAW grid), all the same weight */
.card .grid {
  width: fit-content;
  padding: 5px 0 2px 3px;
  background-image: linear-gradient(90deg, #e6e6ea33 0 2px, transparent 2px);
  background-size: calc((var(--cw, 15px) + 3px) * 4) 100%;
  background-position: 1px 0;
  background-repeat: repeat-x;
}
.card .grid .cell.cut {
  box-shadow: -2px 0 0 0 var(--acc);
}
.card .grid .cell.rev.cut:not(.hs) {
  box-shadow:
    inset 0 0 0 2px var(--mark),
    -2px 0 0 0 var(--acc);
}
.card .btns {
  display: flex;
  gap: 4px;
  margin-top: 4px;
  flex-wrap: wrap;
}
.card .btns button {
  padding: 2px 7px;
  font-size: 12px;
}
.card.pinned {
  box-shadow: inset 0 2px 0 var(--acc);
}
.card .btns button:disabled {
  opacity: 0.3;
  cursor: default;
}
/* NEW tile: sits in the next card slot */
#newtile {
  position: relative;
  border: 1px dashed var(--line);
  border-radius: 3px;
  min-height: 150px;
  display: flex;
}
#newtile .nt-small {
  position: absolute;
  left: 50%;
  bottom: 10px;
  transform: translateX(-50%);
  display: flex;
  gap: 6px;
}
#newtile .nt-small button {
  padding: 3px 8px;
  font-size: 10px;
  letter-spacing: 0.08em;
  color: var(--dim);
}
#newtile.open .nt-small {
  display: none;
}
#newtile .nt-go {
  flex: 1;
  border: 0;
  background: none;
  color: var(--dim);
  font-size: 12px;
  letter-spacing: 0.12em;
}
#newtile .nt-go:hover {
  color: var(--fg);
  background: #ffffff08;
}
#newtile .nt-form {
  display: none;
  flex: 1;
  flex-direction: column;
  justify-content: center;
  gap: 8px;
  padding: 12px;
}
#newtile.open {
  border-color: var(--fg);
  border-style: solid;
}
#newtile.open .nt-go {
  display: none;
}
#newtile.open .nt-form {
  display: flex;
}
#newtile .nt-in {
  width: 100%;
}
#newtile .nt-btns {
  display: flex;
  gap: 6px;
}
#newtile p {
  margin: 0;
  font-size: 10px;
  color: var(--dim);
  line-height: 1.5;
}
textarea {
  width: 100%;
  height: 110px;
}
/* Style pad and pattern generation share a deck above the edit tools. */
.generation-deck {
  display: grid;
  grid-template-columns: minmax(286px, 360px) minmax(0, 1fr);
  border-bottom: 1px solid var(--line);
  padding: 12px 18px;
  background: var(--panel);
}
.generation-controls {
  align-content: center;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px 22px;
  padding: 0 0 0 26px;
  border-left: 1px solid var(--line);
}
.generation-controls h1 {
  flex-basis: 100%;
  font-size: 17px;
  font-weight: 600;
}
.h1-cur {
  color: var(--acc);
}
.generation-mod.view-mod {
  margin-left: auto;
}
/* the drummer plays along, in a box to the left of the waveform; without the sprite the waveform takes the row */
.drummer-panel {
  flex: none;
  width: 118px;
  margin: 0;
}
.drummer-panel figcaption {
  margin-top: 2px;
  text-align: end;
  font-size: 8px;
}
.drummer-panel a {
  color: var(--dim);
  text-underline-offset: 2px;
}
.drummer-panel a:hover,
.drummer-panel a:focus-visible {
  color: var(--acc);
}
.drummer-panel:has(> #drummer[hidden]) {
  display: none;
}
#drummer {
  display: block;
  width: 100%;
  height: 92px;
  /* The sprite uses black ink and multiply. Invert it on the complements of paper and line. */
  background: #dfdfda;
  border: 1px solid #cdcdc5;
  filter: invert(1);
  border-radius: 3px;
}
#wave {
  position: relative;
  align-self: flex-start;
  flex-basis: calc(100% - 118px - 22px);
  height: 92px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 3px;
}
.drummer-panel:has(> #drummer[hidden]) + #wave {
  flex-basis: 100%;
}
#wave canvas {
  display: block;
  width: 100%;
  height: 100%;
}
.wave-head {
  position: absolute;
  left: 0;
  top: 2px;
  bottom: 14px;
  width: 1.5px;
  background: var(--acc);
  pointer-events: none;
}
.generation-mod {
  display: grid;
  gap: 6px;
}
.generation-mod .row {
  display: flex;
  align-items: center;
  min-height: 64px;
  gap: 12px;
}
.generation-mod .togs {
  flex-wrap: wrap;
}
@media (max-width: 700px) {
  .generation-deck {
    grid-template-columns: minmax(0, 1fr);
    padding: 10px 12px;
  }
  .generation-controls {
    padding: 12px 4px 0;
    border-left: 0;
    border-top: 1px solid var(--line);
    gap: 8px 20px;
  }
}
.mod {
  display: grid;
  grid-template-rows: 12px 64px;
  row-gap: 8px;
  padding: 0 18px;
  border-left: 1px solid var(--line);
}
.mod:first-child {
  border-left: 0;
}
.mod > .row {
  display: flex;
  align-items: center;
  gap: 16px;
}
h1 {
  font-size: 13px;
  line-height: 1.25;
  letter-spacing: 0.14em;
  margin: 0;
  font-weight: 700;
}
.cap {
  color: var(--dim);
  font-size: 9px;
  letter-spacing: 0.16em;
  line-height: 12px;
}
.knob {
  width: 44px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  cursor: ns-resize;
  user-select: none;
  touch-action: none;
}
.knob svg {
  width: 36px;
  height: 36px;
  display: block;
}
.knob .v {
  font-size: 11px;
  line-height: 13px;
}
.knob .l {
  font-size: 8.5px;
  line-height: 11px;
  color: var(--dim);
  letter-spacing: 0.14em;
}
.knob.hero .v {
  font-weight: 700;
}
#tip {
  position: fixed;
  z-index: 20;
  max-width: 270px;
  background: var(--panel);
  border: 1px solid var(--fg);
  border-radius: 3px;
  padding: 8px 10px;
  font-size: 11px;
  line-height: 1.45;
  color: var(--fg);
  box-shadow: 0 6px 20px #0008;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.12s;
  white-space: pre-line;
}
#tip.show {
  opacity: 1;
}
body.dragging,
body.dragging * {
  user-select: none !important;
  -webkit-user-select: none !important;
  cursor: var(--dragcur) !important;
}
.kin {
  width: 44px;
  height: 13px;
  padding: 0;
  font-size: 11px;
  text-align: center;
  border-radius: 2px;
  border-color: var(--acc);
}
.seg,
.togs {
  display: flex;
  gap: 4px;
}
.seg button,
.tog {
  height: 26px;
  padding: 0 10px;
  font-size: 10.5px;
  letter-spacing: 0.08em;
  border-radius: 3px;
  background: var(--panel);
}
.seg {
  gap: 0;
}
.seg button {
  border-radius: 0;
  margin-left: -1px;
}
.seg button:first-child {
  border-radius: 3px 0 0 3px;
  margin-left: 0;
}
.seg button:last-child {
  border-radius: 0 3px 3px 0;
}
.seg button.on,
.tog.on {
  background: var(--on);
  color: var(--on-fg);
  border-color: var(--on);
}
#gen {
  height: 30px;
  padding: 0 14px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.1em;
  background: var(--on);
  color: var(--on-fg);
  border-color: var(--on);
}
#gen:hover {
  background: #a1ead7;
}
.kedit .kr {
  column-gap: 16px;
}
.kedit kbd {
  font: inherit;
  font-size: 9.5px;
  min-width: 52px;
  color: var(--fg);
  letter-spacing: 0.04em;
}
#dj {
  background: var(--panel);
  border-top: 1px solid var(--fg);
  display: flex;
  flex-wrap: wrap; /* narrow windows: modules drop to a second row instead of clipping */
  row-gap: 10px;
  padding: 10px 6px;
}
#dj .mod.fmod {
  flex: 1;
  min-width: 260px;
  max-width: 620px;
}
#fader {
  flex: 1;
  height: 40px;
  display: flex;
  align-items: center;
  cursor: ew-resize;
  touch-action: none;
  /* tick scale behind the track: a mark every 5%, a longer one every 25% */
  background-image:
    repeating-linear-gradient(90deg, #a9a69c 0 1px, transparent 1px 25%),
    repeating-linear-gradient(90deg, var(--line) 0 1px, transparent 1px 5%);
  background-size:
    calc(100% + 1px) 22px,
    calc(100% + 1px) 12px;
  background-position:
    0 50%,
    0 50%;
  background-repeat: no-repeat;
}
#ftrack {
  position: relative;
  width: 100%;
  height: 2px;
  background: var(--line);
}
#ftrack::before {
  content: '';
  position: absolute;
  left: 50%;
  top: -8px;
  bottom: -8px;
  width: 1px;
  background: var(--faint);
}
#ffill {
  position: absolute;
  top: 0;
  bottom: 0;
  background: var(--acc);
}
#fcap {
  position: absolute;
  top: 50%;
  width: 10px;
  height: 26px;
  margin: -13px 0 0 -5px;
  background: var(--fg);
  border-radius: 2px;
}
body {
  padding-bottom: 110px;
}
.card.ro {
  border-style: dashed;
}
.card.ro .sh,
.card.ro .pn,
.card.ro .rs {
  display: none;
}
.card.ro .nm {
  letter-spacing: 0.12em;
}
#ideas {
  align-self: center;
  padding-right: 12px;
}
.style-mixer {
  width: min(100%, 360px);
}
.style-mixer-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.style-field {
  position: relative;
  height: 198px;
}
.style-pad,
.style-tip,
.style-origin,
.style-puck {
  position: absolute;
  translate: -50% -50%;
}
.style-pad {
  top: 50%;
  left: 50%;
  width: 124px;
  height: 124px;
  border: 0;
  background: none;
  cursor: crosshair;
  touch-action: none;
}
.style-polygon,
.style-polygon::before {
  position: absolute;
  inset: 0;
  clip-path: var(--style-outline);
}
.style-polygon {
  background: var(--fg);
}
.style-polygon::before {
  content: '';
  inset: 1px;
  background: var(--paper);
}
.style-polygon > span {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 50%;
  height: 1px;
  background: var(--line);
  transform: rotate(var(--spoke));
  transform-origin: left center;
}
.style-puck {
  width: 13px;
  height: 13px;
  border: 2px solid var(--panel);
  border-radius: 50%;
  background: var(--acc);
  box-shadow: 0 0 0 1px var(--fg);
  pointer-events: none;
}
.style-tip,
.style-origin {
  left: calc(50% + var(--tip-x) * 120px);
  top: calc(50% + var(--tip-y) * 82px);
}
.style-origin {
  border: 1px dashed var(--dim);
  border-radius: 4px;
  pointer-events: none;
}
.style-tip {
  min-width: 73px;
  padding: 2px 5px;
  color: var(--dim);
  background: transparent;
  border-color: transparent;
  font-size: 10px;
  letter-spacing: 0.04em;
  cursor: grab;
  touch-action: none;
  user-select: none;
}
.style-tip.style-tip-lifted {
  z-index: 1;
  cursor: grabbing;
  background: var(--panel);
  box-shadow: 0 3px 10px #0008;
}
.style-tip.style-tip-target {
  outline: 1px dashed var(--acc);
  outline-offset: 2px;
}
.style-tip.mixed {
  color: var(--fg);
  border-color: var(--line);
  background: var(--panel);
}
.style-tip:hover,
.style-tip[aria-pressed='true'] {
  border-color: var(--acc);
}
.style-share {
  display: block;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}
.style-tip.mixed .style-share {
  color: var(--fg);
  font-weight: 600;
}
body.nokey #srcmap {
  display: none;
}
#ideasReset {
  height: 26px;
  padding: 0 10px;
  font-size: 10.5px;
  letter-spacing: 0.08em;
  border-radius: 3px;
}
/* Hovering a mixed style highlights the steps it changes. */
.card.marking .grid .cell:not(.mk),
body.marking .card:not(.marking) .grid .cell {
  opacity: 0.22;
}
