/* Aleatory Theme: black field, amber type, one piano roll instead of labeled computer-key rows. */

html.theme-aleatory {
  color-scheme: dark;
  --bg: #0b0b0c;
  --panel: #141416;
  --edge: #332a1c;
  --muted: #a2957f;
  --text: #ece3d2;
  --mint: #ff9e2c;
  --amber: #ffc061;
  --violet: #e8c15a;
  --dim: #6d6254;
  background: #0b0b0c;
  color: #ece3d2;
}

html.theme-aleatory body {
  background: #0b0b0c;
  color: #ece3d2;
  font-family: "DejaVu Sans Mono", "Courier New", ui-monospace, monospace;
}

html.theme-aleatory header {
  background: #0b0b0c;
  border-bottom: 2px solid #ff9e2c;
  padding: 8px 12px;
}

html.theme-aleatory h1,
html.theme-aleatory h2,
html.theme-aleatory h3 {
  color: #ff9e2c;
}

html.theme-aleatory h1 {
  font-size: 18px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

html.theme-aleatory h1 span { color: #ffc061; }
html.theme-aleatory .eyebrow,
html.theme-aleatory .brand-byline,
html.theme-aleatory .brand-copyright,
html.theme-aleatory .intro p { color: #a2957f; }

html.theme-aleatory a { color: #ff9e2c; }
html.theme-aleatory a:hover { color: #ffc061; }

html.theme-aleatory button,
html.theme-aleatory input,
html.theme-aleatory select,
html.theme-aleatory textarea {
  font-family: inherit;
  border-radius: 5px;
  border-color: #332a1c;
  background: #1b1b1f;
  color: #ece3d2;
}

html.theme-aleatory button {
  border-color: #ff9e2c;
  background: transparent;
  color: #ff9e2c;
}

html.theme-aleatory button:hover {
  background: #ff9e2c;
  color: #0b0b0c;
  border-color: #ff9e2c;
}

html.theme-aleatory button.primary,
html.theme-aleatory button.primary:hover {
  background: #ff9e2c;
  border-color: #ff9e2c;
  color: #0b0b0c;
}

html.theme-aleatory button.primary:hover { background: #ffc061; }

html.theme-aleatory button.danger {
  background: transparent;
  color: #ff7a59;
  border-color: #ff7a59;
}

html.theme-aleatory button.danger:hover {
  background: #ff7a59;
  color: #0b0b0c;
}

html.theme-aleatory button[aria-pressed="true"],
html.theme-aleatory .workspace-buttons button[aria-pressed="true"],
html.theme-aleatory .lk-pitch button[aria-pressed="true"] {
  background: #ff9e2c;
  border-color: #ff9e2c;
  color: #0b0b0c;
}

html.theme-aleatory button:focus-visible,
html.theme-aleatory input:focus-visible,
html.theme-aleatory select:focus-visible,
html.theme-aleatory textarea:focus-visible {
  outline: 2px solid #ffd280;
  outline-offset: 2px;
}

html.theme-aleatory main { padding: 8px 10px 12px; }
html.theme-aleatory .intro { margin: 0 0 8px; gap: 10px; }
html.theme-aleatory .intro h2 {
  font-size: 18px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

html.theme-aleatory .panel,
html.theme-aleatory .strip,
html.theme-aleatory .card,
html.theme-aleatory .workspace-nav {
  background: #141416;
  color: #ece3d2;
  border: 1px solid #332a1c;
  border-radius: 8px;
  box-shadow: none;
}

html.theme-aleatory .strip { padding: 6px 8px; margin-bottom: 8px; }
html.theme-aleatory .panel { margin-bottom: 8px; }
html.theme-aleatory .workspace-nav { margin: 6px 0; padding: 6px 8px; }
html.theme-aleatory .workspace-subbar { border-top-color: #332a1c; }
html.theme-aleatory .workspace-status,
html.theme-aleatory .workspace-pin,
html.theme-aleatory .workspace-jump,
html.theme-aleatory .workspace-heading p { color: #a2957f; }
html.theme-aleatory .workspace-heading h2 { color: #ff9e2c; }

html.theme-aleatory .sectionbar {
  background: transparent;
  color: #ff9e2c;
  border-bottom: 1px solid #332a1c;
  padding: 6px 10px;
}

html.theme-aleatory .sectionbar h3,
html.theme-aleatory .sectionbar .tag,
html.theme-aleatory #liveNote { color: #ffc061; }
html.theme-aleatory .sectionbar .index { color: #a2957f; }

html.theme-aleatory .performance-toolbar { background: #101012; }
html.theme-aleatory .performance-toolbar label,
html.theme-aleatory .micro,
html.theme-aleatory .lk-theme { color: #a2957f; }

html.theme-aleatory .functionbar { gap: 3px; margin-bottom: 6px; }
html.theme-aleatory .functionbar button,
html.theme-aleatory .navigation button,
html.theme-aleatory .pad {
  background: #141416;
  color: #ffc061;
  border-color: #332a1c;
  border-bottom-width: 2px;
  border-radius: 3px;
  box-shadow: none;
}

html.theme-aleatory .functionbar button:hover,
html.theme-aleatory .navigation button:hover,
html.theme-aleatory .pad:hover {
  background: #26262b;
  color: #ffc061;
}

html.theme-aleatory .functionbar b,
html.theme-aleatory .navigation b,
html.theme-aleatory .pad b,
html.theme-aleatory .pad span { color: #ffc061; }

html.theme-aleatory .functionbar button,
html.theme-aleatory .navigation button,
html.theme-aleatory .pad {
  padding: 0 2px;
  justify-content: center;
  align-items: center;
}

html.theme-aleatory .functionbar span,
html.theme-aleatory .navigation span,
html.theme-aleatory .pad b { display: none; }

html.theme-aleatory .functionbar b,
html.theme-aleatory .navigation b { margin: 0; font-size: 8px; }

html.theme-aleatory .functionbar button { height: 20px; }

html.theme-aleatory .pad span {
  display: block;
  font-size: 7px;
  line-height: 1.05;
  text-align: center;
  overflow: hidden;
}

html.theme-aleatory .pad.kick,
html.theme-aleatory .pad.hands { color: #ffc061; }
html.theme-aleatory .pad.active,
html.theme-aleatory .pad.flash {
  background: #ff9e2c;
  color: #0b0b0c;
  border-color: #ffc061;
  transform: none;
  box-shadow: none;
}

html.theme-aleatory .pad.active span,
html.theme-aleatory .pad.flash span,
html.theme-aleatory .pad.active b,
html.theme-aleatory .pad.flash b { color: #0b0b0c; }

html.theme-aleatory .board {
  grid-template-columns: minmax(520px, 1fr) 96px 168px;
  gap: 6px;
  min-width: 800px;
  align-items: stretch;
}

html.theme-aleatory .navigation,
html.theme-aleatory .drumpad {
  grid-template-rows: repeat(5, 22px);
  gap: 2px;
}

html.theme-aleatory .keyboard-foot {
  padding: 2px 8px 4px;
  gap: 10px;
  color: #a2957f;
}

html.theme-aleatory .keyboard-foot span:nth-child(1),
html.theme-aleatory .keyboard-foot span:nth-child(2) { display: none; }

/* One piano roll. Amber naturals, black keys layered on the octave pattern. No captions. */
html.theme-aleatory .keyboard.piano-roll {
  gap: 0;
  min-width: 0;
}

html.theme-aleatory .keyboard.piano-roll > .keyrow { display: none; }

html.theme-aleatory .piano {
  position: relative;
  height: 118px;
  width: 100%;
  min-width: 520px;
  user-select: none;
}

html.theme-aleatory .piano-whites {
  display: flex;
  height: 100%;
  position: relative;
  z-index: 1;
}

html.theme-aleatory .pkey.white {
  position: relative;
  flex: 1 1 0;
  min-width: 0;
  height: 100%;
  background: linear-gradient(#ffd7a1, #e8922a 58%, #c56d12);
  border: 1px solid #6a4010;
  border-top: 0;
  border-radius: 0 0 4px 4px;
  box-shadow: inset 0 -10px 10px rgba(90, 40, 0, 0.28);
}

html.theme-aleatory .pkey.white.octave {
  box-shadow: inset 2px 0 0 #1a120c, inset 0 -10px 10px rgba(90, 40, 0, 0.28);
}

html.theme-aleatory .pkey.white.anchor {
  box-shadow: inset 0 -3px 0 #ff9e2c, inset 0 -10px 10px rgba(90, 40, 0, 0.28);
}

html.theme-aleatory .pkey.white.gap {
  background: #1a1612;
  border-color: #3a3228;
  box-shadow: inset 0 8px 12px rgba(0, 0, 0, 0.45);
}

html.theme-aleatory .pkey.white.gap.octave { box-shadow: inset 2px 0 0 #3a2e20; }

html.theme-aleatory .pkey.white:not(.gap):hover {
  background: linear-gradient(#ffe3bf, #f0a03a 58%, #d07716);
}

html.theme-aleatory .pkey.white:has(.key.active),
html.theme-aleatory .pkey.white:has(.key.active):hover {
  background: linear-gradient(#fff4dc, #ffb347);
  box-shadow: 0 0 12px #ff9e2c99;
}

html.theme-aleatory .piano-blacks {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 58%;
  z-index: 2;
  pointer-events: none;
}

html.theme-aleatory .pkey.black {
  position: absolute;
  top: 0;
  height: 100%;
  pointer-events: auto;
  width: calc(100% / var(--whites) * 0.58);
  left: calc(100% / var(--whites) * (var(--slot) - 0.29));
  background: linear-gradient(#2c2c30, #0b0b0c 46%);
  border: 1px solid #000;
  border-top: 0;
  border-radius: 0 0 3px 3px;
  box-shadow: 1px 3px 3px rgba(0, 0, 0, 0.72), inset 0 0 0 1px #3a3228;
}

html.theme-aleatory .pkey.black:hover { background: linear-gradient(#3a3a40, #16161a 46%); }

html.theme-aleatory .pkey.black:has(.key.active),
html.theme-aleatory .pkey.black:has(.key.active):hover {
  background: #ff9e2c;
  border-color: #ffc061;
  box-shadow: 0 0 10px #ff9e2c88;
}

html.theme-aleatory .pkey .key,
html.theme-aleatory .pkey .key:hover,
html.theme-aleatory .pkey .key.active,
html.theme-aleatory .pkey .key.active:hover {
  position: absolute;
  inset: 0;
  width: auto;
  height: auto;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  transform: none;
  min-width: 0;
  flex: none;
  color: transparent;
}

html.theme-aleatory .key .keycap,
html.theme-aleatory .key .notelabel,
html.theme-aleatory .key.conditional:after { display: none; }

html.theme-aleatory .pkey .key:focus-visible {
  outline: 2px solid #ffd280;
  outline-offset: -3px;
}

html.theme-aleatory #lkMulti {
  background: #0b0b0c;
  color: #ece3d2;
  border-top: 2px solid #ff9e2c;
  box-shadow: none;
}

html.theme-aleatory .lk-bar label,
html.theme-aleatory #lkHint,
html.theme-aleatory #lkStatus,
html.theme-aleatory #lkFile,
html.theme-aleatory #lkAccount { color: #a2957f; }

html.theme-aleatory #lkFile a { color: #ff9e2c; }
html.theme-aleatory #lkPlace { color: #ff9e2c; }

html.theme-aleatory #lkRoll {
  height: clamp(120px, 22vh, 180px);
  background: #0b0b0c;
  border: 1px solid #332a1c;
  border-radius: 5px;
}

html.theme-aleatory #lkRoll:focus { outline: 2px solid #ffd280; outline-offset: 2px; }
html.theme-aleatory .lk-track { border-bottom-color: #332a1c; }
html.theme-aleatory .lk-track.lk-armed { outline-color: #ff9e2c; }

html.theme-aleatory .open-entry-banner {
  background: #141416;
  border: 1px solid #332a1c;
  border-radius: 8px;
}
html.theme-aleatory .open-entry-banner strong { color: #ff9e2c; }
html.theme-aleatory .open-entry-banner span { color: #a2957f; }

html.theme-aleatory footer { color: #a2957f; }
html.theme-aleatory #toast {
  background: #1b1b1f;
  color: #ffc061;
  border: 1px solid #ff9e2c;
  border-radius: 6px;
}

@media (max-width: 850px) {
  html.theme-aleatory .board { min-width: 0; }
}

/* One screen. Essays, credits, and duplicate transport stay out of the way.
   The piano grows into the space that remains. Other themes are untouched. */

html.theme-aleatory body {
  height: 100dvh;
  max-height: 100dvh;
  overflow: hidden;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  grid-template-columns: minmax(0, 1fr);
  line-height: 1.2;
  padding-bottom: 0 !important;
}

html.theme-aleatory body:has(#lkMulti),
html.theme-aleatory body:has(#lkMulti.lk-collapsed),
html.theme-aleatory body:has(#lkMulti.lk-tall:not(.lk-collapsed)) {
  padding-bottom: 0 !important;
}

html.theme-aleatory .brandmark,
html.theme-aleatory .eyebrow,
html.theme-aleatory .brand-credit,
html.theme-aleatory h1 span,
html.theme-aleatory #lkRecord,
html.theme-aleatory .intro,
html.theme-aleatory .open-entry-banner,
html.theme-aleatory footer,
html.theme-aleatory .workspace-heading,
html.theme-aleatory .workspace-subbar,
html.theme-aleatory .workspace-safety,
html.theme-aleatory .workspace-all-title,
html.theme-aleatory .patchdesc,
html.theme-aleatory .keyboard-foot,
html.theme-aleatory .help,
html.theme-aleatory .arp-grid-head,
html.theme-aleatory .arp-grid-readouts,
html.theme-aleatory .fxflow,
html.theme-aleatory #lkHint,
html.theme-aleatory #helpToggle,
html.theme-aleatory #keyboardTestToggle,
html.theme-aleatory .sectionbar h3,
html.theme-aleatory .sectionbar h4,
html.theme-aleatory .sectionbar .index,
html.theme-aleatory .sectionbar .tag,
html.theme-aleatory details:not(.soundbank),
html.theme-aleatory .lk-prose:not(details):not(footer) {
  display: none !important;
}

html.theme-aleatory .sectionbar:not(:has(button, input, select, #liveNote)) {
  display: none;
}

html.theme-aleatory header {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  padding: 4px 8px;
  flex-wrap: nowrap;
}

html.theme-aleatory .brand { min-width: 0; flex: 1 1 auto; }
html.theme-aleatory h1 {
  margin: 0;
  font-size: 13px;
  line-height: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

html.theme-aleatory header > a.site-home {
  flex: 0 0 auto;
  z-index: 2;
}

html.theme-aleatory .topactions {
  margin-left: auto;
  flex: 0 1 auto;
  width: auto;
  min-width: 0;
  gap: 4px;
  flex-wrap: nowrap;
}

html.theme-aleatory .lk-theme { font-size: 0; gap: 0; }
html.theme-aleatory .lk-theme select { font-size: 11px; max-width: 128px; padding: 2px 4px; }

html.theme-aleatory button { padding: 3px 7px; }
html.theme-aleatory .topactions button { font-size: 11px; }
html.theme-aleatory a.site-home { padding: 3px 8px; font-size: 12px; }

html.theme-aleatory main {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: auto auto minmax(120px, 1fr) auto;
  grid-template-areas:
    "nav"
    "strip"
    "keys"
    "tools";
  min-height: 0;
  min-width: 0;
  overflow: hidden;
  max-width: none;
  width: 100%;
  margin: 0;
  padding: 4px 6px;
  gap: 4px;
}

html.theme-aleatory main:has(.performance[hidden]) {
  grid-template-rows: auto auto auto minmax(0, 1fr);
  grid-template-areas:
    "nav"
    "strip"
    "focus"
    "tools";
}

html.theme-aleatory #workspaceNav { grid-area: nav; margin: 0; padding: 2px 4px; }
html.theme-aleatory .workspace-buttons { flex-wrap: nowrap; gap: 3px; }
html.theme-aleatory .workspace-buttons button {
  min-height: 0;
  padding: 3px 8px;
  font-size: 11px;
  white-space: nowrap;
}

html.theme-aleatory #workspaceMusicFocus {
  grid-area: focus;
  margin: 0;
  padding: 4px 8px;
  font-size: 11px;
}

html.theme-aleatory .strip {
  grid-area: strip;
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 8px;
  margin: 0;
  padding: 3px 6px;
  min-width: 0;
  overflow-x: auto;
}

html.theme-aleatory .preset-label {
  flex: 1 1 160px;
  flex-direction: row;
  align-items: center;
  gap: 6px;
  min-width: 140px;
  font-size: 9px;
  letter-spacing: 0.06em;
}

html.theme-aleatory .preset-label select {
  flex: 1 1 auto;
  min-width: 0;
  font-size: 12px;
  padding: 1px 4px;
}

html.theme-aleatory .compact-control,
html.theme-aleatory .transpose,
html.theme-aleatory .lk-pitch,
html.theme-aleatory .volume {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 4px;
  margin: 0;
  font-size: 9px;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

html.theme-aleatory .compact-control label,
html.theme-aleatory .transpose > span,
html.theme-aleatory .lk-pitch > span,
html.theme-aleatory .volume {
  grid-column: auto;
}

html.theme-aleatory .compact-control input { width: 52px; padding: 2px 4px; }
html.theme-aleatory .transpose button,
html.theme-aleatory .lk-pitch button { padding: 2px 6px; min-width: 28px; }
html.theme-aleatory .volume { flex: 0 1 200px; min-width: 120px; }
html.theme-aleatory .volume input { width: 88px; min-width: 48px; grid-row: auto; }

html.theme-aleatory .performance {
  grid-area: keys;
  margin: 0;
  min-height: 0;
  min-width: 0;
  height: 100%;
  overflow: hidden;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-rows: auto minmax(0, 1fr);
  grid-template-areas:
    "toolbar note"
    "surface surface";
}

html.theme-aleatory .performance .sectionbar {
  grid-area: note;
  margin: 0;
  padding: 2px 6px;
  border: 0;
  align-self: center;
  gap: 6px;
}

html.theme-aleatory #liveNote {
  font-size: 11px;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

html.theme-aleatory .performance .sectionbar button { padding: 2px 6px; font-size: 10px; }

html.theme-aleatory .performance-toolbar {
  grid-area: toolbar;
  margin: 0;
  padding: 2px 6px;
  gap: 4px 8px;
  flex-wrap: nowrap;
  min-width: 0;
  overflow-x: auto;
  background: transparent;
}

html.theme-aleatory .performance-toolbar select {
  width: auto;
  max-width: none;
  font-size: 11px;
  padding: 2px 4px;
}

html.theme-aleatory #performanceSurface {
  grid-area: surface;
  min-height: 0;
  min-width: 0;
  padding: 2px 4px 4px;
  overflow: auto;
  display: grid;
  grid-template-columns: minmax(420px, 1fr) 84px 148px;
  grid-template-rows: auto minmax(72px, 1fr);
  gap: 3px 4px;
  align-items: stretch;
}

html.theme-aleatory .functionbar {
  grid-column: 1;
  grid-row: 1;
  margin: 0;
  min-width: 0;
  gap: 2px;
}

html.theme-aleatory .functionbar button { height: 16px; }

html.theme-aleatory .board {
  display: contents;
  min-width: 0;
}

html.theme-aleatory .keyboard,
html.theme-aleatory .keyboard.piano-roll {
  grid-column: 1;
  grid-row: 2;
  min-width: 0;
  min-height: 0;
  height: 100%;
}

html.theme-aleatory .navigation {
  display: grid;
  grid-column: 2;
  grid-row: 1 / span 2;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  grid-template-rows: repeat(5, minmax(0, 1fr));
  gap: 2px;
  height: 100%;
  min-height: 0;
}

html.theme-aleatory .drumpad {
  display: grid;
  grid-column: 3;
  grid-row: 1 / span 2;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  grid-template-rows: repeat(5, minmax(0, 1fr));
  gap: 2px;
  height: 100%;
  min-height: 0;
}

html.theme-aleatory .navigation button,
html.theme-aleatory .pad {
  height: 100%;
  min-height: 0;
  padding: 0 1px;
}

html.theme-aleatory .piano {
  height: 100%;
  min-height: 72px;
  min-width: 420px;
}

html.theme-aleatory #workspaceContent {
  grid-area: tools;
  min-height: 0;
  min-width: 0;
  max-height: 28vh;
  margin: 0;
  overflow: auto;
}

/* Play is keys, the instrument strip, and the multitrack roll.
   The arpeggio and Motion panels stay in the document for the
   existing scripts, and they take no space on the keys view. */
html.theme-aleatory .phrasepanel,
html.theme-aleatory #motionStudio { display: none !important; }

html.theme-aleatory main:has(#workspacePage-play:not([hidden])):not(:has(#workspacePage-sound:not([hidden]), #workspacePage-rhythm:not([hidden]), #workspacePage-record:not([hidden]), #workspacePage-tools:not([hidden]))) {
  grid-template-rows: auto auto minmax(0, 1fr);
  grid-template-areas:
    "nav"
    "strip"
    "keys";
}

html.theme-aleatory main:has(#workspacePage-play:not([hidden])):not(:has(#workspacePage-sound:not([hidden]), #workspacePage-rhythm:not([hidden]), #workspacePage-record:not([hidden]), #workspacePage-tools:not([hidden]))) #workspaceContent {
  display: none;
}

html.theme-aleatory .sc-intro,
html.theme-aleatory .sc-indent,
html.theme-aleatory .sc-subhead,
html.theme-aleatory .pb-intro,
html.theme-aleatory .pb-kicker,
html.theme-aleatory .if-explainer,
html.theme-aleatory #motionStudio .sc-message,
html.theme-aleatory #motionStudio .sectionbar { display: none !important; }

html.theme-aleatory #workspacePage-play {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

html.theme-aleatory #workspacePage-play .phrasepanel { order: 1; }
html.theme-aleatory #workspacePage-play #motionStudio { order: 2; }

html.theme-aleatory #motionStudio { margin: 0; padding: 0; }

html.theme-aleatory #motionStudio .sc-toolbar,
html.theme-aleatory #motionStudio .sc-controls {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 4px 8px;
  margin: 0;
  padding: 2px 6px;
  overflow-x: auto;
}

html.theme-aleatory #motionStudio .sc-field,
html.theme-aleatory #motionStudio .sc-check {
  flex: 0 0 auto;
  flex-direction: row;
  align-items: center;
  gap: 4px;
  width: auto;
  min-width: max-content;
  white-space: nowrap;
}

html.theme-aleatory #motionStudio .sc-field > select,
html.theme-aleatory #motionStudio .sc-field > input { width: auto; max-width: none; }

html.theme-aleatory #motionStudio .sc-label { font-size: 9px; letter-spacing: 0.04em; }
html.theme-aleatory #motionStudio .sc-check { font-size: 11px; gap: 4px; }
html.theme-aleatory #motionStudio .sc-range { width: auto; }
html.theme-aleatory #motionStudio .sc-range input { width: 64px; min-width: 64px; }

html.theme-aleatory #motionStudio .sc-steps-scroll {
  max-height: 48px;
  margin: 2px 6px;
  width: auto;
  flex: 1 1 100%;
}

html.theme-aleatory #motionStudio .sc-steps { font-size: 10px; }
html.theme-aleatory #motionStudio .sc-steps th,
html.theme-aleatory #motionStudio .sc-steps td { padding: 1px 3px; }
html.theme-aleatory #motionStudio .sc-steps input[type="number"] { width: 44px; padding: 0 2px; }

html.theme-aleatory #motionStudio .sc-live {
  margin: 0;
  padding: 1px 6px 2px;
  border: 0;
  background: transparent;
  font-size: 10px;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

html.theme-aleatory main:has(.performance[hidden]) #workspaceContent {
  max-height: none;
  height: 100%;
}

html.theme-aleatory .phrasepanel {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 2px 8px;
  margin: 0;
  overflow-x: auto;
}

html.theme-aleatory .phrasepanel .sectionbar {
  width: auto;
  margin: 0;
  padding: 2px 4px 2px 6px;
  border: 0;
}

html.theme-aleatory .phrasegrid,
html.theme-aleatory .phrase-controls,
html.theme-aleatory .echo-controls,
html.theme-aleatory .arp-grid-card,
html.theme-aleatory .arp-grid-controls {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 4px 8px;
  margin: 0;
  padding: 2px 4px;
  border: 0;
  background: transparent;
  flex: 0 0 auto;
  min-width: max-content;
}

html.theme-aleatory .phrase-controls label,
html.theme-aleatory .echo-controls label,
html.theme-aleatory .arp-grid-controls label {
  flex: 0 0 auto;
  flex-direction: row;
  align-items: center;
  gap: 4px;
  margin: 0;
  font-size: 9px;
  letter-spacing: 0.04em;
  min-width: max-content;
  white-space: nowrap;
}

html.theme-aleatory .phrase-controls input[type="range"] { width: 72px; }
html.theme-aleatory .arp-grid-controls select { width: auto; max-width: none; }
html.theme-aleatory .echo-controls strong { font-size: 11px; }
html.theme-aleatory #arpGridStatus {
  margin: 0;
  font-size: 10px;
  max-width: 220px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

html.theme-aleatory .phrase-monitor {
  width: auto;
  flex: 0 0 auto;
  margin: 0;
  padding: 2px 6px;
  gap: 8px;
  font-size: 10px;
  white-space: nowrap;
}

html.theme-aleatory #lkMulti {
  position: static;
  max-height: none;
  padding: 3px 8px 4px;
  min-height: 0;
  overflow: hidden;
  flex: 0 0 auto;
}

html.theme-aleatory #workspace-record,
html.theme-aleatory #workspace-tools,
html.theme-aleatory #workspace-all,
html.theme-aleatory #workspacePage-record,
html.theme-aleatory #workspacePage-tools { display: none !important; }

html.theme-aleatory #lkResize {
  flex: 0 0 auto;
  height: 10px;
  margin: -2px -8px 2px;
  cursor: ns-resize;
  touch-action: none;
  position: relative;
}

html.theme-aleatory #lkResize::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 3px;
  width: 42px;
  height: 3px;
  margin-left: -21px;
  border-radius: 2px;
  background: #ff9e2c;
}

html.theme-aleatory #lkResize:focus-visible {
  outline: 2px solid #ffd280;
  outline-offset: -2px;
}

html.theme-aleatory #lkMulti:not(.lk-tall) .lk-track > .lk-sound,
html.theme-aleatory #lkMulti:not(.lk-tall) .lk-track > input[type="range"],
html.theme-aleatory #lkMulti:not(.lk-tall) .lk-track > .lk-actions { display: none !important; }

html.theme-aleatory #lkMulti.lk-collapsed { max-height: none; }

html.theme-aleatory #lkMulti.lk-tall:not(.lk-collapsed) {
  height: auto;
  max-height: none;
  overflow: hidden;
}

html.theme-aleatory .lk-bar {
  flex-wrap: nowrap;
  gap: 4px;
  overflow-x: auto;
  margin: 0;
}

html.theme-aleatory .lk-bar button,
html.theme-aleatory .lk-bar input,
html.theme-aleatory .lk-bar select { padding: 3px 6px; font-size: 11px; }

html.theme-aleatory .lk-bar input[type="text"] { width: 108px; }
html.theme-aleatory .lk-bar input[type="number"] { width: 58px; }
html.theme-aleatory #lkRecordDock { min-width: 0; min-height: 0; font-size: 12px; }

html.theme-aleatory .lk-body {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
  margin-top: 2px;
  min-height: 0;
  flex: 0 0 auto;
}
html.theme-aleatory #lkRoll {
  order: -1;
  flex: 1 0 100%;
  height: clamp(120px, 22vh, 180px);
  margin: 0 0 2px;
}
html.theme-aleatory #lkTracks {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 4px;
  min-height: 0;
  max-height: 24px;
  overflow: hidden;
  flex: 1 1 auto;
}
html.theme-aleatory .lk-track {
  flex: 1 1 auto;
  min-width: 0;
  margin: 0;
  padding: 0;
}
html.theme-aleatory .lk-track button,
html.theme-aleatory .lk-track input,
html.theme-aleatory #lkAdd,
html.theme-aleatory #lkRemoveNote {
  height: 22px;
  margin: 0;
  padding: 0 6px;
}
html.theme-aleatory #lkPlace,
html.theme-aleatory #lkStatus,
html.theme-aleatory #lkFile { margin: 0; font-size: 10px; }

html.theme-aleatory #lkPlace {
  flex: 0 0 auto;
  margin-left: 8px;
  line-height: 22px;
  white-space: nowrap;
}

html.theme-aleatory #lkMulti.lk-tall .lk-body { flex-direction: column; align-items: stretch; min-height: 0; }
html.theme-aleatory #lkMulti.lk-tall #lkTracks {
  flex: 0 1 auto;
  max-height: 148px;
  overflow: auto;
  flex-direction: column;
  align-items: stretch;
}
html.theme-aleatory #lkMulti.lk-tall #lkPlace { margin-left: 0; align-self: flex-start; }
html.theme-aleatory #lkMulti.lk-tall #lkRoll { flex: 0 0 auto; height: clamp(120px, 22vh, 180px); }

@media (max-height: 800px) {
  html.theme-aleatory main:not(:has(.performance[hidden])) #workspaceContent {
    max-height: min(18vh, 140px);
  }
}

@media (max-width: 720px) {
  html.theme-aleatory .brand { display: none; }
  html.theme-aleatory header,
  html.theme-aleatory .topactions,
  html.theme-aleatory .workspace-buttons { flex-wrap: nowrap; }
  html.theme-aleatory header > a.site-home { flex: 0 0 auto; }
  html.theme-aleatory .topactions {
    width: auto;
    flex: 1 1 auto;
    min-width: 0;
    overflow-x: auto;
  }
  html.theme-aleatory .workspace-nav { overflow-x: auto; }
  html.theme-aleatory .workspace-buttons button { padding: 3px 4px; font-size: 10px; }
  html.theme-aleatory #performanceSurface {
    grid-template-columns: minmax(320px, 1fr) 72px 120px;
  }
}
