/* ── Arrange It — "The Desk" (2026-09-12) ──────────────────────────────────
   One visual system for both pages.  The score is ink on white paper on a
   grey desk; everything the APP adds is a pencil, and each pencil means one
   thing everywhere:
     blue pencil  (--blue)     the source, and the app's own actions
     red pencil   (--red)      what changed or needs a look (fixed versions,
                               warnings, edited notes)
     graphite     (--graphite) the user's selection and marks on the page
     ink          (--ink)      text, notes, primary buttons
   Archivo Narrow does the work (the condensed sans of published part
   headers); Spectral names the pieces.  Square corners, one-pixel rules,
   no shadows except the paper's.  Fonts are self-hosted (CSP: font-src
   'self') — see fonts/fonts.css.  ─────────────────────────────────────── */
@import url("/fonts/fonts.css");

:root {
  --ink: #1F1D1A; --text2: #4A4843; --muted: #6B6963; --faint: #8A8780;
  --desk: #E4E2DC; --panel: #F7F6F2; --panel2: #EFEDE7; --paper: #FFFFFF;
  --rule: #C9C6BE; --rule2: #E6E3DC; --tint: #F1EFE9;
  --blue: #2B4C9B; --blue-ink: #1C3470; --blue-tint: #E7ECF6;
  --red: #B3382F; --red-tint: #F6E4E2;
  --graphite: #5B5F66; --graphite-tint: rgba(91, 95, 102, 0.14);
  --green: #3F8A4E; --amber: #C9962B; --cursor: #1E5AA8;
  --sans: "Archivo Narrow", "Arial Narrow", "Segoe UI", system-ui, sans-serif;
  --serif: Spectral, Georgia, "Times New Roman", serif;
  font-family: var(--sans);
  font-size: 13px;
  color: var(--ink);
  background: var(--desk);
}
* { box-sizing: border-box; }
body { margin: 0; }
a { color: var(--blue); }
a:hover { color: var(--blue-ink); }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 1px; }
h1, h2, h3, h4 { margin: 0; font-weight: 600; }
h2 { font-size: 15px; margin: 0 0 10px; }
h4 { font-size: 13px; }
code, kbd, pre { font-family: Consolas, "Cascadia Mono", Menlo, monospace; }
code { font-size: 12px; }

/* Labels in tracked caps — the "1st Bb CORNET" of a part header. */
.eyebrow, .cap, .jm-label, .output-group-title, .ed-menu-sublabel, .sp-table th, .sheet-table th, .sd-grid label > span:first-child {
  font-size: 11px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); margin: 0;
}
.eyebrow { margin: 0 0 4px; }
.hint { display: block; margin-top: 4px; color: var(--muted); line-height: 1.4; font-size: 12px; }
.hidden { display: none; }

