/* Song pages: one line of controls (Start, key, tempo, click, lyrics), then the chart filling the rest of the screen. */
:root{--paper:#faf8f5;--ink:#2a2724;--ink-soft:#6f6860;--rule:rgba(42,39,36,.26);--rule-faint:rgba(42,39,36,.14);--go:#15803d;--dot:#16a34a;--sans:"Avenir Next","Helvetica Neue",Helvetica,Roboto,Arial,sans-serif}
*{box-sizing:border-box}
html,body{height:100%}
body{margin:0;height:100vh;height:100dvh;display:flex;flex-direction:column;background:#fff;color:var(--ink);font-family:var(--sans)}
button{touch-action:manipulation}
header{flex:none;display:flex;flex-wrap:nowrap;align-items:center;gap:8px clamp(6px,1.2vw,14px);padding:5px clamp(8px,1.4vw,14px);background:var(--paper);border-bottom:1px solid var(--rule-faint);font-size:1rem;min-width:0}
header :focus-visible{outline:2px solid var(--ink);outline-offset:2px}
header a{font:inherit;color:var(--ink-soft);border-bottom:1px solid var(--rule);padding:.15em 0;text-decoration:none;white-space:nowrap}
header a:hover{color:var(--ink);border-color:var(--ink)}
.lyr{margin-left:auto}
/* The back arrow, big (William 2026-12-04: "The back arrow on top left should be bigger"): a 42px tap target like the buttons. */
header .back{display:inline-flex;align-items:center;flex:none;min-height:42px;min-width:34px;padding:0 2px 5px;font-size:2rem;line-height:1;color:var(--ink);border-bottom:0}
header .back .t{font-size:1rem;padding-top:5px}
.sp::before{content:"";display:inline-block;width:.55em;height:.55em;border-radius:50%;background:#1db954;margin-right:.35em;vertical-align:.06em}  /* William 2026-12-01: the record on Spotify, next to Lyrics */
.grp{flex:none;display:flex;align-items:center;gap:5px}
.lab{font-size:.66rem;letter-spacing:.24em;text-transform:uppercase;color:var(--ink-soft)}
.big{font:inherit;font-weight:500;min-height:42px;padding:0 14px;cursor:pointer;border:1px solid var(--rule);background:transparent;color:var(--ink);white-space:nowrap}
.big:disabled{opacity:.4;cursor:default}
#go{background:var(--go);border-color:var(--go);color:#fff;min-width:88px}
#go.on{background:var(--ink);border-color:var(--ink)}
.nudge,.pill{font:inherit;min-height:42px;color:var(--ink);background:transparent;border:1px solid var(--rule-faint);border-radius:6px;cursor:pointer;touch-action:manipulation;user-select:none;-webkit-user-select:none;white-space:nowrap}
.nudge{min-width:38px;padding:0;font-size:.9rem}
.nudge:active{background:var(--ink);color:var(--paper)}
.pill{font-size:.85rem;padding:0 9px}
#kname{position:relative;display:inline-block;min-width:2.2ch;text-align:center;font-weight:600;font-size:1.3rem}
#kname.rec::after{content:"";position:absolute;left:50%;bottom:-5px;width:6px;height:6px;margin-left:-3px;border-radius:50%;background:var(--go)}
#krec:disabled{color:var(--go);border-color:var(--go);cursor:default}
#krec[hidden]{display:none}
#tap.hit{background:var(--ink);border-color:var(--ink);color:var(--paper)}
.tempo{white-space:nowrap}
#bpm{display:inline-block;min-width:2.2ch;text-align:right;font-weight:600;font-size:1.3rem;font-variant-numeric:lining-nums tabular-nums}
.pill .n{display:none}
#bpm0:disabled{color:var(--ink-soft);border-style:dashed;cursor:default}
#snd[aria-pressed=false]{color:var(--ink-soft);border-style:dashed}
/* Chords: the chord-size slider (only on a song with sizes), small A to big A. */
#cgrp[hidden]{display:none}
.aa{font-weight:700;font-size:.78rem;line-height:1;color:var(--ink-soft)}
.aa.lg{font-size:1.3rem}
#csize,#lsize{width:96px;height:42px;margin:0;accent-color:var(--go);cursor:pointer;touch-action:none}
#csize:disabled,#lsize:disabled{opacity:.4;cursor:default}
/* Nashville: the blue numbers on or off (dashed = off, like Click). */
#nash[aria-pressed=false]{color:var(--ink-soft);border-style:dashed}
#nash:disabled{opacity:.4;cursor:default}
#nash[hidden]{display:none}
/* Where the count is, and any error: a small note floating at the foot of the screen, off the controls. */
#where,#note{position:fixed;left:50%;bottom:10px;transform:translateX(-50%);z-index:3;margin:0;padding:5px 12px;border-radius:999px;background:rgba(42,39,36,.82);color:#fff;font-size:.9rem;white-space:nowrap;pointer-events:none}
#where:empty,#note:empty{display:none}
#note{bottom:46px;background:#9b3b2e}
figure{flex:1;min-height:0;margin:0;padding-top:max(10px,1.2vh);background:#fff;display:flex;justify-content:center;align-items:flex-start;container-type:size;overflow-y:auto;overscroll-behavior:contain;-webkit-overflow-scrolling:touch}
/* .view is the printed part of the sheet, fitted to the screen; the empty paper around it is
   cut off. --cl --ct --cw --ch on #sheet are that part in PNG pixels (build.sh prints them). */
/* William 2026-12-01: "fit to the width, not to the height, i want everything as big as possible": the sheet fills the
   width and the page scrolls; the playing bar is kept in view (player-live.js). */
.view{position:relative;flex:none;overflow:hidden;width:100cqw;aspect-ratio:var(--cw)/var(--ch)}
.page{position:absolute;left:calc(-100% * var(--cl) / var(--cw));top:calc(-100% * var(--ct) / var(--ch));width:calc(100% * 2000 / var(--cw));aspect-ratio:2000/var(--ph,2800);container-type:inline-size}
.page img{position:absolute;inset:0;width:100%;height:100%;display:block;transition:opacity .12s linear}
figure.busy img{opacity:.45}
/* Sizes are a share of the sheet's width, so the dots keep their place on any screen. */
.m{position:absolute;cursor:pointer;touch-action:manipulation;-webkit-tap-highlight-color:transparent}
.m.pick{background:rgba(22,163,74,.16);outline:2px solid var(--dot);outline-offset:-2px}
.m.now{background:rgba(22,163,74,.1)}
.m i{position:absolute;top:.25cqw;width:.9cqw;height:.9cqw;margin:-.45cqw 0 0 -.45cqw;border-radius:50%;background:var(--dot);opacity:.28}
.m i.on{opacity:1}
.m i.cur{transform:scale(1.8);box-shadow:0 0 0 .22cqw rgba(22,163,74,.28)}
#count{position:absolute;inset:0;display:flex;align-items:center;justify-content:center;pointer-events:none;font-family:"Avenir Next",Helvetica,Arial,sans-serif;font-weight:700;font-size:44cqw;line-height:1;color:var(--dot);opacity:.55}
#count:empty{display:none}
/* Narrower than a tablet: the words go, the controls stay. */
@media (max-width:980px){
  #go .w,.back .t{display:none}
  #go{min-width:46px;padding:0 12px}
  .lab,.pill .w{display:none}
  .pill .n{display:inline}
}
/* A page with the Chords slider and Nashville button (body.sized) needs room for them: the short labels from
   1500px down (1300px until the Lyrics slider came in), so nothing ever sits on top of anything else. */
@media (max-width:1500px){
  .sized #go .w,.sized .back .t,.sized .lab,.sized .pill .w{display:none}
  .sized #go{min-width:46px;padding:0 12px}
  .sized .pill .n{display:inline}
}
/* One line down to 880px (his ask 2026-11-21: "all buttons on 1 line, u can shrink the tempo bar"; 750px until the
   Lyrics slider came in, 2026-12-03): tighter spacing, narrower ▼ ▲ and sliders, each slider's small A dropped
   (the big one stays); narrower than that, see the 879px rules below. The tempo bar is gone (William 2026-12-04: "Remove the
   tempo slider"): Tap, ▼ ▲ and Default set the tempo. */
@media (max-width:1200px){
  .sized header{gap:4px;padding:5px 6px}
  .sized .grp{gap:3px}
  .sized .nudge{min-width:32px}
  .sized .pill{padding:0 7px}
  .sized .aa:not(.lg){display:none}
  .sized #csize,.sized #lsize{width:60px}
}
/* Every width keeps ONE line (William 2026-12-04: "Keep all control on one line"; it used to wrap below 880px): under
   880px the BPM word goes (the number stays), the ▼ ▲ and sliders get narrower and the spacing tighter, which fits
   down to a 744px iPad mini held upright; on a phone the line is wider than the screen, so it scrolls sideways. */
@media (max-width:879px){
  .sized header{gap:3px;padding:5px 4px;overflow-x:auto;overflow-y:hidden;scrollbar-width:none;-webkit-overflow-scrolling:touch;overscroll-behavior-x:contain}
  .sized header::-webkit-scrollbar{display:none}
  .sized header>*{flex-shrink:0}
  .sized .grp{gap:2px}
  .sized .nudge{min-width:28px}
  .sized .pill{padding:0 5px}
  .sized #go{min-width:42px;padding:0 10px}
  .sized .tempo{font-size:0}
  .sized #bpm{margin:0 2px}
  .sized #csize,.sized #lsize{width:44px}
  .sized .aa.lg{font-size:1.1rem}
  .sized #snd{font-size:.8rem}
  .sized header a:not(.back){font-size:.9rem}
}
@media (prefers-reduced-motion:reduce){.page img{transition:none}}
/* Chord pop-up (tap a chord on the sheet): zones over the chord line, and one chord box at a time with arrows. */
.cz{position:absolute;padding:0;margin:0;border:0;background:transparent;cursor:pointer;-webkit-tap-highlight-color:transparent;touch-action:manipulation;border-radius:.4cqw}
.cz:hover{background:rgba(26,95,208,.09)}
.cz:focus-visible{outline:2px solid #1a5fd0;outline-offset:1px}
.cpop{position:fixed;inset:0;z-index:1000;display:grid;place-items:center;padding:16px;background:rgba(21,24,28,.32)}
.cpop[hidden]{display:none}
.cpcard{background:#fff;color:#15181c;border-radius:14px;box-shadow:0 12px 40px rgba(0,0,0,.28);width:min(320px,100%);padding:10px 10px 14px;font-family:var(--sans)}
.cphead{display:flex;align-items:center;justify-content:space-between;gap:8px;padding:0 4px 0 10px}
.cphead h2{margin:0;font-size:1.9rem;font-weight:700;line-height:1.1}
.cpx{font:inherit;font-size:1.8rem;line-height:1;width:44px;height:44px;border:0;background:transparent;color:#59626d;cursor:pointer;border-radius:8px}
.cpbody{display:grid;grid-template-columns:44px minmax(0,1fr) 44px;align-items:center}
.cpnav{font:inherit;font-size:2.4rem;line-height:1;width:44px;height:72px;border:0;background:transparent;color:#15181c;cursor:pointer;border-radius:8px}
.cpnav:disabled{opacity:.2;cursor:default}
.cpnav:hover:not(:disabled),.cpx:hover{background:#f1f3f5}
.cpop button:focus-visible{outline:2px solid #1a5fd0;outline-offset:1px}
.cpsvg svg{display:block;width:100%;height:auto;touch-action:pan-y;font-family:var(--sans)}
.cpinfo{display:flex;justify-content:space-between;margin:4px 12px 0;color:#59626d;font-size:.95rem;font-variant-numeric:tabular-nums}
.cpf{letter-spacing:.06em}
.cpnone{text-align:center;color:#59626d}
