@font-face {
  font-family: "Open Sans";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("assets/fonts/open-sans-latin-700.woff2") format("woff2");
}
:root {
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #203e56;
  background: #eaf0f2;
  font-synthesis: none;
}
* { box-sizing: border-box; }
body { margin: 0; }
.toolbar {
  position: sticky;
  top: 0;
  z-index: 5;
  padding: 20px 24px 18px;
  background: radial-gradient(ellipse at 50% 0, #fff 20%, #d4f0ff 100%);
  border-bottom: 1px solid #d8e6ed;
}
.toolbar-inner { max-width: 1100px; margin-inline: auto; }
.heading-row { position: relative; display: flex; align-items: center; justify-content: center; margin-bottom: 18px; }
.heading { display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; }
.heading-row.has-ambitus { min-height: 84px; }
.heading-row.has-ambitus .heading { max-width: calc(100% - 490px); }
.ambitus { position: absolute; right: 23px; top: 50%; transform: translateY(-50%); width: 223px; margin: 0; color: #15354c; display: flex; justify-content: center; }
.ambitus svg { display: block; width: 190px; height: 84px; max-width: 100%; }
h1 { font: 700 clamp(20px, 2.3vw, 28px)/1.25 "Open Sans", "Segoe UI", sans-serif; color: #15354c; margin: 0; }
.score-info { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 8px 14px; }
.heading p { font-size: 13px; color: #5c7890; margin: 0; }
/* Lift the Open Sans glyphs 1px for optical centering without resizing the capsule. */
.badge { font: 700 13px/18px "Open Sans", "Segoe UI", sans-serif; white-space: nowrap; color: #134959; background: #baf2ec; border-radius: 24px; padding: 5px 15px 7px; }
.control-panel { padding: 18px 22px 16px; background: #ffffffed; border: 1px solid #fff; border-radius: 15px; box-shadow: 0 8px 26px #447d9c0c; }
.controls { display: grid; grid-template-columns: 154px minmax(0, 1fr) 244px; gap: 22px; align-items: center; }
.key-intro { align-self: stretch; display: flex; flex-direction: column; justify-content: center; gap: 12px; padding-right: 18px; border-right: 1px solid #c9dce9; }
.label { display: block; font: 700 13px/18px "Open Sans", "Segoe UI", sans-serif; letter-spacing: .055em; color: #244b6b; }
.key-intro p { margin: 0; font-size: 13px; line-height: 1.6; color: #627e94; }
.key-section { min-width: 0; }
.key-scroll { width: 515px; max-width: 100%; margin-inline: auto; overflow-x: auto; overscroll-behavior-x: contain; padding-block: 4px; }
.keys { display: grid; width: 515px; grid-template-columns: repeat(14, 27.5px); gap: 8px 10px; }
button, .button {
  font-family: "Open Sans", "Segoe UI", sans-serif;
  font-weight: 700;
  font-size: 16px;
  line-height: 22px;
  height: 44px;
  white-space: nowrap;
  border-radius: 7px;
  padding: 0 12px;
  border: 1px solid transparent;
  background: #1b688b;
  color: white;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-align: center;
}
.keys button { grid-column: span 2; grid-row: 2; min-width: 0; width: 65px; padding: 0; background: #2a9ace; border: 0; border-radius: 5px; }
.keys button[data-pitch="0"] { grid-column: 1/span 2; }
.keys button[data-pitch="2"] { grid-column: 3/span 2; }
.keys button[data-pitch="4"] { grid-column: 5/span 2; }
.keys button[data-pitch="5"] { grid-column: 7/span 2; }
.keys button[data-pitch="7"] { grid-column: 9/span 2; }
.keys button[data-pitch="9"] { grid-column: 11/span 2; }
.keys button[data-pitch="11"] { grid-column: 13/span 2; }
.keys button[data-pitch="1"] { grid-row: 1; grid-column: 2/span 2; }
.keys button[data-pitch="3"] { grid-row: 1; grid-column: 4/span 2; }
.keys button[data-pitch="6"] { grid-row: 1; grid-column: 8/span 2; }
.keys button[data-pitch="8"] { grid-row: 1; grid-column: 10/span 2; }
.keys button[data-pitch="10"] { grid-row: 1; grid-column: 12/span 2; }
.keys button:hover:not(:disabled) { background: #2585b2; filter: none; }
.keys button[aria-pressed=true], .keys button[aria-pressed=true]:hover { background: #1b688b; color: white; }
.transpose-section { padding-left: 20px; border-left: 1px solid #c9dce9; }
.transpose-section .label { margin-bottom: 8px; }
.steps { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.steps button { padding: 0 6px; background: white; border-color: #ccdeeb; color: #244b6b; }
#reset { grid-column: 1/-1; }
button:hover:not(:disabled), .button:hover:not(.disabled) { filter: brightness(.95); }
button:focus-visible, a:focus-visible, select:focus-visible, .key-scroll:focus-visible { outline: 3px solid #dfb44e; outline-offset: 3px; }
button:disabled, .disabled { opacity: .45; cursor: default; pointer-events: none; }
.secondary { background: white; color: #244b6b; border-color: #ccdeeb; }
.icon { width: 18px; height: 20px; flex: 0 0 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.music-icon { color: #158dc5; }
.actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; border-top: 1px solid #dce8ef; margin-top: 16px; padding-top: 14px; }
.downloads { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
#pdf { background: #1b688b; border-color: #1b688b; }
.view-actions { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; max-width: 100%; border-left: 1px solid #c9dce9; padding-left: 16px; }
.return-message { flex-basis: 100%; margin: 0; text-align: right; font-size: 13px; line-height: 1.5; color: #52717d; }
.zoom { display: flex; align-items: center; gap: 7px; font-size: 13px; color: #5c7890; white-space: nowrap; }
.zoom select { height: 44px; font: inherit; font-size: 13px; padding: 7px; color: #244b6b; border: 1px solid #ccdeeb; border-radius: 7px; background: white; }
.zoom option { font-size: 13px; }
main { padding: 24px 18px 50px; min-height: 55vh; }
.notice { max-width: 1000px; margin: 0 auto 22px; padding: 15px 20px; background: #f8fbfc; border: 1px solid #cfdee4; border-radius: 8px; font-size: 14px; line-height: 1.6; display: flex; gap: 16px; align-items: center; flex-wrap: wrap; }
.notice.error { background: #fff7ed; border-color: #efd9b4; color: #754b16; }
[hidden] { display: none!important; }
.pages { display: grid; gap: 24px; justify-items: center; }
.page { width: min(100%, 850px); background: white; box-shadow: 0 6px 28px #143c4d16; position: relative; }
.page img { display: block; width: 100%; height: auto; }
.page-label { display: block; position: absolute; top: 100%; margin-top: 3px; font-size: 10px; color: #71868e; }
.footnote { text-align: center; font-size: 12px; color: #627f88; margin-top: 34px; }
footer { border-top: 1px solid #cddce1; padding: 18px max(24px, calc((100vw - 1200px)/2)); display: flex; justify-content: space-between; gap: 16px; font-size: 11px; color: #627d87; }
footer a { color: inherit; }
@media (max-width: 1080px) {
  .controls { grid-template-columns: minmax(0, 1fr) 244px; gap: 14px 22px; }
  .key-intro { grid-column: 1/-1; flex-direction: row; justify-content: flex-start; align-items: baseline; gap: 12px; border: 0; padding: 0; }
  .actions .button, #return { padding-inline: 8px; gap: 6px; }
  .downloads { gap: 6px; }
  .view-actions { border-left: 0; padding-left: 0; gap: 10px; }
}
@media (max-width: 880px) {
  .heading-row { flex-direction: column; gap: 6px; }
  .heading-row.has-ambitus .heading { max-width: 100%; }
  .ambitus { position: static; transform: none; }
  .toolbar { position: relative; padding: 18px 16px; }
  .controls { grid-template-columns: minmax(0, 1fr); gap: 14px; }
  .key-intro { flex-wrap: wrap; gap: 4px 12px; }
  .transpose-section { border: 0; border-top: 1px solid #dce8ef; padding: 12px 0 0; }
  .steps { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  #reset { grid-column: auto; }
  .actions { justify-content: center; }
  .downloads, .view-actions { justify-content: center; }
  .return-message { text-align: center; }
}
@media (max-width: 560px) {
  .toolbar { padding: 16px 10px; }
  .heading-row { margin-bottom: 14px; }
  h1 { font-size: 21px; }
  .control-panel { padding: 14px 12px; border-radius: 12px; }
  .key-intro { flex-direction: column; gap: 5px; }
  .steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  #reset { grid-column: 1/-1; }
  .downloads { display: grid; grid-template-columns: minmax(0, 1fr); width: 100%; }
  .view-actions { width: 100%; justify-content: space-between; gap: 12px; }
  #return { flex: 1 1 auto; }
  main { padding: 18px 9px 35px; }
  footer { flex-direction: column; font-size: 10px; }
}
@media print {
  .toolbar, .notice, .footnote, footer, .page-label { display: none!important; }
  body, main { background: white; margin: 0; padding: 0; }
  .pages { display: block; }
  .page { width: 100%!important; box-shadow: none; break-after: page; }
  .page:last-child { break-after: auto; }
}
