:root{--notation-bar:#216c9c;--notation-reference:#744aa4;--notation-chord:#b93620}
[data-theme=dark],body.dark,:root[data-theme=dark]{--notation-bar:#79c5f2;--notation-reference:#d2abff;--notation-chord:#ff9579}
.song-bar-separator,.song-beat-count{color:var(--notation-bar);font-weight:600}.song-bar-separator{padding:0 .25em}.song-bar-separator small{font-size:.65em;margin:0 .25em}.song-beat-count{font-size:.65em;margin-left:.25em}.song-bar-error{color:#d04229;text-decoration:underline wavy}.song-meter{font:600 .85rem monospace}
.song-annotated-row{min-width:0}.song-annotated-row.has-references{display:grid;grid-template-columns:minmax(0,1fr) minmax(100px,22%);gap:1rem;align-items:start}.song-reference-call,.song-reference-margin span{color:var(--notation-reference);font-weight:bold}.song-reference-call{padding:0 .25em;font-size:.8em}.song-reference-call sup{font-size:.65em}.song-reference-margin{font-size:.75rem;line-height:1.45;white-space:normal;overflow-wrap:anywhere;padding:.25rem .5rem;border-left:1px solid var(--notation-reference)}.song-reference-margin p{margin:0 0 .4rem;font:inherit!important}.song-reference-margin summary{cursor:pointer}.song-reference-margin details p{margin-top:.3rem}
.song-notation-tools{border-top:1px solid #80808055;margin-top:.5rem;padding-top:.5rem;display:grid;gap:.4rem}.song-notation-tools label{font-size:.8rem;display:grid;gap:.2rem}.song-notation-tools select,.song-notation-tools input{width:100%;min-width:0;padding:.35rem!important;height:2rem!important;font-size:.8rem!important}.song-notation-tools summary{cursor:pointer;font-size:.85rem;padding:.35rem 0}.song-notation-tools button{padding:.3rem .55rem!important;min-height:2rem!important;height:auto!important;font-size:.8rem!important}.song-notation-tools p{font-size:.75rem!important;line-height:1.4}.song-notation-tools output{display:block;font-size:.75rem;color:var(--notation-chord)}
.notation-input{position:relative;min-width:0;width:100%}.notation-input textarea,.notation-input pre{font-family:monospace!important;font-size:14px!important;line-height:1.65!important;letter-spacing:normal!important;tab-size:4!important;white-space:pre-wrap!important;overflow-wrap:break-word!important;word-break:normal!important;padding:12px!important;border:1px solid transparent!important;border-radius:0!important;box-sizing:border-box!important;margin:0!important;font-weight:400!important;text-align:left!important}.notation-input pre{position:absolute;inset:0;overflow:hidden;pointer-events:none;color:inherit;background:transparent}.notation-input textarea{position:relative;display:block;width:100%;color:transparent!important;-webkit-text-fill-color:transparent;background:transparent!important;caret-color:var(--notation-chord);resize:vertical}.notation-input textarea::selection{background:#528bd066}.notation-input pre span{font:inherit;letter-spacing:inherit}.notation-input pre .notation-chord{color:var(--notation-chord)}.notation-input pre .notation-bar{color:var(--notation-bar)}.notation-input pre .notation-reference{color:var(--notation-reference)}.notation-input pre .notation-error{text-decoration:underline wavy;color:var(--notation-chord)}
@media(max-width:600px){.song-annotated-row.has-references{grid-template-columns:minmax(0,1fr) 100px;gap:.5rem}.song-reference-margin{font-size:.68rem;padding:.2rem .3rem}.notation-input textarea,.notation-input pre{font-size:16px!important}}

.has-references .song-line{width:auto;max-width:100%;flex-wrap:wrap}.has-references .song-cell{max-width:100%}.has-references .song-lyric{white-space:pre-wrap;overflow-wrap:anywhere}

body.admin-with-navigation{--notation-bar:#79c5f2;--notation-reference:#d2abff;--notation-chord:#ff9579}.song-bar-cell .song-chord{white-space:normal}.song-reference-margin{font-size:.75rem!important}

/* Calls must stand apart from lyrics, even inside nested lyric cells. */
.song-sheet .song-reference-call,.song-sheet .song-reference-margin span{color:var(--notation-reference)!important;-webkit-text-fill-color:var(--notation-reference);font-weight:700;white-space:nowrap}.song-sheet .song-reference-call{font-size:.8em;padding:0 .3em}

.notation-slot-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:5px}.song-notation-tools .notation-slot-grid label{margin:0!important;min-width:0;font-size:11px}.notation-slot-grid label>span{color:var(--notation-bar);text-align:center}.song-notation-tools .notation-slot-grid input{padding:4px!important;text-align:center;font-family:monospace}.notation-icon-picker{display:flex;flex-wrap:wrap;gap:4px;margin:4px 0}.song-notation-tools .notation-icon-picker button{font-family:'Segoe UI Symbol','DejaVu Sans',sans-serif!important;font-size:21px!important;width:32px;height:32px!important;min-height:32px!important;padding:2px!important;color:var(--notation-reference)}.notation-icon-picker [aria-pressed=true]{outline:2px solid var(--notation-reference);outline-offset:-2px;background:#9874bd22}.notation-icon-field{font-size:.8rem}.song-sheet .song-reference-call{display:inline!important;font-family:'Segoe UI Symbol','DejaVu Sans',sans-serif!important;font-size:1em!important;line-height:1.2!important;min-height:0!important;height:auto!important;padding:0 .3em!important;border:0!important;background:transparent!important;cursor:pointer;vertical-align:middle}.song-reference-margin span{font-family:'Segoe UI Symbol','DejaVu Sans',sans-serif;font-size:1.2em}.song-reference-margin .is-active-reference{background:#9874bd22;outline:1px solid var(--notation-reference);outline-offset:2px}.song-reference-call:focus-visible{outline:2px solid var(--notation-reference)!important}

.song-notation-tools button{background:var(--bg,#101812);color:var(--ink,#e8eee8);border:1px solid var(--line,#596956);border-radius:4px;cursor:pointer}.song-notation-tools .notation-icon-picker{display:grid;grid-template-columns:repeat(5,32px);gap:4px}.song-notation-tools .notation-icon-picker [aria-pressed=true]{background:#9874bd33}.song-notation-tools [data-notation-icon-choice=pause]{font-size:16px!important}

.notation-slot-grid label[hidden]{display:none!important}

/* A chord/bar is one indivisible unit; only lyric cells may wrap. */
.song-sheet .song-chord,.song-sheet .song-bar-cell .song-chord{white-space:nowrap!important;display:block;flex-shrink:0}.song-sheet .song-chord button,.song-sheet .song-beat-count,.song-sheet .song-bar-separator{white-space:nowrap!important;display:inline-block;vertical-align:baseline}.song-sheet .song-bar-cell{flex-shrink:0}

.song-sheet .song-line.has-chords{flex-wrap:nowrap!important;width:max-content!important}.song-annotated-row.has-references>.song-line{width:auto!important;overflow-x:auto;max-width:100%}

.chord-reuse [data-chord-reuse-search]{width:100%;min-width:0;box-sizing:border-box;height:32px;margin:4px 0 7px;padding:4px 6px;font-size:13px}.cipher-toolbar .cipher-history-button{min-width:34px;padding-inline:6px;font-size:19px}

.cipher-editor [data-delete-song-part].is-delete-armed{background:#ff684e!important;color:#111b15!important;border-color:#ff684e!important;font-weight:700!important}.fragment-delete-warning{font-size:14px;line-height:1.5;padding:8px 10px;margin:8px 0;border-left:3px solid #ff684e;background:color-mix(in srgb,#ff684e 9%,transparent);color:inherit}.fragment-delete-warning>button{display:block;margin-top:7px;min-height:32px}

.cipher-editor .fragment-delete-warning{display:block!important;font-size:14px!important;line-height:1.5!important}

/* Recognition problems belong to the current song, never to the catalogue list. */
.cipher-editor .cipher-chord-review{margin:.35rem 0;padding:.45rem .65rem;background:color-mix(in srgb,var(--notation-reference) 12%,transparent);border-radius:4px;font-size:.85rem;line-height:1.4}
.cipher-editor .cipher-chord-review[hidden]{display:none!important}
.cipher-editor .cipher-chord-review p{display:block!important;margin:0 0 .35rem!important;font-size:.85rem!important;line-height:1.4!important}
.cipher-chord-review-list{display:flex;flex-wrap:wrap;gap:.35rem}
.cipher-editor .cipher-chord-review button{min-height:2rem!important;padding:.2rem .5rem!important;font:inherit;border:1px solid currentColor;background:transparent;color:inherit;border-radius:3px}
.notation-input pre .notation-unresolved,.cipher-editor .song-chord-unresolved{color:var(--notation-reference)!important;text-decoration:underline wavy!important;text-underline-offset:3px}
.cipher-editor [data-reuse-symbol].song-chord-unresolved{outline:1px dashed currentColor;outline-offset:-2px}

/* A compact, opt-in warning inside the tool menu. */
.cipher-editor .cipher-chord-review-menu{padding:0!important;margin:0 0 .35rem!important;background:transparent;border:0;display:block;text-align:right}
.cipher-chord-review-menu>summary{list-style:none;display:inline-flex!important;align-items:center;justify-content:center;box-sizing:border-box;width:30px;height:30px;padding:0!important;font:bold 1rem sans-serif;color:var(--notation-reference);border:1px solid currentColor;border-radius:50%;cursor:pointer}
.cipher-chord-review-menu>summary::-webkit-details-marker{display:none}
.cipher-chord-review-menu>summary:focus-visible{outline:2px solid currentColor;outline-offset:3px}
.cipher-chord-review-menu[open]>summary{background:var(--studio-selected);color:var(--studio-selected-ink)}
.cipher-chord-review-body{text-align:left;margin-top:.35rem;padding:.5rem;background:var(--studio-card-alt);border-radius:4px}
.cipher-editor .cipher-chord-review-list{display:grid!important;gap:.35rem!important}
.cipher-editor .cipher-chord-review-list button{display:block!important;width:100%;text-align:left}
.cipher-editor .chord-correction{padding:.5rem;margin:.35rem 0;background:var(--studio-card-alt);font-size:.8rem;line-height:1.4;border-radius:4px;overflow-wrap:anywhere}
.cipher-editor .chord-correction[hidden]{display:none!important}
.cipher-editor .chord-correction [data-correction-original]{font-size:1.05rem;font-weight:700}
.cipher-editor .chord-correction del{color:var(--notation-reference);text-decoration-thickness:2px}
.cipher-editor .chord-correction p{display:block!important;font:inherit!important;margin:.3rem 0!important}
.cipher-editor [data-correcting-chord] [data-builder-to-bar]{display:none!important}

.chord-builder-dialog .chord-interpretation{padding:.5rem;margin:.4rem 0;background:var(--studio-card-alt,#26342d);border-radius:4px;overflow-wrap:anywhere}
.chord-builder-dialog .chord-interpretation[hidden]{display:none!important}
.cipher-editor .chord-interpretation p{display:block!important;margin:.35rem 0!important;font-size:.8rem!important;line-height:1.4!important}
.chord-interpretation-choices{display:flex;flex-wrap:wrap;gap:.3rem;margin:.4rem 0}
.chord-interpretation-choices button{flex:1 1 110px;white-space:normal!important;height:auto!important;min-height:32px!important;font-size:.8rem!important;padding:.3rem!important}
.interpretation-piano-rail{display:flex;gap:.25rem;align-items:center;margin:.4rem 0}
.interpretation-piano-rail>button{flex:0 0 24px;padding:.2rem!important;font-size:1.2rem!important}
.interpretation-piano-viewport{min-width:0;overflow-x:auto;scrollbar-width:none;overscroll-behavior-x:contain;position:relative;flex:1}
.interpretation-piano-viewport::-webkit-scrollbar{display:none}
.interpretation-piano-viewport .chord-input-piano{height:102px;width:588px;min-width:588px}
.interpretation-piano-viewport .chord-piano-key{min-height:0!important;padding:0 0 .25rem!important;font-size:.65rem!important;border-radius:0 0 3px 3px!important}
.interpretation-piano-viewport .chord-piano-key.white{height:96px!important}
.interpretation-piano-viewport .chord-piano-key.black{height:62px!important}
.interpretation-piano-viewport .chord-piano-key:disabled{opacity:.85!important}
.interpretation-piano-viewport .interpretation-third{background:#f5c188!important;color:#36220c!important;border:2px dashed #9b501a!important}
.interpretation-piano-viewport .interpretation-third[aria-pressed=false]{background:#fff0db!important;text-decoration:line-through}
.interpretation-piano-viewport .interpretation-suspension{background:#b1dbb8!important;color:#123722!important;border:2px solid #2b663a!important}

/* Cancelling an existing-chord edit is distinct from clearing a new chord. */
.chord-correction-header{display:flex;align-items:flex-start;gap:.4rem}
.chord-correction-header [data-correction-original]{flex:1;min-width:0}
.cipher-editor .chord-correction-header .chord-correction-close{flex:0 0 30px;display:inline-grid!important;place-items:center;width:30px!important;height:30px!important;min-height:30px!important;padding:0!important;font:24px/1 sans-serif!important;border:1px solid var(--studio-line,#718376)!important;border-radius:4px;background:transparent;color:inherit;cursor:pointer}
.chord-correction-close:focus-visible{outline:2px solid currentColor;outline-offset:2px}

.cipher-editor .chord-replacement-choice{padding:.5rem;margin-top:.5rem;background:var(--studio-card);border-radius:4px}
.cipher-editor .chord-replacement-choice p{display:block!important;font:inherit!important;margin:0 0 .35rem!important}
.chord-replacement-choice>div{display:flex;gap:.35rem;margin:.4rem 0}
.chord-replacement-choice>div button{flex:1;min-height:32px!important;padding:.35rem!important;font:inherit!important}

/* Always reserve a visible reset control next to symbol, notes and functions. */
.cipher-editor .cipher-studio-card .chord-builder-result{grid-template-columns:auto minmax(0,1fr) 30px;padding:9px 10px!important}
form.cipher-editor .chord-builder-dialog .chord-builder-result button.chord-builder-quick-reset{display:inline-grid!important;position:static!important;grid-column:3;grid-row:1/3;align-self:start;place-items:center;width:28px!important;height:28px!important;min-height:28px!important;padding:0!important;margin:0!important;border:1px solid var(--studio-line,#718376)!important;border-radius:4px!important;background:transparent!important;color:var(--studio-ink,currentColor)!important;font:22px/1 sans-serif!important;z-index:1}
.cipher-editor .chord-builder-result [data-builder-notes],.cipher-editor .chord-builder-result [data-builder-formula]{grid-column:2}
.cipher-editor .chord-builder-result [data-builder-matches]{grid-column:1/-1}
.cipher-editor .is-identifying .chord-builder-result [data-builder-matches]{grid-column:1/3}
.cipher-editor .chord-builder-result.has-long-symbol [data-builder-symbol]{grid-column:1/3;grid-row:1;font-size:24px!important;min-width:0;overflow-wrap:anywhere}
.cipher-editor .chord-builder-result.has-long-symbol [data-builder-notes],.cipher-editor .chord-builder-result.has-long-symbol [data-builder-formula]{grid-column:1/3;grid-row:auto}
.cipher-editor .cipher-studio-armory{flex-wrap:nowrap!important}

/* Contextual actions: empty drafts and unchanged corrections have no action. */
form.cipher-editor .chord-builder-dialog .chord-builder-result button.chord-builder-quick-reset[hidden],form.cipher-editor .chord-builder-dialog [data-builder-insert][hidden]{display:none!important}

/* The original/proposal panel is shown only when something can be replaced. */
.chord-selection-close-slot{display:inline-flex;flex:0 0 28px;align-self:center;align-items:center}
.chord-selection-close-slot[hidden]{display:none!important}
.cipher-editor .chord-builder-tabs .chord-selection-close-slot .chord-correction-close{display:inline-grid!important;place-items:center;width:28px!important;min-width:28px!important;height:28px!important;min-height:28px!important;padding:0!important;font:22px/1 sans-serif!important;border:1px solid var(--studio-line,#718376);border-radius:4px;background:transparent;color:inherit}
.notation-input .notation-editor-position{position:absolute;inset:0;overflow:hidden;pointer-events:none;z-index:0}
.notation-input .notation-editor-position[hidden]{display:none!important}
.notation-input pre{z-index:1}.notation-input textarea{z-index:2}
.notation-position-mark{position:absolute;box-sizing:border-box;pointer-events:none}
.notation-position-chord{background:color-mix(in srgb,var(--studio-selected,#e7ba64) 25%,transparent);border-bottom:2px solid var(--studio-selected,#c38a25);border-radius:2px;outline:1px solid color-mix(in srgb,var(--studio-selected,#c38a25) 55%,transparent)}
.notation-position-caret{background:var(--notation-reference,#8052b4);box-shadow:0 0 0 1px color-mix(in srgb,var(--notation-reference,#8052b4) 20%,transparent)}
.notation-position-selection{background:color-mix(in srgb,var(--notation-bar,#327db2) 25%,transparent)}
