/* A separate row belongs to the score panel; the original-score action stays in its title bar. */
.app-shell .score-stage[data-direct-score-zoom="true"]{flex-direction:column}
.app-shell #score-size-controls{display:flex;flex:0 0 auto;align-items:center;justify-content:flex-end;gap:8px;width:100%;min-height:52px;padding:4px 14px;border:0;background:var(--paper,#fff);color:var(--ink,#23362f);box-sizing:border-box;z-index:1}
.app-shell #score-size-controls .score-size-row{display:flex;flex-wrap:nowrap;align-items:center;gap:8px;flex:0 0 auto}
.app-shell #score-size-controls .score-page-nav{display:flex;flex:0 0 auto;align-items:center;gap:8px;margin-right:auto}
.app-shell #score-size-controls .score-page-nav button{font-size:21px}
.app-shell #score-size-controls button{display:inline-flex;align-items:center;justify-content:center;flex:0 0 44px;width:44px;height:44px;min-width:44px;min-height:44px;margin:0;padding:0;border:1px solid var(--line,#c8cbd1);border-radius:8px;background:var(--paper,#fff);color:var(--ink,#23362f);font-size:24px;line-height:1;touch-action:manipulation}
.app-shell #score-size-controls button:focus-visible{outline:2px solid var(--green,#176d53);outline-offset:-3px}
.app-shell #score-size-controls button:disabled{opacity:.43;cursor:default}
.app-shell #score-size-value{display:block;min-width:5ch;width:5ch;text-align:center;font-size:14px;font-variant-numeric:tabular-nums;line-height:1.4}
.app-shell #score-size-status{min-width:0;font-size:12px;line-height:1.35;text-align:right;overflow-wrap:anywhere}
.app-shell .score-stage[data-direct-score-zoom="true"]>#staff{flex:1 1 0;min-height:0;width:100%}
@media(min-width:901px){.app-shell #score-size-controls{padding-inline:20px}}
.app-shell #score-layout-popup{position:absolute;top:60px;left:50%;right:auto;transform:translateX(-50%);z-index:8;width:min(320px,calc(100% - 24px));box-sizing:border-box;padding:12px 14px;border:1px solid var(--line,#c8cbd1);border-radius:12px;background:var(--paper,#fff);color:var(--ink,#23362f);box-shadow:0 8px 30px #1b2b3640;font-size:13px;line-height:1.45}
.app-shell #score-layout-popup[data-state="error"]{border-color:var(--danger,#bd554a)}
.app-shell .score-layout-popup-head,.app-shell .score-layout-popup-row{display:flex;align-items:center;justify-content:space-between;gap:12px}
.app-shell .score-layout-popup-row{margin-top:5px}
.app-shell #score-layout-popup-percent{font-variant-numeric:tabular-nums;white-space:nowrap;font-weight:700}
.app-shell #score-layout-popup-progress{display:block;width:100%;height:6px;margin-top:10px;accent-color:var(--green,#176d53)}
.app-shell #score-layout-popup-close{display:grid;place-items:center;width:28px;height:28px;padding:0;border:0;background:transparent;color:inherit;font:inherit;font-size:22px;cursor:pointer}
.app-shell #score-layout-popup-retry{min-height:36px;margin-top:10px;padding:0 12px;border:1px solid var(--line,#c8cbd1);border-radius:8px;background:var(--paper,#fff);color:inherit;font:inherit;cursor:pointer}

/* Keep all four 44px score controls inside narrow viewports. */
@media(max-width:359px){
 .app-shell #score-size-controls{padding-inline:8px;gap:4px;flex-wrap:wrap}
 .app-shell #score-size-controls :is(.score-page-nav,.score-size-row){gap:4px}
}
