:root { color-scheme: dark; --bg: #131616; --panel: #1a1e1e; --line: #343b39; --fg: #edf2ef; --dim: #99a8a3; --mint: #8de4bc; --gold: #ead082; --coral: #f5a091; }
* { box-sizing: border-box; letter-spacing: 0; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--bg); color: var(--fg); font: 15px/1.4 -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; font-variant-numeric: tabular-nums; }
button, input, select, textarea { font: inherit; }
button, select, a { -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
button, select, .back { min-height: 46px; border: 1px solid var(--line); border-radius: 5px; background: var(--panel); color: var(--fg); }
button { cursor: pointer; padding: 8px 12px; }
button:hover, a.back:hover { border-color: #879991; background: #272e2b; }
button:disabled { opacity: .4; cursor: wait; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible { outline: 2px solid var(--mint); outline-offset: 3px; }
svg { width: 20px; height: 20px; flex: none; }
h1, h2, p { margin: 0; }
h1 { font-size: 22px; font-weight: 600; }
h2 { font-size: 17px; font-weight: 600; }
.icon, .back { width: 46px; padding: 0; flex: none; display: inline-grid; place-items: center; }
.topbar { height: 76px; padding: 0 26px; display: flex; align-items: center; gap: 17px; border-bottom: 1px solid var(--line); }
.back { color: var(--dim); text-decoration: none; background: transparent; border-color: transparent; }
.brand { display: flex; align-items: center; gap: 18px; font-weight: 700; font-size: 16px; }
.brand > span { color: #52635b; font-weight: 400; }
.connection { margin-left: auto; display: flex; align-items: center; gap: 8px; color: var(--dim); font-size: 13px; }
#connection-dot { width: 7px; height: 7px; background: var(--coral); border-radius: 50%; }
#connection-dot.online { background: var(--mint); }
#error { background: #412c28; color: #ffd0c7; padding: 12px 26px; border-bottom: 1px solid #7e4f43; }
main { display: grid; grid-template-columns: 340px minmax(0, 1fr); max-width: 1600px; margin: auto; min-height: calc(100dvh - 174px); }
.library { border-right: 1px solid var(--line); padding: 24px 20px; }
.library-heading { display: flex; align-items: center; gap: 10px; }
.library-heading h2 { flex: 1; }
#count { color: var(--dim); font-size: 12px; }
.library-heading .icon { min-height: 40px; width: 40px; background: transparent; }
.filters { display: flex; gap: 2px; margin: 17px 0 18px; border-bottom: 1px solid var(--line); }
.filters button { min-height: 43px; padding: 8px 6px; flex: 1; font-size: 12px; background: transparent; border: 0; border-bottom: 2px solid transparent; border-radius: 0; color: var(--dim); }
.filters button[aria-pressed=true] { border-bottom-color: var(--mint); color: var(--mint); }
#presets { display: grid; grid-template-columns: 1fr 1fr; grid-auto-rows: max-content; gap: 9px; max-height: calc(100dvh - 314px); overflow-y: auto; scrollbar-width: thin; scrollbar-color: #52635b transparent; padding: 2px 4px 12px 2px; align-content: start; }
.preset { min-height: 112px; text-align: left; padding: 13px 11px; position: relative; overflow-wrap: anywhere; }
.preset .name { display: block; font-size: 14px; font-weight: 600; margin-bottom: 8px; }
.preset .symbols { display: block; color: var(--dim); font-size: 12px; line-height: 1.8; }
.preset .mood { color: #91a19a; display: block; font-size: 10px; margin-top: 8px; }
.preset[aria-pressed=true] { border-color: var(--mint); background: #24382e; }
.preset[aria-pressed=true] .symbols { color: var(--mint); }
.preset.queued { border-color: var(--gold); background: #302f23; }
.workspace { padding: 26px 34px 28px; min-width: 0; }
.section-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.section-heading > span { color: var(--dim); font-size: 12px; }
.eyebrow { color: var(--mint); display: block; font-size: 13px; text-transform: capitalize; margin-bottom: 5px; }
#name { font-size: 26px; font-weight: 550; }
#cycle { align-self: flex-end; padding-bottom: 3px; }
#chord-strip { display: grid; gap: 7px; grid-template-columns: repeat(var(--chords, 4), minmax(0, 1fr)); margin: 22px 0 17px; }
.chord-step { border-top: 2px solid var(--line); padding: 12px 8px; background: #1c2120; min-width: 0; }
.chord-step strong { display: block; font-size: 24px; font-weight: 500; overflow-wrap: anywhere; }
.chord-step span { display: block; font-size: 12px; color: var(--dim); margin-top: 3px; }
.chord-step.current { border-color: var(--mint); background: #26392f; color: var(--mint); }
.phrase { display: flex; align-items: center; gap: 15px; }
#bars { display: flex; flex: 1; gap: 4px; }
#bars b { display: block; height: 5px; flex: 1; background: #333e38; }
#bars b.done { background: #577b66; }
#bars b.current { background: var(--mint); }
#position { color: var(--dim); font-size: 12px; flex: none; min-width: 77px; text-align: right; }
.pending { background: #343122; border-left: 2px solid var(--gold); color: var(--gold); display: flex; align-items: center; gap: 12px; padding: 8px 10px 8px 14px; margin-top: 14px; }
.pending { flex-shrink: 0; }
.pending > div { flex: 1; min-width: 0; }
.pending span { font-size: 11px; display: block; }
.pending strong { font-size: 13px; font-weight: 500; }
.pending .icon { background: transparent; color: var(--gold); border-color: transparent; }
.arrangement { padding: 16px 0; margin-top: 16px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.dim { color: var(--dim); }
.setting-row { display: flex; gap: 24px; margin-top: 17px; align-items: flex-end; }
.setting-row label, .label { font-size: 12px; color: var(--dim); }
.setting-row select { display: block; width: 100%; margin-top: 7px; padding: 8px 12px; }
.key-setting { width: 84px; flex: none; }
.bar-setting { flex: 1; }
.segments { margin-top: 7px; display: flex; }
.segments button { flex: 1; border-radius: 0; min-width: 40px; font-size: 14px; }
.segments button:first-child { border-radius: 5px 0 0 5px; }
.segments button:last-child { border-radius: 0 5px 5px 0; }
.segments button + button { border-left: 0; }
.segments button[aria-pressed=true] { background: #33483c; color: var(--mint); }
.color-setting { width: 132px; flex: none; }
#patterns { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 7px; margin-top: 20px; }
.pattern { padding: 10px 6px; min-height: 72px; font-size: 11px; }
.pattern[aria-pressed=true] { color: var(--mint); border-color: #80b399; background: #25352c; }
.pattern-rhythm { display: flex; justify-content: center; gap: 3px; margin: 0 auto 9px; height: 14px; align-items: flex-end; }
.pattern-rhythm b { width: 5px; height: 3px; background: #46534d; }
.pattern-rhythm b.hit { height: calc(12px * var(--accent, 1)); background: currentColor; opacity: .7; }
.sliders { gap: 26px; margin-top: 20px; }
.sliders label { flex: 1; min-width: 0; }
.sliders label > span { display: flex; justify-content: space-between; }
input[type=range] { accent-color: var(--mint); width: 100%; min-width: 0; height: 30px; margin: 4px 0 0; cursor: pointer; }
.sliders label:has(input:disabled) { opacity: .45; }
.sliders input:disabled { cursor: default; }
.guide { padding-top: 16px; }
.guide-heading { display: flex; justify-content: space-between; gap: 20px; align-items: center; margin-bottom: 20px; }
.chord-name { display: flex; align-items: center; gap: 18px; }
.chord-name > strong { font-size: 42px; line-height: 1.1; font-weight: 500; color: var(--mint); }
.chord-name > div { display: flex; flex-direction: column; gap: 4px; font-size: 13px; }
#next-chord { color: var(--dim); font-size: 12px; }
.legend { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px 14px; font-size: 11px; color: var(--dim); max-width: 300px; }
.legend span { display: flex; align-items: center; gap: 6px; }
.legend b { width: 8px; height: 8px; border-radius: 2px; display: inline-block; }
.tone { background: var(--mint); }.scale { background: var(--gold); }.outside { background: #718078; }
#keyboard { height: 158px; position: relative; display: flex; border-bottom: 5px solid #090c0b; border-radius: 4px; overflow: hidden; }
.pkey { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; position: relative; flex: 1; padding-bottom: 13px; border: 1px solid #939c95; border-top: 0; border-radius: 0 0 4px 4px; background: #e4e9e3; color: #37453d; font-size: 12px; }
.pkey.black { position: absolute; width: calc(100% / var(--white-count) * .61); left: calc(var(--left) * 100% / var(--white-count) - 100% / var(--white-count) * .305); top: 0; height: 63%; flex: none; background: #202624; color: #d7dfd9; border-color: #090c0b; z-index: 1; padding-bottom: 10px; font-size: 10px; }
.pkey.chord { background: #98d8b7; border-color: #5c9b77; color: #163f2b; }
.pkey.scale-tone { background: #e5d69c; border-color: #b4a268; color: #5b5129; }
.pkey.black.chord { background: #448464; color: #effff5; border-color: #2a5942; }
.pkey.black.scale-tone { background: #87743b; color: #fff6d8; border-color: #5c5029; }
.pkey small { font-size: 9px; opacity: .75; display: block; min-height: 13px; margin-top: 4px; }
.guide-footer { display: flex; justify-content: space-between; margin-top: 12px; color: var(--dim); font-size: 11px; }
.guide-footer .dim { margin-left: 9px; color: #74837b; }
#scale-name { text-transform: capitalize; }
.transport { position: sticky; bottom: 0; z-index: 3; background: #1b201e; border-top: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; gap: 28px; padding: 18px 28px; min-height: 98px; }
.playback { display: flex; align-items: center; gap: 10px; }
.primary { display: inline-flex; align-items: center; justify-content: center; gap: 10px; color: #173626; border-color: var(--mint); background: var(--mint); min-width: 116px; min-height: 52px; font-weight: 600; }
.primary:hover { background: #acf1ce; }
.stop { color: var(--coral); min-height: 52px; width: 52px; }
.status { min-width: 110px; margin-left: 8px; font-size: 12px; color: var(--dim); }
#beats { display: flex; gap: 5px; margin-top: 8px; }
#beats b { width: 15px; height: 4px; background: #49564f; }
#beats b.current { background: var(--mint); }
.tempo { display: flex; align-items: center; gap: 8px; }
.tempo label { display: flex; flex-direction: column; text-align: center; color: var(--dim); font-size: 10px; }
#bpm { appearance: textfield; -moz-appearance: textfield; background: transparent; border: 0; color: var(--fg); font-size: 24px; width: 66px; text-align: center; padding: 0; }
#bpm::-webkit-inner-spin-button { appearance: none; }
#tap { margin-left: 6px; color: var(--dim); }
.volume { display: flex; gap: 12px; align-items: center; width: 210px; color: var(--dim); }
.volume output { width: 37px; flex: none; font-size: 12px; text-align: right; }
.volume input { margin: 0; }
dialog { background: var(--panel); color: var(--fg); border: 1px solid var(--line); border-radius: 8px; width: min(90%, 600px); }
dialog::backdrop { background: #0009; }
dialog textarea { width: 100%; margin: 20px 0; height: 110px; background: var(--bg); color: var(--fg); }
@media (min-width: 1600px) { main { border-left: 1px solid var(--line); border-right: 1px solid var(--line); } }
@media (max-width: 1100px) { main { grid-template-columns: 290px minmax(0, 1fr); }.workspace { padding: 24px; }.library { padding: 24px 14px; }.setting-row { gap: 14px; }#patterns { grid-template-columns: repeat(3, minmax(0, 1fr)); }.transport { gap: 14px; padding: 16px; }.volume { width: 160px; }.status { min-width: 86px; }.guide-heading { align-items: flex-start; }.legend { max-width: 130px; }.chord-step strong { font-size: 20px; } }
@media (max-width: 760px) { .topbar { padding: 0 12px; height: 66px; gap: 8px; }.brand { gap: 10px; }h1 { font-size: 18px; }.connection { font-size: 11px; }.connection #output { max-width: 85px; }.topbar .back { width: 32px; }main { display: flex; flex-direction: column; }.library { border-right: 0; border-bottom: 1px solid var(--line); padding: 18px; }#presets { display: flex; max-height: none; overflow-x: auto; padding-bottom: 8px; }.preset { flex: 0 0 148px; }.library-heading .icon { min-height: 42px; }.filters { margin: 6px 0 12px; }.workspace { padding: 22px 18px; }#patterns { grid-template-columns: repeat(3, 1fr); }.guide-heading { flex-wrap: wrap; gap: 14px; }.legend { max-width: none; justify-content: flex-start; }.chord-step { padding: 10px 5px; }#chord-strip:has(.chord-step:nth-child(5)) { grid-template-columns: repeat(4, minmax(0, 1fr)); }.transport { flex-wrap: wrap; gap: 15px 10px; padding: 12px 16px; }.playback { flex: 1; }.status { min-width: 80px; }.volume { width: 145px; }.tempo { order: 3; width: 100%; justify-content: center; border-top: 1px solid var(--line); padding-top: 10px; }.transport .volume { flex: 1; max-width: 150px; min-width: 95px; }.primary { min-width: 90px; }.key-setting { width: 68px; }.color-setting { width: 110px; }.bar-setting .segments button { padding: 8px; min-width: 31px; }.setting-row { gap: 10px; }.sliders { gap: 18px; } }
@media (max-width: 440px) { .status { display: none; }.volume { max-width: 140px; }.brand > span { display: none; }.brand { gap: 8px; font-size: 13px; }.connection { gap: 5px; }#chord-strip { gap: 5px; } }
@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto !important; } }
/* Keep the instrument and transport visible on the 1280 x 720 kiosk. */
body { height: 100dvh; display: grid; grid-template-rows: 64px auto minmax(0, 1fr) auto; overflow: hidden; }
.topbar { grid-row: 1; height: 64px; }
#error { grid-row: 2; }
main { grid-row: 3; width: 100%; height: 100%; min-height: 0; }
.library { min-height: 0; display: flex; flex-direction: column; }
#presets { min-height: 0; max-height: none; flex: 1; }
.workspace { min-height: 0; display: grid; grid-template-rows: auto auto minmax(0, 1fr); overflow: hidden; }
.arrangement { min-height: 0; }
.transport { grid-row: 4; position: static; min-height: 84px; padding-top: 14px; padding-bottom: 14px; }
@media (min-width: 761px) {
  .workspace { padding: 15px 24px; }
  .library { padding-top: 15px; padding-bottom: 15px; }
  .filters { margin-top: 8px; margin-bottom: 12px; }
  #name { font-size: 22px; }
  .eyebrow { font-size: 12px; margin-bottom: 2px; }
  #chord-strip { margin: 12px 0 10px; }
  .chord-step { padding: 7px 8px; }
  .chord-step strong { font-size: 21px; }
  #chord-strip:has(.chord-step:nth-child(5)) .chord-step strong { font-size: 16px; }
  .chord-step span { font-size: 11px; margin-top: 0; }
  .arrangement { padding: 12px 0; margin-top: 12px; }
  .arrangement h2 { font-size: 15px; }
  .setting-row { margin-top: 8px; }
  .setting-row select, .segments { margin-top: 3px; }
  #patterns { margin-top: 10px; grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .pattern { min-height: 57px; padding: 7px 4px; font-size: 10px; }
  .pattern-rhythm { margin-bottom: 5px; height: 10px; }
  .pattern-rhythm b.hit { height: calc(9px * var(--accent, 1)); }
  .sliders { margin-top: 10px; }
  .sliders input { margin: 0; height: 25px; }
  .guide { padding-top: 13px; min-height: 0; display: grid; grid-template-rows: auto minmax(88px, 158px) auto; align-content: end; }
  .guide-heading { margin-bottom: 10px; }
  .chord-name > strong { font-size: 32px; }
  #keyboard { height: 100%; min-height: 0; }
  .pkey { padding-bottom: 8px; }
  .pkey.black { padding-bottom: 6px; }
  .pkey small { font-size: 8px; min-height: 10px; margin-top: 1px; }
  .guide-footer { margin-top: 7px; }
  .pending { margin-top: 9px; padding: 4px 8px; }
  .pending .icon { min-height: 38px; height: 38px; }
  .legend { max-width: none; }
}
@media (max-width: 760px) {
  body { grid-template-rows: 64px auto minmax(0, 1fr) auto; }
  main { display: block; overflow-y: auto; }
  .workspace { display: block; overflow: visible; }
  .library { display: block; }
  #presets { flex: none; }
  .arrangement { overflow: visible; }
  .transport { padding-top: 10px; padding-bottom: 10px; }
}
@media (min-width: 761px) and (max-height: 780px) {
  .performance .section-heading > div { display: flex; flex-direction: row-reverse; justify-content: flex-end; align-items: baseline; gap: 12px; }
  .performance .eyebrow { margin: 0; }
  .arrangement > .section-heading { display: none; }
  .arrangement > .setting-row:first-of-type { margin-top: 0; }
  .arrangement { padding-top: 8px; padding-bottom: 8px; }
  .pattern { min-height: 46px; padding-top: 5px; padding-bottom: 5px; }
  .pattern-rhythm { margin-bottom: 3px; height: 8px; }
  .guide { padding-top: 8px; }
  .guide-heading { margin-bottom: 8px; }
  .chord-name > strong { font-size: 28px; }
  .guide { grid-template-rows: auto minmax(88px, 110px) auto; }
}
