/* The reader shares a coordinate system with the SVG. Print only the selected physical pages. */
* {
  box-sizing: border-box;
}
body {
  margin: 0;
}
main {
  max-width: 70rem;
  margin: auto;
  padding: 1.25rem clamp(1rem, 4vw, 3.5rem) 3rem;
}
header,
#tools {
  display: flex;
  gap: 1rem;
  align-items: center;
  flex-wrap: wrap;
}
header {
  justify-content: space-between;
  border-bottom: var(--mast-rule);
  padding-bottom: 0.8rem;
}
a {
  color: var(--green);
}
h1 {
  font: var(--title);
  letter-spacing: -1.2px;
  margin: 1.4rem 0 0.4rem;
}
#credit {
  margin: 0;
  color: var(--muted);
}
#intro {
  font: 18px/1.65 var(--book);
  max-width: 68ch;
}
#tools {
  margin: 1.25rem 0;
}
button,
select {
  font: inherit;
  padding: 0.48rem 0.65rem;
  border: 1px solid var(--control-border);
  background: white;
  color: inherit;
  border-radius: 0.28rem;
  max-width: 100%;
}
button {
  cursor: pointer;
}
label {
  font-weight: 600;
}
select {
  font-weight: 400;
}
#page {
  /* The reader's paragraph spacing must not flow into the engraved SVG text. */
  line-height: normal;
  overflow: auto;
  background: white;
  border: 1px solid var(--line);
}
#frame {
  position: relative;
  margin: 0 auto;
}
#highlight {
  position: absolute;
  pointer-events: none;
  background: #2e977720;
  outline: 2px solid #157a62;
  border-radius: 3px;
}
#reading {
  display: grid;
  /* A long note description must fit the reader even on a phone. */
  grid-template-columns: minmax(0, 1fr);
  gap: 0.35rem;
  margin: 1rem 0;
}
#score > svg {
  display: block;
}
.publication #score > svg {
  height: auto;
  width: min(100%, 210mm);
  margin: auto;
  border-bottom: 1px solid var(--line);
}
[hidden],
#reading[hidden],
#tools[hidden] {
  display: none;
}
@page {
  size: A4;
  margin: 0;
}
@media print {
  body,
  main,
  #page,
  #frame {
    background: white;
    padding: 0;
    margin: 0;
    border: 0;
    overflow: visible;
    max-width: none;
  }
  main > :not(#page) {
    display: none !important;
  }
  .publication #score > svg {
    width: 210mm;
    height: 297mm;
    border: 0;
    break-after: page;
  }
  .publication #score > svg:last-child {
    break-after: auto;
  }
}
