.score-reader { border-top:1px solid var(--line); padding-top:18px; margin-top:20px; min-width:0 }
.score-toolbar,.score-nav { display:flex; align-items:center; flex-wrap:wrap; gap:8px 14px }
.score-toolbar { justify-content:space-between }
.score-toolbar h2 { font:normal 1.35rem/1.2 Georgia,serif }
.score-toolbar label { font-size:.86rem; display:flex; align-items:center; gap:5px }
.score-toolbar input { width:17px; height:17px; accent-color:var(--forest) }
.score-options { display:flex; justify-content:space-between; align-items:center; gap:12px; margin:12px 0 8px; font-size:.86rem }
.score-options label { display:flex; align-items:center; gap:5px }
.score-options input { width:17px; height:17px; accent-color:var(--forest) }
.notation { max-height:min(68vh,640px); overflow:auto; position:relative; background:white; border:1px solid var(--line); margin-bottom:8px; overflow-anchor:none }
.score-paper { width:100%; position:relative; isolation:isolate }
.score-paper.magnified { width:max(175%,720px) }
.score-paper img { display:block; width:100%; height:100%; position:absolute; inset:0 }
.score-mark { position:absolute; border:1.5px solid #865000; border-radius:50%; background:rgba(255,187,0,.55); mix-blend-mode:multiply; pointer-events:none }
.score-nav { justify-content:space-between; border-top:1px solid var(--line); padding-top:8px }
.score-nav button { font:inherit; font-size:.85rem; color:var(--forest); background:white; border:1px solid var(--line); border-radius:6px; padding:6px 12px; min-height:40px; cursor:pointer }
.score-nav button:disabled { opacity:.45; cursor:default }
.score-page,.score-status { color:var(--muted); font-size:.82rem }
.score-status:empty { display:none }

.score-expand,.score-play { font-family:inherit; line-height:1.2; font-size:.9rem; font-weight:600; padding:0 14px; min-height:44px; border:1px solid var(--forest); border-radius:8px; background:var(--forest); color:white; cursor:pointer }
.score-transport { display:flex; align-items:center; gap:12px }
.reading-score { overflow:hidden }
.score-screen { position:fixed; inset:0; margin:0; width:100%; max-width:none; height:100%; height:100dvh; max-height:none; padding:0; border:0; background:#f5f4ef; color:var(--forest); overflow:hidden }
.score-screen::backdrop { background:#f5f4ef }
.reader-rehearsal, .score-fit { display:none }
.reader-hint { margin:.6rem 0 0; font-size:.82rem; color:var(--muted); }
.score-screen .score-reader { position:relative; height:100%; border:0; margin:0; padding:0; }
.score-screen .notation {
  position:absolute; inset:0; display:grid; align-items:safe center; justify-items:safe center;
  width:100%; height:100%; max-height:none; container-type:size; margin:0; border:0;
  overscroll-behavior:contain; background:#f0efe9;
}
.score-screen .score-paper { width:min(100%, calc(100cqh * var(--page-ratio))); background:white; }
.score-screen .score-paper.magnified { width:100%; }
.score-screen .reader-head, .score-screen .reader-foot {
  position:absolute; z-index:1; left:0; right:0; display:flex; align-items:center;
  flex-wrap:wrap; justify-content:center; gap:4px 18px;
  padding:6px max(12px, env(safe-area-inset-right)) 6px max(12px, env(safe-area-inset-left));
  background:#faf8f3; box-shadow:0 1px 8px #243e3326;
}
.score-screen .reader-head { top:0; padding-top:max(6px,env(safe-area-inset-top)); }
.score-screen .reader-foot { bottom:0; padding-bottom:max(6px,env(safe-area-inset-bottom)); }
.score-screen .score-toolbar, .score-screen .score-options { display:contents; }
.score-screen .score-options label, .score-screen .reader-hint { display:none; }
.score-screen .reader-head h2 { font-size:1.12rem; }
.score-screen .score-fit, .score-screen .reader-rehearsal { display:flex; align-items:center; gap:10px; }
.score-screen .score-nav { padding:0; margin:0; border:0; gap:8px; }
.score-screen label { min-height:44px; display:inline-flex; align-items:center; font-size:.86rem; gap:5px; }
.score-screen button, .reader-rehearsal select { min-height:44px; }
.score-screen .score-fit, .reader-rehearsal select {
  padding:0 10px; border:1px solid var(--line); border-radius:6px;
  background:white; color:var(--forest); font:inherit; font-size:.88rem;
}
.reader-rehearsal select { max-width: min(46vw, 230px); }
.reader-rehearsal input, .score-screen .score-seek { accent-color:var(--forest); }
.score-screen .score-seek { width:clamp(70px,15vw,250px); height:44px; }
.score-screen .score-clock { font-size:.82rem; font-variant-numeric:tabular-nums; white-space:nowrap; }
.score-screen.controls-hidden :is(.reader-head,.reader-foot) { visibility:hidden; }
.reader-controls-toggle { position:absolute; z-index:2; left:1rem; top:1rem; }
.reader-controls-toggle:not(:focus-visible) { width:1px; height:1px; min-height:0; overflow:hidden; clip-path:inset(50%); padding:0; border:0; }
.score-screen .notation:focus { outline:none; }
.score-screen .notation:focus-visible { outline:2px solid #536e52; outline-offset:-2px; }
@media(max-height:450px) {
  .score-screen .reader-head, .score-screen .reader-foot { gap:0 8px; padding-block:2px; }
  .score-screen .reader-head h2 { display:none; }
}

.transport > .score-transport { display:flex; align-items:center; gap:12px; margin:10px 0 }
.transport .score-play { background:white; color:var(--forest); min-width:68px }
.transport .score-seek { flex:1; min-width:36px; height:44px; accent-color:#b8d2b3 }
.transport .score-clock { font-size:.82rem; white-space:nowrap; font-variant-numeric:tabular-nums }
.score-paper { -webkit-touch-callout:none; -webkit-user-select:none; user-select:none }
@media print { .score-paper, .score-screen { display:none !important } }

@media (max-width:720px), (max-width:960px) and (max-height:500px) and (pointer:coarse) {
  .panel .score-toolbar, .panel .score-options, .panel .score-nav, .score-screen .score-nav {
    justify-content:center;
  }
  .panel .score-toolbar h2 { flex-basis:100%; }
}
