* { box-sizing: border-box; }
body { margin: 0; color: #172033; background: #f3f6fc; font: 16px/1.5 -apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif; }
header { padding: 12px 18px; background: #fff; border-bottom: 1px solid #dce3ef; display: flex; align-items: center; justify-content: space-between; }
header a { display: flex; align-items: center; font-weight: 800; color: #172033; text-decoration: none; }
header img { margin-right: 8px; }
header a, header span { flex-shrink: 0; }
header span, small { color: #596579; font-size: 14px; }
main { max-width: 960px; margin: 0 auto; padding: 20px 16px; }
h1 { font-size: 26px; line-height: 1.35; margin: 12px 0; }
h2 { font-size: 20px; }
section { border-top: 1px solid #dce3ef; padding-top: 16px; margin-top: 24px; }
label { display: block; margin: 12px 0; font-weight: 600; }
input, select, button, .button { font: inherit; border: 1px solid #cdd7e5; border-radius: 8px; min-height: 44px; }
input { display: block; width: 100%; padding: 10px; background: #fff; color: #172033; margin-top: 6px; }
input[type=hidden] { display: none; }
button, .button { display: inline-block; background: #245ee9; color: #fff; padding: 9px 16px; text-decoration: none; cursor: pointer; margin: 4px 4px 4px 0; text-align: center; font-weight: 600; }
button:disabled { opacity: .45; cursor: default; }
.secondary { background: #fff; color: #214b9d; }
.quiet { background: transparent; color: #415270; border: 0; }
a { color: #2058ca; }
button:focus, input:focus, a:focus, select:focus { outline: 3px solid #67a6ff; outline-offset: 2px; }
small { display: block; }
form { margin: 12px 0; }
.setlists { list-style: none; padding: 0; background: #fff; border: 1px solid #dce3ef; border-radius: 8px; overflow: hidden; }
.setlists li + li { border-top: 1px solid #e6eaf1; }
.setlists a { display: block; padding: 16px; text-decoration: none; color: #172033; }
.setlists small { margin-top: 4px; }
.setlists strong { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; overflow-wrap: break-word; font-size: 18px; line-height: 1.5; }
.setlists a:hover { background: #eef4ff; }
.draft-label { display: inline-block; margin-left: 6px; padding: 0 6px; border-radius: 4px; color: #815210; background: #fff3db; }
.list-tabs { display: flex; margin: 20px 0 12px; }
.list-tabs a { flex: 1; margin: 0; border-radius: 0; }
.list-tabs a:first-child { border-radius: 8px 0 0 8px; }
.list-tabs a:last-child { border-radius: 0 8px 8px 0; }
.search-form { display: flex; align-items: flex-end; }
.search-form label { flex: 1; min-width: 0; margin: 0; }
.search-form button { flex-shrink: 0; margin: 0 0 0 8px; }
.empty-state { padding: 32px 12px; text-align: center; color: #596579; }
.setlist-summary h1 { overflow-wrap: break-word; }
.setlist-summary p { margin: 6px 0; color: #596579; }
.songs { padding: 0; list-style: none; counter-reset: song; }
.songs li { position: relative; padding: 16px 0 16px 42px; border-bottom: 1px solid #dce3ef; overflow-wrap: break-word; }
.songs li::before { counter-increment: song; content: counter(song); position: absolute; left: 0; top: 16px; width: 30px; height: 30px; line-height: 30px; text-align: center; border-radius: 50%; background: #e7efff; color: #245ee9; font-weight: 700; }
.songs strong { font-size: 18px; }
.songs small { margin-top: 4px; color: #2454a0; font-weight: 600; }
.songs p { margin: 4px 0; white-space: pre-wrap; }
.login-page { max-width: 520px; margin: 0 auto; }
.home-link { display: block; margin: 20px 0 8px; padding: 12px; border: 1px solid #cdd7e5; border-radius: 8px; background: #fff; text-align: center; font-weight: 700; text-decoration: none; }
.page-description { color: #596579; margin-bottom: 24px; }
.login-choice { margin: 12px 0; border: 1px solid #cdd7e5; border-radius: 8px; background: #fff; }
.login-choice[open] { border-color: #245ee9; }
.login-choice summary { padding: 16px; cursor: pointer; font-weight: 700; font-size: 18px; }
.login-choice summary small { margin: 4px 0 0 20px; font-weight: 400; }
.login-choice summary:focus { outline: 3px solid #67a6ff; outline-offset: 2px; }
.login-content { padding: 0 16px 8px; border-top: 1px solid #e6eaf1; }
.login-content button { width: 100%; margin: 8px 0 0; }
.cf-turnstile { overflow-x: auto; max-width: 100%; }
.score-controls { display: flex; flex-wrap: wrap; }
.score-controls .toolbar { flex: 1 1 300px; min-width: 0; }
.toolbar { display: flex; align-items: center; padding: 4px 12px; }
.toolbar button { margin: 0 6px 0 0; white-space: nowrap; }
.toolbar button:last-child { margin-right: 0; }
.toolbar select { flex: 1; min-width: 0; width: 0; padding: 8px; color: #172033; background: #fff; margin-right: 6px; text-overflow: ellipsis; }
.page-toolbar button, #zoom-in, #zoom-out { width: 44px; flex-shrink: 0; padding: 6px; font-size: 20px; }
.action-toolbar { flex-wrap: nowrap; }
.action-toolbar button { font-size: 14px; }
#fit { flex: 1; width: auto; font-size: 16px; padding: 6px; margin-right: 0; }
.song-context { display: flex; justify-content: space-between; padding: 2px 12px; font-size: 14px; color: #596579; }
.song-context span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
#page-position { font-weight: 700; padding-right: 10px; }
#next-song { max-width: 50%; text-align: right; }
.connection-info { flex: 1; min-width: 0; padding-right: 8px; }
.view-mode { display: inline-block; font-size: 14px; font-weight: 700; color: #596579; }
.view-mode::before { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; background: #7c8798; }
.view-mode[data-mode=following] { color: #16724c; }
.view-mode[data-mode=following]::before { background: #16724c; }
.view-mode[data-mode=manual] { color: #98600c; }
.view-mode[data-mode=manual]::before { background: #98600c; }
#connection-age { font-size: 14px; color: #9a5714; }
#image-error { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; padding: 4px 12px; background: #fff5e8; color: #874410; font-size: 13px; }
#retry-image { font-size: 13px; padding: 6px 10px; }
#last-cue { margin: 0; font-size: 14px; line-height: 36px; color: #596579; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#follow { margin: 0 0 0 auto; flex-shrink: 0; font-size: 14px; padding: 8px 10px; }
#follow[aria-pressed=true] { background: #eef4ff; color: #214b9d; border-color: #c8d9f5; }
#follow[aria-pressed=false] { background: #245ee9; color: #fff; }
#score { margin-left: -16px; margin-right: -16px; background: #fff; }
.score-heading { font-size: 16px; margin: 0 12px 8px; }
.score-status { display: flex; flex-wrap: wrap; align-items: center; min-height: 48px; padding: 4px 12px; border-top: 1px solid #e6eaf1; }
#connection { font-size: 13px; color: #596579; margin: 0; flex: 1; }
#retry { font-size: 13px; margin: 0 0 0 4px; padding: 4px 8px; }
.cue-slot { height: 44px; padding: 4px 12px; background: #f3f6fc; }
#cue { margin: 0; font-size: 20px; line-height: 36px; font-weight: 800; color: #144aac; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#cue:not(:empty) { background: #eaf2ff; border-left: 4px solid #245ee9; padding: 0 10px; border-radius: 4px; }
#viewport { position: relative; height: 65vh; min-height: 160px; overflow: auto; background: #e4e8ef; -webkit-overflow-scrolling: touch; touch-action: pan-x pan-y; }
#paper { position: relative; margin: 0 auto; line-height: 0; background: #fff; }
#sheet { display: block; width: 100%; height: auto; }
#annotations { position: absolute; left: 0; top: 0; width: 100%; height: 100%; pointer-events: none; }
.room-summary { display: flex; align-items: center; justify-content: space-between; padding: 10px 12px; border-bottom: 1px solid #e6eaf1; background: #fff; }
.room-summary > div { min-width: 0; }
.room-summary h1 { font-size: 18px; margin: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.room-summary p { font-size: 14px; color: #596579; margin: 2px 0 0; }
.back-link { flex-shrink: 0; padding: 12px 0 12px 12px; font-size: 14px; text-decoration: none; }
.room-view main { padding: 0; max-width: 1200px; }
.room-view #score { margin: 0; border: 0; padding-top: 4px; }
.room-view .score-heading { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }
.room-view header { padding: 8px 12px; }
.room-view footer { display: none; }
footer { padding: 20px; text-align: center; font-size: 14px; }
footer form { display: inline; }
footer .quiet { font-size: 14px; }
.qr { display: block; max-width: 100%; margin: auto; }
.code { font-size: 28px; font-weight: 700; text-align: center; letter-spacing: 2px; }
p { overflow-wrap: break-word; }
[hidden] { display: none !important; }
@media (min-width:700px) { main { padding: 24px; } #score { margin-left: 0; margin-right: 0; } }
@media (max-height:500px) { .room-view header { display: none; } .room-summary { padding-top: 4px; padding-bottom: 4px; } .room-summary p { display: none; } }
@media (max-height:500px) and (min-width:600px) {
  .room-view .score-controls .toolbar { flex-basis: 250px; }
  .room-view .song-context { display: none; }
  .room-summary .back-link { padding-top: 8px; padding-bottom: 8px; }
}
@supports (padding-bottom:env(safe-area-inset-bottom)) { .room-view { padding-bottom: env(safe-area-inset-bottom); } }
@media (prefers-color-scheme:dark) {
  body { background: #15191e; color: #eef2f7; }
  header, #score, .room-summary, .setlists { background: #20262d; border-color: #394350; }
  header a, .setlists a { color: #eef2f7; }
  header span, small, #connection, .room-summary p { color: #c0c9d5; }
  .song-context, #last-cue { color: #c0c9d5; }
  #image-error { background: #3c2b1a; color: #ffce8a; }
  a { color: #91b6ff; }
  .secondary, input, .toolbar select, .login-choice { background: #242c35; color: #eef2f7; border-color: #536171; }
  .login-choice[open] { border-color: #91b6ff; }
  .home-link { background: #242c35; color: #91b6ff; border-color: #536171; }
  .login-content, .songs li, .score-status { border-color: #394350; }
  .page-description, .empty-state, .setlist-summary p, .view-mode { color: #c0c9d5; }
  .songs small { color: #91b6ff; }
  .setlists a:hover, .cue-slot { background: #19232f; }
  #viewport { background: #111820; }
  .view-mode[data-mode=following] { color: #8de3b8; }
  .view-mode[data-mode=following]::before { background: #8de3b8; }
  .view-mode[data-mode=manual] { color: #ffd18b; }
  .view-mode[data-mode=manual]::before { background: #ffd18b; }
  #connection-age { color: #ffd18b; }
  #follow[aria-pressed=true] { background: #223752; color: #bfdbfe; border-color: #536171; }
  #cue { color: #bfdbfe; }
  #cue:not(:empty) { background: #223752; }
}
