.readerbar > .tuner-link { flex: 0 0 48px; padding: 0; }
body[data-full-score] .tuner-link, body[data-preparation] .tuner-link { display: none; }

#tunerPage {
  position: fixed;
  inset: 0;
  box-sizing: border-box;
  width: 100vw;
  width: 100dvw;
  height: 100dvh;
  max-width: 100vw;
  max-height: none;
  margin: 0;
  padding: 0 max(20px, env(safe-area-inset-right)) env(safe-area-inset-bottom) max(20px, env(safe-area-inset-left));
  border: 0;
  color: var(--text);
  background: var(--ground);
  overflow-y: auto;
  overscroll-behavior: contain;
}
.tuner-layout { max-width: 860px; margin: 0 auto; }
.tuner-header {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  min-height: 68px;
  padding-top: env(safe-area-inset-top);
  border-bottom: 1px solid var(--edge);
}
.tuner-header h1 { font-size: 22px; }
#tunerBack { display: inline-flex; gap: 8px; align-items: center; justify-self: start; min-height: 48px; }
#tunerBack span { font-size: 24px; }
.tuner-instrument {
  max-width: 520px;
  margin: 0 auto;
  padding: clamp(20px, 7vh, 72px) 0 24px;
  text-align: center;
  font-variant-numeric: tabular-nums;
}
.tuner-reference, #tunerFrequency, .tuner-labels { color: var(--muted); }
.tuner-reference { font-size: 15px; }
#tunerNote { margin-top: 12px; font-size: clamp(68px, 14vmin, 116px); font-weight: 650; line-height: 1.15; letter-spacing: -.055em; }
#tunerFrequency { min-height: 24px; font-size: 16px; }
.tuner-scale { margin: clamp(20px, 5vh, 44px) 10px 10px; }
.tuner-ticks {
  position: relative;
  height: 32px;
  border-bottom: 1px solid var(--muted);
  background: repeating-linear-gradient(90deg, var(--muted) 0 1px, transparent 1px 5%) left bottom / 100% 10px no-repeat;
}
.tuner-ticks::before, .tuner-ticks::after { content: ""; position: absolute; bottom: 0; width: 1px; background: var(--text); }
.tuner-ticks::before { height: 100%; left: 50%; }
.tuner-ticks::after { height: 10px; right: 0; }
#tunerNeedle {
  position: absolute;
  left: var(--position, 50%);
  bottom: 0;
  width: 4px;
  height: 100%;
  transform: translateX(-50%);
  background: var(--accent);
}
#tunerNeedle::before {
  content: ""; position: absolute; top: -5px; left: -4px;
  border: 6px solid transparent; border-top-color: var(--accent);
}
:root[data-theme="light"] #tunerNeedle { background: var(--signal); }
:root[data-theme="light"] #tunerNeedle::before { border-top-color: var(--signal); }
.tuner-labels { display: grid; grid-template-columns: 1fr 1fr 1fr; margin-top: 6px; font-size: 13px; }
.tuner-labels span:first-child { text-align: left; }
.tuner-labels span:last-child { text-align: right; }
#tunerOffset { font-size: 18px; font-weight: 600; }
#tunerStatus { margin: 20px 0 16px; min-height: 30px; font-size: clamp(18px, 3vw, 22px); }
#tunerToggle { min-width: min(100%, 235px); }
.tuner-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
@media (max-height: 500px) and (min-aspect-ratio: 4/3) {
  .tuner-header { min-height: 48px; }
  .tuner-instrument { max-width: 620px; padding: 12px 0; display: grid; grid-template-columns: 2fr 3fr; align-items: center; column-gap: 24px; }
  .tuner-reference, #tunerNote, #tunerFrequency { grid-column: 1; }
  .tuner-reference { grid-row: 1; }
  #tunerNote { grid-row: 2 / 4; margin: 0; }
  #tunerFrequency { grid-row: 4; }
  .tuner-scale { grid-column: 2; grid-row: 1 / 3; margin: 0 6px; }
  #tunerOffset { grid-column: 2; grid-row: 3; }
  #tunerStatus { grid-column: 2; grid-row: 4; margin: 6px 0; }
  #tunerToggle { grid-column: 1 / -1; justify-self: center; margin-top: 12px; }
}
