:root {
  color-scheme: light;
  --ink: #193b32;
  --muted: #52695d;
  --accent: #17634f;
  --line: #d6ded3;
  --pale: #edf3e9;
  --paper: #fff;
  --green: #c3e5a2;
  font-family: 'Segoe UI', system-ui, sans-serif;
  font-size: 14px;
  color: var(--ink);
  background: #e7ebe4;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  height: 100vh;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
button,
select,
input,
textarea {
  font: inherit;
  color: inherit;
}
button,
select,
input[type='number'],
input[type='text'],
input[type='search'],
textarea {
  border: 1px solid #bccabf;
  border-radius: 6px;
  background: white;
}
button,
select {
  cursor: pointer;
}
button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 7px 10px;
  font-weight: 530;
  line-height: 1.25;
}
button:hover:not(:disabled),
details[open] > summary,
summary:hover {
  background: #eaf1e6;
}
button:disabled {
  opacity: 0.42;
  cursor: default;
}
button:focus-visible,
summary:focus-visible,
input:focus-visible,
select:focus-visible,
[tabindex]:focus-visible {
  outline: 3px solid #6ba84d;
  outline-offset: 2px;
}
button.icon {
  width: 32px;
  height: 32px;
  padding: 6px;
}
.i {
  width: 17px;
  height: 17px;
  stroke: currentColor;
  stroke-width: 1.65;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
  flex: none;
}
select {
  padding: 6px 24px 6px 8px;
  min-height: 32px;
}
input[type='checkbox'],
input[type='range'] {
  accent-color: #17634f;
}
input[type='checkbox'] {
  width: 15px;
  height: 15px;
  margin: 0;
}
input[type='number'],
input[type='text'],
input[type='search'],
textarea {
  padding: 6px 8px;
  min-width: 0;
}
label {
  color: #354e41;
}
h1,
h2,
h3,
p {
  margin: 0;
}
.sr {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
[hidden] {
  display: none !important;
}
.mast {
  min-height: 64px;
  flex: none;
  background: #143e34;
  color: white;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 22px;
  gap: 12px;
}
.brand,
.file-actions,
.row,
.view-tools,
.play-section,
.zoom,
.tempo,
.search {
  display: flex;
  align-items: center;
}
.brand {
  gap: 11px;
  font-weight: 640;
  letter-spacing: -0.7px;
  font-size: 22px;
}
.file-actions {
  gap: 6px;
}
.file-actions button {
  color: #fff;
  border-color: transparent;
  background: transparent;
  padding: 8px 12px;
}
.file-actions button:hover:not(:disabled) {
  background: #2a5145;
}
.file-actions .save,
.primary,
button.primary {
  background: #c3e5a2;
  color: #16372b;
  border-color: #c3e5a2;
}
.file-actions .save:hover:not(:disabled),
button.primary:hover:not(:disabled) {
  background: #b6dc92;
}
.pipe {
  height: 22px;
  width: 1px;
  background: #527266;
  margin: 0 6px;
}
.groups {
  position: relative;
  display: flex;
  align-items: center;
  gap: 4px;
  flex: none;
  min-height: 43px;
  padding: 4px 14px;
  background: white;
  border-bottom: 1px solid var(--line);
  z-index: 8;
}
.groups details {
  position: relative;
}
.groups summary {
  list-style: none;
  display: flex;
  align-items: center;
  gap: 7px;
  cursor: pointer;
  padding: 7px 9px;
  border-radius: 5px;
  font-size: 13px;
  font-weight: 570;
  white-space: nowrap;
}
.groups summary::-webkit-details-marker {
  display: none;
}
.chev {
  width: 7px;
  height: 7px;
  transform: rotate(45deg);
  border: solid currentColor;
  border-width: 0 1.3px 1.3px 0;
  margin: -3px 1px 0 2px;
}
.menu {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  min-width: 195px;
  max-height: min(65vh, 540px);
  overflow: auto;
  background: white;
  box-shadow: 0 6px 20px #193b3226;
  border: 1px solid #cbd6c9;
  border-radius: 7px;
  padding: 5px;
  z-index: 20;
}
.menu button {
  width: 100%;
  border: 0;
  background: white;
  justify-content: flex-start;
  text-align: left;
  white-space: nowrap;
}
.menu hr {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 4px 1px;
}
.desk {
  display: flex;
  flex: 1;
  overflow: hidden;
  min-height: 0;
}
.palette {
  width: 243px;
  flex: none;
  background: #fdfefb;
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.side-title {
  padding: 18px 17px 13px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.side-title h2 {
  font-size: 17px;
  font-weight: 650;
  letter-spacing: -0.45px;
}
.palette-body {
  padding: 14px 15px 12px;
  overflow: auto;
}
.palette h3 {
  font-size: 14px;
  font-weight: 660;
}
.stack {
  display: block;
  margin: 9px 0 5px;
  font-size: 12px;
  color: var(--muted);
}
.palette select {
  width: 100%;
  font-size: 13px;
}
.pitches {
  margin-top: 8px;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 4px;
}
.tile {
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 4px 0 3px;
  height: 49px;
  color: var(--ink);
  font-size: 10px;
  font-weight: 550;
}
.tile > svg {
  height: 25px;
  max-width: 100%;
}
.side-rule {
  height: 1px;
  background: var(--line);
  margin: 18px 0 14px;
}
.between {
  justify-content: space-between;
  gap: 6px;
  margin-bottom: 7px;
}
.text-button {
  border: 0;
  padding: 3px 0;
  background: transparent;
  color: #1b654a;
  font-size: 11px;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.search {
  background: white;
  border: 1px solid #bccabf;
  border-radius: 6px;
  gap: 5px;
  padding-left: 8px;
  margin: 8px 0;
}
.search > span {
  display: flex;
  color: #607566;
}
.search input {
  width: 100%;
  border: 0;
  min-height: 30px;
  font-size: 12px;
  background: transparent;
}
.ornaments {
  display: grid;
  gap: 2px;
}
.ornament {
  justify-content: flex-start;
  border: 0;
  border-radius: 5px;
  min-height: 30px;
  padding: 2px 7px;
  background: transparent;
  text-align: left;
  font-weight: 450;
  font-size: 13px;
}
.ornament > svg {
  width: 26px;
  max-height: 23px;
  flex: none;
}
.empty {
  color: var(--muted);
  font-size: 13px;
  padding: 8px;
}
.mobile-palette,
.close-palette {
  display: none !important;
}
main {
  display: flex;
  flex: 1;
  min-width: 0;
  min-height: 0;
  flex-direction: column;
  background: #e7ebe4;
}
.title-row {
  flex: none;
  min-height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 21px;
  gap: 10px;
  background: #f3f5ef;
  border-bottom: 1px solid var(--line);
}
.tune-name {
  min-width: 0;
}
.tune-name > span {
  font-size: 10px;
  font-weight: 650;
  letter-spacing: 1.05px;
  text-transform: uppercase;
  color: #55765c;
}
.tune-name h1 {
  font-size: 21px;
  letter-spacing: -0.6px;
  line-height: 1.3;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.view-tools {
  gap: 5px;
  flex: none;
}
.view-tools label {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 4px;
  font-size: 12px;
}
.view-tools button:not(.icon) {
  font-size: 12px;
}
.stage {
  flex: 1;
  min-height: 0;
  overflow: auto;
  background: #e5eae3;
  position: relative;
  overscroll-behavior: contain;
}
.stage #score {
  min-width: 100%;
  min-height: 100%;
  padding: 23px 24px 30px;
  display: flex;
  flex-direction: column;
  align-items: safe center;
  gap: 16px;
}
.score-page {
  display: block;
  flex: none;
  box-shadow: 0 2px 9px #233d2c20;
  background: white;
}
.loading {
  margin: auto;
  padding: 40px;
  color: var(--muted);
}
#hint {
  font-size: 12px;
  padding: 7px 21px;
  background: #f3f5ef;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
}
.context {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  min-height: 39px;
  background: #f7f9f4;
  border-top: 1px solid var(--line);
  padding: 4px 12px;
}
.selection {
  font-size: 12px;
  color: #3d5946;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.note-actions {
  display: flex;
  align-items: center;
  gap: 3px;
}
.note-actions button {
  font-size: 11px;
  padding: 4px 6px;
  border: 1px solid transparent;
  background: transparent;
}
.note-actions button .i {
  width: 14px;
  height: 14px;
}
.transport {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 8px 15px;
  border-top: 1px solid #c1cebf;
  background: #fdfefb;
  min-height: 51px;
  flex: none;
  z-index: 3;
}
.transport button:not(.icon),
.transport select {
  font-size: 12px;
}
.play-section {
  gap: 3px;
}
.play-section .play {
  color: white;
  background: #1c654f;
  border-color: #1c654f;
  min-width: 72px;
}
.play-section .play:hover:not(:disabled) {
  background: #174c3f;
}
.tempo {
  gap: 5px;
  margin: 0 2px;
  color: var(--muted);
  font-size: 10px;
  letter-spacing: 0.5px;
}
.tempo input {
  width: 55px;
  font-size: 13px;
  letter-spacing: 0;
}
.transport-spacer {
  flex: 1;
}
.zoom {
  gap: 3px;
}
.zoom select {
  font-size: 12px;
}
.preview-bar {
  display: none;
}
#status {
  pointer-events: none;
  position: fixed;
  z-index: 60;
  bottom: 65px;
  left: 50%;
  transform: translateX(-50%);
  background: #183d32;
  color: white;
  border-radius: 7px;
  box-shadow: 0 2px 8px #0002;
  max-width: min(92vw, 600px);
  font-size: 13px;
}
#status:not(:empty) {
  padding: 10px 15px;
}
dialog {
  border: 1px solid #c4d0c0;
  border-radius: 12px;
  padding: 0;
  max-width: min(94vw, 740px);
  width: max-content;
  min-width: min(390px, 92vw);
  max-height: 85dvh;
  color: var(--ink);
  box-shadow: 0 16px 70px #12322538;
}
dialog::backdrop {
  background: #0e2d2352;
}
.dialog-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 15px 18px;
  border-bottom: 1px solid var(--line);
  gap: 22px;
}
.dialog-head h2 {
  font-size: 19px;
  letter-spacing: -0.4px;
}
.dialog-body {
  padding: 17px 18px;
  max-height: calc(85dvh - 122px);
  overflow: auto;
}
.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 7px;
  padding: 11px 18px;
  border-top: 1px solid var(--line);
}
.form-grid {
  display: grid;
  gap: 12px;
}
.field {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  font-size: 13px;
}
.field input:not([type='checkbox']):not([type='range']) {
  max-width: 130px;
}
.field select {
  max-width: 200px;
}
.field output {
  width: 37px;
  text-align: right;
  display: inline-block;
  font-variant-numeric: tabular-nums;
}
.section-title {
  font-size: 14px;
  margin: 12px 0 0;
}
.note-tone {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}
.note-tone th,
.note-tone td {
  padding: 3px 5px;
  text-align: left;
}
.note-tone input {
  width: 78px;
}
.library-search {
  width: 100%;
  margin-bottom: 8px;
}
.library-list {
  display: grid;
  min-width: min(440px, 73vw);
  gap: 1px;
}
.library-list button {
  justify-content: space-between;
  border: 0;
  text-align: left;
  background: transparent;
}
.library-list small {
  color: var(--muted);
  font-weight: 400;
}
.check-list {
  display: grid;
  gap: 4px;
}
.check-list label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  padding: 3px;
}
.preview .mast,
.preview .groups,
.preview .palette,
.preview .title-row,
.preview #hint,
.preview .context,
.preview .transport {
  display: none !important;
}
.preview .preview-bar {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: center;
  padding: 8px;
  background: #fff;
}
.preview .preview-bar strong {
  margin-right: 12px;
}
@media (max-width: 1100px) {
  .palette {
    width: 210px;
  }
  .stage #score {
    padding: 16px;
  }
  .groups {
    gap: 1px;
  }
  .groups summary {
    font-size: 12px;
    padding: 7px;
  }
  .selection {
    max-width: 190px;
  }
  .note-actions button {
    padding: 4px;
  }
}
@media (max-width: 850px) {
  .palette {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: min(290px, 87vw);
    z-index: 40;
    box-shadow: 0 0 0 100vmax #12322550;
  }
  .palette-open .palette {
    display: flex;
  }
  .close-palette,
  .mobile-palette {
    display: inline-flex !important;
  }
  .groups {
    flex-wrap: wrap;
  }
  .groups details:nth-last-child(-n + 2) .menu {
    left: auto;
    right: 0;
  }
  .title-row {
    padding: 7px 12px;
  }
  .context {
    flex-wrap: wrap;
  }
  .transport {
    gap: 4px;
    padding: 6px;
  }
  .file-actions .pipe {
    display: none;
  }
}
@media (max-width: 620px) {
  .mast {
    min-height: 48px;
    padding: 6px 9px;
    gap: 3px;
  }
  .brand {
    font-size: 16px;
    line-height: 1.08;
    gap: 6px;
    max-width: 145px;
    letter-spacing: -0.4px;
  }
  .brand img {
    width: 29px;
    height: 29px;
  }
  .file-actions {
    gap: 1px;
  }
  .file-actions button {
    padding: 7px;
    gap: 3px;
    font-size: 0;
  }
  .file-actions .save {
    font-size: 11px;
  }
  .groups {
    padding: 3px 4px;
    gap: 0;
    min-height: 0;
  }
  .groups summary {
    padding: 5px;
    font-size: 11px;
    gap: 4px;
  }
  .groups summary > .i {
    display: none;
  }
  .groups .chev {
    width: 5px;
    height: 5px;
  }
  .groups details .menu {
    position: fixed;
    left: 6px !important;
    right: auto !important;
    top: auto;
    max-width: 92vw;
  }
  .title-row {
    min-height: 47px;
    flex-wrap: wrap;
    gap: 4px;
  }
  .tune-name h1 {
    font-size: 17px;
    max-width: 90vw;
  }
  .view-tools {
    gap: 3px;
    flex-wrap: wrap;
  }
  .view-tools label {
    font-size: 11px;
  }
  .view-tools button.icon {
    width: 26px;
    height: 26px;
  }
  .view-tools button:not(.icon) {
    font-size: 11px;
    padding: 4px;
  }
  .context {
    padding: 3px 6px;
  }
  .context .selection {
    max-width: 100%;
  }
  .note-actions {
    max-width: 100%;
    overflow: auto;
  }
  .note-actions button {
    white-space: nowrap;
  }
  .transport {
    flex-wrap: wrap;
    gap: 3px;
  }
  .transport-spacer {
    display: none;
  }
  .transport .zoom {
    margin-left: auto;
  }
  .transport select {
    max-width: 145px;
  }
  .stage #score {
    padding: 8px;
  }
  .transport .i {
    width: 14px;
    height: 14px;
  }
  .transport button.icon {
    width: 26px;
    height: 27px;
  }
  .tempo input {
    width: 48px;
  }
  .transport button:not(.icon) {
    padding: 5px;
  }
  .play-section .play {
    min-width: 53px;
  }
  #hint {
    padding: 5px 10px;
    font-size: 11px;
  }
  .dialog-body {
    padding: 12px;
  }
}
@media print {
  @page {
    size: A4 portrait;
    margin: 0;
  }
  html,
  body,
  main,
  .desk,
  .stage,
  .stage #score {
    margin: 0 !important;
    padding: 0 !important;
    display: block !important;
    height: auto !important;
    min-height: 0 !important;
    overflow: visible !important;
    background: white !important;
  }
  .mast,
  .groups,
  .palette,
  .title-row,
  .context,
  .transport,
  .preview-bar,
  #hint,
  #status,
  dialog {
    display: none !important;
  }
  .score-page {
    margin: 0 !important;
    box-shadow: none !important;
    break-inside: avoid;
    break-after: page;
  }
  .score-page:last-child {
    break-after: auto;
  }
}
#setup-screen,
#starting {
  display: none;
}
body[data-phase='setup'] #setup-screen {
  display: grid;
  flex: 1;
  place-items: center;
  padding: 20px;
  background: #e9eee6;
  overflow: auto;
}
body[data-phase='loading'] #starting {
  display: block;
  margin: auto;
  font-size: 16px;
  color: var(--muted);
}
body:not([data-phase='editor']) .desk,
body:not([data-phase='editor']) .groups,
body:not([data-phase='editor']) .transport,
body:not([data-phase='editor']) .file-actions {
  display: none;
}
.pack-card {
  background: #fff;
  border: 1px solid #cbd7c8;
  box-shadow: 0 6px 22px #193b320e;
  max-width: 460px;
  padding: 32px 34px;
  border-radius: 12px;
  line-height: 1.5;
}
.pack-card h1 {
  font-size: 25px;
  font-weight: 640;
  letter-spacing: -0.7px;
  margin: 12px 0 6px;
}
.pack-card p {
  color: var(--muted);
}
.pack-card strong {
  font-weight: 600;
  color: var(--ink);
}
.pack-picker {
  position: relative;
  display: inline-flex;
  margin: 17px 0 12px;
  padding: 10px 15px;
  overflow: hidden;
  border-radius: 6px;
  font-weight: 550;
}
.pack-picker span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}
.pack-picker input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}
.pack-picker:focus-within {
  outline: 3px solid #6ba84d;
  outline-offset: 2px;
}
.pack-picker:hover {
  background: #b6dc92;
}
.pack-note {
  font-size: 12px;
}
.pack-card #setup-error {
  margin-top: 9px;
  font-size: 13px;
  color: #8e351f;
}
@media print {
  #setup-screen,
  #starting {
    display: none !important;
  }
}
