/* Minnesinger theme: the logo's cream, navy, red, and gold. Text colors meet WCAG AA (4.5:1) on cream and white. */
:root {
  --bg: #f7f2e7;        /* cream page */
  --panel: #fffdf8;     /* cards, bars, dialogs */
  --panel2: #f1eadb;    /* hover, wells */
  --line: #ddd2bd;
  --text: #1f2350;      /* logo navy */
  --muted: #545a7d;     /* 6:1 on cream */
  --accent: #c8391f;    /* logo red, darkened for text contrast */
  --accent2: #8a5a00;   /* gold as TEXT (logo gold is too light to read) */
  --gold: #e8b043;      /* logo gold, for fills only */
  --blue: #2f5bd3;
  --paper: #fffdf8;
  --ink: #15151f;
  --music: 'Noto Music', 'Segoe UI Symbol', 'Bravura', serif;
  --ui: 'Nunito', 'Segoe UI', system-ui, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg); color: var(--text);
  font: 15px/1.45 var(--ui);
  display: flex; flex-direction: column; overflow: hidden;
}
:focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; }
button {
  font: 600 14px/1.2 var(--ui); color: var(--text); background: #fff; border: 1px solid var(--line);
  border-radius: 10px; padding: 7px 12px; cursor: pointer; white-space: nowrap; box-shadow: 0 1px 0 #1f23500d;
}
button:hover { border-color: #b9ab8f; background: var(--panel2); }
button:disabled { opacity: .5; cursor: default; }
button.primary { background: linear-gradient(135deg, #d34027, #e3602f); border-color: transparent; color: #fff; font-weight: 800; }
button.primary:hover { background: linear-gradient(135deg, #bd341d, #d34027); }
button.hot { background: var(--gold); border-color: #d39a2c; color: var(--text); font-weight: 800; }
button.hot:hover { background: #f0c25e; }
button.small { padding: 4px 10px; font-size: 13px; }
button.toggle.on { background: #e3eaff; border-color: var(--blue); color: #1d3a8f; }
button.active { background: #dfe8fd; border-color: var(--blue); color: var(--text); box-shadow: inset 0 0 0 1px var(--blue); }
kbd {
  font: 11px/1 ui-monospace, Consolas, monospace; color: var(--muted); border: 1px solid var(--line); background: var(--panel);
  border-radius: 4px; padding: 2px 4px; margin-left: 5px; vertical-align: 1px;
}
button.active kbd { color: #fff; border-color: #ffffff88; background: transparent; }
.g { font-family: var(--music); font-size: 18px; line-height: 1; }

/* top bar */
.topbar { display: flex; align-items: center; gap: 16px; padding: 10px 16px; background: var(--panel); border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 10px; }
.tag { color: var(--muted); font-size: 13px; font-weight: 600; }
.songname { flex: 1; font-weight: 800; font-size: 18px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; cursor: pointer; color: var(--text); }
.actions { display: flex; gap: 6px; flex-wrap: wrap; }
.actions button { padding: 7px 10px; }
/* page tabs: Scriptorium | Da Capo */
.pages { display: flex; gap: 4px; }
.pages a { color: var(--muted); font-weight: 800; font-size: 14px; text-decoration: none; padding: 7px 12px; border-radius: 10px; white-space: nowrap; }
.pages a:hover { background: var(--panel2); color: var(--text); }
.pages a[aria-current="page"] { background: var(--text); color: #fff; }

/* toolbar */
.toolbar { display: flex; align-items: center; gap: 6px; padding: 8px 16px; background: #fbf7ee; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.toolbar .sep { width: 1px; height: 26px; background: var(--line); margin: 0 4px; }
.toolbar .group { display: inline-flex; gap: 4px; }
.toolbar select { padding: 6px 8px; border-radius: 10px; font-weight: 600; font-size: 14px; }

/* workspace */
.workspace { flex: 1; display: grid; grid-template-columns: 1fr 400px; min-height: 0; }
.scorepane { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.score { flex: 1; overflow: auto; position: relative; background: #ebe3d1; padding: 16px; }
#svg { display: block; background: var(--paper); border-radius: 8px; box-shadow: 0 4px 24px #1f235022; user-select: none; }
.floatin {
  position: absolute; z-index: 5; width: 130px; font: 15px Georgia, serif; padding: 2px 6px;
  border: 2px solid var(--blue); border-radius: 5px; background: #fff; color: #111; outline: none;
}
.status { padding: 7px 16px; font-size: 13.5px; color: var(--muted); background: var(--panel); border-top: 1px solid var(--line); min-height: 32px; }
.status b { color: var(--text); font-weight: 800; }
.status .warn { color: var(--accent); font-weight: 700; }

/* piano */
.piano[hidden] { display: none; }
.scorepane { position: relative; }
.piano-tab { position: absolute; right: 16px; bottom: 82px; z-index: 5; padding: 2px 10px; min-height: 0; font-size: 12px; font-weight: 700; border-radius: 8px 8px 0 0; border-bottom: 0; background: #e4dac4; }
.piano-tab.collapsed { bottom: 0; border-radius: 8px 8px 0 0; }
.piano { position: relative; height: 78px; background: #e4dac4; padding: 6px 16px 8px; display: flex; justify-content: center; border-top: 1px solid var(--line); }
.piano .keys { position: relative; height: 62px; }
.piano .w, .piano .b { position: absolute; top: 0; border-radius: 0 0 6px 6px; cursor: pointer; }
.piano .w { width: 30px; height: 62px; background: #fffdf8; border: 1px solid #b9ab8f; }
.piano .b { width: 20px; height: 38px; background: var(--text); z-index: 2; border: 1px solid #12142e; }
.piano .w:hover { background: #fde9c4; }
.piano .b:hover { background: #3a4290; }
.piano .lit { background: var(--gold) !important; }
.piano .lbl { position: absolute; bottom: 3px; width: 100%; text-align: center; font-size: 10px; font-weight: 700; color: #6b6450; pointer-events: none; }

/* side chart */
.side { display: flex; flex-direction: column; min-height: 0; background: var(--panel); border-left: 1px solid var(--line); position: relative; }
.sidehead { display: flex; justify-content: space-between; align-items: center; padding: 10px 14px; border-bottom: 1px solid var(--line); }
.sidehead h2 { margin: 0; font-size: 14px; font-weight: 800; text-transform: uppercase; letter-spacing: 1.5px; color: var(--muted); }
.chart { flex: 1; overflow: auto; padding: 10px 0; font: 13.5px/1.6 ui-monospace, Consolas, 'Cascadia Mono', monospace; }
.chart .cl { white-space: pre; padding: 0 14px; cursor: pointer; border-left: 4px solid transparent; min-height: 1.6em; }
.chart .cl:hover { background: var(--panel2); }
.chart .cl.chord { color: var(--accent2); font-weight: 700; }
.chart .cl.lyric { color: var(--text); }
.chart .cl.section { color: var(--accent); font-weight: 800; margin-top: 6px; }
.chart .cl.other { color: var(--muted); }
.chart .cl.here { background: #fdf0d2; border-left-color: var(--gold); }
.chartedit { display: flex; flex-direction: column; flex: 1; min-height: 0; padding: 10px; gap: 8px; }
.chartedit[hidden] { display: none; }
.chartedit textarea { flex: 1; resize: none; }
.chartedit .row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
textarea, input, select {
  font: inherit; color: var(--text); background: #fff; border: 1px solid #cbbfa6; border-radius: 10px; padding: 8px 10px;
}
textarea { font: 14px/1.5 ui-monospace, Consolas, monospace; white-space: pre; overflow: auto; }
input:focus, select:focus, textarea:focus { outline: 3px solid #2f5bd355; border-color: var(--blue); outline-offset: 0; }
::placeholder { color: #8a8698; }
.hint { color: var(--muted); font-size: 13.5px; }

/* dialogs */
dialog { border: 1px solid var(--line); border-radius: 20px; background: var(--panel); color: var(--text); padding: 0; box-shadow: 0 30px 80px #1f235040; }
dialog::backdrop { background: #1f235055; backdrop-filter: blur(3px); }
dialog h2 { font-size: 22px; font-weight: 800; }
#setup { width: min(1100px, 96vw); }
.dlghead { padding: 20px 24px 6px; }
.dlghead h1 { margin: 0; font-size: 30px; font-weight: 800; }
.dlghead p { margin: 6px 0 0; color: var(--muted); font-size: 16px; }
.dlgbody { display: grid; grid-template-columns: 310px 1fr; gap: 22px; padding: 14px 24px; }
.fields { display: flex; flex-direction: column; gap: 14px; }
.fields label { display: flex; flex-direction: column; gap: 5px; font-size: 14px; font-weight: 700; color: var(--muted); }
.fields .two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.modes { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; }
.fields label.radio { flex-direction: row; align-items: center; gap: 6px; color: var(--text); font-size: 15px; }
.detected { font-size: 14px; font-weight: 700; color: var(--accent2); }
.songs { border-top: 1px solid var(--line); padding-top: 10px; max-height: 210px; overflow: auto; }
.songs h3 { margin: 0 0 6px; font-size: 13px; font-weight: 800; color: var(--muted); text-transform: uppercase; letter-spacing: 1px; }
.songs .item { display: flex; align-items: center; gap: 6px; padding: 6px 8px; border-radius: 10px; cursor: pointer; }
.songs .item:hover { background: var(--panel2); }
.songs .item .t { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.songs .item .d { color: var(--muted); font-size: 13px; }
.songs .item button { padding: 2px 8px; font-size: 13px; }
.chartin { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.chartinhead { display: flex; justify-content: space-between; align-items: center; font-size: 14px; font-weight: 700; color: var(--muted); }
.chartinhead span { display: flex; gap: 6px; }
#fChart { height: 380px; resize: vertical; }
.ugrow { display: flex; gap: 6px; }
.ugrow input { flex: 1; min-width: 0; }
.ugresults { border: 1px solid var(--line); border-radius: 8px; background: var(--panel); max-height: 240px; overflow-y: auto; font-size: 14px; }
.ugresults .r { display: flex; gap: 8px; align-items: baseline; padding: 6px 10px; cursor: pointer; border-bottom: 1px solid var(--line); }
.ugresults .r:last-child { border-bottom: 0; }
.ugresults .r:hover, .ugresults .r:focus { background: var(--panel2); outline: none; }
.ugresults .r .t { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ugresults .r .t b { font-weight: 700; }
.ugresults .r .d { color: var(--muted); font-size: 13px; white-space: nowrap; }
.ugresults .msg { padding: 8px 10px; color: var(--muted); }
.ugsource { font-size: 13px; color: var(--muted); }
.ugsource a { color: var(--accent); }
.dlgfoot { display: flex; justify-content: flex-end; gap: 10px; padding: 14px 24px 20px; }
.dlgfoot button { font-size: 15px; padding: 9px 16px; }
/* Melody from audio: a full-screen workshop */
#melody { width: 100vw; height: 100vh; max-width: none; max-height: none; margin: 0; border: 0; border-radius: 0; }
.mel { height: 100%; box-sizing: border-box; padding: 10px 16px 12px; display: flex; flex-direction: column; gap: 8px; }
.melhead { display: flex; align-items: center; gap: 16px; }
.melhead h2 { margin: 0; white-space: nowrap; font-size: 20px; }
.melhead .melsrc { flex: 1; }
.melx { font-size: 18px; padding: 4px 12px; }
.meltools { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 18px; padding: 6px 10px; background: var(--panel2); border: 1px solid var(--line); border-radius: 10px; }
.tgroup { display: flex; align-items: center; gap: 6px; }
.tlabel { font-size: 13px; font-weight: 800; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.meltools select { font-size: 14px; }
.lens button { display: flex; align-items: center; gap: 5px; padding: 3px 8px; font-size: 13px; border-radius: 8px; }
.lens button .sw { width: 12px; height: 12px; border-radius: 3px; flex-shrink: 0; }
.lens button .g { font-family: var(--music); font-size: 19px; line-height: 1; }
.lens button.on { outline: 2px solid var(--text); outline-offset: 1px; }
.rollbox { flex: 1; min-height: 220px; display: flex; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: #0b0c18; }
#melKeys { flex-shrink: 0; display: block; }
.rollbox .roll { flex: 1; min-width: 0; height: auto; border: 0; border-radius: 0; }
.roll #melRoll { position: sticky; left: 0; }
#melRollSpace { height: 1px; }
.melinfo { font-size: 14px; min-height: 20px; color: var(--muted); }
.melinfo b { color: var(--text); }
.melinfo .g { font-family: var(--music); font-size: 18px; color: var(--text); }
.melhelp { font-size: 13px; color: var(--muted); line-height: 1.7; background: var(--panel2); border-radius: 10px; padding: 6px 10px; }
.melhelp[hidden] { display: none; }
.melfoot { display: flex; align-items: center; gap: 10px; }
.melfoot .melsum { flex: 1; }
.melfoot button { font-size: 15px; padding: 9px 16px; }
.melsrc, .melctl { display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: center; }
.melctl label { display: flex; align-items: center; gap: 6px; font-size: 14px; font-weight: 600; color: var(--muted); }
.melctl input[type=number] { width: 84px; }
label.check { display: flex; align-items: center; gap: 6px; font-size: 14px; color: var(--muted); }
label.check.sep { color: var(--text); font-size: 15px; }
label.check.sep b { color: var(--accent); }
label.check.sep.off { opacity: .5; }
button.rec { color: var(--accent); font-weight: 800; }
button.rec.on { background: var(--accent); color: #fff; border-color: var(--accent); animation: pulse 1s infinite; }
@keyframes pulse { 50% { opacity: .7; } }
@media (prefers-reduced-motion: reduce) { button.rec.on { animation: none; } .toast { transition: none; } }
.roll { overflow-x: auto; overflow-y: hidden; background: #0b0c18; border: 1px solid var(--line); border-radius: 12px; height: 318px; }
.rollbar { display: flex; gap: 12px; align-items: center; justify-content: space-between; }
.rollbar .hint b { color: var(--accent2); }
.rolltools { display: flex; gap: 6px; align-items: center; flex-shrink: 0; }
.edited { color: var(--accent2); font-size: 14px; font-weight: 700; display: flex; gap: 6px; align-items: center; }
.edited[hidden] { display: none; }
.roll canvas { display: block; cursor: crosshair; }
.melsum { font-size: 15px; color: var(--text); min-height: 22px; }
.melsum b { color: var(--accent); }
.small-dlg { padding: 20px 24px 0; width: min(460px, 94vw); display: flex; flex-direction: column; gap: 12px; }
.small-dlg h2 { margin: 0; }
.small-dlg p { margin: 0; }
.small-dlg > label { display: flex; flex-direction: column; gap: 5px; font-size: 14px; font-weight: 700; color: var(--muted); }
.small-dlg .dlgfoot { padding: 6px 0 20px; }
.xparts { display: flex; flex-direction: column; gap: 6px; max-height: 50vh; overflow: auto; }
.xparts label { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border: 1px solid var(--line); border-radius: 8px; background: #fff; cursor: pointer; font-size: 15px; }
.xparts label:has(input:checked) { border-color: var(--accent); box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 25%, transparent); }
.xparts .pn { font-weight: 700; }
.sp-range { display: flex; gap: 12px; flex-wrap: wrap; margin: 0 0 4px 30px; }
.sp-range[hidden], .xparts label[hidden], #spPcHint[hidden] { display: none; }
.xparts .sp-range label { padding: 4px 8px; cursor: default; }
.sp-range input { width: 84px; min-height: 40px; font: inherit; }
.xparts .pc { margin-left: auto; color: var(--muted); font-size: 13.5px; text-align: right; }
#help form { padding: 18px 24px 0; width: min(680px, 94vw); }
#help h2 { margin: 0 0 10px; }
.keys { border-collapse: collapse; width: 100%; font-size: 15px; }
.keys td { padding: 6px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
.keys td:first-child { white-space: nowrap; width: 1%; }
.keys kbd { margin: 0; font-size: 12px; color: var(--text); }

.toast {
  position: fixed; left: 50%; bottom: 100px; transform: translate(-50%, 20px); opacity: 0; pointer-events: none;
  background: var(--text); color: #fff; font-size: 15px; font-weight: 600; padding: 11px 18px; border-radius: 14px;
  transition: .25s; z-index: 50; max-width: 80vw; box-shadow: 0 10px 30px #1f235040;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* score svg classes */
.staff line { stroke: #222; stroke-width: 1; }
/* Staff lines never take the click: the score finds what's under the pointer from its position, and a grey rest
   (or anything else) under a line stays clickable. */
#svg .staff line { pointer-events: none; }
.bar { stroke: #222; stroke-width: 1.2; }
.bar.thick { stroke-width: 4; }
.music { font-family: var(--music); fill: var(--ink); }
.chordsym { font: var(--chord-weight, 700) var(--chord-size, 17px) var(--chord-font); fill: #111; cursor: text; }
.chordsym.dragging { fill: var(--blue); }
.chordsym .cacc { font: 400 var(--chord-size, 17px) var(--cacc-font); }
.acc line { stroke: var(--ink); stroke-width: 1.1; }
.acc line.thick { stroke-width: 2.6; }
.acc .bowl { fill: none; stroke: var(--ink); stroke-width: 2; }
.sel .acc line, .sel .acc .bowl { stroke: var(--blue); }
.restfill { fill: var(--ink); }
.reststroke { fill: none; stroke: var(--ink); stroke-width: 2.8; stroke-linejoin: round; }
.reststroke.thin { stroke-width: 1.6; }
.sel .restfill { fill: var(--blue); }
.sel .reststroke { stroke: var(--blue); }
.lyr { font: var(--lyr-size, 14px) var(--sheet-font); fill: #111; text-anchor: middle; }
.lyr.auto { fill: #1d2c7a; }
.lyr.vnum { font-weight: 700; }
.versepick select { min-width: 4.2em; }
.title { font: 700 var(--title-size, 35px) var(--sheet-font); fill: #111; text-anchor: middle; }
#svg .title { cursor: text; }
.sub { font: 13px var(--sheet-font); fill: #333; }
.secbox { fill: #fff; stroke: #111; stroke-width: 1.4; }
.sectxt { font: 700 13px var(--sect-font); fill: #111; }
.mnum { font: italic 10px var(--sheet-font); fill: #777; }
.direction { font: italic 12px var(--sheet-font); fill: #444; }
/* Notes / Text look picker: app.js sets these on the score svg. Defaults = the Minnesinger look. */
#svg {
  --sheet-font: Georgia, 'Times New Roman', serif;
  --chord-font: 'Outfit', 'Segoe UI', sans-serif;
  --sect-font: 'Outfit', sans-serif;
  --cacc-font: 'Segoe UI Symbol', 'Noto Music', sans-serif;
  --note-font: 'MS Bravura';
  --timesig-font: 700 23px Georgia, serif;
}
.smufl { font-family: var(--note-font); font-size: 40px; fill: var(--ink); font-style: normal; font-weight: 400; }
.sel .smufl { fill: var(--blue); }
.rng .smufl { fill: #23408f; }
.look { display: inline-flex; gap: 8px; align-items: center; }
.look label { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; font-weight: 700; color: var(--muted); }
.note { fill: var(--ink); stroke: var(--ink); }
.note.hollow { fill: none; stroke-width: 1.6; }
.stem { stroke: var(--ink); stroke-width: 1.3; }
.beam, .tie { fill: var(--ink); }
.slur { fill: var(--ink); }
.dyn.msel, .ntext.msel, .direction.msel { fill: var(--blue); }
.hairpin.msel { stroke: var(--blue); stroke-width: 2; }
.slur { cursor: move; }
.slurh { fill: #fff; stroke: var(--blue); stroke-width: 1.5; cursor: grab; }
.slurguide { fill: none; stroke: var(--blue); stroke-width: 1; stroke-dasharray: 3 3; opacity: .6; }
@media print { .slurh, .slurguide { display: none; } }
.slur.msel { fill: var(--blue); }
.hairpin { cursor: grab; }
.floatin.chordin { font: 700 17px 'Outfit', 'Segoe UI', sans-serif; padding: 0 4px; height: 24px; border: 2px solid var(--blue); background: #fffdf8; }
.hairpin { fill: none; stroke: var(--ink); stroke-width: 1.3; }
/* Piano pedal: "Ped." then the bracket line under the left hand (a notch where it changes, a hook where it lets go). */
.pedal { fill: none; stroke: var(--ink); stroke-width: 1.2; stroke-linejoin: miter; cursor: grab; }
.pedal.msel { stroke: var(--blue); stroke-width: 2; }
.pedtxt { font: italic 700 15px 'Times New Roman', Georgia, serif; fill: var(--ink); cursor: grab; }
.pedtxt.msel { fill: var(--blue); }
.pagenum { font: 700 26px Georgia, 'Times New Roman', serif; fill: var(--ink); }
[data-pn].on::before { content: '● '; color: var(--blue); }
.pedlbl { font: italic 700 14px 'Times New Roman', Georgia, serif; }
.dyn { font: italic 700 16px 'Times New Roman', Georgia, serif; fill: var(--ink); letter-spacing: -0.5px; cursor: pointer; }
.ntext { font: italic 13px Georgia, serif; fill: #222; cursor: text; }
.direction { cursor: text; }
.selbox { fill: #2f5bd31a; stroke: var(--blue); stroke-width: 1; stroke-dasharray: 4 3; pointer-events: none; }
.rng .note { fill: #23408f; stroke: #23408f; }
.rng .note.hollow { fill: none; }
.ledger { stroke: #222; stroke-width: 1.2; }
.sel .note, .sel .stem { fill: var(--blue); stroke: var(--blue); }
.sel .note.hollow { fill: none; }
.sel .music { fill: var(--blue); }
.last .note { stroke: #2a4fb0; }
.ghostrest { opacity: .18; }
/* Start bar next to ▶ Play: ⏮, the Bar box, ▲ ▼ */
.tostart { font-size: 17px; padding: 6px 10px; }
.barnav { display: inline-flex; align-items: center; gap: 5px; font: 700 13px var(--ui); color: var(--muted); }
.barnav input { width: 58px; font: 700 16px var(--ui); color: var(--text); text-align: center; padding: 5px 4px; border: 2px solid var(--line); border-radius: 8px; background: #fff; }
.barnav input::-webkit-inner-spin-button { display: none; }
.barnav .barspin { display: inline-flex; flex-direction: column; gap: 1px; }
.barnav .barspin button { min-height: 0; padding: 0 6px; font-size: 10px; line-height: 15px; height: 17px; border-radius: 5px; }
.barnav .barof { font-weight: 600; font-size: 12px; }
/* The mouse's job on the music: Select & move ⟷ Click to add (a big switch at the front of the toolbar) */
.syncchip { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; min-height: 40px; border-radius: 999px; border: 2px solid var(--line); background: var(--panel); font: 600 13px var(--ui); cursor: pointer; max-width: 340px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.syncchip.ok { border-color: #2e8b57; }
.syncchip.busy { border-color: #c9a227; }
.syncchip.bad { border-color: #c0392b; background: #fdecea; }
.modeswitch { display: inline-flex; align-items: center; gap: 10px; padding: 6px 14px; min-height: 40px; border-radius: 999px; border: 2px solid var(--line); background: var(--panel); font: 700 14px var(--ui); cursor: pointer; }
.modeswitch .ms-side { color: var(--muted); transition: color .15s; white-space: nowrap; }
.modeswitch:not(.on) .ms-sel, .modeswitch.on .ms-add { color: var(--text); }
.modeswitch.on .ms-add { color: #1d6b38; }
.modeswitch .ms-track { position: relative; width: 52px; height: 28px; border-radius: 999px; background: #c9c3b4; transition: background .15s; flex: none; }
.modeswitch.on .ms-track { background: #2e9d57; }
.modeswitch .ms-knob { position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; box-shadow: 0 1px 4px #0004; transition: left .15s; }
.modeswitch.on .ms-knob { left: 27px; }
.modeswitch.on { border-color: #2e9d57; background: #eaf7ee; }
.modeswitch:focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; }
#tbBacking:not(.on) .ms-add { color: var(--muted); text-decoration: line-through; }
/* The beat under the mouse: a thin line with "bar:beat" over it */
#svg #beatcur { pointer-events: none; }
#svg #beatcur line { stroke: #d2691e; stroke-width: 1.2; opacity: .8; }
#svg #beatcur text { font: 700 10px var(--ui); fill: #d2691e; stroke: #fffdf8; stroke-width: 3px; paint-order: stroke; }
/* Where Ctrl+V will paste: the beat you clicked */
#svg .pastemark { pointer-events: none; }
#svg .pastemark path { fill: var(--blue); }
#svg .pastemark line { stroke: var(--blue); stroke-width: 1.5; stroke-dasharray: 3 2; }
@media print { #svg #beatcur, #svg .pastemark { display: none; } }
.mpanel .mnote { font-size: 12px; color: var(--muted); max-width: 300px; margin: 4px 10px 6px; line-height: 1.35; white-space: normal; }
/* The spot where a staff's name goes: always clickable (opens the name window), invisible */
#svg .namehit { fill: transparent; cursor: pointer; }
#svg .namehit:hover { fill: #2f5bd312; }
@media print { #svg .namehit { display: none; } }
/* Fermatas can be clicked (hit area invisible); a selected one is blue */
#svg .fermhit { fill: transparent; cursor: pointer; }
#svg .fermg.fsel path, #svg .fermg.fsel circle, #svg .fermg.fsel text { fill: var(--blue); stroke: var(--blue); }
@media print { #svg .fermhit { display: none; } }
/* A selected chord symbol (and its diagram) */
#svg .cselbox { fill: #2f5bd318; stroke: var(--blue); stroke-width: 1.5; pointer-events: none; }
#svg .diag.csel { outline: none; }
#svg .diag.csel * { stroke: var(--blue); }
@media print { #svg .cselbox { display: none; } }
/* One note of a chord picked (second click on it) */
#svg .tonering { fill: none; stroke: var(--blue); stroke-width: 2; pointer-events: none; }
/* One note of a chord picked: that head drawn selected, over the chord's black heads */
#svg .tonehead { pointer-events: none; }
#svg .tonehead text, #svg .tonehead .note { fill: var(--blue) !important; }
#svg .tonehead .note.hollow { fill: none !important; stroke: var(--blue) !important; }
/* Bars selected across staves (Shift+click) */
#svg .bselrect { fill: #2f5bd322; stroke: var(--blue); stroke-width: 1.5; pointer-events: none; }
@media print { #svg .bselrect { display: none; } }
#svg .ghostrest[data-gm] { cursor: pointer; }
#svg .ghostrest[data-gm]:hover { opacity: .55; }
.cursor { fill: var(--blue); opacity: .85; }
.mbg { fill: transparent; }
.mbg.cur { fill: #2f5bd30d; }
.mbg.range { fill: #2f5bd322; }
.mbg.over { fill: #c8391f22; }
/* The hover preview: a see-through note of the length that will go in. */
#ghost { pointer-events: none; opacity: .45; }
#ghost .gsym { font-family: 'MS BravuraFull'; font-size: 40px; fill: var(--blue); }
#ghost .gledger { stroke: var(--blue); stroke-width: 1.2; }
#playhead { fill: #e8b04340; pointer-events: none; }

@media (max-width: 900px) {
  .workspace { grid-template-columns: 1fr; grid-template-rows: 1fr 220px; }
  .side { border-left: 0; border-top: 1px solid var(--line); }
  .dlgbody { grid-template-columns: 1fr; }
  .tag { display: none; }
}

/* chart words: click for how it's sung, drag onto a note */
.chart .cl .w { cursor: grab; border-radius: 4px; }
.chart .cl .w:hover { background: var(--gold); color: var(--text); }
.chart .cl .w.on { background: var(--blue); color: #fff; }
.splitpop { position: absolute; left: 10px; right: 10px; z-index: 20; background: var(--panel); border: 2px solid var(--blue);
  border-radius: 14px; padding: 12px 14px; box-shadow: 0 12px 40px #1f235033; display: flex; flex-direction: column; gap: 8px; }
.splitpop[hidden] { display: none; }
.splitpop .sphead { display: flex; align-items: center; gap: 8px; }
.splitpop .sphead b { font-size: 17px; }
.splitpop .sphead button { margin-left: auto; }
.splitpop .spcount { color: var(--accent2); font-size: 14px; font-weight: 700; }
.splitpop label { display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 700; color: var(--muted); }
.splitpop input { flex: 1; font: 16px ui-monospace, Consolas, monospace; letter-spacing: .5px; }
.splitpop p { margin: 0; }
.splitpop .row { display: flex; gap: 6px; flex-wrap: wrap; }
.lyrtarget { fill: #2f5bd322; stroke: var(--blue); stroke-width: 1.5; }
.lyrghost { fill: var(--blue); opacity: .85; pointer-events: none; }

/* lyrics by voice */
#voice { width: min(660px, 96vw); }
.voice { padding: 18px 24px 0; display: flex; flex-direction: column; gap: 12px; }
.voice h2, .voice p { margin: 0; }
.vrow { display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: center; }
.vrow[hidden] { display: none; }
.vrow label:not(.check) { display: flex; align-items: center; gap: 6px; font-size: 14px; font-weight: 700; color: var(--muted); }
.vrow input[type=number] { width: 76px; }
.vmodes { display: flex; flex-direction: column; gap: 8px; }
.vmodes label.radio { display: flex; gap: 8px; align-items: flex-start; font-size: 15px; }
.vmodes label.radio input { margin-top: 4px; }
.vheard { display: flex; flex-direction: column; gap: 5px; font-size: 14px; font-weight: 700; color: var(--muted); }
.vheard textarea { white-space: pre-wrap; font: 16px/1.5 Georgia, serif; }
#vSum b { color: var(--accent); }

/* brand: logo, mascot */
.brand .mark { height: 34px; width: 34px; display: block; }
.brand .word { height: 26px; width: auto; display: block; }
.dlghead.branded { display: flex; align-items: center; gap: 18px; }
.dlghead.branded h1 { display: flex; align-items: center; gap: 12px; }
.dlghead.branded h1 .mark { height: 52px; width: 52px; }
.dlghead.branded h1 .word { height: 42px; width: auto; }
.mascot-stand { flex: none; width: 126px; height: 150px; border-radius: 50%;
  background: radial-gradient(closest-side, #e8b04340, #e8b04314 70%, transparent); display: grid; place-items: end center; }
.mascot-stand img { width: 106px; height: auto; display: block; }
.face { width: 32px; height: 32px; border-radius: 9px; vertical-align: -7px; margin-right: 8px; box-shadow: 0 0 0 1px var(--line); }
.peek { flex: none; height: 66px; overflow: hidden; display: flex; justify-content: flex-end; padding-right: 14px;
  border-top: 1px solid var(--line); pointer-events: none; background: linear-gradient(#fffdf8, #fbf3e2); }
.peek img { width: 64px; height: auto; margin-top: 8px; }
.toast::before { content: ""; display: inline-block; width: 20px; height: 20px; margin-right: 8px; vertical-align: -4px;
  background: url(assets/icon-gold.png) center / contain no-repeat; }
@media (max-width: 760px) { .mascot-stand { display: none; } .peek { display: none; } }

/* ---------- Sound: header button, status dot, the Sound panel ---------- */
.side[hidden] { display: none; }
.workspace > .side { grid-column: 2; grid-row: 1; }
.workspace.sound-open { grid-template-columns: 1fr 460px; }
#btnSound { display: inline-flex; align-items: center; gap: 7px; }
#btnSound.on { background: #e3eaff; border-color: var(--blue); color: #1d3a8f; }
.sdot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; flex: none; box-shadow: 0 0 0 2px #fff, 0 0 0 3px #1f235022; }
.sdot.grey { background: #a19c90; }
.sdot.green { background: #2e9b4f; }
.sdot.amber { background: var(--gold); }
.sdot.red { background: var(--accent); }
.snd { flex: 1; overflow: auto; padding: 10px 14px 16px; display: flex; flex-direction: column; gap: 10px; font-size: 14px; }
.sndstat { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; background: var(--panel2); border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; font-weight: 600; }
.sndstat #sndStatText { flex: 1; min-width: 160px; }
.sndrow { display: flex; align-items: center; gap: 8px 10px; flex-wrap: wrap; }
.sndrow[hidden] { display: none; }
.sndrow > label:not(.check) { display: flex; align-items: center; gap: 6px; font-weight: 700; color: var(--muted); }
.sndrow label.check[hidden] { display: none; }
.snd select { padding: 5px 8px; font-size: 14px; border-radius: 8px; }
.sndsaveas input { flex: 1; min-width: 140px; padding: 6px 8px; }
.sndparts { display: flex; flex-direction: column; gap: 8px; }
.spart { border: 1px solid var(--line); border-radius: 12px; background: #fff; padding: 8px 10px; display: flex; flex-direction: column; gap: 6px; }
.spart.master { background: #fbf7ee; }
.spart .sp1, .spart .sp2, .spart .sp3 { display: flex; align-items: center; gap: 6px 8px; flex-wrap: wrap; }
.spart .sp1 b { width: 58px; flex: none; font-weight: 800; }
.spart .sp2 { padding-left: 66px; }
.spart .sp2 .fxsel { flex: 1; min-width: 120px; max-width: 180px; }
.spart .sw { display: flex; align-items: center; gap: 4px; color: var(--muted); font-size: 13px; font-weight: 700; }
.spart .sw select { font-size: 13px; padding: 4px 6px; }
.spart.master .sp1 .fxsel { flex: 1; max-width: 220px; }
.ipick { flex: 1; min-width: 0; display: flex; align-items: center; justify-content: space-between; gap: 6px; text-align: left; overflow: hidden; text-overflow: ellipsis; padding: 5px 10px; font-size: 14px; }
.ipick .caret { color: var(--muted); font-size: 13px; }
.spart .sp3 label { display: flex; align-items: center; gap: 4px; font-size: 13px; font-weight: 700; color: var(--muted); }
.spart .sp3 input[type=range] { width: 92px; padding: 0; accent-color: var(--accent); border: 0; background: transparent; }
.spart .sp3 .pl input[type=range] { width: 64px; accent-color: var(--text); }
.spart .sp3 .timing { width: 54px; padding: 2px 4px; font: 600 13px var(--ui); border: 1px solid var(--line); border-radius: 6px; background: #fff; color: var(--text); }
.vval, .pval { min-width: 46px; font-variant-numeric: tabular-nums; color: var(--text); font-weight: 600; }
.pval { min-width: 30px; }
button.ms { padding: 3px 8px; font-size: 13px; font-weight: 800; border-radius: 7px; }
button.ms.mute.on { background: var(--accent); border-color: var(--accent); color: #fff; }
button.ms.solo.on { background: var(--gold); border-color: #d39a2c; color: var(--text); }
.meter { flex: 1; min-width: 40px; height: 8px; border-radius: 4px; background: var(--panel2); border: 1px solid var(--line); overflow: hidden; }
.meter i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #2e9b4f, #8cc63f 70%, var(--gold)); transition: width .08s linear; }
.meter i.hot { background: var(--accent); }
.pstat { font-size: 13px; color: var(--muted); padding-left: 66px; }
.pstat .warn, .blocked .warn { color: var(--accent); font-weight: 700; }
.pstat a, .blocked a { color: var(--accent); font-weight: 700; }
.sndfoot { display: flex; flex-direction: column; gap: 8px; border-top: 1px solid var(--line); padding-top: 10px; }
.sndfoot .row { display: flex; gap: 8px; flex-wrap: wrap; }
.sndfoot details[hidden] { display: none; }
.sndfoot summary { cursor: pointer; font-weight: 700; color: var(--text); }
.devbox { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding: 8px 0 0; }
.devbox label { display: flex; flex-direction: column; gap: 3px; font-size: 13px; font-weight: 700; color: var(--muted); }
.devbox p { grid-column: 1 / -1; margin: 0; }
.devbox button { justify-self: start; }
.blocked { border: 1px solid var(--line); border-radius: 10px; padding: 6px 10px; background: var(--panel2); display: flex; flex-direction: column; gap: 4px; font-size: 13px; }
.sndfoot p.hint { margin: 0; }
/* instrument picker: search, then plugins grouped by maker */
.ipop { position: fixed; z-index: 60; width: 330px; max-height: 360px; display: flex; flex-direction: column; gap: 6px; padding: 8px;
  background: var(--panel); border: 2px solid var(--blue); border-radius: 12px; box-shadow: 0 14px 40px #1f235040; }
.ipop input { padding: 6px 10px; font-size: 14px; }
.ilist { overflow: auto; display: flex; flex-direction: column; }
.ilist .ig { font-size: 13px; font-weight: 800; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; padding: 6px 6px 2px; }
.ilist .ig small { text-transform: none; letter-spacing: 0; font-weight: 600; margin-left: 6px; }
.ilist .ifam { font-size: 13px; font-weight: 700; color: #8a5a00; padding: 6px 8px 1px; }
.ilist .iitem { text-align: left; border: 0; box-shadow: none; border-radius: 8px; padding: 6px 8px; font-size: 14px; display: flex; flex-direction: column; background: transparent; }
.ilist .iitem small { font-size: 13px; color: var(--muted); font-weight: 400; }
.ilist .iitem:hover { background: var(--panel2); }
.ilist .iitem.cur { background: #e3eaff; color: #1d3a8f; }
.ilist p { margin: 6px; }
@media (max-width: 900px) {
  .workspace > .side { grid-column: 1; grid-row: 2; }
  .workspace.sound-open { grid-template-columns: 1fr; grid-template-rows: 1fr 50vh; }
}

/* ---------- Touch screens (touch.js adds html.touch) and small windows ----------
   Nothing is taken away on a small screen: the header buttons move into ☰ Menu, the chart into a drawer,
   dialogs fill the screen. With a mouse on a wide window none of this shows. */
.menubtn, .drawerbtn, .tkeys, .actions .qc, .touchonly, table.touchkeys { display: none; }
html.touch .touchonly { display: inline; }
html.touch table.touchkeys { display: table; margin-top: 12px; }
.ttip { position: fixed; z-index: 100; max-width: 320px; background: var(--text); color: #fff; font: 600 14px/1.4 var(--ui);
  padding: 8px 12px; border-radius: 10px; box-shadow: 0 10px 30px #1f235040; pointer-events: none; }
/* on-screen keys: under the music, and in the melody workshop's tool row */
html.touch .tkeys { display: flex; align-items: center; gap: 6px; }
#touchKeys { flex-wrap: nowrap; overflow-x: auto; padding: 6px 10px; background: #fbf7ee; border-top: 1px solid var(--line); scrollbar-width: thin; }
#touchKeys > * { flex: none; }
.tkeys button { min-width: 44px; min-height: 44px; padding: 6px 10px; font-size: 15px; font-weight: 700; }
.tkeys button[data-mod].on { background: var(--text); border-color: var(--text); color: #fff; }
.tkeys .sep { width: 1px; height: 28px; background: var(--line); margin: 0 2px; }
.tkeys .letters { display: inline-flex; gap: 4px; }
.meltkeys { flex: none; flex-wrap: nowrap; overflow-x: auto; padding: 2px 0; scrollbar-width: thin; }
.meltkeys > * { flex: none; }
/* fingers: every control at least 44 px, no tiny type, the app does its own scrolling where you draw */
html.touch button, html.touch select, html.touch .pages a,
html.touch input:not([type=checkbox]):not([type=radio]):not([type=range]):not([type=file]) { min-height: 44px; }
html.touch button.small, html.touch .lens button, html.touch .songs .item button, html.touch button.ms { min-height: 44px; min-width: 44px; padding: 6px 12px; font-size: 14px; }
html.touch input[type=checkbox], html.touch input[type=radio] { width: 22px; height: 22px; }
html.touch input[type=range] { height: 32px; }
html.touch .toolbar kbd, html.touch .meltools kbd { display: none; }
html.touch .toolbar .g, html.touch .lens button .g { font-size: 20px; }
html.touch .score, html.touch #melRollWrap, html.touch #melKeys { touch-action: none; }
html.touch .chart { touch-action: pan-x pan-y; }
html.touch .chart .cl { padding-top: 3px; padding-bottom: 3px; }
html.touch .chart .cl .w { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; padding: 2px 0; }
html.touch #svg, html.touch .roll canvas { -webkit-touch-callout: none; }
html.touch .floatin { font-size: 16px; } /* 16 px keeps phones from zooming the page while you type */
html.touch .floatin.chordin { height: 34px; font-size: 17px; }
html.touch .piano { overflow-x: auto; justify-content: flex-start; }
html.touch .piano .lbl { font-size: 13px; }
html.touch .ilist .iitem { min-height: 44px; justify-content: center; }
html.touch .ugresults .r, html.touch .songs .item { min-height: 44px; }
html.touch .xparts label { min-height: 48px; }
html.touch .actions .qc { display: inline-flex; }
.actions .qc { align-items: center; gap: 6px; font: 700 14px/1.2 var(--ui); color: var(--text); background: var(--gold); border: 1px solid #d39a2c;
  border-radius: 10px; padding: 7px 12px; text-decoration: none; white-space: nowrap; }

@media (max-width: 820px) {
  .topbar { flex-wrap: wrap; gap: 8px 10px; padding: 8px 12px; position: relative; z-index: 30; }
  .brand .word { display: none; }
  .songname { order: 2; min-width: 0; font-size: 16px; }
  .menubtn { display: inline-flex; align-items: center; order: 3; min-height: 44px; font-size: 15px; }
  .pages { order: 4; width: 100%; }
  .pages a { flex: 1; display: flex; align-items: center; justify-content: center; min-height: 44px; font-size: 15px; }
  /* menus: the ☰ Menu opens the menu bar as a panel over the top of the toolbar; each menu folds open like an accordion */
  .toolbar { position: relative; padding: 0; z-index: 40; }
  .toolbar > .actions { display: none; }
  .topbar.open ~ .toolbar > .actions { display: flex; flex-direction: column; flex-wrap: nowrap; gap: 4px; position: absolute; top: 0; left: 8px; right: 8px;
    z-index: 45; padding: 10px; background: var(--panel); border: 1px solid var(--line); border-radius: 16px; box-shadow: 0 20px 50px #1f235040;
    max-height: calc(100dvh - 150px); overflow-y: auto; }
  .quick { flex-wrap: nowrap; overflow-x: auto; padding: 6px 10px; gap: 6px; scrollbar-width: thin; }
  .quick > * { flex: none; }
  .toolbar button, .toolbar select { min-height: 44px; }
  .toolbar button { min-width: 44px; }
  .workspace, .workspace.sound-open { grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(0, 1fr) auto; }
  .workspace > .side { grid-column: 1; grid-row: 2; min-width: 0; border-left: 0; border-top: 1px solid var(--line); }
  /* the status line is one line; tap it to read all of it */
  .status { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-height: 0; cursor: pointer; }
  .status.full { white-space: normal; }
  .drawerbtn { display: inline-block; }
  .workspace:not(.chart-open) .chartside > :not(.sidehead) { display: none !important; }
  .workspace.chart-open .chartside { height: 42dvh; }
  .chartside .sidehead { padding: 6px 12px; }
  .chartside .sidehead > div { display: flex; gap: 6px; }
  .workspace > .soundside { position: fixed; inset: 0; z-index: 40; border: 0; }
  .score { padding: 8px; }
  .piano { overflow-x: auto; justify-content: flex-start; padding: 6px 8px; }
  .piano .lbl { font-size: 13px; }
  .status { padding: 8px 12px; }
  .peek { display: none; }
  /* dialogs become full-screen sheets */
  dialog, #setup, #voice { width: 100vw; max-width: 100vw; height: 100dvh; max-height: 100dvh; margin: 0; border: 0; border-radius: 0; overflow-y: auto; }
  dialog > form, dialog > div { min-height: 100%; }
  .small-dlg, #help form { width: auto; padding: 16px 14px 0; }
  .dlghead { padding: 14px 14px 4px; }
  .dlghead h1 { font-size: 24px; }
  .dlghead.branded h1 .mark { height: 40px; width: 40px; }
  .dlghead.branded h1 .word { height: 30px; }
  .dlghead p { font-size: 15px; }
  .dlgbody { grid-template-columns: 1fr; gap: 14px; padding: 10px 14px; }
  #fChart { height: 40dvh; }
  .dlgfoot { position: sticky; bottom: 0; background: var(--panel); border-top: 1px solid var(--line); padding: 10px 14px calc(10px + env(safe-area-inset-bottom)); }
  .dlgfoot button { min-height: 48px; flex: 1; }
  .voice { padding: 14px 14px 0; }
  .keys td:first-child { white-space: normal; width: 34%; }
  /* the melody workshop scrolls as a page; the picture keeps a good height */
  .mel { overflow-y: auto; padding: 8px 10px 10px; }
  .melhead { flex-wrap: wrap; gap: 8px 12px; }
  .melhead h2 { font-size: 18px; }
  .melx { margin-left: auto; min-width: 48px; min-height: 48px; }
  .melhead .melsrc { order: 3; flex-basis: 100%; }
  .meltools { flex: none; flex-wrap: nowrap; overflow-x: auto; gap: 8px 14px; scrollbar-width: thin; }
  .meltools .tgroup { flex: none; }
  .melsrc .hint { font-size: 13px; }
  .rollbox { flex: none; height: 52dvh; min-height: 260px; }
  .melctl input[type=number] { width: 76px; }
  .melfoot { flex-wrap: wrap; padding-top: 6px; }
  .melfoot .melsum { flex-basis: 100%; }
  .melfoot button { flex: 1; min-height: 48px; }
  .ipop { width: calc(100vw - 16px) !important; left: 8px !important; }
  .splitpop { left: 6px; right: 6px; }
}

/* ---------------- Instruments + Score view ---------------- */
.staffpick { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; font-size: 13px; color: var(--muted); }
.staffpick select { max-width: 220px; }
.staffpick.other select { border-color: var(--blue); color: var(--blue); }
#svg .editing { fill: var(--blue); font-weight: 700; }
.inst-dlg { min-width: min(880px, 94vw); }
.inst-list li { flex-wrap: wrap; }
.inst-list li input:not([type=range]) { min-width: 160px; }
.inst-list { list-style: none; margin: 8px 0 14px; padding: 0; display: grid; gap: 6px; }
.inst-list li { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.inst-list li input { flex: 1; min-width: 0; font: 600 14px var(--ui); padding: 6px 8px; border: 1px solid var(--line); border-radius: 8px; }
.inst-list li .clefs { font-size: 12px; color: var(--muted); white-space: nowrap; }
.inst-list li.lead { background: var(--panel2); }
.inst-list li button { padding: 6px 10px; }
.inst-add { display: flex; gap: 8px; margin-top: 4px; }
.inst-add select { flex: 1; }
/* Score view: the chart folds away and the music takes the whole width. */
.toolbar .seg { gap: 0; }
.toolbar .seg > button { border-radius: 0; margin-left: -1px; }
.toolbar .seg > button:first-child { border-radius: 10px 0 0 10px; margin-left: 0; }
.toolbar .seg > button:last-child { border-radius: 0 10px 10px 0; }
.toolbar .seg[hidden] { display: none; }
.workspace.score-mode { grid-template-columns: minmax(0, 1fr); }
.workspace.score-mode .chartside { display: none; }
#svg.paged { background: transparent; box-shadow: none; border-radius: 0; margin: 0 auto; }
#svg .page { fill: var(--paper); stroke: #d8ccb4; filter: drop-shadow(0 3px 10px #1f235026); }
#svg .iname { font: 600 14px var(--ui); fill: var(--ink); }
#svg .iname.active { fill: var(--blue); font-weight: 800; }
#svg .brace { fill: var(--ink); }
/* Score view: things you can drag anywhere (title, tempo, composer, rehearsal marks, staff names). */
#svg .mov { cursor: move; }
#svg .mov:hover text, #svg .mov:hover .secbox { fill: var(--blue); }
#svg .mov:hover .secbox { fill: #2f5bd312; stroke: var(--blue); }
#svg .grid line { stroke: #2f5bd316; stroke-width: 0.6; }
#svg .grid line.major { stroke: #2f5bd333; stroke-width: 0.8; }
#svg .gaph { cursor: ns-resize; opacity: 0.35; }
#svg .gaph:hover { opacity: 1; }
#svg .gaph rect { fill: var(--panel2); stroke: var(--line); }
#svg .gaph path { fill: var(--muted); }
/* A staff drawn smaller (folio staff sizes): its lines keep their weight and full ink */
#svg .szband .staff line { stroke: #222; stroke-width: calc(1px * var(--szw, 1)); }
#svg .szband .bar { stroke-width: calc(1.2px * var(--szw, 1)); }
#svg .szband .stem { stroke-width: calc(1.3px * var(--szw, 1)); }
#svg .szband .ledger { stroke-width: calc(1.2px * var(--szw, 1)); }
#svg .szband .lyrext, #svg .szband .tupbr { stroke-width: calc(1px * var(--szw, 1)); }
#svg .szband .endline { stroke-width: calc(1.2px * var(--szw, 1)); }
#svg .pgap .pgapline { stroke: var(--muted); stroke-width: 1; stroke-dasharray: 3 3; }
.name-dlg { min-width: min(520px, 92vw); }
/* Voice 2: written on its own staff below (tinted), then merged into the staff. */
#svg .v2bg { fill: #2f5bd30d; stroke: #2f5bd355; stroke-dasharray: 4 3; }
#svg .v2label { font: 700 11px var(--ui); fill: var(--blue); }
/* Hidden (H): faint and dashed in the editor; not drawn on paper. */
#svg .hiddenobj { opacity: 0.28; }
#svg .fsel text, #svg .fsel .secbox { fill: var(--blue); }
#svg .fsel .secbox { fill: #2f5bd318; stroke: var(--blue); }
.hotkeys input[type=search] { width: 100%; font: 600 15px var(--ui); padding: 9px 12px; border: 1px solid var(--line); border-radius: 10px; margin: 6px 0 4px; }
.hotkeys h3 { margin: 16px 0 4px; font-size: 13px; text-transform: uppercase; letter-spacing: 1.2px; color: var(--muted); }
.hotkeys h3[hidden], .hotkeys tr[hidden] { display: none; }
.hotkeys .hk { display: inline-block; font: 700 12.5px ui-monospace, Consolas, monospace; background: var(--panel2); border: 1px solid var(--line); border-radius: 6px; padding: 2px 7px; white-space: nowrap; }
.hotkeys td:first-child { width: 36%; }
/* Dockable palettes (Notes, Dynamics): columns on the left / right of the music; drag the title bar to move. */
.scorerow { flex: 1; display: flex; min-height: 0; min-width: 0; }
.scorerow > .score { flex: 1; min-width: 0; }
.pdock { display: flex; flex-direction: column; gap: 10px; padding: 10px 8px; background: var(--panel); overflow-y: auto; flex: none; }
.pdock.left { border-right: 1px solid var(--line); }
.pdock.right { border-left: 1px solid var(--line); }
.pdock.empty { display: none; }
.pdock.drop { outline: 3px dashed var(--blue); outline-offset: -6px; background: #2f5bd310; display: flex; min-width: 40px; }
.palette { display: grid; grid-template-columns: 1fr; gap: 5px; width: 112px; align-content: start; }
.palette.cols2 { grid-template-columns: 1fr 1fr; width: 220px; }
.palette button { white-space: nowrap; overflow: hidden; }
.palette[hidden], .pdock.top .palette[hidden], .pdock .palette[hidden] { display: none !important; }
.palette .pal-grip { grid-column: 1 / -1; cursor: grab; user-select: none; font: 800 10px var(--ui); letter-spacing: 0.6px; text-transform: uppercase; color: var(--muted); padding: 4px 6px; border-radius: 8px; background: var(--panel2); touch-action: none; display: flex; align-items: center; justify-content: space-between; gap: 4px; }
.palette .pal-grip:active { cursor: grabbing; }
.palette .pal-cols { padding: 0 4px; min-height: 0; font-size: 13px; line-height: 1.2; border-radius: 5px; }
.palette .pal-cols[hidden] { display: none; }
.palette .pal-x { padding: 0 5px; min-height: 0; font-size: 15px; line-height: 1.1; border-radius: 5px; margin-left: 2px; }
.palette .pal-x:hover { color: var(--accent); border-color: var(--accent); }
.palette #durGroup { grid-column: 1 / -1; display: grid; grid-template-columns: 1fr; gap: 5px; }
.palette.cols2 #durGroup { grid-template-columns: 1fr 1fr; }
/* Docked at the top: rows under the writing tools (drop a palette into a row, or under the last row for a new one). */
.pdock.top { flex-direction: column; gap: 4px; padding: 5px 16px; border-bottom: 1px solid var(--line); overflow: visible; }
.pdock.top .prow { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; min-height: 34px; }
.pdock.top .prow[hidden] { display: none; }
.pal-dropline { position: fixed; z-index: 300; display: none; background: var(--blue); border-radius: 2px; box-shadow: 0 0 0 2px #2f5bd355; pointer-events: none; }
.pdock.top .palette { display: flex; flex-wrap: wrap; align-items: center; width: auto; gap: 4px; }
.pdock.top .palette #durGroup { display: inline-flex; gap: 4px; }
.pdock.top .palette .pal-grip { padding: 6px 8px; }
.pdock.top .palette .dynb { min-width: 38px; }
.palette button { padding: 6px 4px; min-width: 0; font-size: 15px; display: inline-flex; align-items: center; justify-content: center; gap: 3px; }
.palette button kbd { font-size: 9px; padding: 0 3px; }
.palette button.active, .palette button.on { background: var(--text); color: #fff; border-color: var(--text); }
.palette #btnChordBuild { grid-column: 1 / -1; }
.palette .pg { font-family: 'MS BravuraFull'; font-size: 24px; line-height: 0; position: relative; top: 4px; }
.palette .mk-more { grid-column: 1 / -1; font-weight: 700; color: var(--blue); }
.marks-dlg { width: min(1100px, 96vw); max-height: 90vh; }
.mk-wrap { padding: 20px 24px; }
.mk-bar { display: flex; gap: 10px; margin: 8px 0 12px; }
.mk-bar input { flex: 1; font: 600 15px var(--ui); padding: 8px 12px; border: 1px solid var(--line); border-radius: 10px; }
.mk-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 8px; max-height: 62vh; overflow-y: auto; padding: 2px; }
.mk-tile { position: relative; display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 14px 6px 8px; border: 1px solid var(--line); border-radius: 12px; background: #fff; cursor: pointer; text-align: center; }
.mk-tile:hover { border-color: var(--blue); background: #2f5bd30a; }
.mk-tile .mk-glyph { height: 34px; padding-top: 22px; }
.mk-name { font-size: 11.5px; font-weight: 600; color: var(--muted); line-height: 1.2; }
.mk-pin { position: absolute; top: 4px; right: 4px; padding: 0 3px; min-height: 0; font-size: 12px; opacity: 0.35; border: 0; background: none; }
.mk-pin.on, .mk-tile:hover .mk-pin { opacity: 1; }
.palette small { font-size: 10px; color: var(--muted); font-weight: 600; }
.palette .pal-sub { grid-column: 1 / -1; font: 800 10px var(--ui); text-transform: uppercase; letter-spacing: 0.6px; color: var(--muted); margin-top: 6px; }
.pdock.top .palette .pal-sub { margin: 0 0 0 8px; }
.palette .dynb { font: italic 700 17px 'EB Garamond', Georgia, serif; }
/* Road map buttons: one height, one text size, signs the same size as the words. */
#palRoad button { height: 34px; padding: 0 8px; gap: 5px; font: 700 14px var(--ui); color: var(--text); overflow: hidden; }
#palRoad button i { font: italic 700 15px 'EB Garamond', Georgia, serif; }
#palRoad button small { font-size: 11px; }
#palRoad .pg { font-size: 18px; line-height: 0; position: relative; top: 0.32em; display: inline-block; }
#palRoad button[data-road^="repeat"] .pg { font-size: 16px; top: 0.5em; }
/* Sing it in (next to Fit) */
.singgrp { display: inline-flex; align-items: center; gap: 4px; }
.singgrp .qsrec.rec { background: #d92d2d; border-color: #d92d2d; color: #fff; }
.singgrp .qsmsg { font: 700 13px var(--ui); color: #d92d2d; min-width: 92px; }
.palette.dragging { position: fixed; z-index: 200; background: var(--panel); padding: 8px; border-radius: 12px; box-shadow: 0 10px 30px #1f235044; opacity: 0.95; }
@media (max-width: 820px) {
  .scorerow { flex-direction: column; }
  .pdock { flex-direction: row; overflow-x: auto; padding: 6px; border: 0; border-bottom: 1px solid var(--line); }
  .palette { grid-template-columns: none; grid-auto-flow: column; width: auto; }
  .palette #durGroup { grid-template-columns: none; grid-auto-flow: column; grid-column: auto; }
  .palette .pal-grip { grid-column: auto; }
}
dialog label[hidden] { display: none; }
/* The × on every popup window. */
dialog { position: fixed; }
dialog > .dlg-x { position: absolute; top: 10px; right: 12px; z-index: 5; width: 36px; height: 36px; padding: 0; border-radius: 50%;
  font: 400 26px/1 var(--ui); color: var(--muted); background: var(--panel); border: 1px solid var(--line); display: flex; align-items: center; justify-content: center; }
dialog > .dlg-x:hover { color: var(--accent); border-color: var(--accent); background: #fff; }
.tup-dlg { min-width: min(600px, 94vw); }
.tup-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-weight: 700; font-size: 16px; }
.tup-row input { width: 4.2em; font: 700 16px var(--ui); padding: 6px 8px; }
.tup-quick { display: flex; flex-wrap: wrap; gap: 6px; margin: 12px 0; }
.tup-quick button { padding: 4px 10px; font-size: 13px; }
.tup-result { font-weight: 700; color: var(--blue); min-height: 1.4em; }
.sf-dlg { min-width: min(680px, 94vw); }
.sf-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 16px; }
.sf-grid fieldset { border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px; display: flex; flex-direction: column; gap: 4px; }
.sf-grid legend { font-weight: 700; font-size: 13px; color: var(--muted); padding: 0 4px; }
.sf-grid label.check { display: flex; gap: 8px; align-items: center; font-weight: 600; }
.sf-quick { display: flex; gap: 6px; margin-bottom: 4px; }
.sf-quick button, .sf-only { padding: 2px 10px; font-size: 12px; min-height: 0; border-radius: 8px; }
.sf-only { margin-left: auto; opacity: 0.7; }
.sf-only:hover { opacity: 1; }
.sf-voices { display: flex; flex-direction: column; gap: 4px; max-height: 220px; overflow-y: auto; }
#btnSelFilter.on { background: var(--blue); color: #fff; border-color: var(--blue); }
.chord-dlg { min-width: min(640px, 94vw); }
.cb-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 16px; }
.cb-grid label[hidden] { display: none; }
.cb-result { font-size: 16px; margin: 14px 0 0; }
.volctl { display: inline-flex; align-items: center; gap: 6px; }
.volctl input[type=range] { width: 110px; padding: 0; border: 0; }
.volctl .volpct { font-size: 12px; color: var(--muted); min-width: 36px; font-variant-numeric: tabular-nums; }
.volctl button { padding: 4px 8px; }
#svg .diag { cursor: pointer; }
#svg .diag .dg { stroke: var(--ink); stroke-width: 0.8; }
#svg .diag .dgnut, #svg .diag .dgdot { fill: var(--ink); }
#svg .diag .dgo { fill: none; stroke: var(--ink); stroke-width: 0.9; }
#svg .diag .dgx { font: 600 9px var(--ui); fill: var(--ink); }
#svg .diag .dgfr { font: 600 8px var(--ui); fill: var(--ink); }
#svg .diag:hover .dgdot, #svg .diag:hover .dgnut { fill: var(--blue); }
#svg .tupnum { font: italic 700 13px 'EB Garamond', Georgia, serif; fill: var(--ink); }
#svg .tupbr { fill: none; stroke: var(--ink); stroke-width: 1; }
#svg .tupcur .note, #svg .tupcur.rest * { fill: var(--accent); stroke: var(--accent); }
#svg .rptbar, #svg .rptdot { fill: var(--ink); }
#svg .endline { stroke: var(--ink); stroke-width: 1.2; }
#svg .endnum { font: 700 13px 'EB Garamond', Georgia, serif; fill: var(--ink); }
#svg .roadword { font: italic 700 15px 'EB Garamond', Georgia, serif; fill: var(--ink); }
#svg .roadsign { font-family: 'MS BravuraFull'; font-size: 30px; fill: var(--ink); }
#svg .mnumbox { fill: none; stroke: var(--ink); stroke-width: 0.8; }
#svg .tempomark { font: 700 14px 'EB Garamond', Georgia, serif; fill: var(--ink); }
#svg .lyrext { stroke: var(--ink); stroke-width: 1; }
#svg .tempohead, #svg .tempomark { cursor: text; }
#svg .tempohead:hover, #svg .tempomark:hover { fill: var(--blue); }
#svg .tempoword { font: italic 700 15px 'EB Garamond', Georgia, serif; fill: var(--ink); }
#svg .fermata { fill: none; stroke: var(--ink); stroke-width: 1.6; }
#svg .smark { font-family: 'MS BravuraFull'; font-size: 40px; fill: var(--ink); pointer-events: none; }
#svg .sel .smark { fill: var(--blue); }
.mk-glyph { font-family: 'MS BravuraFull'; font-size: 34px; line-height: 1; display: block; height: 30px; overflow: visible; }
#svg .artic-line { stroke: var(--ink); stroke-width: 1.8; }
#svg .artic-stroke { fill: none; stroke: var(--ink); stroke-width: 1.4; stroke-linejoin: miter; }
#svg .artic-tr { font: italic 700 15px 'EB Garamond', Georgia, serif; fill: var(--ink); }
#svg .sel .artic-stroke, #svg .sel .artic-line { stroke: var(--blue); }
/* An ornament picked (click it; drag it anywhere in its bar): blue. */
#svg .orn.msel .smark, #svg .orn.msel .artic-tr { fill: var(--blue); }
#svg .orn.msel .artic-stroke { stroke: var(--blue); }
#svg .orn { cursor: move; }
#svg .partname { font: 700 16px 'EB Garamond', Georgia, serif; fill: var(--ink); }
#svg .mmrest rect { fill: var(--ink); }
#svg .mmrest line { stroke: var(--ink); stroke-width: 1.3; }
#svg .mmnum { font: 700 18px 'EB Garamond', Georgia, serif; fill: var(--ink); }
.papersel { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; font-size: 13px; color: var(--muted); }
/* Print preview: every sheet at the paper's exact shape. */
.print-dlg { width: min(1400px, 96vw); height: 92vh; max-height: 92vh; }
.pd-wrap { display: flex; flex-direction: column; height: 100%; }
.pd-bar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 14px 20px; border-bottom: 1px solid var(--line); }
.pd-bar h2 { margin: 0 8px 0 0; }
.pd-bar label { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; font-size: 14px; }
.pd-info { color: var(--muted); font-size: 14px; }
.pd-grow { flex: 1; }
.pd-hint { margin: 8px 20px 0; }
.pd-pages { flex: 1; overflow: auto; display: flex; flex-wrap: wrap; gap: 28px; justify-content: center; align-content: flex-start; padding: 20px; background: #d9d3c6; }
.pd-sheet { margin: 0; width: min(560px, 90%); background: #fff; box-shadow: 0 4px 18px #1f235040; position: relative; }
.pd-sheet svg { display: block; width: 100%; height: 100%; }
.pd-sheet figcaption { position: absolute; left: 0; right: 0; bottom: -22px; text-align: center; font-size: 12px; color: var(--muted); }
.pd-sheet .page { fill: #fff; stroke: none; filter: none; }
.printpages { display: none; }
.pd-set { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 16px; padding: 8px 20px 0; font: 600 14px var(--ui); }
.pd-set[hidden] { display: none; }
.pd-set label { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }
.pd-set .pd-set-lbl { color: var(--muted); font-weight: 700; }
.pd-cover { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.cover-dlg { border: 0; border-radius: 12px; padding: 0; max-width: 620px; width: 94vw; }
.cover-form { display: flex; flex-direction: column; gap: 10px; padding: 20px 22px; }
.cover-form h2 { margin: 0; }
.cover-form label { display: flex; flex-direction: column; gap: 3px; font-size: 13px; flex: 1; }
.cover-form input { padding: 6px 8px; font: inherit; font-size: 15px; }
.cover-form .cv-row { display: flex; gap: 10px; }
.cover-form .cv-row label:first-child { flex: 0 0 40%; }
.cover-form .cv-btns { display: flex; gap: 8px; margin-top: 6px; }
/* Print view, Galley view, Grid, and Paper exist only in the score view (app.js applyView sets hidden). */
#layoutGroup[hidden], .toolbar .seg[hidden] { display: none !important; }
/* On paper, the rests that fill out an unfinished bar print as real rests. */
.printpage .ghostrest, .pd-sheet .ghostrest { opacity: 1; }
@media print {
  @page { margin: 0; }
  /* paper is pure white: the app's cream page color must never print (11-28) */
  html, body.printing, body.printing #printPages { background: #fff !important; }
  body.printing > *:not(#printPages) { display: none !important; }
  body.printing #printPages { display: block; }
  body.printing .printpage { display: block; page-break-after: always; break-after: page; background: #fff; box-shadow: none; border-radius: 0; }
  body.printing .printpage .page { fill: #fff; stroke: none; filter: none; }
  body.printing .printpage .mbg, body.printing .printpage .cursor, body.printing .printpage #selbox,
  body.printing .printpage #ghost, body.printing .printpage #playhead,
  body.printing .printpage .grid, body.printing .printpage .gaph { display: none; }
  body.printing .printpage .iname.active { fill: var(--ink); font-weight: 600; }
  body.printing .printpage .sel, body.printing .printpage .last, body.printing .printpage .rng { fill: var(--ink); stroke: var(--ink); }
}

/* ---------- Menu bar and hint-friendly toolbar (menus.js, hints.js) ---------- */
.toolbar { display: block; padding: 0; position: relative; z-index: 40; }
.menubar { display: flex; flex-wrap: wrap; gap: 2px; padding: 4px 12px; background: var(--panel); border-bottom: 1px solid var(--line); align-items: center; }
.quick { display: flex; align-items: center; gap: 6px; padding: 8px 16px; flex-wrap: wrap; }
.quick .sep { width: 1px; height: 26px; background: var(--line); margin: 0 4px; }
.quick .group { display: inline-flex; gap: 4px; }
.quick select { padding: 6px 8px; border-radius: 10px; font-weight: 600; font-size: 14px; }
.quick .seg { gap: 0; }
.quick .seg > button { border-radius: 0; margin-left: -1px; }
.quick .seg > button:first-child { border-radius: 10px 0 0 10px; margin-left: 0; }
.quick .seg > button:last-child { border-radius: 0 10px 10px 0; }
.menu { position: relative; }
.mtop { background: transparent; border-color: transparent; font-weight: 700; padding: 6px 12px; border-radius: 8px; }
.mtop:hover, .mtop[aria-expanded=true] { background: var(--text); border-color: var(--text); color: #fff; }
.mpanel { position: absolute; top: calc(100% + 2px); left: 0; z-index: 60; min-width: 250px; padding: 6px; display: flex; flex-direction: column; gap: 1px;
  background: var(--panel); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 16px 40px #1f235040; }
.mpanel[hidden], .msubpanel[hidden] { display: none; }
.mpanel.right { left: auto; right: 0; }
.mpanel > button, .mpanel > a, .mpanel .msub > button, .msubpanel > button, .mpanel .group > button {
  display: flex; align-items: center; gap: 8px; width: 100%; text-align: left; border-color: transparent; background: transparent; padding: 7px 10px;
  border-radius: 8px; font: 600 14px/1.2 var(--ui); color: var(--text); text-decoration: none; cursor: pointer; box-sizing: border-box; }
.mpanel > a.qc { background: transparent; border-color: transparent; }
.mpanel > button:hover, .mpanel > a:hover, .mpanel .msub > button:hover, .msubpanel > button:hover, .mpanel .group > button:hover { background: var(--panel2); }
.mpanel button:focus-visible, .mpanel a:focus-visible, .mpanel select:focus-visible, .mtop:focus-visible { outline: 2px solid var(--blue); outline-offset: -2px; }
.mpanel button.primary, .mpanel button.hot { color: var(--text); }
.mpanel button.toggle::before { content: ""; width: 1.1em; flex: none; text-align: center; }
.mpanel button.toggle.on { background: #e3eaff; color: #1d3a8f; }
.mpanel button.toggle.on::before { content: "✓"; font-weight: 800; }
.mpanel button:disabled { opacity: .45; cursor: default; }
.mpanel button.active { background: #e3eaff; color: #1d3a8f; }
.mpanel kbd { margin-left: auto; }
.mpanel hr { border: 0; border-top: 1px solid var(--line); margin: 4px 2px; width: auto; }
.mpanel .group { display: flex; flex-direction: column; gap: 1px; }
.mpanel .mrow { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 4px 10px; font: 600 14px var(--ui); }
.mpanel .mrow select { max-width: 190px; }
.mpanel .papersel { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 4px 10px; font: 600 14px var(--ui); }
.msub > .msubtop::after { content: "▸"; margin-left: auto; }
.msub > .msubtop[aria-expanded=true]::after { content: "▾"; }
.msubpanel { display: flex; flex-direction: column; padding-left: 14px; }
/* Checked menu items (11-28): a ✓ and the normal row, not a blue box on every one. Wins over the toolbar's
   toggle styles, which were leaking into the menus. */
.mpanel button.toggle.on, .msubpanel button.toggle.on, .mpanel .group > button.toggle.on {
  background: transparent !important; border-color: transparent !important; box-shadow: none !important; color: var(--text) !important; }
.mpanel button.toggle.on:hover, .msubpanel button.toggle.on:hover { background: var(--panel2) !important; }
.mpanel button.toggle.on::before { color: var(--blue); }
/* A submenu's items sit on a thin rule so it's clear what belongs to it. */
.mpanel .msubpanel { margin: 2px 0 4px 12px; padding-left: 6px; border-left: 2px solid var(--line); }
.mpanel .sdot { margin-left: auto; }
@media (max-width: 820px) {
  .menubar { display: flex; }
  .mpanel { position: static; box-shadow: none; border: 0; min-width: 0; padding: 0 0 4px 12px; background: transparent; }
  .mtop { text-align: left; width: 100%; min-height: 48px; font-size: 16px; background: var(--panel2); border-color: var(--line); color: var(--text); }
  .mtop::after { content: "▸"; float: right; }
  .mtop[aria-expanded=true]::after { content: "▾"; }
  .mtop:hover, .mtop[aria-expanded=true] { background: var(--text); color: #fff; border-color: var(--text); }
  .menu { width: 100%; }
  .mpanel > button, .mpanel > a, .mpanel .msub > button, .msubpanel > button, .mpanel .group > button { min-height: 48px; font-size: 16px; }
  .mpanel .mrow, .mpanel .papersel { min-height: 48px; font-size: 16px; }
  .topbar.open ~ .toolbar > .actions { padding: 8px; }
}
html.touch .mpanel kbd { display: none; }
.actions .mpanel > a.qc { display: flex; }
@media (max-width: 820px) {
  .quick { flex-wrap: nowrap; overflow-x: auto; padding: 6px 10px; }
  .quick > * { flex: none; }
}
.mpanel .group[hidden], #layoutGroup[hidden] { display: none !important; }

/* Sections from the score, and barlines of any kind */
#palBar button { height: 34px; padding: 0 6px; gap: 4px; font: 700 13px var(--ui); color: var(--text); overflow: hidden; }
#palBar button small { font-size: 10px; }
#palBar .pg { font-size: 18px; line-height: 0; position: relative; top: 0.32em; display: inline-block; }
#palBar button[data-bl^="repeat"] .pg { font-size: 16px; top: 0.5em; }
/* Clefs: the clef sign in its own box on the left, its name beside it; the whole sign inside the button. */
#palClef button { height: 46px; min-height: 46px; padding: 0 10px 0 4px; gap: 6px; font: 700 13px var(--ui); color: var(--text); overflow: hidden; display: inline-flex; align-items: center; justify-content: flex-start; }
.pdock.top #palClef button { height: 46px; min-height: 46px; }
#palClef button small { font: 600 12px var(--ui); color: var(--text); }
#palClef .pg { flex: none; width: 24px; height: 40px; font-size: 19px; line-height: 0; position: relative; display: inline-block; text-align: center; padding-top: 25px; box-sizing: border-box; }
#palClef button.on { background: #dfe8fd; color: var(--text); border-color: var(--blue); box-shadow: inset 0 0 0 1px var(--blue); }
#palClef button:disabled { opacity: 0.4; }
#palClef #clWhere { text-transform: none; letter-spacing: 0; font-size: 11px; }
#svg .clefcue { pointer-events: none; }
#palBar .blside { grid-column: 1 / -1; }
#palBar .blwide { grid-column: 1 / -1; font-size: 12px; }
#palBar .blside.on { background: #dfe8fd; color: var(--text); border-color: var(--blue); box-shadow: inset 0 0 0 1px var(--blue); }
#palBar #blWhere { text-transform: none; letter-spacing: 0; font-size: 11px; }
#svg .blsel { fill: #2f5bd322; stroke: var(--blue); stroke-width: 1.2; pointer-events: none; }
#svg .secdrop { fill: #2f5bd322; stroke: var(--blue); stroke-width: 2; stroke-dasharray: 5 3; pointer-events: none; }
.ctxmenu { position: fixed; z-index: 300; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 10px 30px #1f235055; padding: 6px; min-width: 190px; display: flex; flex-direction: column; gap: 2px; }
.ctxmenu[hidden] { display: none; }
.ctxmenu button { text-align: left; font-size: 14px; padding: 6px 10px; border: 0; background: transparent; border-radius: 6px; }
.ctxmenu button:hover, .ctxmenu button:focus { background: var(--panel2); }
.ctxmenu .cx-sub { font: 800 10px var(--ui); text-transform: uppercase; letter-spacing: 0.6px; color: var(--muted); padding: 6px 10px 2px; }
.ctxmenu .cx-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 2px; }
/* Hover a barline: a + to add bars (never printed: it's not in the score's drawing). */
.barplus { position: absolute; z-index: 40; transform: translate(-50%, -100%); display: flex; flex-direction: column; align-items: center; gap: 4px; padding-top: 4px; }
.barplus[hidden] { display: none; }
.barplus .bp-btn { width: 24px; height: 24px; min-height: 0; padding: 0; border-radius: 50%; font: 800 17px/1 var(--ui); background: var(--blue); color: #fff; border: 2px solid #fff; box-shadow: 0 2px 6px #1f235055; cursor: pointer; display: grid; place-items: center; }
.barplus .bp-btn:hover { transform: scale(1.12); }
.barplus .bp-box { display: none; align-items: center; gap: 6px; white-space: nowrap; font: 600 13px var(--ui); background: var(--panel); border: 1px solid var(--blue); border-radius: 10px; padding: 6px 8px; box-shadow: 0 6px 18px #1f235033; }
.barplus.open .bp-box { display: flex; }
.barplus .bp-box input { width: 56px; font: 600 14px var(--ui); padding: 3px 6px; border: 1px solid var(--line); border-radius: 6px; }
.barplus .bp-box button { min-height: 0; padding: 4px 10px; }
@media print { .barplus { display: none !important; } }
.ctxmenu .cx-sys { display: grid; grid-template-columns: minmax(90px, 1fr) auto auto auto; gap: 2px; align-items: center; }
.ctxmenu .cx-sysname { font: 600 12px var(--ui); padding: 0 10px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sysdlg { width: min(1000px, 96vw); max-height: 90vh; }
.titledlg { width: min(640px, 96vw); }
.ti-wrap { padding: 20px 24px; display: flex; flex-direction: column; gap: 12px; }
.ti-row { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; font-weight: 600; }
.ti-row input[type=text] { flex: 1; min-width: 220px; font: 600 15px var(--ui); padding: 7px 10px; border: 1px solid var(--line); border-radius: 8px; }
.ti-row input[type=number] { width: 70px; font: 600 15px var(--ui); padding: 5px 8px; border: 1px solid var(--line); border-radius: 8px; }
.ti-row input[type=color] { width: 44px; height: 30px; padding: 0; border: 1px solid var(--line); border-radius: 6px; }
.ti-note { font-size: 12.5px; color: var(--muted); margin: 0; }
.ti-foot { display: flex; justify-content: flex-end; gap: 8px; }
.sys-wrap { padding: 20px 24px; }
.sys-note { font-size: 13px; color: var(--muted); margin: 4px 0 10px; }
.sys-opt { display: inline-flex; gap: 6px; align-items: center; margin-right: 18px; font-weight: 600; }
.sys-table { overflow: auto; max-height: 58vh; margin-top: 10px; }
.systbl { border-collapse: collapse; font-size: 13px; }
.systbl th, .systbl td { border: 1px solid var(--line); padding: 4px 8px; text-align: left; white-space: nowrap; }
.systbl thead th { position: sticky; top: 0; background: var(--panel); }
.systbl tbody th small { display: block; font-weight: 400; color: var(--muted); }
.systbl td.off { background: #f1ece1; }
.systbl select { font: inherit; }
.sys-foot { display: flex; justify-content: flex-end; gap: 8px; margin-top: 14px; }

/* ---------- Toolbar: labeled groups (.tg) — one card per job, its name on top, every control one height ---------- */
.quick { align-items: stretch; gap: 8px; padding: 8px 14px; background: var(--bg); border-bottom: 1px solid var(--line); }
.quick .tg { display: flex; flex-direction: column; gap: 3px; padding: 4px 8px 7px; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 1px 2px #1f235010; }
.quick .tg-label { font: 800 10px/1 var(--ui); letter-spacing: .7px; text-transform: uppercase; color: var(--muted); padding: 2px 2px 0; white-space: nowrap; }
.quick .tg-body { display: flex; align-items: center; gap: 5px; flex: 1; }
.quick .tg-body > *, .quick .tg-body .group, .quick .tg-body .voicegrp, .quick .tg-body .midigrp, .quick .tg-body .singgrp { flex-wrap: nowrap; }
.quick .tg button, .quick .tg select, .quick .tg .syncchip { height: 32px; min-height: 32px; padding-top: 0; padding-bottom: 0; font-size: 13px; border-radius: 8px; }
.quick .tg select { padding-left: 8px; padding-right: 6px; font-size: 13px; }
.quick .tg .modeswitch { height: 32px; min-height: 32px; padding: 0 10px; gap: 7px; font-size: 13px; }
.quick .tg .modeswitch .ms-track { width: 40px; height: 22px; }
.quick .tg .modeswitch .ms-knob { width: 16px; height: 16px; }
.quick .tg .modeswitch.on .ms-knob { left: 21px; }
.quick .tg .barnav input { height: 32px; padding: 0 4px; font-size: 15px; }
.quick .tg .barnav .barspin button { height: 15px; min-height: 0; padding: 0 6px; font-size: 9px; line-height: 15px; }
.quick .tg .staffpick { font-size: 12px; gap: 5px; }
.quick .tg .voicegrp .vlabel { margin-left: 8px; padding-left: 8px; border-left: 1px solid var(--line); }
.quick .tg .zoomgrp { margin-left: 6px; padding-left: 8px; border-left: 1px solid var(--line); }
.quick .tg #btnPlay { padding-left: 14px; padding-right: 14px; }
.quick .tbtext { font-weight: 800; }
.quick .tbtext.on { background: var(--blue); border-color: var(--blue); color: #fff; }
#svg.textmode, #svg.textmode * { cursor: crosshair !important; }
#svg .direction { cursor: move; }
#svg .ntext { cursor: move; }
@media (max-width: 820px) {
  .quick { flex-wrap: nowrap; overflow-x: auto; }
  .quick .tg { flex: none; }
}

/* ---------- Palettes docked at the top: the same cards, name on the left, buttons one height ---------- */
.pdock.top { padding: 6px 14px; gap: 6px; background: var(--bg); }
.pdock.top .prow { gap: 8px; align-items: stretch; }
.pdock.top .palette { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 4px 8px 4px 4px; gap: 4px; box-shadow: 0 1px 2px #1f235010; align-items: center; }
.pdock.top .palette .pal-grip { align-self: stretch; padding: 0 8px; border-radius: 8px; font-size: 10px; min-width: 0; }
.pdock.top .palette button { height: 30px; min-height: 30px; padding: 0 8px; font-size: 13px; border-radius: 7px; }
.pdock.top .palette .pal-grip button { height: 18px; min-height: 0; padding: 0 4px; }
.pdock.top .palette .pal-sub { margin: 0 2px 0 6px; padding-left: 8px; border-left: 1px solid var(--line); align-self: stretch; display: flex; align-items: center; }
/* The chosen button in a palette or toolbar group: a light blue fill with a blue edge, so its text and symbol stay readable. */
.palette button.active, .palette button.on, .quick .tg button.toggle.on, .quick .tg .vbtn.on, .midigrp .toggle.on, .voicegrp .vbtn.on {
  background: #dfe8fd; border-color: var(--blue); color: var(--text); box-shadow: inset 0 0 0 1px var(--blue);
}
.palette button.active *, .palette button.on * { color: var(--text) !important; fill: currentColor; }
.palette button.active small, .palette button.on small { color: var(--blue) !important; }
/* Toolbar groups move: drag a group by its name onto another group (the order is kept in this browser). */
.quick .tg-label { cursor: grab; user-select: none; }
.quick .tg-label::before { content: '⠿ '; opacity: .55; }
.quick .tg.tg-drag { opacity: .45; }
.quick .tg.tg-over-l { box-shadow: -4px 0 0 var(--blue); }
.quick .tg.tg-over-r { box-shadow: 4px 0 0 var(--blue); }
/* Hover: what a click will grab — an outline on the music and its name by the mouse. */
#svg #hovermark { fill: #2f5bd312; stroke: var(--blue); stroke-width: 1.5; stroke-dasharray: 3 2; pointer-events: none; }
.hovertip { position: fixed; z-index: 400; pointer-events: none; max-width: 420px; padding: 4px 9px; border-radius: 8px; background: var(--text); color: #fff; font: 700 12px/1.3 var(--ui); box-shadow: 0 4px 14px #1f235044; }
.hovertip[hidden] { display: none; }
/* Bars by mouse (print view): a bar's grip (the strip above its system) moves it; its barline resizes it. */
#svg.bargrip { cursor: grab; }
#svg.barsize { cursor: col-resize; }
body.barmoving, body.barmoving * { cursor: grabbing !important; }
body.barsizing, body.barsizing * { cursor: col-resize !important; }
#svg .bardrop { stroke: var(--blue); stroke-width: 4; stroke-linecap: round; pointer-events: none; }
#svg .bardragsrc { fill: #2f5bd31c; stroke: var(--blue); stroke-width: 1; stroke-dasharray: 4 3; pointer-events: none; }
/* Time signature… window (timesig.js) */
#tsDlg .ts-form { width: min(560px, 94vw); }
#tsDlg .ts-sig { display: flex; align-items: flex-end; gap: 10px; margin: 6px 0 8px; }
#tsDlg .ts-sig label { display: flex; flex-direction: column; gap: 3px; font-weight: 700; font-size: 13px; color: var(--muted); }
#tsDlg .ts-sig input { width: 84px; font: 800 22px var(--ui); text-align: center; padding: 4px; border: 2px solid var(--line); border-radius: 10px; }
#tsDlg .ts-sig select { font: 700 15px var(--ui); padding: 7px 8px; border-radius: 10px; }
#tsDlg .ts-slash { font: 800 26px var(--ui); color: var(--muted); padding-bottom: 6px; }
#tsDlg .ts-quick { display: flex; flex-wrap: wrap; gap: 5px; margin-bottom: 10px; }
#tsDlg .ts-quick button { padding: 4px 10px; font-weight: 800; }
#tsDlg .ts-quick button.on { background: #dfe8fd; border-color: var(--blue); }
#tsDlg .ts-scope { border: 1px solid var(--line); border-radius: 10px; padding: 6px 10px; display: flex; flex-direction: column; gap: 4px; }
#tsDlg .ts-scope legend { font-weight: 800; font-size: 12px; color: var(--muted); padding: 0 4px; }
#tsDlg .ts-effect { margin-top: 10px; }
#tsDlg .ts-ok { color: #1d6b38; font-weight: 700; }
#tsDlg .ts-warn { color: var(--accent); font-weight: 800; margin: 6px 0 4px; }
#tsDlg .ts-lost { margin: 0 0 8px 18px; padding: 0; font-size: 13px; max-height: 140px; overflow: auto; }
#tsDlg .ts-opts { display: flex; flex-direction: column; gap: 6px; }
#tsDlg .ts-opt { display: block; border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; cursor: pointer; }
#tsDlg .ts-opt.rec { border-color: #2e9d57; background: #eaf7ee; }
#tsDlg .ts-opt small { display: block; color: var(--muted); margin: 2px 0 0 24px; font-size: 12.5px; }
#tsDlg .ts-rec { font: 800 10px var(--ui); text-transform: uppercase; letter-spacing: .5px; color: #fff; background: #2e9d57; border-radius: 999px; padding: 2px 7px; margin-left: 4px; }
/* A note past the 88 keys of a piano: red, as a flag (it is never stopped). */
#svg .outrange .note, #svg .outrange .smufl, #svg .outrange text { fill: #d92d2d !important; }
#svg .outrange .note.hollow { stroke: #d92d2d !important; }
#svg .outrange .ledger, #svg .outrange .stem { stroke: #d92d2d !important; }
/* Arpeggio: a thin wavy line; little boxes at its ends while the note is selected (drag to resize). */
#svg .arpline { fill: none; stroke: var(--ink); stroke-width: 1.5; stroke-linejoin: round; }
#svg .arph { fill: #fff; stroke: var(--blue); stroke-width: 1.4; cursor: ns-resize; }
#svg .tempomark, #svg .tempoword { cursor: move; }
#svg .tempomark.msel, #svg .tempoword.msel { fill: var(--blue); }
#svg .fermg { cursor: move; }
/* Showing (View card) and the Folios window */
.quick .viewpick { margin-left: 6px; padding-left: 8px; border-left: 1px solid var(--line); }
.quick .viewpick select.other { border-color: var(--blue); color: var(--blue); font-weight: 800; background: #eef3fe; }
#folioDlg .small-dlg { width: min(520px, 94vw); }
#folioDlg .fol-list { display: grid; grid-template-columns: 1fr auto; gap: 5px; margin: 8px 0 12px; }
#folioDlg .fol-list button { text-align: left; }
#folioDlg .fol-edit { border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px; display: flex; flex-direction: column; gap: 8px; }
#folioDlg .fol-edit legend { font-weight: 800; font-size: 13px; color: var(--muted); padding: 0 4px; }
#folioDlg .fol-parts { display: flex; flex-direction: column; gap: 3px; }
#folioDlg .fol-head { display: flex; justify-content: space-between; font-size: 12px; font-weight: 700; color: var(--muted); margin-top: 2px; }
#folioDlg .fol-row { display: grid; grid-template-columns: 1fr auto auto; align-items: center; gap: 8px; padding: 2px 0; border-bottom: 1px solid var(--line); }
#folioDlg .fol-row:last-child { border-bottom: 0; }
#folioDlg .fol-move button { padding: 0 6px; min-width: 0; font-size: 11px; line-height: 20px; }
#folioDlg .fol-sz { display: flex; align-items: center; gap: 4px; font-size: 13px; color: var(--muted); }
#folioDlg .fol-sz input { width: 64px; text-align: right; }
#folioDlg .fol-szhint { font-size: 12px; }
#folioDlg .fol-look { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; font-size: 13px; }
#folioDlg .fol-look label { display: flex; align-items: center; gap: 5px; }
/* Page spacing… (right-click the page margin) */
#pageSpacingDlg .ps-grid { display: flex; flex-direction: column; gap: 8px; font-size: 14px; }
#pageSpacingDlg .ps-grid > label { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
#pageSpacingDlg .ps-grid input[type=number] { width: 70px; text-align: right; }
/* Staff size… (right-click a staff name) */
#staffSizeDlg .ss-row { display: flex; align-items: center; gap: 10px; }
#staffSizeDlg .ss-row input[type=range] { flex: 1; }
#staffSizeDlg .ss-row input[type=number] { width: 70px; text-align: right; }
#staffSizeDlg .ss-pct { font-weight: 800; min-width: 48px; text-align: right; }
/* Shapes on the music (lines, arrows, boxes, circles) */
#svg .shape line, #svg .shape rect, #svg .shape ellipse { fill: none; stroke: var(--ink); stroke-width: 1.6; stroke-linecap: round; }
#svg .shape .shapefill { fill: var(--ink); stroke: none; }
#svg .shape .shapehit { stroke: transparent !important; stroke-width: 12 !important; fill: none; cursor: move; pointer-events: stroke; }
#svg .shape.ssel line:not(.shapehit), #svg .shape.ssel rect:not(.shapehit), #svg .shape.ssel ellipse:not(.shapehit) { stroke: var(--blue); }
#svg .shape.ssel .shapefill { fill: var(--blue); }
#svg .shapeh { fill: #fff; stroke: var(--blue); stroke-width: 1.4; cursor: crosshair; }
#svg.shapemode, #svg.shapemode * { cursor: crosshair !important; }
.quick .shapegrp { display: inline-flex; gap: 3px; margin-left: 6px; padding-left: 8px; border-left: 1px solid var(--line); }
.quick .shapegrp button { min-width: 32px; padding: 0 6px; font-size: 15px; }
.quick .shapegrp button.on { background: #dfe8fd; border-color: var(--blue); }
/* Side docks: cards too */
.pdock.left .palette, .pdock.right .palette { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 5px; box-shadow: 0 1px 2px #1f235010; }

/* ---------- Less clutter (11-28): one slim toolbar row; everything else in folding palettes ---------- */
/* The toolbar: one row, each group a small card with a ⠿ drag handle instead of a name on top. */
.quick { flex-wrap: nowrap; overflow-x: auto; padding: 5px 12px; gap: 6px; scrollbar-width: thin; }
.quick > * { flex: none; }
.quick .tg { flex-direction: row; align-items: center; gap: 4px; padding: 3px 6px 3px 2px; border-radius: 10px; }
.quick .tg-label { font-size: 0 !important; letter-spacing: 0; padding: 0 2px !important; cursor: grab; color: var(--muted); align-self: stretch; display: flex; align-items: center; }
.quick .tg-label::before { content: '⠿'; font-size: 14px; }
.quick .tg button, .quick .tg select { height: 30px; min-height: 30px; }
.quick .tg .modeswitch { height: 30px; min-height: 30px; }
/* The song file chip, up in the top bar by the song's name. */
.topbar .syncchip { min-height: 30px; padding: 3px 12px; font-size: 12.5px; flex: none; }
/* Folded palettes: just the title bar. Click it to open. */
.palette .pal-fold { font-size: 11px; width: 12px; flex: none; display: inline-block; text-align: center; }
.palette .pal-grip { cursor: pointer; justify-content: flex-start; flex-wrap: nowrap; }
.palette .pal-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.palette.folded:not(.pal-searching) > :not(.pal-grip) { display: none !important; }
.pdock .palette.folded:not(.pal-searching) { width: 138px; padding-bottom: 5px; }
.pdock.top .palette.folded:not(.pal-searching) { width: auto; }
/* One title bar for every palette, wherever it's docked: the same height, font, and buttons. */
.palette .pal-grip, .pdock.top .palette .pal-grip { height: 26px; min-height: 26px; padding: 0 4px 0 6px; gap: 4px; font: 800 10px/1 var(--ui); letter-spacing: .5px;
  border-radius: 7px; background: var(--panel2); align-self: auto; box-sizing: border-box; }
.palette .pal-grip button, .pdock.top .palette .pal-grip button, .pdock.top #palClef .pal-grip button {
  flex: none; width: 20px; height: 20px !important; min-height: 0 !important; padding: 0 !important; font-size: 12px !important; line-height: 1;
  border-radius: 5px; display: inline-flex; align-items: center; justify-content: center; }
.palette .pal-grip .pal-x { font-size: 14px !important; margin-left: 0; }
.palette .pal-grip button[hidden] { display: none !important; }
/* The music takes what's left between the docks, never pushing a dock off the screen. */
.scorerow > :not(.pdock) { min-width: 0; }
/* Columns never grow past the palette's width (a long title shortens with … instead). */
.pdock.left .palette, .pdock.right .palette { grid-template-columns: minmax(0, 1fr); }
.pdock.left .palette.cols2, .pdock.right .palette.cols2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.palette .pal-grip { min-width: 0; }
/* Side docks: every button fills its column; one-column palettes a little wider so the title bar fits. */
.pdock.left .palette:not(.cols2), .pdock.right .palette:not(.cols2) { width: 138px; }
.pdock.left .palette > button, .pdock.right .palette > button, .pdock .palette #durGroup > button { width: 100%; box-sizing: border-box; }
.pdock .palette.folded:not(.pal-searching):not(.cols2) { width: 138px; }
/* Top dock: a folded palette is a small chip, not an empty card. */
.pdock.top .prow { align-items: center; }
.pdock.top .palette.folded:not(.pal-searching) { padding: 3px; align-self: center; }
.pdock.top .palette { align-self: center; }
/* Find a symbol */
.pal-search { width: 100%; min-width: 0; padding: 6px 8px; border: 1px solid var(--line); border-radius: 9px; font: 600 13px var(--ui); background: var(--bg); box-sizing: border-box; }
.palette .pal-miss { display: none !important; }
.palette.pal-nohit { display: none !important; }
/* The toolbar groups that became palettes: their rows wrap to the palette's width. */
.palette.pal-tools > :not(.pal-grip) { grid-column: 1 / -1; }
.palette.pal-tools .group, .palette.pal-tools .voicegrp, .palette.pal-tools .midigrp, .palette.pal-tools .singgrp,
.palette.pal-tools .shapegrp { display: flex; flex-wrap: wrap; gap: 4px; margin: 0; padding: 0; border: 0; }
.palette.pal-tools .staffpick { display: flex; flex-direction: column; gap: 2px; font: 700 11px var(--ui); color: var(--muted); }
.palette.pal-tools select { width: 100%; min-width: 0; padding: 4px 6px; font-size: 13px; border-radius: 8px; }
.palette.pal-tools button { font-size: 13px; padding: 5px 6px; }
.palette.pal-tools .vlabel { flex-basis: 100%; font: 700 11px var(--ui); color: var(--muted); }
.palette.pal-tools .vbtn, .palette.pal-tools .vmove { min-width: 30px; }
.palette.pal-tools #btnMergeAligned, .palette.pal-tools #btnSplitChords, .palette.pal-tools #btnVoice2 { flex-basis: 100%; }
.pdock.top .palette.pal-tools > :not(.pal-grip) { grid-column: auto; }
.pdock.top .palette.pal-tools .staffpick { flex-direction: row; align-items: center; }
.pdock.top .palette.pal-tools select { width: auto; }
.pdock.top .palette.pal-tools #btnMergeAligned, .pdock.top .palette.pal-tools #btnSplitChords, .pdock.top .palette.pal-tools #btnVoice2 { flex-basis: auto; }
.pdock.top .palette.pal-tools .vlabel { flex-basis: auto; }