/* ── Controls ────────────────────────────────────────────────────────────── */
label { display: grid; gap: 4px; margin-bottom: 10px; color: var(--ink); font-weight: 400; font-size: 13px; }
.inline { display: flex; align-items: center; gap: 8px; }
input:not([type=checkbox]):not([type=radio]):not([type=range]), select, textarea {
  width: 100%; height: 30px; border: 1px solid var(--rule); border-radius: 0; padding: 0 8px;
  background: var(--paper); font: inherit; font-weight: 600; color: var(--ink);
}
textarea { height: auto; padding: 6px 8px; resize: vertical; font-weight: 400; }
select { appearance: none; -webkit-appearance: none; padding-right: 24px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%231F1D1A' stroke-width='2.4'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 7px center; }
input[type=checkbox], input[type=radio] { width: 14px; height: 14px; margin: 0; flex: 0 0 auto; accent-color: var(--ink); }
input[type=file] { padding: 4px 6px !important; font-weight: 400 !important; }
button {
  height: 30px; border: 1px solid var(--ink); border-radius: 0; padding: 0 12px;
  font: inherit; font-weight: 600; cursor: pointer; background: var(--ink); color: var(--panel);
  box-shadow: none; line-height: 1;
}
button:hover { background: #33302B; }
button:disabled { cursor: default; opacity: 0.55; }
button.secondary { background: var(--panel); color: var(--ink); border-color: var(--rule); }
button.secondary:hover { background: var(--panel2); }
button.arranging { background: var(--red); border-color: var(--red); cursor: default; }
button.arranging:hover { background: var(--red); }
/* the quiet button: one-pixel rule, no fill */
.cancel-btn, .delete-btn, .archive-btn, .restore-btn, .log-copy-btn, .log-download-btn, .preview-btn, .correct-btn, .icon-btn, .omr-btn, .print-btn, .editor-link, .source-plan-btn, .correction-btn, .pdf-btn, .preflight-resume-btn, .ed-top-btn, .ed-zoom-btn, .ed-zoom-value, .ed-tool, .mp-toggle, .ed-pal-item, .ed-dbl-apply, .ed-pdf-print, .sd-actions button, .sd-versions button, .ed-part-tab, .preflight-tab, .version-preview-btn, .version-delete-btn {
  height: 26px; padding: 0 9px; background: var(--panel); color: var(--ink); border: 1px solid var(--rule);
  font-size: 12px; font-weight: 600; border-radius: 0; box-shadow: none; line-height: 1;
}
.cancel-btn:hover, .delete-btn:hover, .archive-btn:hover, .restore-btn:hover, .log-copy-btn:hover, .log-download-btn:hover, .preview-btn:hover, .correct-btn:hover, .icon-btn:hover, .omr-btn:hover, .print-btn:hover, .editor-link:hover, .source-plan-btn:hover, .correction-btn:hover, .pdf-btn:hover, .preflight-resume-btn:hover, .ed-top-btn:hover, .ed-zoom-btn:hover, .ed-zoom-value:hover, .ed-tool:hover, .mp-toggle:hover, .ed-pal-item:hover, .ed-dbl-apply:hover, .ed-pdf-print:hover, .sd-actions button:hover, .sd-versions button:hover, .ed-part-tab:hover, .preflight-tab:hover {
  background: var(--panel2); border-color: var(--ink); filter: none;
}
a.editor-link, a.ed-top-btn, a.ed-tab { display: inline-flex; align-items: center; text-decoration: none; line-height: 1; }
.delete-btn, .version-delete-btn, .omr-del, .cancel-btn { color: var(--red); }
.delete-btn:hover, .version-delete-btn:hover, .omr-del:hover, .cancel-btn:hover { background: var(--red-tint); border-color: var(--red); }
.cancel-btn:disabled { cursor: default; opacity: 0.7; }

/* ── The Desk (index.html): top bar · rail | set sheet | new set ─────────── */
.desk-body { height: 100vh; height: 100dvh; overflow: hidden; }
/* The header: the one surface in the app's own blue (--blue-ink), paper
   text on it — the desk's top bar and the editor's menu bar alike. */
.hero {
  height: 50px; background: var(--blue-ink); color: var(--panel); border-bottom: 1px solid var(--blue-ink);
  display: flex; align-items: center; gap: 16px; padding: 0 18px;
}
.desk-brand { font-family: var(--serif); font-size: 19px; font-weight: 500; letter-spacing: 0.08em; text-transform: uppercase; color: var(--panel); text-decoration: none; }
.desk-brand:hover { color: #fff; }
.desk-sep { width: 1px; height: 22px; background: rgba(247, 246, 242, 0.35); }
.desk-nav { display: flex; gap: 2px; }
.desk-nav a { padding: 6px 12px; font-size: 14px; font-weight: 600; color: rgba(247, 246, 242, 0.82); text-decoration: none; }
.desk-nav a:hover { background: rgba(247, 246, 242, 0.12); color: #fff; }
.desk-nav a.active { background: var(--panel); color: var(--blue-ink); }
.desk-nav-new { display: none; }
.hero .job-search {
  margin-left: auto; width: 260px !important; height: 30px; padding: 0 10px !important; font-size: 13px; font-weight: 400;
  border-color: var(--blue-ink);
}
.user-badge { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; color: rgba(247, 246, 242, 0.85); white-space: nowrap; }
.user-badge button { height: 26px; padding: 0 9px; font-size: 12px; background: transparent; color: var(--panel); border: 1px solid rgba(247, 246, 242, 0.45); }
.user-badge button:hover { background: rgba(247, 246, 242, 0.12); border-color: var(--panel); }
.help-link { color: var(--blue); font-weight: 600; text-decoration: none; }

.desk {
  height: calc(100vh - 50px); height: calc(100dvh - 50px);
  display: grid; grid-template-columns: 264px minmax(0, 1fr) 318px; grid-template-rows: auto minmax(0, 1fr); overflow: hidden;
}
#jobList, .job-shell { display: contents; }
.job-menu {
  grid-column: 1; grid-row: 1 / span 2; overflow-y: auto; min-height: 0;
  background: var(--panel2); border-right: 1px solid var(--rule); padding: 6px 0 24px;
}
.job-detail { grid-column: 2; grid-row: 2; overflow-y: auto; min-height: 0; padding: 22px 26px 40px; }
#jobList > p { grid-column: 2; grid-row: 2; padding: 22px 26px; color: var(--muted); }
.omr-correct-card { grid-column: 2; grid-row: 1; margin: 22px 26px 0; max-height: 70vh; overflow: auto; }
.desk-new, .preflight-card {
  grid-column: 3; grid-row: 1 / span 2; overflow-y: auto; min-height: 0;
  background: var(--panel); border-left: 1px solid var(--rule); padding: 16px 16px 40px;
}
.desk-new[hidden], .preflight-card[hidden], .omr-correct-card[hidden] { display: none; }
.desk-new-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 12px; }
.desk-new-head h2 { font-family: var(--serif); font-size: 18px; font-weight: 500; margin: 0; }
.desk-drop { position: relative; border: 1px dashed var(--faint); background: var(--paper); padding: 12px; margin-bottom: 12px; display: grid; gap: 3px; }
.desk-drop strong { font-weight: 700; }
.desk-drop input[type=file] { margin-top: 6px; height: auto; border: none; background: transparent; padding: 0 !important; font-size: 12px; color: var(--text2); }
.desk-drop input[type=file]::file-selector-button { height: 26px; padding: 0 9px; margin-right: 8px; background: var(--panel); color: var(--ink); border: 1px solid var(--ink); font: inherit; font-size: 12px; font-weight: 600; cursor: pointer; }
.desk-drop input[type=file]::file-selector-button:hover { background: var(--panel2); }
.desk-new .inline { margin-bottom: 6px; font-weight: 400; }
/* New set has two modes; an element marked data-mode shows in its own only. */
.desk-new:not(.mode-transcribe) [data-mode="transcribe"], .desk-new.mode-transcribe [data-mode="arrange"] { display: none; }
.new-mode-tabs { margin: 0 0 12px; }
.new-mode-tabs[hidden] { display: none; }
/* Transcribe: a take from the microphone (red = it is recording). */
.take { margin: -4px 0 12px; }
.take-row { display: flex; align-items: center; gap: 8px; }
.take-clock { font-variant-numeric: tabular-nums; color: var(--muted); font-size: 12px; min-width: 3.2em; }
#takeRecord.recording { background: var(--red); border-color: var(--red); color: #fff; }
#takeRecord.recording + .take-clock { color: var(--red); font-weight: 600; }
.take-player { display: block; width: 100%; height: 32px; margin-top: 8px; }
.take-player[hidden] { display: none; }
.desk-new .hint.warn { color: var(--red); }
.desk-new .two { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.desk-new-foot { position: sticky; bottom: 0; margin: 14px -16px -40px; padding: 10px 16px 16px; background: var(--panel); border-top: 1px solid var(--rule); display: grid; gap: 6px; }
.desk-new-foot button[type=submit] { width: 100%; height: 34px; font-weight: 700; letter-spacing: 0.02em; }
/* The arrange buttons: green when ready, red while an arrangement runs
   (button.arranging, set by app.js). */
.desk-new-foot button[type=submit] { background: var(--faint); border-color: var(--faint); color: #fff; }
.desk-new-foot button[type=submit]:hover { background: var(--muted); border-color: var(--muted); }
.desk-new-foot button[type=submit].ready, #preflightStart { background: var(--green); border-color: var(--green); color: #fff; }
.desk-new-foot button[type=submit].ready:hover, #preflightStart:hover { background: #33743F; border-color: #33743F; }
.desk-new-foot button[type=submit].arranging, .desk-new-foot button[type=submit].arranging:hover { background: var(--red); border-color: var(--red); }

/* the folder: titles grouped by day, a dot per status */
.jm-group + .jm-group { margin-top: 6px; }
.jm-label { padding: 8px 12px 4px; font-size: 10px; }
button.jm-label { background: none; border: none; color: var(--muted); width: 100%; text-align: left; height: auto; cursor: pointer; }
button.jm-label:hover { background: var(--panel); }
.job-menu-row {
  display: flex; align-items: flex-start; gap: 8px; width: 100%; text-align: left; height: auto;
  background: none; color: var(--ink); border: none; border-top: 1px solid transparent; border-bottom: 1px solid transparent;
  padding: 7px 12px; font-weight: 600; border-radius: 0;
}
.job-menu-row:hover { background: var(--panel); }
.job-menu-row.selected { background: var(--paper); border-color: var(--rule); }
.jm-text { display: grid; gap: 1px; min-width: 0; }
.jm-title { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 13px; }
.jm-meta { font-size: 12px; font-weight: 400; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.jm-dot { flex: 0 0 7px; width: 7px; height: 7px; border-radius: 50%; background: var(--rule); margin-top: 5px; }
.jm-dot.complete { background: var(--green); }
.jm-dot.failed { background: var(--red); }
.jm-dot.running, .jm-dot.queued { background: var(--blue); }
.jm-dot.planning, .jm-dot.awaiting_approval { background: var(--amber); }
.jm-dot.cancelled { background: var(--faint); }
.jm-dot.pulse { animation: jm-pulse 1.2s ease-in-out infinite; }
@keyframes jm-pulse { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }
.jm-empty { padding: 10px 12px; }

/* the set sheet */
.job { display: grid; gap: 16px; }
.job-top { display: flex; justify-content: space-between; gap: 16px; align-items: flex-end; }
.sheet-head { display: grid; gap: 4px; min-width: 0; }
.sheet-title { font-family: var(--serif); font-size: 26px; font-weight: 500; line-height: 1.1; }
.sheet-title em { font-style: italic; font-weight: 400; color: var(--text2); }
.sheet-meta { font-size: 13px; color: var(--text2); }
.sheet-meta code { color: var(--muted); }
.job-top-right { display: flex; gap: 6px; align-items: center; flex: 0 0 auto; flex-wrap: wrap; justify-content: flex-end; }
.open-editor-btn {
  display: inline-flex; align-items: center; height: 30px; padding: 0 14px; font-size: 13px; font-weight: 600;
  background: var(--blue); color: #fff !important; text-decoration: none; white-space: nowrap; border: 1px solid var(--blue);
}
.open-editor-btn:hover { background: var(--blue-ink); }
.badge { display: inline-block; padding: 0 6px; height: 18px; line-height: 18px; font-size: 11px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; background: var(--tint); color: var(--muted); border: 1px solid var(--rule); }
.badge.complete { color: var(--green); border-color: var(--green); background: transparent; }
.badge.failed { color: var(--red); border-color: var(--red); background: transparent; }
.badge.running, .badge.queued { color: var(--blue); border-color: var(--blue); background: transparent; }
.badge.planning, .badge.awaiting_approval { color: #8A6413; border-color: var(--amber); background: transparent; }
.badge.cancelled { color: var(--faint); }

/* The instrumentation sheet: chair by chair, from the job's own plan. */
.sheet { background: var(--paper); border: 1px solid var(--rule); }
.sheet[hidden] { display: none; }
.sheet-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.sheet-table th { text-align: left; padding: 7px 10px; background: var(--tint); border-bottom: 1px solid var(--rule); }
.sheet-table td { padding: 7px 10px; border-bottom: 1px solid var(--rule2); vertical-align: top; }
.sheet-table tr:last-child td { border-bottom: none; }
.sheet-chair { font-weight: 700; width: 44px; }
.sheet-src { color: var(--blue); font-weight: 600; }
.sheet-note { color: var(--text2); }
.sheet-foot { border-top: 1px solid var(--rule); background: #FBFAF7; padding: 8px 10px; display: flex; gap: 14px; align-items: baseline; flex-wrap: wrap; font-size: 13px; color: var(--text2); }
.sheet-foot .cap { flex: 0 0 auto; }
.sheet-foot-right { margin-left: auto; color: var(--muted); }
.sheet-loading { padding: 10px; color: var(--muted); }

/* files, tools, log */
.outputs { display: flex; flex-direction: column; gap: 10px; }
.output-group { border: 1px solid var(--rule); background: var(--paper); }
.output-group-title { background: var(--tint); padding: 6px 10px; border-bottom: 1px solid var(--rule); }
.output-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 6px 10px; border-top: 1px solid var(--rule2); }
.output-row:first-of-type { border-top: none; }
.output-name { font-weight: 600; min-width: 0; }
.output-name.source-name { color: var(--text2); }
.output-actions { display: inline-flex; align-items: center; gap: 6px; flex: 0 0 auto; }
.output-actions .dl-link { color: var(--blue); font-weight: 600; font-size: 12px; text-decoration: none; padding: 4px 6px; }
.output-actions .dl-link:hover { text-decoration: underline; text-underline-offset: 2px; }
.dev-outputs { margin-top: 0; }
.dev-outputs summary { cursor: pointer; font-size: 12px; color: var(--muted); user-select: none; }
.dev-outputs summary:hover { color: var(--ink); }
.dev-outputs .outputs { margin-top: 6px; gap: 0; }
.dev-outputs .output-group { border: none; background: transparent; }
.dev-outputs .output-group-title { display: none; }
.dev-outputs .output-row { padding: 3px 0; border: none; }
.dev-outputs .output-name { font-size: 12px; font-weight: 600; color: var(--muted); }
.dev-outputs .links a { font-size: 12px; font-weight: 600; color: var(--muted); }
.sheet-tools { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.sheet-tools select { width: auto; height: 26px; font-size: 12px; }
.renotate { margin: 10px 0 0; }
.renotate-row { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; margin-top: 4px; font-size: 12px; }
.renotate-row label { display: inline-flex; align-items: center; gap: 4px; margin: 0; }
.renotate-row select, .renotate-row input { width: auto; height: 26px; font-size: 12px; }
.renotate-row input[type="number"] { width: 78px; }
.correction-note { font-size: 12px; color: var(--text2); font-style: italic; }
.links { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.links a { color: var(--blue); font-weight: 600; text-decoration: none; }
pre { white-space: pre-wrap; overflow: auto; max-height: 220px; background: var(--paper); border: 1px solid var(--rule); padding: 10px; margin: 0; font-size: 12px; line-height: 1.35; }
.job-log { margin-top: 0; }
.job-log summary { cursor: pointer; font-weight: 600; color: var(--text2); display: flex; align-items: center; gap: 8px; }
.job-log-pre { max-height: 420px; }
.job-error { max-height: 280px; background: var(--red-tint); border-color: var(--red); }
.fix-proposal { margin-top: 10px; }
.fix-op-list { margin: 6px 0; padding-left: 18px; }
.fix-actions { display: flex; gap: 8px; margin-top: 8px; align-items: center; }
.fix-actions a { color: var(--blue); font-weight: 600; text-decoration: none; }
/* The toolbar's message line lets clicks through to the notes beneath it
   (2026-09-10: it covered the bar's neighbours after an octave move). */
#edMsg { pointer-events: none; }
.card { background: var(--paper); border: 1px solid var(--rule); padding: 16px; }
.grid { display: grid; gap: 16px; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }

/* Source plan / override panel (Source assignments ↓) */
.source-plan-panel { background: var(--paper); border: 1px solid var(--rule); padding: 12px; }
.source-plan-panel[hidden] { display: none; }
.sp-hint { font-size: 12px; color: var(--muted); margin: 0 0 8px; line-height: 1.4; }
.sp-loading { font-style: italic; }
.sp-locks { margin: 0 0 14px; padding: 8px 10px 10px; border: 1px solid var(--rule); }
.sp-locks legend { padding: 0 5px; font-weight: 600; }
.sp-lock-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 4px 12px; }
.sp-lock-row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 7px; font-size: 13px; margin: 0; }
.sp-lock-row small { color: var(--muted); }
.sp-lock-count { margin: 8px 0 0; font-size: 12px; color: var(--muted); }
.sp-lock-count.sp-lock-over { color: var(--red); font-weight: 700; }
.sp-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.sp-table th { text-align: left; border-bottom: 1px solid var(--rule); padding: 4px 8px 6px; }
.sp-table td { padding: 5px 8px; border-bottom: 1px solid var(--rule2); }
.sp-slot { font-weight: 700; white-space: nowrap; width: 150px; }
.sp-table select { width: 100%; height: 28px; font-size: 12px; }
.sp-actions { margin-top: 12px; text-align: right; }
.rearrange-btn { background: var(--blue); border-color: var(--blue); }
.rearrange-btn:hover { background: var(--blue-ink); }

/* Ensemble roster editor (presets + custom) */
.custom-ensemble { margin: 0 0 10px; }
.custom-roster { display: flex; flex-wrap: wrap; gap: 4px; margin: 6px 0; }
.custom-roster-row {
  display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600;
  border: 1px solid var(--ink); padding: 2px 4px 2px 7px; background: var(--paper);
}
.custom-roster-row .name { flex: 1; }
.custom-roster-row input[type="number"] { width: 3em !important; height: 22px; padding: 0 4px !important; font-size: 12px; }
.custom-roster-row .remove { background: transparent; border: 0; color: var(--muted); cursor: pointer; font-size: 14px; padding: 0 4px; height: auto; }
.custom-roster-row .remove:hover { color: var(--red); background: transparent; }
.custom-add { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 4px; }
.custom-add select { flex: 1; min-width: 10em; height: 26px; font-size: 12px; }
.custom-add button { height: 26px; padding: 0 9px; font-size: 12px; }
.custom-summary { margin-top: 6px; font-weight: 600; color: var(--text2); }

/* Pre-arrangement target-key and source-lock review (takes the right panel) */
.preflight-card .job-top { align-items: flex-start; margin-bottom: 8px; }
.preflight-card .job-top h2 { font-family: var(--serif); font-size: 18px; font-weight: 500; margin: 0; }
.preflight-tabs { display: grid; grid-template-columns: 1fr 1fr; margin: 12px 0 12px; }
.preflight-tab { height: 28px; border: 1px solid var(--rule); background: var(--panel); color: var(--muted); }
.preflight-tab + .preflight-tab { border-left: none; }
.preflight-tab.active { background: var(--ink); color: var(--panel); border-color: var(--ink); }
.preflight-panel { padding-top: 2px; }
.preflight-panel[hidden] { display: none; }
.preflight-lock-grid { display: grid; gap: 4px; margin: 10px 0 8px; }
.preflight-lock-row {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 8px; margin: 0;
  padding: 7px 8px; border: 1px solid var(--rule2); background: var(--paper); font-weight: 400;
}
.preflight-lock-row span { display: grid; min-width: 0; }
.preflight-lock-row small { color: var(--muted); font-weight: 400; }
.preflight-lock-count { margin: 8px 0; color: var(--muted); font-size: 12px; }
.preflight-nav { display: flex; justify-content: space-between; gap: 8px; margin-top: 14px; }
.preflight-nav:has(:only-child) { justify-content: flex-end; }
.preflight-resume-btn { color: #8A6413; border-color: var(--amber); justify-self: start; }

/* Score details panel (title / tempo / part names / versions) */
.score-details { border: 1px solid var(--rule); background: var(--paper); padding: 8px 12px; margin-bottom: 10px; }
.score-details > summary { cursor: pointer; font-weight: 600; }
.score-details-body { padding-top: 8px; }
.score-details h4 { margin: 14px 0 6px; font-size: 13px; }
.sd-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 8px 12px; }
.sd-grid label { display: block; font-size: 13px; }
.sd-grid input { margin-top: 4px; }
.sd-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.sd-table th, .sd-table td { text-align: left; padding: 4px 6px; border-bottom: 1px solid var(--rule2); vertical-align: middle; }
.sd-table input, .sd-table select { height: 26px; width: 100%; }
.sd-table input.sd-num { width: 5.5em; }
.sd-table select { width: auto; }
.sd-actions { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 12px; }
.sd-actions input { width: auto; flex: 1 1 160px; height: 26px; }
.sd-status { margin-left: 4px; }
.sd-versions { list-style: none; padding: 0; margin: 4px 0 0; font-size: 13px; }
.sd-versions li { display: flex; gap: 6px; align-items: center; padding: 3px 0; }

/* Archived arrangements */

/* Arrangement review (audit) findings */
.audit-list li { margin-bottom: 0.4em; }
.audit-badge { display: inline-block; padding: 0 6px; font-size: 10px; letter-spacing: 0.08em; text-transform: uppercase; font-weight: 700; border: 1px solid currentColor; background: transparent; height: auto; line-height: 16px; }
.audit-error { color: var(--red); }
.audit-warning { color: #8A6413; }
.audit-info { color: var(--blue); }
button.audit-badge { cursor: pointer; }
button.audit-badge:hover { background: var(--red-tint); }
button.audit-badge:disabled { cursor: default; opacity: 0.6; }
.audit-list li.audit-done { text-decoration: line-through; opacity: 0.55; }
.audit-list li.audit-done::after { content: " ✓ applied"; text-decoration: none; color: var(--green); font-weight: 700; font-size: 0.85em; }
.fix-findings { margin-top: 10px; }

/* ── OMR correction panel ─────────────────────────────────────────────────── */
.omr-header-actions { display: flex; gap: 6px; align-items: center; }
.omr-body { display: grid; grid-template-columns: 1fr 340px; gap: 16px; margin-top: 12px; }
@media (max-width: 900px) { .omr-body { grid-template-columns: 1fr; } }
.omr-preview-pane { min-width: 0; }
#omrOsmdContainer { background: var(--paper); border: 1px solid var(--rule); padding: 12px; overflow: auto; min-height: 200px; max-height: 600px; }
.omr-edit-pane { display: flex; flex-direction: column; gap: 10px; }
.omr-controls { display: flex; flex-direction: column; gap: 8px; }
.omr-part-label { font-size: 13px; font-weight: 600; }
.omr-measure-row { display: flex; align-items: center; gap: 6px; }
.omr-measure-input { width: 64px !important; height: 26px; font-size: 13px; }
.omr-flag-badge { font-size: 12px; font-weight: 600; padding: 2px 6px; }
.omr-flag-badge.warn { color: #8A6413; border: 1px solid var(--amber); }
.omr-heatmap-wrap { overflow-x: auto; border: 1px solid var(--rule); padding: 6px; background: var(--paper); }
.omr-heatmap { display: flex; flex-wrap: wrap; gap: 3px; }
.hm-cell { padding: 2px 5px; font-size: 11px; font-weight: 600; border: 1px solid transparent; cursor: pointer; min-width: 26px; text-align: center; }
.hm-ok   { background: #E3EFE5; color: #235A30; }
.hm-warn { background: #F5ECD6; color: #6E4E0B; }
.hm-bad  { background: var(--red-tint); color: var(--red); }
.hm-cell.hm-active { border-color: var(--ink); outline: 1px solid var(--ink); }
.omr-note-list { flex: 1; overflow-y: auto; max-height: 380px; display: flex; flex-direction: column; gap: 3px; }
.omr-note-row { display: flex; align-items: center; gap: 6px; padding: 5px 8px; background: var(--paper); border: 1px solid var(--rule2); font-size: 13px; }
.omr-note-row.omr-suspicious { border-color: var(--amber); }
.omr-rest { color: var(--faint); font-style: italic; }
.omr-beat { min-width: 58px; color: var(--muted); font-size: 12px; }
.omr-pitch { font-weight: 700; min-width: 50px; }
.omr-dur { min-width: 20px; font-size: 15px; }
.omr-warn { color: #8A6413; font-size: 13px; margin-left: 2px; }
.omr-note-actions { display: flex; gap: 3px; margin-left: auto; }
.omr-btn { height: 22px; padding: 0 6px; }
.omr-add-row { padding-top: 4px; }

/* ── Login overlay ───────────────────────────────────────────────────────── */
.login-overlay {
  position: fixed; inset: 0; background: var(--desk);
  display: flex; align-items: center; justify-content: center;
  z-index: 9999; overflow-y: auto; padding: 32px 20px;
}
.login-overlay[hidden] { display: none; }
.landing-wrap { display: flex; gap: 56px; align-items: center; max-width: 900px; width: 100%; margin: auto; }
.landing-hero { flex: 1; min-width: 0; }
.landing-title { font-family: var(--serif); font-size: 44px; font-weight: 500; margin: 4px 0 14px; line-height: 1.05; }
.landing-sub { font-size: 16px; color: var(--text2); line-height: 1.5; margin: 0 0 22px; max-width: 460px; }
.landing-features { list-style: none; margin: 0 0 22px; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.landing-features li { display: flex; align-items: baseline; gap: 10px; font-size: 14px; }
.landing-features li::before { content: ""; width: 14px; height: 1px; background: var(--ink); flex: 0 0 auto; position: relative; top: -4px; }
.landing-anchor { font-size: 13px; color: var(--muted); margin: 0; }
.landing-signin { flex-shrink: 0; width: 320px; }
.login-card { background: var(--panel); border: 1px solid var(--rule); padding: 28px 24px; text-align: center; }
.login-card h2 { margin: 0 0 6px; font-family: var(--serif); font-size: 20px; font-weight: 500; }
.login-card p  { color: var(--muted); margin: 0 0 16px; font-size: 13px; }
#loginForm { display: flex; flex-direction: column; gap: 8px; }
#loginEmail { height: 32px; font-weight: 400; }
#loginMsg { margin-top: 8px; display: block !important; }
.google-signin-btn {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  width: 100%; height: 34px; margin-bottom: 6px;
  background: var(--paper); color: var(--ink); font-weight: 600; font-size: 14px;
  border: 1px solid var(--rule); text-decoration: none;
}
.google-signin-btn:hover { border-color: var(--ink); color: var(--ink); }
@media (max-width: 680px) {
  .landing-wrap { flex-direction: column; gap: 32px; }
  .landing-signin { width: 100%; }
  .landing-title { font-size: 32px; }
}

/* ── Small screens: the desk stacks ──────────────────────────────────────── */
@media (max-width: 960px) {
  .desk-body { height: auto; overflow: auto; }
  .desk { height: auto; display: flex; flex-direction: column; overflow: visible; }
  #jobList, .job-shell { display: block; }
  .job-menu { grid-column: auto; grid-row: auto; max-height: 40vh; border-right: none; border-bottom: 1px solid var(--rule); }
  .job-detail { grid-column: auto; grid-row: auto; padding: 16px 14px 24px; }
  #jobList > p { grid-column: auto; grid-row: auto; }
  .omr-correct-card { grid-column: auto; grid-row: auto; }
  .desk-new, .preflight-card { grid-column: auto; grid-row: auto; }
  .omr-correct-card { margin: 14px; }
  /* Phones: the folder and the open set first, the New set form last —
     the top bar's "New set" jumps to it; the review step still replaces it. */
  .desk-new, .preflight-card { border-left: none; border-top: 1px solid var(--rule); padding-bottom: 16px; }
  .preflight-card { order: -1; }
  .desk-new-foot { position: static; margin: 14px 0 0; padding: 10px 0 0; }
  .hero { flex-wrap: wrap; height: auto; padding: 8px 10px; gap: 8px 10px; }
  .hero .job-search { flex: 1 1 auto; width: auto !important; min-width: 0; margin-left: 0; order: 10; }
  .desk-nav a { padding: 6px 8px; font-size: 13px; }
  .desk-brand { font-size: 17px; }
  .desk-sep { display: none; }
  .user-badge { order: 11; font-size: 0; gap: 0; }
  .user-badge button { font-size: 12px; }
  .desk-nav-new { display: inline-block; }
  .job-top, .job-top-right { flex-wrap: wrap; }
  .sheet-table { font-size: 12px; }
  .sheet { overflow-x: auto; }
}

/* ── The editor page (/edit/{job_id}) ────────────────────────────────────── */
#osmdContainer { position: relative; background: var(--paper); padding: 12px; overflow-x: auto; min-height: 60px; }
/* The playback cursor: OSMD's ThinLeft cursor element (an <img> whose
   left / top / height OSMD sets per voice entry, and whose left
   preview.js interpolates between entries every frame) drawn as a 2 px
   solid line the full height of the system, like MuseScore's.  No
   transition: the per-frame interpolation IS the motion, and an animated
   `left` would trail it by its own duration (the old 120 ms transition
   was that much of the lag Jon heard); a system change jumps at once.
   will-change keeps the line on its own compositor layer. */
#osmdContainer img[id^="cursorImg"] { width: 2px !important; transition: none; will-change: left, top; pointer-events: none; }

.edapp-body { height: 100vh; height: 100dvh; overflow: hidden; background: #6E6C66; }
.edapp { display: flex; flex-direction: column; height: 100vh; height: 100dvh; }
.edapp[hidden] { display: none; }
.edapp button:disabled { cursor: default; }

/* Menu bar */
.ed-menubar, .ed-tabrow, .ed-noteinput, .ed-partstrip, .ed-statusbar { flex: 0 0 auto; }
.ed-menubar {
  display: flex; align-items: center; gap: 8px; padding: 0 12px; height: 42px;
  background: var(--blue-ink); color: var(--panel); border-bottom: 1px solid var(--blue-ink); position: relative; z-index: 90;
}
.ed-brand { font-family: var(--serif); font-size: 16px; font-weight: 500; letter-spacing: 0.08em; text-transform: uppercase; color: var(--panel); text-decoration: none; padding-right: 12px; margin-right: 4px; border-right: 1px solid rgba(247, 246, 242, 0.35); white-space: nowrap; }
.ed-brand:hover { color: #fff; }
.ed-hamburger { display: none; background: none; border: none; color: var(--panel); padding: 0 8px; font-size: 18px; height: 28px; }
.ed-menus { display: flex; align-items: center; gap: 2px; }
.ed-menu-item { position: relative; }
.ed-menu-btn { background: none; border: 1px solid transparent; color: rgba(247, 246, 242, 0.88); font-weight: 600; font-size: 14px; height: 28px; padding: 0 9px; }
.ed-menu-btn:hover { background: rgba(247, 246, 242, 0.12); color: #fff; }
.ed-menu-item.open .ed-menu-btn { background: var(--panel); color: var(--blue-ink); }
.ed-menu-panel {
  position: absolute; left: 0; top: calc(100% + 2px); z-index: 95; min-width: 250px;
  background: var(--paper); border: 1px solid var(--ink); padding: 4px; box-shadow: 0 8px 20px rgba(0,0,0,.18);
  display: grid; gap: 0; font-size: 13px; max-height: calc(100vh - 48px); overflow-y: auto;
}
.ed-menu-panel[hidden] { display: none; }
.ed-menu-panel button, .ed-menu-panel a {
  display: flex; align-items: center; justify-content: space-between; gap: 18px; width: 100%; height: auto;
  background: none; color: var(--ink); text-align: left; text-decoration: none;
  padding: 6px 8px; font-weight: 500; font-size: 13px; border: none;
}
.ed-menu-panel button:hover, .ed-menu-panel a:hover { background: var(--ink); color: var(--panel); }
.ed-menu-panel button:hover kbd { color: var(--rule); }
.ed-menu-panel button:disabled { color: var(--faint); }
.ed-menu-panel button:disabled:hover { background: none; color: var(--faint); }
.ed-menu-panel kbd { font-family: inherit; font-size: 11px; font-weight: 500; color: var(--muted); }
.ed-menu-panel hr { border: none; border-top: 1px solid var(--rule2); margin: 4px 0; }
.ed-menu-close { display: none; }
.ed-menu-panel [aria-checked] { justify-content: flex-start; gap: 4px; }
.ed-menu-panel [aria-checked="true"]::before { content: "✓ "; color: var(--blue); }
.ed-menu-panel [aria-checked="false"]::before { content: "\00a0\00a0\00a0"; }
.ed-menu-sub { padding: 2px 0; }
.ed-menu-sublabel { display: block; padding: 6px 8px 2px; }
.ed-menu-subitems { display: grid; gap: 0; }
.ed-menu-subitems .hint { padding: 4px 8px; margin: 0; }
.ed-pdf-list:empty { display: none; }
.ed-pdf-row { display: flex; align-items: center; gap: 6px; padding: 2px 4px; }
.ed-pdf-row a { flex: 1 1 auto; padding: 5px 6px; }
.ed-pdf-print { width: auto !important; height: 24px !important; padding: 0 8px !important; }
.ed-title { flex: 1 1 auto; min-width: 0; text-align: center; display: flex; align-items: baseline; justify-content: center; gap: 8px; line-height: 1.15; }
.ed-title strong { font-family: var(--serif); font-size: 15px; font-weight: 500; color: var(--panel); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: pointer; }
.ed-title strong:hover { text-decoration: underline; text-underline-offset: 3px; }
.ed-title small { font-family: var(--serif); font-style: italic; color: rgba(247, 246, 242, 0.75); font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ed-menubar-right { display: flex; align-items: center; gap: 8px; flex: 0 1 auto; min-width: 0; }
.ed-file { display: flex; align-items: center; gap: 6px; margin: 0; font-size: 12px; max-width: 360px; color: var(--panel); }
.ed-file-label { white-space: nowrap; color: rgba(247, 246, 242, 0.75); }
.ed-file select { height: 28px; font-size: 12px; width: auto; max-width: 300px; border-color: var(--blue-ink); }
.ed-file-single select { color: var(--text2); }
.ed-file-note { font-size: 12px; font-weight: 600; color: #F2B6AF; white-space: nowrap; }
.ed-file-note[hidden] { display: none; }

/* Tab row */
.ed-tabrow {
  display: flex; align-items: center; gap: 12px; padding: 4px 10px; min-height: 40px;
  background: var(--panel); border-bottom: 1px solid var(--rule); position: relative; z-index: 80; flex-wrap: wrap;
}
.ed-tabs { display: flex; align-items: stretch; border: 1px solid var(--ink); }
.ed-tab {
  background: transparent; color: var(--ink); border: none; border-left: 1px solid var(--ink); height: 26px;
  padding: 0 10px; font-size: 13px; font-weight: 600; text-decoration: none; line-height: 26px; display: inline-flex; align-items: center;
}
.ed-tab:first-child { border-left: none; }
.ed-tab:hover { background: var(--panel2); }
.ed-tab.active, .ed-tab[aria-selected="true"] { background: var(--ink); color: var(--panel); }
.ed-tabrow-centre { display: flex; align-items: center; gap: 4px; margin: 0 auto; }
.ed-tool { white-space: nowrap; }
.ed-tool[aria-pressed="true"] { background: var(--ink); color: var(--panel); border-color: var(--ink); }

/* Playback cluster (player.js owns the controls inside #previewMidiBar) */
.ed-player { position: relative; margin-left: auto; }
.ed-player.mp-unavailable .mp-controls { opacity: .45; }
.ed-player .mp-controls { display: flex; align-items: center; gap: 4px; flex-wrap: nowrap; background: transparent; border: none; padding: 0; }
.ed-player .mp-btn, .mp-btn {
  width: 28px; height: 28px; padding: 0; border-radius: 0; border: 1px solid transparent;
  background: transparent; color: var(--ink); font-size: 14px; line-height: 1;
  display: inline-flex; align-items: center; justify-content: center;
}
.ed-player .mp-btn:hover, .mp-btn:hover { background: var(--panel2); border-color: var(--rule); }
.ed-player #mpPlay { background: var(--ink); color: var(--panel); border-color: var(--ink); width: 32px; height: 28px; }
.ed-player #mpPlay:hover { background: #33302B; }
.ed-player .mp-btn-small { width: 26px; height: 26px; font-size: 13px; }
.ed-player .mp-btn-stop { color: var(--ink); }
.ed-player .mp-btn-toggle { border-color: transparent; }
.ed-player .mp-btn-toggle[aria-pressed="true"] { background: var(--blue-tint); color: var(--blue); border-color: var(--blue); }
.ed-listen { display: inline-flex; }
.ed-listen[hidden] { display: none; }
.ed-listen-btn { height: 26px; padding: 0 8px; font: inherit; font-size: 12px; background: #fff; color: inherit; border: 1px solid var(--rule, #c9ccd1); border-left-width: 0; border-radius: 0; cursor: pointer; }
.ed-listen-btn:first-child { border-left-width: 1px; }
.ed-listen-btn[aria-pressed="true"] { background: var(--blue-tint); color: var(--blue); border-color: var(--blue); border-left-width: 1px; }
.ed-listen-btn:disabled { opacity: .5; cursor: default; }
.ed-check-btn { height: 26px; padding: 0 8px; margin-left: 4px; font: inherit; font-size: 12px; background: #fff; color: var(--red); border: 1px solid var(--red); border-radius: 0; cursor: pointer; }
.ed-check-btn[hidden] { display: none; }
.ed-check-btn[aria-pressed="true"] { background: var(--red); color: #fff; }
.ed-check-panel { position: fixed; top: 150px; right: 16px; z-index: 40; width: 300px; max-height: 62vh; overflow: auto; background: #fff; border: 1px solid var(--red); padding: 10px 12px; font-size: 13px; box-shadow: 0 2px 10px rgba(0,0,0,.15); }
.ed-check-panel[hidden] { display: none; }
.ed-check-panel h3 { margin: 0 0 4px; font-size: 13px; letter-spacing: .06em; text-transform: uppercase; color: var(--red); }
.ed-check-panel p { margin: 0 0 8px; color: var(--graphite); font-size: 12px; }
.ed-check-row { display: block; width: 100%; height: auto; min-height: 0; line-height: 1.35; white-space: normal; text-align: left; padding: 5px 4px; background: none; color: #1c1d1f; border: 0; border-top: 1px solid #e3e5e8; font: inherit; font-size: 13px; cursor: pointer; }
.ed-check-row:hover, .ed-check-row.current { background: #fbeeed; }
.ed-check-row b { font-weight: 600; }
.ed-check-tools { display: flex; gap: 6px; margin: 6px 0 8px; }
.ed-check-tools button { height: 24px; padding: 0 8px; font: inherit; font-size: 12px; background: #fff; color: #1c1d1f; border: 1px solid #c9ccd1; border-radius: 0; cursor: pointer; }
.ed-check-tools button:disabled { color: #9a9da3; cursor: default; }
.ed-check-marks { position: fixed; left: 0; top: 0; width: 0; height: 0; z-index: 30; pointer-events: none; }
.ed-check-mark { position: fixed; width: 20px; height: 20px; margin: -10px 0 0 -10px; border: 2px solid var(--red); border-radius: 50%; box-sizing: border-box; }
.ed-check-mark.missing { width: 10px; height: 30px; margin: -26px 0 0 0; border-width: 2px 0 0 2px; border-radius: 0; }
.ed-check-mark.current { background: rgba(179, 56, 47, .18); }
.ed-check-mark.unsure { border-style: dashed; }
.ed-player .mp-btn-unavailable { opacity: .5; }
.ed-player .mp-btn-flat { font-size: 16px; }
.ed-player .mp-btn-flat:disabled { opacity: .35; }
.ed-player .mp-readout {
  font-variant-numeric: tabular-nums; font-size: 13px; font-weight: 700; color: var(--ink); height: 26px;
  padding: 0 8px; background: transparent; border: 1px solid transparent; white-space: nowrap; display: inline-flex; align-items: center;
}
.ed-player .mp-readout-btn:hover { background: var(--panel2); border-color: var(--rule); filter: none; }
.ed-player .mp-readout-btn { box-shadow: none; cursor: pointer; line-height: 1.2; }
.ed-player #edTime { font-size: 15px; }
.ed-player .mp-time { font-variant-numeric: tabular-nums; font-size: 11px; color: var(--muted); min-width: 30px; text-align: center; }
#previewMidiBar input[type=range].mp-range { width: auto; height: 22px; padding: 0; margin: 0; border: none; background: transparent; accent-color: var(--ink); cursor: pointer; }
#previewMidiBar input[type=range].mp-seek { flex: 0 1 120px; min-width: 70px; }
.ed-player .mp-bpm { display: inline-flex; align-items: center; gap: 4px; margin: 0; font-size: 13px; font-weight: 600; color: var(--text2); white-space: nowrap; }
.ed-player .mp-bpm-input { width: 56px !important; height: 26px; padding: 0 4px !important; font-size: 12px; font-weight: 700; text-align: center; font-variant-numeric: tabular-nums; }
.ed-player .mp-pct-input { width: 48px !important; }
.ed-player .mp-pct-sign { font-size: 12px; }
.ed-player .mp-sep { width: 1px; height: 22px; background: var(--rule); margin: 0 4px; }
.ed-player .mp-status, .ed-player #audioHint {
  position: absolute; right: 0; top: calc(100% + 2px); z-index: 86; margin: 0; font-size: 11px; font-style: normal;
  background: var(--paper); border: 1px solid var(--rule); padding: 2px 8px; white-space: nowrap; max-width: 70vw; overflow: hidden; text-overflow: ellipsis;
}
.mp-status-error { color: var(--red); }
.midi-hint { font-size: 11px; color: var(--muted); margin: 6px 0 0; font-style: italic; }
.ed-popover {
  position: absolute; right: 0; top: calc(100% + 6px); z-index: 85; min-width: 280px;
  background: var(--paper); border: 1px solid var(--ink); padding: 10px 12px; box-shadow: 0 8px 20px rgba(0,0,0,.18); font-size: 13px;
}
.ed-popover[hidden] { display: none; }
.ed-popover-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.ed-popover-close { background: transparent; border: none; color: var(--muted); height: 24px; padding: 0 6px; font-size: 13px; }
.ed-popover-close:hover { background: var(--panel2); color: var(--ink); }
.ed-popover-row { margin: 8px 0 0; font-size: 13px; font-weight: 400; }
.ed-popover .mp-tempo { display: flex; align-items: center; gap: 8px; margin: 0; font-size: 12px; font-weight: 600; color: var(--text2); }
.ed-popover input[type=range]#tempoRange { flex: 1 1 auto; min-width: 120px; }
#tempoValue { font-variant-numeric: tabular-nums; min-width: 38px; }
.ed-popover-note { margin: 6px 0 0; font-size: 11px; }
.ed-popover-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.ed-popover-actions .ed-top-btn { height: 24px; padding: 0 8px; font-size: 12px; }
.ed-goto, .ed-dynpop { min-width: 240px; }
.ed-goto-row { display: flex; align-items: center; gap: 8px; margin: 6px 0 0; font-size: 13px; font-weight: 400; }
.ed-goto-row input:not([type=checkbox]):not([type=radio]) { width: auto !important; flex: 1 1 auto; height: 26px; font-size: 13px; }
.ed-goto-row select { width: auto; height: 26px; }
.ed-dyn-choices { display: flex; flex-wrap: wrap; gap: 4px; }
.ed-dblpop { max-width: 560px; }
.ed-dbl-list { display: flex; flex-direction: column; gap: 4px; max-height: 50vh; overflow: auto; }
.ed-dbl-item { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 6px 8px; border: 1px solid var(--rule2); }
.ed-dbl-goto { flex: 1 1 auto; text-align: left; background: transparent; border: none; color: var(--ink); height: auto; padding: 2px 4px; font-size: 13px; font-weight: 500; white-space: normal; }
.ed-dbl-goto:hover { background: var(--panel2); }
.ed-dbl-actions { display: inline-flex; gap: 4px; flex: 0 0 auto; }
.ed-dbl-apply { height: 24px; }
.ed-window-pager { display: inline-flex; align-items: center; gap: 2px; }
.ed-window-pager .mp-btn { width: 24px; height: 24px; font-size: 14px; }
.ed-window-pager .mp-readout-btn { height: 24px; padding: 0 6px; font-size: 12px; box-shadow: none; line-height: 1.2; cursor: pointer; font-weight: 600; background: transparent; border: 1px solid transparent; }
.ed-window-pager .mp-readout-btn:hover { background: var(--panel2); border-color: var(--rule); }
.ed-window-pager[hidden] { display: none; }
.ed-loop-flag { position: absolute; width: 2px; background: var(--cursor); opacity: .9; }
.ed-loop-flag::before { content: ""; position: absolute; top: 0; width: 0; height: 0; border-top: 7px solid transparent; border-bottom: 7px solid transparent; }
.ed-loop-flag-start::before { left: 2px; border-left: 12px solid var(--cursor); }
.ed-loop-flag-end::before { right: 2px; border-right: 12px solid var(--cursor); }

/* Mixer VU lights: eight LEDs up the left edge of each strip (green, then
   amber, then a red top), lit from the note stream while the part sounds. */
.ed-mixer .mp-part { position: relative; }
.mp-vu { display: none; }
.ed-mixer .mp-vu { display: flex; flex-direction: column-reverse; gap: 2px; position: absolute; left: 8px; top: 10px; width: 6px; height: 110px; }
.mp-vu-seg { display: block; flex: 1 1 auto; background: #D8D6D0; border-radius: 1px; }
.mp-vu-seg.on { background: var(--green); }
.mp-vu-seg.mp-vu-amber.on { background: var(--amber); }
.mp-vu-seg.mp-vu-red.on { background: var(--red); }
/* Faders look like a board's: a dark slot with a centre line and a
   rectangular cap (the input is rotated, so the cap's width runs along the
   travel), a dB scale on the right and the value under the fader. */
#previewMidiBar .ed-mixer .mp-part input[type=range].mp-volume { -webkit-appearance: none; appearance: none; height: 22px; }
#previewMidiBar .ed-mixer .mp-part input[type=range].mp-volume::-webkit-slider-runnable-track { height: 6px; background: #2A2825; border-radius: 1px; box-shadow: inset 0 0 0 1px #57544E, inset 0 2px 0 -1px #6B6963; }
#previewMidiBar .ed-mixer .mp-part input[type=range].mp-volume::-webkit-slider-thumb { -webkit-appearance: none; appearance: none; width: 14px; height: 30px; margin-top: -12px; border-radius: 2px; border: 1px solid #1F1D1A; background: linear-gradient(90deg, #6B6963 0%, #C9C6BE 35%, #F7F6F2 47%, #F7F6F2 53%, #C9C6BE 65%, #6B6963 100%); box-shadow: 0 1px 3px rgba(0,0,0,.45); cursor: grab; }
#previewMidiBar .ed-mixer .mp-part input[type=range].mp-volume::-moz-range-track { height: 6px; background: #2A2825; border-radius: 1px; }
#previewMidiBar .ed-mixer .mp-part input[type=range].mp-volume::-moz-range-thumb { width: 14px; height: 30px; border-radius: 2px; border: 1px solid #1F1D1A; background: linear-gradient(90deg, #6B6963 0%, #C9C6BE 35%, #F7F6F2 47%, #F7F6F2 53%, #C9C6BE 65%, #6B6963 100%); cursor: grab; }
.mp-scale { display: none; }
.ed-mixer .mp-scale { display: block; position: absolute; right: 6px; top: 10px; height: 110px; width: 26px; font-size: 9px; font-weight: 600; color: var(--muted); font-variant-numeric: tabular-nums; }
.ed-mixer .mp-scale i { position: absolute; left: 0; right: 0; font-style: normal; line-height: 0; text-align: right; padding-right: 2px; }
.ed-mixer .mp-scale i::before { content: ""; position: absolute; left: 0; top: 0; width: 5px; height: 1px; background: var(--faint); }
.mp-db { display: none; }
.ed-mixer .mp-db { display: block; order: 2; font-size: 10px; font-weight: 600; color: var(--text2); font-variant-numeric: tabular-nums; margin: -2px 0 2px; }
/* Mixer: vertical channel strips — fader, mute / solo, name at the bottom */
.ed-mixer { min-width: 0; max-width: 92vw; }
.ed-mixer-strips { display: flex; align-items: flex-start; gap: 6px; overflow-x: auto; padding-bottom: 4px; }
.ed-mixer .mp-parts { display: flex; flex-wrap: nowrap; gap: 6px; margin: 0; }
.mp-parts { display: flex; flex-wrap: wrap; gap: 6px 10px; margin-top: 8px; }
.mp-part { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--rule); padding: 3px 6px 3px 10px; background: var(--paper); font-size: 12px; }
.ed-mixer .mp-part, .ed-metro-strip {
  display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 4px;
  width: 112px; min-height: 150px; padding: 8px 6px 6px; border: 1px solid var(--rule); border-top: 3px solid var(--strip, var(--faint));
  background: var(--paper); font-size: 11px; color: var(--ink);
}
.ed-mixer .mp-part.mp-silent .mp-part-name { color: var(--faint); text-decoration: line-through; }
.mp-part.mp-silent .mp-part-name { color: var(--faint); text-decoration: line-through; }
.mp-part-name { max-width: 200px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ed-mixer .mp-part .mp-part-name, .ed-metro-strip .mp-part-name { order: 10; max-width: 100%; text-align: center; white-space: normal; line-height: 1.15; font-weight: 600; font-size: 11px; }
#previewMidiBar .ed-mixer .mp-part input[type=range].mp-volume { order: 1; width: 110px; min-width: 0; flex: 0 0 auto; transform: rotate(-90deg); margin: 46px 0; padding: 0; border: none; background: transparent; accent-color: var(--strip, var(--ink)); }
#previewMidiBar .ed-mixer .mp-part .mp-pan, #previewMidiBar .ed-mixer .mp-part .mp-reverb, #previewMidiBar .ed-mixer .mp-part .mp-chorus { order: 3; width: 100%; min-width: 0; flex: 0 0 auto; height: 16px; margin: 0; padding: 0; border: none; background: transparent; transform: none; accent-color: var(--muted); }
#previewMidiBar .ed-mixer .mp-part .mp-pan { accent-color: var(--blue); }
.mp-part .mp-pan, .mp-part .mp-reverb, .mp-part .mp-chorus { width: 80px; }
.mp-part .mp-program { max-width: 130px; font-size: 11px; }
.ed-mixer .mp-part .mp-program { order: 6; width: 100%; max-width: 100%; font-size: 10px; height: 22px; padding: 0 2px; }
.ed-master-strip { border-top-color: var(--ink); justify-content: flex-end; }
.ed-mixer .mp-part .mp-toggle { order: 5; width: 100%; text-align: center; }
.ed-metro-strip { border-top-color: var(--graphite); justify-content: flex-end; }
.mp-toggle { height: 22px; padding: 0 6px; font-size: 10px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.mp-mute.on { background: var(--red); color: #fff; border-color: var(--red); }
.mp-solo.on { background: var(--amber); color: var(--ink); border-color: var(--amber); }
.ed-metro-toggle.on { background: var(--ink); color: var(--panel); border-color: var(--ink); }
.ed-mixer-hint { margin-top: 8px; font-size: 11px; }
.ed-export-parts { display: flex; flex-wrap: wrap; gap: 6px 14px; margin: 6px 0 8px; }
.ed-export-parts label { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; margin: 0; }
.ed-export-parts label.ed-export-score { flex-basis: 100%; }
.ed-export-select { font-size: 12px; }

/* Note-input toolbar */
.ed-noteinput {
  display: flex; align-items: center; gap: 2px; padding: 3px 10px; min-height: 34px;
  background: var(--panel2); border-bottom: 1px solid var(--rule); overflow-x: auto; white-space: nowrap; position: relative; z-index: 70;
}
.ed-noteinput[hidden] { display: none; }
.ed-phone-only { display: none; }
.ed-ni {
  width: 28px; height: 26px; padding: 0; flex: 0 0 auto;
  background: transparent; color: var(--ink); border: 1px solid transparent; font-weight: 600;
  display: inline-flex; align-items: center; justify-content: center;
}
.ed-ni:hover { background: var(--paper); border-color: var(--rule); }
.ed-ni.active, .ed-ni[aria-pressed="true"] { background: var(--ink); color: var(--panel); border-color: var(--ink); }
.ed-ni:disabled { color: var(--faint); }
.ed-ni:disabled:hover { background: transparent; border-color: transparent; }
.ed-glyph { font-family: "Bravura Text", "Noto Music", "Segoe UI Symbol", "Apple Symbols", "Noto Sans Symbols2", serif; font-size: 17px; line-height: 1; }
.ed-glyph-dot { font-size: 22px; }
.ed-ni-voice { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; color: var(--blue); padding: 0 8px; font-weight: 700; }
.ed-ni-sep { width: 1px; height: 18px; background: var(--rule); margin: 0 4px; flex: 0 0 auto; }
.ed-ni-msg { margin-left: 10px; font-size: 12px; color: var(--blue); font-weight: 600; }
body.ed-input-mode #osmdContainer { cursor: text; }

/* Part tab strip */
.ed-partstrip { display: flex; align-items: center; gap: 0; padding: 4px 10px 0; background: var(--panel); border-bottom: 1px solid var(--rule); overflow-x: auto; }
.ed-partstrip[hidden] { display: none; }
.ed-part-tab { border-bottom: none; height: 26px; white-space: nowrap; color: var(--muted); }
.ed-part-tab + .ed-part-tab { border-left: none; }
.ed-part-tab.active { background: var(--paper); color: var(--ink); border-color: var(--ink); }
.ed-part-close { margin-left: auto; background: transparent; border: none; color: var(--muted); height: 24px; padding: 0 8px; font-size: 12px; }
.ed-part-close:hover { background: var(--panel2); color: var(--ink); }

/* Publish panel */
.ed-publish { flex: 1 1 auto; overflow: auto; padding: 20px; }
.ed-publish[hidden] { display: none; }
.ed-publish-body { max-width: 860px; margin: 0 auto; background: var(--paper); border: 1px solid var(--rule); padding: 22px; }
.ed-publish-body h2 { font-family: var(--serif); font-size: 20px; font-weight: 500; }
.ed-publish-body h3 { margin: 14px 0 6px; font-size: 11px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.ed-publish-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin: 14px 0 18px; }
.ed-publish-list { display: grid; gap: 2px; margin-top: 6px; font-size: 13px; }
.ed-publish-list a { color: var(--blue); font-weight: 600; text-decoration: none; padding: 4px 6px; }
.ed-publish-list a:hover { background: var(--blue-tint); }
.ed-print-settings { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 6px 12px; }
.ed-print-settings label { margin: 0; }
.ed-publish-audio { margin: 10px 0 0; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.ed-top-btn { display: inline-flex; align-items: center; white-space: nowrap; text-decoration: none; line-height: 1; }
.ed-top-btn:disabled { opacity: .5; cursor: default; }

/* Sidebar | score | drawer */
.ed-main { display: flex; flex: 1 1 auto; min-height: 0; position: relative; }
.ed-main[hidden] { display: none; }
.ed-sidebar { flex: 0 0 280px; width: 280px; display: flex; flex-direction: column; min-height: 0; background: var(--panel); border-right: 1px solid var(--rule); }
.ed-sidebar.collapsed { display: none; }
.ed-side-tabs { display: flex; align-items: stretch; border-bottom: 1px solid var(--rule); }
.ed-side-tab {
  flex: 1 1 auto; background: transparent; color: var(--muted); border: none; border-bottom: 2px solid transparent;
  height: 30px; padding: 0 6px; font-size: 12px; font-weight: 600;
}
.ed-side-tab:hover { background: var(--panel2); }
.ed-side-tab.active { color: var(--ink); border-bottom-color: var(--ink); }
.ed-side-collapse, .ed-side-expand { flex: 0 0 auto; background: transparent; border: none; color: var(--muted); height: 30px; padding: 0 8px; font-size: 16px; }
.ed-side-collapse:hover, .ed-side-expand:hover { background: var(--panel2); color: var(--ink); }
.ed-side-expand { position: absolute; left: 4px; top: 8px; z-index: 30; background: var(--panel); border: 1px solid var(--rule); height: 26px; }
.ed-side-expand[hidden] { display: none; }
.ed-side-body { flex: 1 1 auto; overflow: auto; padding: 10px 12px 40px; font-size: 13px; }
.ed-panel[hidden] { display: none; }
.ed-side-body .score-details { border: none; padding: 0; margin: 0; background: transparent; }
.ed-side-body .score-details[hidden] { display: none; }
.ed-side-body .score-details-body { padding-top: 0; }
.ed-side-body .sd-grid { grid-template-columns: 1fr; }
.ed-selprops h4, .ed-side-body h4 { margin: 8px 0 6px; font-size: 11px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.ed-props { width: 100%; border-collapse: collapse; font-size: 13px; }
.ed-props th { text-align: left; color: var(--muted); font-weight: 500; padding: 4px 8px 4px 0; width: 40%; vertical-align: top; }
.ed-props td { padding: 4px 0; }
.ed-layout-parts { display: grid; gap: 4px; }
.ed-layout-row { display: grid; grid-template-columns: auto minmax(0, 1fr) 64px; gap: 6px; align-items: center; }
.ed-layout-row input { height: 26px; font-size: 12px; }
.ed-layout-tools { grid-column: 2 / -1; display: flex; gap: 4px; align-items: center; }
.ed-layout-tools button { height: 22px; min-width: 24px; padding: 0 6px; font-size: 12px; background: transparent; border: 1px solid var(--rule); color: var(--ink); }
.ed-layout-tools button:hover:not(:disabled) { background: var(--panel2); }
.ed-layout-tools button:disabled { color: var(--faint); }
.ed-layout-tools .ed-layout-remove { color: var(--red); margin-left: auto; }
.ed-layout-tools .ed-layout-remove.armed { background: var(--red); color: #fff; }
.ed-layout-tools select { height: 22px; font-size: 12px; min-width: 0; flex: 1 1 auto; }
.ed-layout-add { margin-top: 8px; }
.ed-ni-kind { height: 26px; font-size: 12px; margin: 0 4px; max-width: 92px; }
.ed-layout-add select { width: 100%; height: 28px; font-size: 12px; }
.ed-eye { background: transparent; border: none; color: var(--blue); height: 24px; padding: 0 6px; font-size: 14px; }
.ed-eye[aria-pressed="false"] { color: var(--faint); }
.ed-eye:hover { background: var(--panel2); }
.ed-layout-opt { margin-top: 12px; font-size: 12px; font-weight: 400; }
.ed-palette-search { margin-bottom: 6px; height: 28px; font-size: 13px; font-weight: 400; }
.ed-palette-hint { margin: 0 0 8px; font-size: 11px; }
.ed-palettes { display: grid; gap: 6px; }
.ed-palette { border: 1px solid var(--rule); padding: 4px 8px 8px; background: var(--paper); }
.ed-palette summary { cursor: pointer; font-weight: 600; font-size: 12px; padding: 4px 0; }
.ed-palette-items { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.ed-pal-item { min-width: 36px; height: 30px; padding: 0 8px; font-size: 13px; }
.ed-pal-dyn { font-style: italic; font-family: var(--serif); font-weight: 700; }

.ed-stage { display: flex; flex-direction: column; flex: 1 1 auto; min-width: 0; min-height: 0; position: relative; }
.ed-score {
  flex: 1 1 auto; min-width: 0; overflow: auto; padding: 20px 24px 80px; position: relative;
  overscroll-behavior: contain; background: #6E6C66;
  /* the score's width must not change when its own height brings a
     scrollbar: one layout, not a second one (preview.js, 2026-09-11) */
  scrollbar-gutter: stable;
}
/* The scrubber above the score: a board-style position bar — a dark track,
   the played part in the app's blue, a square handle; drag anywhere. */
.ed-seekbar { display: flex; align-items: center; gap: 10px; padding: 6px 14px; background: var(--panel2); border-bottom: 1px solid var(--rule); flex: 0 0 auto; }
.ed-seekbar[hidden] { display: none; }
.ed-seek-play { width: 30px; height: 26px; padding: 0; background: var(--ink); color: var(--panel); border: 1px solid var(--ink); font-size: 12px; display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto; }
.ed-seek-play:hover { background: #33302B; }
.ed-seek-time { font-variant-numeric: tabular-nums; font-size: 12px; font-weight: 600; color: var(--text2); min-width: 34px; text-align: center; }
.ed-seek-track { position: relative; flex: 1 1 auto; height: 22px; cursor: pointer; touch-action: none; }
.ed-seek-track::before { content: ""; position: absolute; left: 0; right: 0; top: 9px; height: 4px; background: #4E4C47; border-radius: 2px; }
.ed-seek-fill { position: absolute; left: 0; top: 9px; height: 4px; width: 0; background: var(--cursor); border-radius: 2px; pointer-events: none; }
.ed-seek-handle { position: absolute; top: 3px; left: 0; width: 10px; height: 16px; margin-left: -5px; background: var(--panel); border: 1px solid var(--ink); box-shadow: 0 1px 2px rgba(0,0,0,.3); pointer-events: none; }
.ed-seek-track:focus-visible .ed-seek-handle { outline: 2px solid var(--blue); outline-offset: 1px; }
.ed-seek-tip { position: absolute; top: calc(100% + 2px); transform: translateX(-50%); background: var(--ink); color: var(--panel); font-size: 11px; font-weight: 600; padding: 2px 6px; white-space: nowrap; pointer-events: none; z-index: 30; }
.ed-seek-tip[hidden] { display: none; }
/* The paper: the only shadow in the app. */
.ed-page { background: var(--paper); box-shadow: 0 2px 0 #4E4C47, 0 12px 30px rgba(0,0,0,.35); margin: 0 auto; max-width: 1400px; min-height: 60px; }
body.ed-continuous .ed-page { max-width: none; width: max-content; min-width: 100%; }
.ed-score #osmdContainer { padding: 16px; overflow: visible; }
.ed-hint { display: none; }  /* the docked context bar carries this text (2026-09-14) */
.ed-notice { margin: 0 0 8px; font-size: 13px; color: #D8D6D0; }
.ed-notice-error { color: #F0B8B2; }
body.ed-vertical .ed-page { max-width: none; box-shadow: none; }
body.ed-vertical .ed-score { padding-left: 0; padding-right: 0; background: var(--paper); }
.ed-drawer { flex: 0 0 400px; width: 400px; display: flex; flex-direction: column; min-height: 0; background: var(--panel); border-left: 1px solid var(--rule); }
.ed-drawer[hidden] { display: none; }
.ed-drawer-tabs { display: flex; align-items: stretch; border-bottom: 1px solid var(--rule); }
.ed-drawer-tabs .ed-tab { border: none; border-bottom: 2px solid transparent; background: transparent; color: var(--muted); height: 30px; }
.ed-drawer-tabs .ed-tab.active { color: var(--ink); border-bottom-color: var(--ink); background: transparent; }
.ed-drawer-close { margin-left: auto; background: transparent; border: none; color: var(--muted); height: 30px; padding: 0 10px; font-size: 14px; }
.ed-drawer-close:hover { background: var(--panel2); color: var(--ink); }
.ed-drawer-body { flex: 1 1 auto; overflow: auto; padding: 12px 14px 40px; }
.fix-buttons { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 8px; }
.fix-buttons button { height: 28px; padding: 0 10px; font-size: 13px; }

/* ── The pencil layer: selection, marks, the floating passage bar ────────── */
#edScoreWrap, #previewCard { position: relative; }
.ed-overlay { position: absolute; pointer-events: none; z-index: 20; }
/* Marks sketched the moment they are added, until the accurate redraw:
   ink, as the engraving will be — they are the score, not a selection. */
svg.ed-provisional { position: absolute; pointer-events: none; z-index: 19; overflow: visible; }
.ed-prov-ink { fill: var(--ink); }
.ed-prov-stroke { stroke: var(--ink); stroke-linecap: round; stroke-linejoin: round; fill: none; }
.ed-prov-dyn { font-family: 'Spectral', Georgia, serif; font-style: italic; font-weight: 700; }
.ed-prov-rehearsal { font-weight: 700; }
.ed-prov-acc { font-family: 'Segoe UI Symbol', 'Noto Music', 'DejaVu Sans', 'Apple Symbols', serif; }
.ed-bar-hl { position: absolute; border: 1px solid var(--graphite); background: var(--graphite-tint); box-sizing: border-box; }
.ed-bar-hl-faint { background: transparent; border-style: dashed; opacity: .7; }
.ed-note-hl { position: absolute; border: 1.5px solid var(--graphite); border-radius: 50%; background: var(--graphite-tint); box-sizing: border-box; }
.ed-note-hl-list { border-style: dashed; }
.ed-rest-hl { border-radius: 0; }
.ed-input-caret { position: absolute; width: 2px; background: var(--cursor); animation: ed-caret 1s steps(2) infinite; }
@keyframes ed-caret { 50% { opacity: .2; } }
/* The context bar is DOCKED under the score (2026-09-14): a strip that
   never covers a staff and never scrolls away.  Status on the left, the
   selection's actions on the right, the last message under them. */
.ed-toolbar {
  flex: 0 0 auto; z-index: 40; max-width: none;
  background: var(--ink); color: var(--panel); border-top: 1px solid #4E4C47;
  padding: 6px 12px 6px; font-size: 13px;
}
.ed-toolbar-empty .ed-buttons, .ed-toolbar-empty .ed-close { display: none; }
.ed-toolbar-empty .ed-status { font-weight: 400; color: #D8D6D0; }
.ed-status-row { display: flex; align-items: center; gap: 8px; }
.ed-status { flex: 1 1 auto; font-weight: 600; min-width: 0; }
.ed-spinner { flex: 0 0 auto; width: 12px; height: 12px; border-radius: 50%; border: 2px solid var(--rule); border-top-color: transparent; animation: ed-spin .8s linear infinite; }
@keyframes ed-spin { to { transform: rotate(360deg); } }
.ed-buttons { display: flex; flex-wrap: wrap; gap: 1px; margin-top: 6px; border: 1px solid #4E4C47; background: #4E4C47; width: max-content; max-width: 100%; }
.ed-btn {
  height: 28px; padding: 0 10px; background: var(--ink); color: var(--panel); border: none;
  font-weight: 600; font-size: 12px; line-height: 1; flex: 0 0 auto;
}
.ed-btn:hover { background: #33302B; }
.ed-btn:disabled { opacity: .45; cursor: default; }
.ed-close { flex: 0 0 auto; height: 24px; min-width: 24px; padding: 0 6px; background: transparent; border: 1px solid #4E4C47; color: var(--panel); }
.ed-close:hover { background: #33302B; }
.ed-msg { margin-top: 6px; font-size: 12px; color: #D8D6D0; }
.ed-msg-error { color: #F0B8B2; }
.ed-menu {
  position: absolute; z-index: 50; display: grid; gap: 0; padding: 4px;
  background: var(--paper); border: 1px solid var(--ink); box-shadow: 0 8px 20px rgba(0,0,0,.18); max-height: 280px; overflow-y: auto; min-width: 160px;
}
.ed-menu[hidden], .ed-toolbar[hidden] { display: none !important; }
.ed-menu button { background: none; border: none; color: var(--ink); text-align: left; height: auto; padding: 6px 8px; font-weight: 500; font-size: 13px; }
.ed-menu button:hover { background: var(--ink); color: var(--panel); }

/* Status bar */
.ed-statusbar {
  display: flex; align-items: center; gap: 12px; padding: 0 10px; min-height: 26px;
  background: var(--panel); border-top: 1px solid var(--rule); font-size: 12px; color: var(--ink);
}
.ed-statusbar-left { flex: 1 1 auto; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 600; }
.ed-statusbar-right { display: flex; align-items: center; gap: 6px; flex: 0 0 auto; }
.ed-status-select { width: auto !important; height: 22px; padding: 0 22px 0 6px !important; font-size: 12px; }
.ed-status-check { display: inline-flex; align-items: center; gap: 5px; margin: 0; font-size: 12px; font-weight: 600; cursor: pointer; }
.ed-status-check input { margin: 0; }
.ed-zoom { display: inline-flex; align-items: center; gap: 0; }
.ed-zoom-btn, .ed-zoom-value { height: 22px; padding: 0 6px; min-width: 24px; font-weight: 700; }
.ed-zoom-btn + .ed-zoom-value, .ed-zoom-value + .ed-zoom-btn { border-left: none; }
input.ed-zoom-value { width: 56px !important; text-align: center; font-variant-numeric: tabular-nums; font-size: 12px; }
.ed-zoom-preset { width: auto !important; max-width: 110px; height: 22px; padding: 0 20px 0 4px !important; border-left: none; }

/* Toast */
.ed-toast {
  position: fixed; left: 50%; bottom: 48px; transform: translateX(-50%); z-index: 200;
  background: var(--ink); color: var(--panel); padding: 8px 14px; font-size: 13px; font-weight: 600;
  box-shadow: 0 6px 18px rgba(0,0,0,.3); max-width: min(90vw, 560px);
}
.ed-toast[hidden] { display: none; }
.ed-toast-error { background: var(--red); color: #fff; }

.ed-message { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px; background: var(--desk); }
.ed-message[hidden] { display: none; }
.ed-message-card { max-width: 520px; text-align: center; background: var(--panel); border: 1px solid var(--rule); padding: 32px; }
.ed-message-card h1 { font-family: var(--serif); font-size: 28px; font-weight: 500; line-height: 1.1; margin-bottom: 12px; }
.ed-message-card .help-link { display: inline-block; margin-top: 18px; }

@media (max-width: 1100px) {
  .ed-title { display: none; }
  .ed-sidebar { flex-basis: 250px; width: 250px; }
  .ed-drawer { flex-basis: 340px; width: 340px; }
}

/* Phones: the menu folds into ☰, the toolbar scrolls, sidebar / mixer /
   drawer become sheets, the player cluster docks at the bottom. */
@media (max-width: 700px) {
  /* Phones (2026-09-12, Jon): the menus stay visible as a second row of
     the menu bar, every tab of the tab row stays, and the sidebar's
     panels sit BELOW the score instead of covering it. */
  .ed-menubar { gap: 4px 6px; padding: 4px 8px; height: auto; flex-wrap: wrap; }
  .ed-brand { display: none; }
  .ed-hamburger { display: none; }
  .ed-menus { order: 10; flex: 1 1 100%; display: flex; gap: 0; overflow-x: auto; scrollbar-width: none; }
  .ed-menus::-webkit-scrollbar { display: none; }
  .ed-menu-item { position: static; }
  .ed-menu-btn { height: 30px; padding: 0 10px; font-size: 14px; }
  .ed-menu-panel { position: fixed; left: 8px; right: 8px; top: 96px; z-index: 130; max-height: calc(100vh - 110px - var(--ed-player-h, 0px)); overflow-y: auto; -webkit-overflow-scrolling: touch; min-width: 0; }
  .ed-menus kbd { display: none; }  /* a touch screen has no shortcuts to show */
  .ed-title { display: flex; text-align: left; justify-content: flex-start; flex: 1 1 auto; }
  .ed-menu-panel .ed-menu-close { display: flex; justify-content: center; margin-top: 4px; height: 40px; background: var(--ink); color: var(--panel); font-weight: 700; }
  .ed-menu-panel .ed-menu-close:hover { background: #33302B; color: var(--panel); }
  .ed-menubar-right { margin-left: auto; }
  .ed-file-label { display: none; }
  .ed-file select { max-width: 150px; }
  .ed-tabrow { padding: 4px 6px; gap: 6px; min-height: 36px; }
  .ed-tab { padding: 0 8px; font-size: 12px; }
  .ed-tool { padding: 0 8px; font-size: 12px; }
  .ed-tabrow-centre { margin: 0 0 0 auto; gap: 4px; }
  .ed-tabrow { flex-wrap: wrap; overflow: visible; }
  .ed-tool { white-space: nowrap; }
  /* The player docks at the bottom of the screen; the editor's context bar
     sits above it (--ed-player-h, set by editor_page.js). */
  .ed-player {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 120; margin: 0;
    background: var(--panel); border-top: 1px solid var(--rule); padding: 4px 8px calc(4px + env(safe-area-inset-bottom));
  }
  .ed-player .mp-controls { flex-wrap: wrap; justify-content: center; gap: 3px 4px; }
  #previewMidiBar input[type=range].mp-seek { flex: 1 1 100%; order: 10; margin: 2px 0 0; height: 22px; }
  .ed-player .mp-time { order: 11; }
  .ed-player .midi-hint { display: none !important; }
  .ed-popover { position: fixed; left: 8px; right: 8px; top: auto; bottom: calc(var(--ed-player-h, 0px) + 8px); min-width: 0; }
  .ed-noteinput { padding: 3px 6px; scrollbar-width: none; -webkit-overflow-scrolling: touch; mask-image: linear-gradient(90deg, #000 94%, transparent); }
  .ed-noteinput::-webkit-scrollbar { display: none; }
  .ed-main { flex-direction: column; overflow-y: auto; -webkit-overflow-scrolling: touch; }
  .ed-score { order: 0; }
  .ed-sidebar, .ed-side-expand { order: 1; }
  .ed-drawer { order: 2; }
  .ed-score { flex: 0 0 auto; height: 62vh; min-height: 320px; padding: 8px 8px 60px; touch-action: pan-x pan-y; }
  .ed-seekbar { padding: 4px 8px; }
  .ed-seek-play { width: 44px; height: 36px; font-size: 15px; }
  .ed-seekbar .ed-seek-bpm { display: inline-flex; align-items: center; gap: 4px; margin: 0 0 0 4px; font-size: 13px; font-weight: 600; color: var(--text2); white-space: nowrap; flex: 0 0 auto; }
  .ed-seekbar .ed-seek-bpm .mp-bpm-input { width: 54px !important; height: 30px; }
  .ed-seek-track { height: 30px; }
  .ed-seek-track::before, .ed-seek-fill { top: 13px; }
  .ed-seek-handle { top: 5px; width: 14px; height: 20px; margin-left: -7px; }
  .ed-sidebar { position: static; width: auto; flex: 0 0 auto; border-right: none; border-top: 1px solid var(--rule); box-sizing: border-box; overflow-x: hidden; padding-bottom: calc(var(--ed-player-h, 0px) + 12px); }
  .ed-sidebar input, .ed-sidebar select, .ed-sidebar textarea { max-width: 100%; box-sizing: border-box; }
  .ed-sidebar table { width: 100%; table-layout: fixed; }
  .ed-side-body { overflow: visible; padding-bottom: 16px; }
  .ed-side-collapse { margin-left: auto; font-size: 20px; padding: 0 12px; }
  .ed-side-expand { position: static; width: 100%; height: 34px; border: none; border-top: 1px solid var(--rule); font-size: 13px; font-weight: 600; }
  .ed-side-expand::after { content: " Layout, Properties, Palettes"; }
  .ed-drawer { position: static; width: auto; flex: 0 0 auto; border-left: none; border-top: 1px solid var(--rule); padding-bottom: calc(var(--ed-player-h, 0px) + 12px); }
  .ed-drawer-body { overflow: visible; }
  .ed-statusbar { padding: 3px 6px calc(3px + var(--ed-player-h, 0px)); gap: 6px; font-size: 12px; }
  .ed-statusbar-right { gap: 4px; flex-wrap: wrap; min-width: 0; }
  .ed-window-pager .mp-readout-btn { padding: 0 4px; font-size: 11px; }
  .ed-status-select { display: none; }
  .ed-publish-cols { grid-template-columns: 1fr; }
  .ed-toast { bottom: calc(var(--ed-player-h, 0px) + 12px); }
  /* Compact transport: one row of 36 px buttons + the seek bar; tempo and
     undo / redo live in the settings popover and the tab row. */
  .ed-player .mp-btn { width: 36px; height: 36px; font-size: 14px; }
  .ed-player #mpPlay { width: 44px; height: 44px; font-size: 18px; }
  .ed-player .mp-readout-btn { padding: 0 6px; font-size: 12px; }
  .ed-player .mp-sep, .ed-player #edUndoBtn, .ed-player #edRedoBtn, .ed-player #mpTotal, .ed-player #mpSeek { display: none; }  /* the position bar above the score seeks */
  .ed-player .mp-bpm:has(#edTempoPct) { display: none; }  /* the percent lives under the gear */
  .ed-player .mp-bpm { font-size: 12px; }
  .ed-player .mp-bpm-input { width: 50px !important; padding: 0 4px !important; }
  .ed-phone-only { display: inline-flex; }
  .ed-hint { display: none; }
  .ed-title strong { font-size: 13px; }
  .ed-file select { max-width: 112px; }
  .ed-ni { width: 38px; height: 38px; }
  .ed-pal-item { min-height: 36px; }
  .ed-popover { max-height: calc(100vh - var(--ed-player-h, 0px) - 24px); overflow: auto; box-sizing: border-box; }
  .ed-mixer .mp-part, .ed-metro-strip { min-height: 120px; width: 104px; }
  .ed-mixer { max-height: calc(100vh - var(--ed-player-h, 0px) - 24px); overflow: auto; }
  /* The toolbar docks above the player bar. */
  .ed-toolbar { position: fixed !important; left: 0 !important; right: 0; bottom: var(--ed-player-h, 0px); top: auto !important; max-width: none; padding-bottom: 8px; z-index: 110; }
  .ed-stage { display: contents; }
  .ed-toolbar.ed-toolbar-empty { display: none !important; }  /* a phone has no room for a hint strip */
  .ed-btn { height: 40px; min-width: 44px; }
  .ed-menu { position: fixed; left: 8px !important; right: 8px; bottom: calc(var(--ed-player-h, 0px) + 8px); top: auto !important; z-index: 115; }
}

/* A Play that is waiting for its sound (editor_page.js setPlayWaiting). */
@keyframes ed-play-wait { 0%, 100% { opacity: 1; } 50% { opacity: 0.35; } }
.mp-btn.is-waiting, .ed-seek-play.is-waiting { animation: ed-play-wait 1s ease-in-out infinite; cursor: progress; }
.ed-play-wait { font-size: 12px; color: var(--muted); white-space: nowrap; margin: 0 8px; align-self: center; }
@media (prefers-reduced-motion: reduce) { .mp-btn.is-waiting, .ed-seek-play.is-waiting { animation: none; opacity: 0.6; } }
