:root {
  font-family: Arial, Helvetica, sans-serif;
  color: #32251f;
  background: #faf8f5;
}
* { box-sizing: border-box; }
body { margin: 0; }
a { color: inherit; }
a:focus-visible, button:focus-visible, select:focus-visible, #viewport:focus-visible { outline: 3px solid #9c3d08; outline-offset: 2px; }
.masthead { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 16px max(5%, calc((100% - 1120px) / 2)); background: white; border-bottom: 1px solid #ded9d3; }
.brand { color: #32251f; font-size: 24px; font-weight: 800; text-decoration: none; letter-spacing: -.06em; white-space: nowrap; }
.brand span { color: #a64610; }
.brand small { margin-left: .35em; font-size: .45em; letter-spacing: 0; text-transform: uppercase; }
.home-link { font-size: .875rem; text-underline-offset: .2em; }
main { width: min(92%, 1120px); margin: 0 auto 32px; }
.heading { display: flex; gap: 1rem; justify-content: space-between; align-items: center; margin: 24px 0 16px; }
h1 { margin: 0; font-size: clamp(1.45rem, 3.2vw, 2.5rem); line-height: 1.12; letter-spacing: -.035em; }
.pdf-link { flex: none; font-weight: 700; font-size: .93rem; text-underline-offset: .2em; }
.tools { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 4px 12px; padding: 5px 12px; background: white; border: 1px solid #cfc9c2; border-radius: 7px 7px 0 0; }
[hidden] { display: none; }
.tool-group { display: flex; align-items: center; gap: 8px; font-size: .9rem; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tool-group button, .tool-group select { font: inherit; color: inherit; background: white; border: 1px solid #cec8c1; border-radius: 4px; min-height: 36px; }
.tool-group button { font-size: 1.4rem; line-height: 1; min-width: 40px; cursor: pointer; }
.tool-group button:enabled:hover, .tool-group select:hover { background: #f5eee8; border-color: #a58d7d; }
.tool-group button:disabled { opacity: .4; cursor: default; }
.tool-group select { padding: 2px 3px; }
.tool-group output { min-width: 4ch; text-align: center; }
#viewport { height: clamp(430px, 74vh, 1020px); height: clamp(430px, 74svh, 1020px); overflow: auto; background: #ebe8e4; border: 1px solid #cfc9c2; border-top: 0; border-radius: 0 0 7px 7px; overscroll-behavior-x: contain; scroll-margin-top: 12px; }
.paper-holder { width: max-content; min-width: 100%; min-height: 100%; padding: 12px; display: grid; place-items: center; }
#sheet { display: block; width: var(--page-width, min(73vw, 50vh)); height: auto; box-shadow: 0 2px 12px #32251f26; background: white; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
@media (max-width: 580px) {
  main { width: 96%; }
  .masthead { padding: 12px 4%; }
  .heading { margin: 18px 2% 12px; }
  .tools { padding: 5px 6px; gap: 3px; }
  .tool-group { gap: 5px; font-size: .82rem; }
  .tool-group button { min-width: 32px; min-height: 40px; }
  .paper-holder { padding: 7px; }
  #viewport { height: min(68vh, 144vw); height: min(68svh, 144vw); }
}
