/* Global optional dark scheme shared by every Piano Mus page. */
:root[data-theme="dark"]{color-scheme:dark;--ink:#e9ede7;--muted:#acb8aa;--paper:#121713;--card:#1e2820;--line:#354438;--green:#9fbb94;--green-dark:#c1d6b9;--gold:#dbb57e;--shadow:0 15px 32px #05090566}
:root[data-theme="dark"] body{background:#121713!important;color:#e9ede7}
:root[data-theme="dark"] :is(.page-shell,.site-main,.sheet-workspace,.stage-workspace,.topbar,.site-footer-band){color:#e9ede7}
:root[data-theme="dark"] :is(.search-panel,.chord-card,.sheet-library-sidebar,.sheet-library-row,.sheet-library-song,.sheet-player,.sheet-config-panel,.sheet-stats-modal,.sheet-midi-info-modal,.score-frame,.midi-modal,.songs-library-card,.shortcut-capture-card,.auth-card,.admin-panel,.dashboard-card,.stage-piano-dock,.sheet-dialog,.modal-content,.card,.panel){background-color:#202a22!important;color:#e8eee5!important;border-color:#3d5140!important}
:root[data-theme="dark"] :is(input:not([type="checkbox"]):not([type="radio"]),select,textarea,.sheet-library-search,button:not(.stage-key):not(.stage-black-key):not(.stage-white-key)){color:inherit}
:root[data-theme="dark"] :is(.input-wrap,.sheet-library-search,.notation-options select,.saved-song,.songs-fab,.midi-button,.sheet-library-song){background:#263329!important;color:#e8eee5!important;border-color:#4c6150!important}
:root[data-theme="dark"] :is(.lead,.field-help,.sheet-library-empty,.sheet-library-count,.site-footer,.card-name,.sheet-meta,.sheet-library-song span,.sheet-library-song small){color:#b2bfb1!important}
:root[data-theme="dark"] :is(.score-paper,.sheet-notation,.music-staff){background:#f2f0e8!important;color:#273226!important}
:root[data-theme="dark"] :is(.stage-piano,.piano){color:#252824}
.global-theme-toggle{position:fixed;right:14px;top:100px;z-index:110;border:1px solid #75906f;border-radius:999px;padding:9px 13px;background:#eef3e9;color:#354b35;box-shadow:0 4px 15px #1114;font:600 11px Manrope,sans-serif;cursor:pointer}
:root[data-theme="dark"] .global-theme-toggle{background:#314332;color:#e3f0df;border-color:#789377}
.sheet-library-search{width:100%;margin:12px 0;padding:10px 12px;border:1px solid #d1dbcb;border-radius:6px;background:#fff;color:#243026;font:500 12px Manrope,sans-serif}
.sheet-library-search:focus{outline:2px solid var(--green);outline-offset:1px}
@media(max-width:650px){.global-theme-toggle{top:auto;bottom:12px;right:12px;z-index:100}}

/* Header icon: beside account/navigation, not a floating control */
.global-theme-toggle{position:static!important;display:inline-grid;place-items:center;flex:0 0 34px;width:34px;height:34px;padding:0!important;border:1px solid var(--line);border-radius:50%;background:transparent;color:var(--ink);font:22px/1 Arial,sans-serif;box-shadow:none!important;vertical-align:middle}
.global-theme-toggle:hover{background:var(--line)}
:root[data-theme="dark"] .global-theme-toggle{color:#f2e7c0;background:#29372e;border-color:#59705f}
:root[data-theme="dark"] img[src*="piano-chords-wordmark.svg"]{filter:brightness(0) invert(1)}
:root[data-theme="dark"]{--bg:#121713;--soft:#253227;--green-light:#29382d}
:root[data-theme="dark"] :is(.home-header,.admin-header,.buy-header,.feature-card,.chord-demo,.plan-card,.plan-card.featured,.plan-card.teacher,.admin-card,.admin-summary article,.auth-card,.home-footer,.site-footer-band,.song-dialog,.sheet-workspace,.sheet-library-sidebar,.sheet-player){background:#1c261f!important;color:#e9eee7!important;border-color:#3b5040!important}
:root[data-theme="dark"] :is(.feature-card,.plan-card,.admin-card,.chord-demo,.auth-card,.teacher-profile-editor,.teacher-account-panel,.stage-piano-dock){box-shadow:0 8px 28px #0005!important}
:root[data-theme="dark"] :is(.hero-band,.home-hero,.home-features,.features-band,.pricing-band,.footer-band,.admin-shell,.buy-shell,.auth-shell){background-color:#121913;color:#e9eee7}
:root[data-theme="dark"] :is(.admin-table th,.admin-table tr,.admin-table td,.admin-user-row,.admin-user-dialog,.teacher-profile-editor,.teacher-profile-photo,.plan-action.secondary,.input-wrap,.auth-form input){background-color:#222f26!important;color:#e8eee6!important;border-color:#425847!important}
:root[data-theme="dark"] :is(.nav-auth,.home-nav a,.buy-back,.admin-header-actions a,.site-footer-nav a,.site-footer-email){color:#d5e7d0!important}
:root[data-theme="dark"] :is(.hero-description,.feature-description,.plan-description,.admin-heading p,.auth-heading p,.teacher-account-panel p){color:#b8c9b6!important}

/* Partituras: continuous dark shell, readable white musical paper, consistent controls */
:root[data-theme="dark"] .sheet-workspace,
:root[data-theme="dark"] .sheet-workspace .sheet-player,
:root[data-theme="dark"] .sheet-workspace .sheet-intro,
:root[data-theme="dark"] .sheet-workspace .sheet-actions,
:root[data-theme="dark"] .sheet-workspace .sheet-library-sidebar,
:root[data-theme="dark"] .sheet-workspace .stage-piano-dock,
:root[data-theme="dark"] .sheet-workspace .stage-piano-scroll {background:#19241e!important;color:#e9eee7!important;border-color:#3d5142!important}
:root[data-theme="dark"] .sheet-workspace .sheet-score {background:#f2f0e8!important;border-color:#3d5142!important}
:root[data-theme="dark"] .sheet-workspace .sheet-score::after {background:none!important}
:root[data-theme="dark"] .sheet-workspace .sheet-notation {background:#f2f0e8!important;color:#273226!important}
:root[data-theme="dark"] .sheet-workspace .sheet-status {background:#263529!important;border-color:#4a634e!important;color:#d5e5d0!important}
:root[data-theme="dark"] .sheet-workspace :is(.sheet-library-song,.sheet-library-search,.sheet-library-delete,.sheet-config-panel,.sheet-config-panel select,.sheet-config-panel input[type="number"],.midi-menu-button,.midi-menu-popover,.midi-menu-popover button,.sheet-actions button,.sheet-actions-overlay button:not(.stage-key),.sheet-upload-button,.sheet-config-button,.sheet-toolbar button){background:#28382c!important;color:#edf4e9!important;border-color:#506b55!important}
:root[data-theme="dark"] .sheet-workspace :is(.sheet-library-song:hover,.sheet-library-song.is-current,.midi-menu-button:hover,.midi-menu-popover button:hover,.sheet-actions button:hover,.sheet-config-button:hover){background:#38503c!important;color:#fff!important}
:root[data-theme="dark"] .sheet-workspace :is(.sheet-upload-button,.sheet-actions button.is-active,.sheet-actions button[aria-pressed="true"]){background:#496947!important;color:#fff!important}
:root[data-theme="dark"] .sheet-workspace .stage-piano {background:#121713!important}
:root[data-theme="dark"] .sheet-workspace .stage-white-key:not(.is-local):not(.is-expected):not(.is-preview) {background:linear-gradient(#f9f9f6,#fff)!important;color:#333!important}
:root[data-theme="dark"] .sheet-workspace .stage-black-key:not(.is-local):not(.is-expected):not(.is-preview) {background:linear-gradient(90deg,#252824,#454a42,#252824)!important}
:root[data-theme="dark"] .sheet-workspace .global-theme-toggle {background:#314332!important;color:#f2e7c0!important}

/* Fix the full-viewport light regions in the sheet screenshot. */
:root[data-theme="dark"] html.sheet-workspace body .practice-stage {background:#141d17!important;color:#e8eee5!important}
:root[data-theme="dark"] html.sheet-workspace body .sheet-score,
:root[data-theme="dark"] html.sheet-workspace body .sheet-notation {background:#202b23!important;color:#d4e2d0!important}
:root[data-theme="dark"] html.sheet-workspace body .sheet-notation:has(svg) {background:#f2f0e8!important;color:#273226!important}
:root[data-theme="dark"] html.sheet-workspace body .sheet-score:after {background:none!important}
:root[data-theme="dark"] html.sheet-workspace body .sheet-drop-zone {background:#27392c!important;color:#e5efe2!important;border-color:#64836a!important}
:root[data-theme="dark"] html.sheet-workspace body .sheet-drop-zone :is(strong,small) {color:#e6eee2!important}
:root[data-theme="dark"] html.sheet-workspace body .sheet-drop-icon {background:#3b5540!important;color:#e5f2df!important}
:root[data-theme="dark"] html.sheet-workspace body .sheet-drop-zone:hover {background:#354b39!important}
:root[data-theme="dark"] html.sheet-workspace body .sheet-actions :is(button,.midi-menu-button),
:root[data-theme="dark"] html.sheet-workspace body .sheet-library-delete {background:#304234!important;color:#eef4ed!important;border:1px solid #617964!important}
:root[data-theme="dark"] html.sheet-workspace body .sheet-actions :is(button:hover,.midi-menu-button:hover) {background:#405c46!important;color:#fff!important}
:root[data-theme="dark"] html.sheet-workspace body .sheet-actions :is(button:disabled,[aria-disabled="true"]) {background:#27332a!important;color:#a1b3a1!important;opacity:.6}
:root[data-theme="dark"] html.sheet-workspace body .sheet-action-primary:not(:disabled),
:root[data-theme="dark"] html.sheet-workspace body .sheet-upload-button {background:#617e5b!important;color:#fff!important;border-color:#83a07b!important}
:root[data-theme="dark"] html.sheet-workspace body .sheet-notation:not(:has(svg)) .sheet-empty {color:#c0d1ba!important}

/* Sheet canvas fix: a light score is only the SVG itself, never its entire viewport. */
html[data-theme="dark"] html.sheet-workspace body .practice-stage,
html[data-theme="dark"] html.sheet-workspace body .sheet-player,
html[data-theme="dark"] html.sheet-workspace body .sheet-score,
html[data-theme="dark"] html.sheet-workspace body #sheet-notation,
html[data-theme="dark"] html.sheet-workspace body #sheet-notation:has(svg),
html[data-theme="dark"] html.sheet-workspace body .sheet-notation,
html[data-theme="dark"] html.sheet-workspace body .sheet-notation:has(svg) {
  background:#18231c!important;
  background-image:none!important;
  color:#e7ede4!important;
}
html[data-theme="dark"] html.sheet-workspace body #sheet-notation > svg {
  background:#f5f2e9!important;
  border-radius:6px;
  box-shadow:0 2px 14px #0004;
}
html[data-theme="dark"] html.sheet-workspace body :is(.sheet-score,.sheet-notation)::before,
html[data-theme="dark"] html.sheet-workspace body .sheet-score::after {background:none!important}
html[data-theme="dark"] html.sheet-workspace body :is(.sheet-library-delete,.sheet-actions button,.sheet-actions .midi-menu-button,.sheet-drop-zone,.sheet-drop-zone .sheet-upload-button){background-color:#304534!important;color:#f0f5ed!important;border-color:#627b64!important}
html[data-theme="dark"] html.sheet-workspace body .sheet-actions button:disabled{background-color:#28352b!important;color:#a8bca9!important;opacity:.68}
html[data-theme="dark"] html.sheet-workspace body .sheet-library-delete:hover{background-color:#855047!important;color:#fff!important}

/* Unified page canvas: equal background at every width, inside and outside content. */
html[data-theme="dark"],html[data-theme="dark"] body,html[data-theme="dark"] body > main {background:#121913!important}
html[data-theme="dark"] body .hero-band,
html[data-theme="dark"] body .home-hero,
html[data-theme="dark"] body .home-features,
html[data-theme="dark"] body .home-about,
html[data-theme="dark"] body .features-band {background:#121913!important}
html[data-theme="dark"].sheet-workspace body .practice-stage,
html[data-theme="dark"].sheet-workspace body .sheet-player,
html[data-theme="dark"].sheet-workspace body .sheet-score,
html[data-theme="dark"].sheet-workspace body .sheet-notation {background:#18231c!important}
html[data-theme="dark"].sheet-workspace body .sheet-notation > svg {background:#f5f2e9!important}
html[data-theme="dark"].sheet-workspace body .sheet-drop-zone {background:#293b2d!important;color:#e5eee2!important}
html[data-theme="dark"].sheet-workspace body .sheet-actions button {background:#304534!important;color:#ecf4e9!important;border-color:#647c67!important}
html[data-theme="dark"].sheet-workspace body .sheet-library-delete {background:#304534!important;color:#e9f1e6!important}

/* Home hero uses exactly the same canvas as the surrounding page. */
html[data-theme="dark"] body > main > .hero-band,
html[data-theme="dark"] body > main > .hero-band > .home-hero {background:#121913!important;background-image:none!important}

/* Dark musical score, bright notation (VexFlow SVG). */
html[data-theme="dark"].sheet-workspace body .sheet-score,
html[data-theme="dark"].sheet-workspace body #sheet-notation,
html[data-theme="dark"].sheet-workspace body #sheet-notation > svg {
  background:#18221c!important;
  background-color:#18221c!important;
  background-image:none!important;
  color:#f4f7f2!important;
}
html[data-theme="dark"].sheet-workspace body #sheet-notation > svg :is(.vf-stavebarline,.vf-staveline) {stroke:#dce6da!important}
html[data-theme="dark"].sheet-workspace body #sheet-notation > svg .sheet-note-current-treble,
html[data-theme="dark"].sheet-workspace body #sheet-notation > svg .sheet-note-current-treble * {fill:#83b7fa!important;stroke:#83b7fa!important}
html[data-theme="dark"].sheet-workspace body #sheet-notation > svg .sheet-note-current-bass,
html[data-theme="dark"].sheet-workspace body #sheet-notation > svg .sheet-note-current-bass * {fill:#e8b776!important;stroke:#e8b776!important}
html[data-theme="dark"].sheet-workspace body .sheet-tempo-control {background:#2b3d30!important;color:#f4f7f2!important;border:1px solid #718974!important;box-shadow:0 4px 14px #0005!important}
html[data-theme="dark"].sheet-workspace body .sheet-tempo-control :is(button,.sheet-tempo-value,.sheet-tempo-value strong,.sheet-tempo-value span){color:#f4f7f2!important}
html[data-theme="dark"].sheet-workspace body .sheet-tempo-control button{background:#304a36!important;border-color:#718974!important}
html[data-theme="dark"].sheet-workspace body .sheet-tempo-control button:not(:disabled):hover{background:#45674b!important}

/* Preserve VexFlow SVG geometry: only tint strokes and paths that draw music. */
html[data-theme="dark"].sheet-workspace #sheet-notation > svg {color:#f4f7f2!important}
html[data-theme="dark"].sheet-workspace #sheet-notation > svg g.vf-stave path,
html[data-theme="dark"].sheet-workspace #sheet-notation > svg g.vf-stavenote path,
html[data-theme="dark"].sheet-workspace #sheet-notation > svg g.vf-clef path,
html[data-theme="dark"].sheet-workspace #sheet-notation > svg g.vf-rest path,
html[data-theme="dark"].sheet-workspace #sheet-notation > svg g.vf-beam path,
html[data-theme="dark"].sheet-workspace #sheet-notation > svg g.vf-tuplet path {fill:#f4f7f2}
html[data-theme="dark"].sheet-workspace #sheet-notation > svg :is(.sheet-score-meta,.sheet-measure-label) {fill:#f4f7f2!important}
html[data-theme="dark"].sheet-workspace #sheet-notation > svg .sheet-note-label {fill:#e7f0e6!important}
html[data-theme="dark"].sheet-workspace #sheet-notation > svg .sheet-simple-accidental {fill:#e7f0e6!important}
html[data-theme="dark"].sheet-workspace :is(.sheet-continuous-overview span,.evolution-navigation-title) {color:#d7e8d3}
html[data-theme="dark"].sheet-workspace .evolution-navigation-controls .sheet-action {color:#edf4e9;background:#28382c;border-color:#506b55}
/* VexFlow outlines, braces, clefs and musical glyphs are paths, not rects. */
html[data-theme="dark"].sheet-workspace #sheet-notation > svg path {fill:#edf3ed!important;stroke:#edf3ed!important}
html[data-theme="dark"].sheet-workspace #sheet-notation > svg :is(line,polyline) {stroke:#edf3ed!important}
html[data-theme="dark"].sheet-workspace #sheet-notation > svg :is(.sheet-note-current-treble,.sheet-note-current-treble *) {fill:#83b7fa!important;stroke:#83b7fa!important}
html[data-theme="dark"].sheet-workspace #sheet-notation > svg :is(.sheet-note-current-bass,.sheet-note-current-bass *) {fill:#e8b776!important;stroke:#e8b776!important}
