:root {
  color-scheme: dark;
  --bg: #0c0c0e;
  --surface: #121214;
  --line: #2b2b30;
  --text: #e7e7e9;
  --muted: #a0a0a8;
  --red: #ef1239;
  font-family: Arial, Helvetica, sans-serif;
  font-synthesis: none;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); }
button, input, select { font: inherit; }
button, select { color: var(--text); background: #19191d; border: 1px solid #3b3b42; border-radius: 4px; }
button { cursor: pointer; min-height: 44px; padding: 0 15px; touch-action: manipulation; }
button:hover { background: #252529; border-color: #777780; }
button:active { transform: translateY(1px); }
button:disabled { opacity: .5; cursor: wait; }
button:focus-visible, input:focus-visible, select:focus-visible, a:focus-visible, [tabindex]:focus-visible { outline: 2px solid #fff; outline-offset: 3px; }
input[type="range"] { accent-color: var(--red); cursor: pointer; width: 100%; margin: 0; min-height: 32px; }
input[type="number"] { color: #fff; background: transparent; border: 0; border-bottom: 1px solid #555; width: 65px; padding: 4px 0; font-size: 23px; font-variant-numeric: tabular-nums; }
output { font-variant-numeric: tabular-nums; }
a { color: #ededf2; text-underline-offset: 3px; }
[hidden] { display: none !important; }
.instrument { max-width: 1264px; margin: auto; padding: 34px 40px 30px; }
.brand { display: flex; justify-content: space-between; align-items: center; gap: 20px; padding-bottom: 26px; border-bottom: 1px solid var(--line); }
.wordmark { display: block; width: 285px; max-width: 65%; height: auto; }
.beta { color: #b6b6bd; font-size: 10px; font-weight: 700; letter-spacing: 1.5px; white-space: nowrap; }
.beta span { display: inline-block; margin-left: 9px; color: var(--red); border: 1px solid #652132; padding: 5px 7px; }
.intro { display: flex; align-items: center; justify-content: space-between; padding: 30px 0 28px; }
.eyebrow { font-size: 10px; font-weight: 700; letter-spacing: 2px; margin: 0 0 12px; color: #b8b8c0; }
.eyebrow span { color: #81818b; padding-left: 18px; }
h1 { font-size: clamp(32px, 4vw, 48px); line-height: 1; letter-spacing: -1.5px; margin: 0 0 12px; font-weight: 800; }
.red { color: var(--red); }
.slogan { margin: 0; font-size: 10px; color: #a4a4ae; letter-spacing: 2px; }
.bug { width: 31px; height: auto; margin: 4px 10px 0 30px; }
.machine { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; overflow: hidden; box-shadow: 0 16px 55px #0005; }
.transport { padding: 22px; display: flex; align-items: center; gap: 28px; border-bottom: 1px solid var(--line); background: #171719; }
.transport-buttons { display: flex; gap: 6px; flex-shrink: 0; }
.transport-buttons button { min-width: 44px; padding: 0 12px; font-size: 19px; }
.transport-buttons .primary { background: var(--red); border-color: var(--red); color: white; font-size: 11px; font-weight: 800; min-width: 108px; letter-spacing: 1px; }
.primary span { margin-right: 7px; font-size: 13px; }
.transport-buttons .primary:hover { background: #ff3154; }
.tempo, .swing { font-size: 9px; font-weight: 700; color: #b4b4bd; letter-spacing: 1px; }
.tempo { display: flex; gap: 12px; align-items: center; }
.tempo > span { white-space: nowrap; }
.tempo > span > span { font-size: 9px; color: #8d8d96; }
.swing { width: 124px; }
.swing output { float: right; color: #ddd; }
.transport-status { margin-left: auto; display: grid; grid-template-columns: 6px 1fr; align-items: center; gap: 5px 8px; font-size: 11px; color: #bbb; white-space: nowrap; }
#status-dot { width: 5px; height: 5px; border-radius: 50%; background: #74747c; }
body.is-playing #status-dot { background: var(--red); }
#position { grid-column: 2; font: 10px monospace; color: #92929b; }
.pattern-bar { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 20px 22px 18px; }
.pattern-choice { display: flex; align-items: center; gap: 12px; }
.pattern-choice label { font-size: 9px; color: var(--muted); font-weight: 700; letter-spacing: 1px; }
select { max-width: 100%; padding: 0 30px 0 11px; min-height: 40px; font-size: 12px; }
#modified { font: 8px monospace; color: #c1a8ad; }
.file-actions { display: flex; align-items: center; gap: 7px; }
.file-actions button { min-height: 38px; font-size: 11px; padding: 0 12px; background: transparent; }
.file-actions button:last-of-type { border-color: #605158; }
.sequencer-scroll { overflow-x: auto; padding: 0 22px; scrollbar-color: #52525c #17171a; }
.sequencer { min-width: 840px; }
.step-header, .voice-row { display: grid; grid-template-columns: 208px repeat(16, minmax(27px, 1fr)); gap: 5px; align-items: center; }
.step-header { padding: 0 0 10px; font: 9px monospace; color: #8e8e99; text-align: center; }
.step-header .header-label { text-align: left; letter-spacing: 1px; }
.step-number.beat { color: #ddd; }
.step-number.current { color: var(--red); font-weight: bold; }
.voice-row { margin-bottom: 6px; }
.voice-controls { display: grid; grid-template-columns: 78px 38px 1fr; gap: 9px; align-items: center; padding-right: 16px; }
.voice-name { font-size: 10px; font-weight: 700; letter-spacing: .5px; }
.voice-name span { display: inline-block; width: 18px; color: #777780; font: 9px monospace; }
.mute { min-height: 32px; padding: 0; font-size: 9px; color: #a8a8b2; }
.mute[aria-pressed="true"] { border-color: #ef1239; color: #ff859c; background: #3a1720; }
.voice-controls input { height: 32px; accent-color: #b6b6c0; }
.step { display: block; min-height: 34px; height: 34px; padding: 0; border: 1px solid #303036; background: #222226; border-radius: 3px; position: relative; }
.step.beat { background: #2a2a2f; border-color: #3b3b43; }
.step[aria-pressed="true"] { background: #bd1938; border-color: #ef3858; }
.step[aria-pressed="true"]::after { content: ""; display: block; width: 3px; height: 3px; border-radius: 50%; background: #fff8; margin: auto; }
.step.soft[aria-pressed="true"] { background: #762336; border-color: #ac3d53; }
.step.current { box-shadow: inset 0 0 0 2px #e6e6f0; }
.voice-row.muted-row .step { opacity: .38; }
.sequence-footer { display: flex; justify-content: space-between; gap: 10px; margin: 8px 22px 22px; font: 9px monospace; color: #9c9ca5; }
.muted { color: #777781; }
.touch-help { display: none; }
.performance { display: grid; grid-template-columns: 1fr 240px; border-top: 1px solid var(--line); }
.pad-section { padding: 22px; }
.section-label { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 13px; }
h2 { font-size: 9px; letter-spacing: 1.3px; margin: 0; font-weight: 700; }
.section-label > span { font: 9px monospace; color: #8e8e98; }
.pads { display: grid; grid-template-columns: repeat(8, 1fr); gap: 7px; }
.pad { height: 78px; min-width: 0; text-align: left; padding: 10px 9px; background: linear-gradient(145deg, #242428, #1a1a1e); border: 1px solid #3b3b43; border-bottom: 3px solid #4d323b; display: flex; flex-direction: column; justify-content: space-between; }
.pad kbd { color: #8c8c96; font-size: 10px; font-family: inherit; }
.pad .pad-name { font-size: 9px; font-weight: 700; white-space: nowrap; }
.pad.fired { background: #5e1727; border-color: #ff4d6c; }
.pad.is-muted { opacity: .45; }
.mix-section { border-left: 1px solid var(--line); padding: 22px; display: flex; flex-direction: column; justify-content: space-between; gap: 18px; }
.mix-section label { display: block; font-size: 9px; font-weight: 700; letter-spacing: 1px; }
.mix-section label > span { display: flex; justify-content: space-between; }
.mix-section output { color: #d7d7de; }
.mix-section small { display: block; color: #9b9ba5; font-size: 9px; font-weight: 400; letter-spacing: 0; }
.master input { accent-color: #c9c9d2; }
.feedback { min-height: 40px; padding: 10px 0 0; font-size: 11px; color: #a3a3af; }
.feedback p { margin: 4px 0; line-height: 1.5; }
#error { color: #ff91a4; }
footer { display: flex; justify-content: space-between; align-items: center; gap: 16px; font: 9px monospace; letter-spacing: .4px; color: #7d7d88; }
footer button { border: 0; min-height: 40px; background: transparent; color: #babac4; font-size: 10px; padding-right: 0; }
.help { border-top: 1px solid var(--line); color: #aaaab5; font-size: 12px; line-height: 1.7; padding-top: 12px; max-width: 850px; }
.help strong { color: #d4d4dd; }
@media (min-width: 1500px) { .instrument { padding-top: 50px; } }
@media (max-width: 1050px) {
  .instrument { padding: 24px; }
  .transport { gap: 20px; }
  .transport-status { display: none; }
  .performance { grid-template-columns: 1fr 190px; }
  .pads { grid-template-columns: repeat(4, 1fr); }
  .pad { height: 66px; }
  .mix-section { justify-content: center; }
}
@media (max-width: 700px) {
  .instrument { padding: 18px 12px; }
  .brand { padding: 0 4px 20px; }
  .wordmark { width: 216px; max-width: 64%; }
  .beta { font-size: 8px; letter-spacing: .8px; }
  .beta span { display: none; }
  .intro { padding: 26px 4px; }
  .eyebrow { font-size: 8px; letter-spacing: 1.2px; }
  .eyebrow span { padding-left: 8px; }
  .slogan { font-size: 8px; letter-spacing: 1.1px; }
  .bug { margin-right: 6px; }
  .transport { flex-wrap: wrap; gap: 16px 20px; padding: 16px; }
  .transport-buttons { flex: 1 1 190px; }
  .tempo { gap: 8px; }
  .swing { width: 150px; }
  .transport-status { display: grid; }
  .pattern-bar { align-items: stretch; flex-direction: column; gap: 8px; padding: 16px; }
  .pattern-choice { gap: 10px; }
  .pattern-choice select { flex: 1; min-width: 0; }
  #modified { display: none; }
  .file-actions { justify-content: flex-end; }
  .file-actions button { min-height: 44px; }
  .sequencer-scroll { padding: 0 16px; }
  .sequencer { min-width: 964px; }
  .step-header, .voice-row { grid-template-columns: 180px repeat(16, minmax(44px, 1fr)); }
  .step { min-height: 44px; height: 44px; }
  .mute { min-height: 44px; }
  .voice-controls { position: sticky; left: 0; z-index: 1; background: var(--surface); min-height: 44px; grid-template-columns: 68px 44px 1fr; gap: 7px; padding-right: 8px; }
  .desktop-help { display: none; }
  .touch-help { display: inline; }
  .sequence-footer { margin: 12px 16px 20px; font-size: 8px; flex-direction: column; }
  .performance { grid-template-columns: 1fr; }
  .pad-section { padding: 18px 16px; }
  .pad { height: 76px; }
  .pad .pad-name { font-size: 10px; }
  .mix-section { border-left: 0; border-top: 1px solid var(--line); flex-direction: row; padding: 20px 16px; gap: 25px; }
  .mix-section label { flex: 1; }
  .mix-section small { line-height: 1.5; }
  footer { font-size: 8px; }
  .feedback { font-size: 10px; padding: 8px 4px; }
}
@media (prefers-reduced-motion: reduce) { button:active { transform: none; } }
