a.site-home {
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  margin-right: 4px;
  padding: 4px 10px;
  border: 1px solid #ff9e2c;
  border-radius: 7px;
  background: #1a1208;
  color: #ffc061;
  font-weight: 700;
  font-size: 13px;
  line-height: 1.2;
  text-decoration: none;
  white-space: nowrap;
}
a.site-home:hover { background: #ff9e2c; color: #14110c; }
.lk-theme { display: flex; align-items: center; gap: 6px; font-size: 11px; color: #b7cfc2; white-space: nowrap; }
.lk-theme select { padding: 4px 6px; max-width: 168px; }
#lkRecord, #lkRecordDock {
  min-width: 132px;
  font-weight: 800;
  background: #9d2e2a;
  color: #fff;
  border-color: #ffb0a8;
}
#lkRecordDock { min-height: 40px; font-size: 16px; }
#lkMulti {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 40;
  display: flex;
  flex-direction: column;
  max-height: 42vh;
  overflow: hidden;
  background: #101816;
  border-top: 1px solid #3c6b58;
  padding: 8px 10px 10px;
  box-shadow: 0 -8px 24px #06120e88;
}
#lkMulti.lk-tall:not(.lk-collapsed) { height: min(78vh, 820px); max-height: min(78vh, 820px); }
body:has(#lkMulti.lk-tall:not(.lk-collapsed)) { padding-bottom: min(82vh, 860px); }
.lk-bar, .lk-tools { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.lk-bar label, .lk-tools label { display: flex; align-items: center; gap: 6px; font-size: 11px; color: #b7cfc2; }
.lk-bar input[type="text"] { width: 160px; padding: 6px 8px; }
.lk-bar input[type="number"] { width: 72px; padding: 6px 8px; }
.lk-bar { flex: 0 0 auto; }
.lk-body {
  margin-top: 6px;
  min-height: 0;
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  overflow: hidden;
}
#lkMulti.lk-collapsed .lk-body { display: none; }
#lkMulti.lk-collapsed #lkGrow { display: none; }
#lkTracks {
  overflow-x: hidden;
  overflow-y: auto;
  min-height: 96px;
  flex: 1 1 auto;
  overscroll-behavior: contain;
}
#lkRoll, #lkPlace, #lkHint, #lkStatus, #lkFile { flex: 0 0 auto; }
#lkHint { flex: 0 1 auto; max-height: 3.4em; overflow: auto; }
.lk-track {
  display: grid;
  grid-template-columns: auto auto minmax(0, 1fr) auto auto auto;
  gap: 4px 6px;
  align-items: center;
  margin-bottom: 6px;
  padding-bottom: 4px;
  border-bottom: 1px solid #2c463c;
}
.lk-track > .lk-expand { grid-column: 1; grid-row: 1; }
.lk-track > .lk-arm { grid-column: 2; grid-row: 1; }
.lk-track > input[type="text"] { grid-column: 3; grid-row: 1; }
.lk-track > .lk-mute { grid-column: 4; grid-row: 1; }
.lk-track > .lk-solo { grid-column: 5; grid-row: 1; }
.lk-track > .lk-count { grid-column: 6; grid-row: 1; white-space: nowrap; }
.lk-track > .lk-sound { grid-column: 1 / -1; grid-row: 2; max-width: none; }
.lk-track > input[type="range"] { grid-column: 1 / -1; grid-row: 3; }
.lk-track > .lk-actions {
  grid-column: 1 / -1;
  grid-row: 4;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.lk-track:not(.lk-open) > .lk-sound,
.lk-track:not(.lk-open) > input[type="range"],
.lk-track:not(.lk-open) > .lk-actions { display: none; }
.lk-sound { width: 100%; min-width: 0; max-width: 220px; padding: 2px 4px; font-size: 11px; }
.lk-track input[type="text"] { width: 100%; min-width: 0; padding: 4px 6px; }
.lk-track input[type="range"] { width: 100%; }
.lk-track button { padding: 4px 8px; }
.lk-track.lk-armed { outline: 1px solid #9ae7ce; border-radius: 6px; padding: 2px; }
#lkRoll { display: block; width: 100%; height: 140px; background: #0c1412; border: 1px solid #2c463c; border-radius: 6px; margin-top: 4px; }
#lkRoll:focus { outline: 2px solid #efbd79; outline-offset: 2px; }
#lkPlace { margin: 4px 0 0; font: 12px/1.2 ui-monospace, "Courier New", monospace; color: #efbd79; }
#lkHint, #lkStatus, #lkFile { margin: 4px 0 0; font-size: 12px; color: #9bb5a8; }
#lkFile a { font-weight: 700; }
#lkStatus:empty { display: none; }
.brand-fork a { color: inherit; }
.lk-pitch { display: grid; grid-template-columns: 36px 36px; gap: 2px; text-align: center; align-items: center; }
.lk-pitch > span { grid-column: 1 / 3; font-size: 9px; letter-spacing: 1px; color: var(--muted, #a3b1b5); }
.lk-pitch button { padding: 4px 2px; min-width: 36px; }
.lk-pitch button[aria-pressed="true"] { background: #b6ecd0; color: #122a20; border-color: #b6ecd0; }
#lkAccount { font-size: 12px; }

html.theme-stage .lk-prose,
html.theme-compact .lk-prose,
html.theme-stage .intro,
html.theme-compact .intro,
html.theme-stage footer,
html.theme-compact footer,
html.theme-stage details,
html.theme-compact details,
html.theme-stage .help,
html.theme-compact .help,
html.theme-stage .patchdesc,
html.theme-compact .patchdesc,
html.theme-stage .workspace-heading,
html.theme-compact .workspace-heading,
html.theme-stage p.note,
html.theme-compact p.note,
html.theme-stage .seqhint,
html.theme-compact .seqhint,
html.theme-stage .workspace-tools p,
html.theme-compact .workspace-tools p,
html.theme-stage .workspace-help-grid,
html.theme-compact .workspace-help-grid,
html.theme-stage .keyboard-foot,
html.theme-compact .keyboard-foot,
html.theme-stage .arp-grid-head,
html.theme-compact .arp-grid-head,
html.theme-stage .sectionbar .index,
html.theme-compact .sectionbar .index,
html.theme-stage .sectionbar .tag,
html.theme-compact .sectionbar .tag,
html.theme-stage .micro:not([id]),
html.theme-compact .micro:not([id]),
html.theme-stage .workspace-status,
html.theme-compact .workspace-status,
html.theme-stage .workspace-jump,
html.theme-compact .workspace-jump { display: none !important; }

html.theme-stage header .eyebrow,
html.theme-compact header .eyebrow { display: none; }
html.theme-stage .brand-credit,
html.theme-compact .brand-credit {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 12px;
  font-size: 11px;
  line-height: 1.3;
  color: #9bb5a8;
}
html.theme-stage header,
html.theme-compact header { padding: 6px 12px; gap: 10px; }
html.theme-stage h1,
html.theme-compact h1 { font-size: 18px; margin: 0; }
html.theme-stage .workspace-nav,
html.theme-compact .workspace-nav {
  position: static;
  margin: 0 0 6px;
  padding: 6px 8px;
  box-shadow: none;
}
html.theme-stage .workspace-buttons button,
html.theme-compact .workspace-buttons button { padding: 6px 10px; min-height: 32px; font-size: 12px; }
html.theme-stage .strip,
html.theme-compact .strip { padding: 6px 8px; gap: 8px 12px; margin: 0 0 6px; }
html.theme-compact .keyrow { height: 56px; }
html.theme-compact .navigation,
html.theme-compact .drumpad { grid-template-rows: repeat(5, 56px); }
html.theme-compact main,
html.theme-reference main { padding-bottom: 220px; }

html.theme-stage body {
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) minmax(0, 210px);
}
html.theme-stage main {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 420px);
  grid-template-rows: auto auto minmax(0, 1fr);
  grid-template-areas:
    "nav nav"
    "strip strip"
    "keys tools";
  min-height: 0;
  overflow: hidden;
  max-width: none;
  width: 100%;
  margin: 0;
  padding: 8px 10px 6px;
}
html.theme-stage #workspaceNav { grid-area: nav; }
html.theme-stage .strip { grid-area: strip; }
html.theme-stage .performance { grid-area: keys; min-height: 0; overflow: auto; margin: 0; }
html.theme-stage #workspaceContent { grid-area: tools; min-height: 0; overflow: auto; margin: 0; }
html.theme-stage #workspaceMusicFocus:not([hidden]) { grid-area: focus; margin: 0 0 6px; padding: 6px 10px; font-size: 12px; }
html.theme-stage main:has(.performance[hidden]) {
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: auto auto auto minmax(0, 1fr);
  grid-template-areas:
    "nav"
    "strip"
    "focus"
    "tools";
}
html.theme-stage .keyrow { height: 52px; }
html.theme-stage .navigation,
html.theme-stage .drumpad { grid-template-rows: repeat(5, 52px); }
html.theme-stage #lkMulti { position: static; max-height: 210px; box-shadow: none; }
html.theme-stage .performance .sectionbar { margin-bottom: 4px; }
html.theme-stage #workspaceContent .panel { margin-bottom: 8px; }

@media (max-width: 1599px), (max-height: 859px) {
  html.theme-stage body { height: auto; overflow: auto; display: block; }
  html.theme-stage main {
    display: block;
    height: auto;
    overflow: visible;
    max-width: none;
    padding-bottom: 220px;
  }
  html.theme-stage .performance,
  html.theme-stage #workspaceContent { max-height: none; overflow: visible; }
  html.theme-stage #lkMulti { position: fixed; max-height: 42vh; }
}

@media (max-width: 720px) {
  header { flex-wrap: wrap; align-items: flex-start; }
  header > a.site-home { flex: 0 0 auto; }
  .topactions { width: 100%; margin-left: 0; flex-wrap: wrap; justify-content: flex-start; }
  #lkRecord { min-width: 0; width: auto; }
  .lk-theme { flex: 1 1 140px; }
  html.theme-compact main,
  html.theme-reference main,
  html.theme-stage main { padding: 6px 8px 72px; }
  html.theme-compact header,
  html.theme-stage header { padding: 4px 8px; gap: 4px; }
  html.theme-compact h1,
  html.theme-stage h1 { font-size: 16px; }
  html.theme-compact h1 span,
  html.theme-stage h1 span { display: none; }
  html.theme-compact .brand-credit,
  html.theme-stage .brand-credit { font-size: 10px; gap: 0 8px; }
  html.theme-compact .topactions button,
  html.theme-stage .topactions button,
  html.theme-compact .topactions .lk-theme,
  html.theme-stage .topactions .lk-theme { font-size: 11px; }
  html.theme-compact .workspace-safety,
  html.theme-stage .workspace-safety { display: none; }
  html.theme-compact .workspace-nav,
  html.theme-stage .workspace-nav { padding: 4px; margin: 0 0 4px; }
  html.theme-compact .workspace-buttons,
  html.theme-stage .workspace-buttons { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px; }
  html.theme-compact .workspace-buttons button,
  html.theme-stage .workspace-buttons button { min-height: 28px; padding: 4px 2px; font-size: 10px; white-space: nowrap; }
  html.theme-compact .workspace-subbar,
  html.theme-stage .workspace-subbar { display: none; }
  html.theme-compact .strip,
  html.theme-stage .strip {
    display: grid;
    grid-template-columns: auto auto auto minmax(0, 1fr);
    grid-template-areas: "preset preset preset preset" "tempo octave pitch volume";
    align-items: center;
    padding: 4px 6px;
    gap: 4px 8px;
    margin: 0 0 4px;
  }
  html.theme-compact .preset-label,
  html.theme-stage .preset-label {
    grid-area: preset;
    min-width: 0;
    flex: none;
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 6px;
  }
  html.theme-compact .preset-label select,
  html.theme-stage .preset-label select { flex: 1; min-width: 0; }
  html.theme-compact .compact-control,
  html.theme-stage .compact-control { grid-area: tempo; }
  html.theme-compact .transpose,
  html.theme-stage .transpose { grid-area: octave; }
  html.theme-compact .lk-pitch,
  html.theme-stage .lk-pitch { grid-area: pitch; }
  html.theme-compact .volume,
  html.theme-stage .volume {
    grid-area: volume;
    margin: 0;
    width: 100%;
    min-width: 0;
    grid-template-columns: minmax(0, 1fr) auto;
  }
  html.theme-compact .volume input,
  html.theme-stage .volume input { width: 100%; min-width: 0; max-width: 100%; }
  html.theme-compact .performance,
  html.theme-stage .performance { margin-bottom: 8px; }
  html.theme-compact .performance .sectionbar,
  html.theme-stage .performance .sectionbar { padding: 4px 8px; margin: 0; flex-wrap: nowrap; gap: 6px; }
  html.theme-compact .performance .sectionbar h3,
  html.theme-stage .performance .sectionbar h3 { display: none; }
  html.theme-compact .performance .sectionbar button,
  html.theme-stage .performance .sectionbar button { padding: 3px 6px; font-size: 10px; }
  html.theme-compact .performance-toolbar,
  html.theme-stage .performance-toolbar {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4px 8px;
    padding: 4px 8px;
    overflow: visible;
  }
  html.theme-compact .performance-toolbar label,
  html.theme-stage .performance-toolbar label { min-width: 0; }
  html.theme-compact .performance-toolbar select,
  html.theme-stage .performance-toolbar select { min-width: 0; max-width: 100%; }
  html.theme-compact #performanceSurface,
  html.theme-stage #performanceSurface { padding: 4px 6px 2px; }
  html.theme-compact .functionbar,
  html.theme-stage .functionbar { margin-bottom: 4px; }
  html.theme-compact .functionbar button,
  html.theme-stage .functionbar button { height: 32px; }
  html.theme-compact .keyrow,
  html.theme-stage .keyrow { height: 46px; }
  html.theme-compact .drumpad,
  html.theme-stage .drumpad { grid-template-rows: repeat(5, 46px); }
  #lkMulti { max-height: none; padding: 6px 8px; overflow: hidden; }
  #lkMulti.lk-collapsed { box-shadow: none; }
  #lkMulti:not(.lk-collapsed) { max-height: 42vh; overflow: hidden; }
  #lkMulti.lk-tall:not(.lk-collapsed) { height: min(78vh, 820px); max-height: min(78vh, 820px); }
  #lkMulti.lk-collapsed .lk-secondary { display: none; }
  #lkMulti.lk-collapsed .lk-bar { flex-wrap: nowrap; }
  .lk-bar { display: flex; gap: 4px; }
  .lk-bar button { padding: 6px 8px; white-space: nowrap; }
  #lkMulti.lk-collapsed .lk-bar button { flex: 1 1 0; min-width: 0; padding: 6px 4px; font-size: 12px; }
  #lkRecordDock { min-width: 0; width: auto; flex: 1 1 auto; min-height: 36px; font-size: 14px; }
}
