/* Layout: one narrow column (max 760px) under a sticky header with tabs.
   Setlists are the one loud element: songs read like strips of stage tape. */
:root {
  --bg: #eceef3;
  --surface: #ffffff;
  --sunk: #e2e5ec;
  --ink: #151a26;
  --muted: #586177;
  --line: #d3d8e2;
  --accent: #2b44d6;
  --accent-ink: #ffffff;
  --tape: #f2ce3d;
  --tape-ink: #2a2306;
  --in: #1d8448;
  --maybe: #a86d12;
  --out: #c03b34;
  --cue: #d22f27;
  --display: 'Big Shoulders Display', 'Arial Narrow', 'Helvetica Neue', sans-serif;
  --body: 'Atkinson Hyperlegible', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, monospace;
  --r: 10px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0f121a; --surface: #181d28; --sunk: #131721; --ink: #e7eaf2; --muted: #98a1b6;
    --line: #2a3142; --accent: #8597ff; --accent-ink: #0d1230; --tape: #e2c03a; --tape-ink: #211b04;
    --in: #4cc07f; --maybe: #e2a94b; --out: #f0716a; --cue: #ff6b61; color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0f121a; --surface: #181d28; --sunk: #131721; --ink: #e7eaf2; --muted: #98a1b6;
  --line: #2a3142; --accent: #8597ff; --accent-ink: #0d1230; --tape: #e2c03a; --tape-ink: #211b04;
  --in: #4cc07f; --maybe: #e2a94b; --out: #f0716a; --cue: #ff6b61; color-scheme: dark;
}

* { box-sizing: border-box; }
body { background: var(--bg); color: var(--ink); font: 15px/1.5 var(--body); margin: 0; }
body::before { content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px); z-index: 10; background: var(--surface); }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; touch-action: manipulation; }
html { -webkit-text-size-adjust: 100%; -webkit-tap-highlight-color: transparent; }
@media (display-mode: standalone) { body { overscroll-behavior-y: none; } }
.banner.install { border-color: var(--tape); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.wrap {
  max-width: 760px; margin: 0 auto;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
}

/* header */
.top { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 5; background: var(--surface); border-bottom: 1px solid var(--line); }
.top-in { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-block: 12px 4px; }
.brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.brand h1 { font: 800 26px/1 var(--display); text-transform: uppercase; letter-spacing: .02em; margin: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.logo { display: block; flex: none; width: auto; }
.logo-sm { height: 28px; }
.logo-lg { height: 42px; }
.logo-pick { fill: var(--accent); } /* the logo's pick is the app's blue; lighter in dark mode */
.me-btn { border: 1px solid var(--line); background: var(--sunk); border-radius: 999px; padding: 4px 12px 4px 4px; display: flex; align-items: center; gap: 8px; font-size: 13px; }
.avatar { width: 28px; height: 28px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; font: 700 13px var(--body); }
.tabs { display: flex; gap: 4px; overflow-x: auto; padding-block: 6px 0; scrollbar-width: none; }
.tabs button { background: none; border: 0; padding: 8px 12px 10px; font-weight: 700; color: var(--muted); border-bottom: 3px solid transparent; white-space: nowrap; }
.tabs button[aria-current="page"] { color: var(--ink); border-bottom-color: var(--accent); }

main { padding-block: 20px 64px; display: flex; flex-direction: column; gap: 16px; }
.section-head { display: flex; align-items: end; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.section-head h2 { font: 800 30px/1 var(--display); text-transform: uppercase; margin: 0; letter-spacing: .01em; }
.sub { color: var(--muted); font-size: 13px; margin: 4px 0 0; }
.btn { border: 0; background: var(--accent); color: var(--accent-ink); border-radius: 999px; padding: 9px 16px; font-weight: 700; }
.btn.ghost { background: transparent; color: var(--ink); border: 1px solid var(--line); }
.btn.danger { background: transparent; color: var(--out); border: 1px solid currentColor; }
.link { background: none; border: 0; padding: 4px 0; color: var(--accent); font-weight: 700; font-size: 13px; }
.empty { border: 1.5px dashed var(--line); border-radius: var(--r); padding: 28px 20px; text-align: center; color: var(--muted); }
.banner { background: var(--surface); border: 1px solid var(--accent); border-radius: var(--r); padding: 14px 16px; display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.example-flag { font: 600 11px var(--mono); text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }

/* schedule */
.ev { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); display: grid; grid-template-columns: 64px 1fr; overflow: hidden; }
.date { background: var(--sunk); display: flex; flex-direction: column; align-items: center; padding-block: 14px; gap: 2px; border-right: 1px solid var(--line); }
.date span { font: 700 11px var(--mono); text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.date b { font: 800 34px/1 var(--display); }
.ev-gig .date { background: var(--accent); border-right-color: var(--accent); }
.ev-gig .date span, .ev-gig .date b { color: var(--accent-ink); }
.ev-body { padding: 12px 14px 14px; min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.ev-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.ev h3 { font: 700 18px/1.25 var(--body); margin: 0; text-wrap: balance; }
.meta { margin: 0; color: var(--muted); font-size: 14px; }
.notes { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.chip { font: 700 11px var(--mono); text-transform: uppercase; letter-spacing: .08em; padding: 3px 8px; border-radius: 4px; border: 1px solid var(--line); color: var(--muted); }
.k-gig { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.k-session { background: var(--tape); color: var(--tape-ink); border-color: var(--tape); }
.rsvp { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.rsvp-label { font-size: 13px; color: var(--muted); margin-right: 2px; }
.rsvp button { border: 1px solid var(--line); background: var(--surface); border-radius: 999px; padding: 5px 14px; font-weight: 700; font-size: 13px; }
.rsvp button[aria-pressed="true"].s-in { background: var(--in); border-color: var(--in); color: #fff; }
.rsvp button[aria-pressed="true"].s-maybe { background: var(--maybe); border-color: var(--maybe); color: #fff; }
.rsvp button[aria-pressed="true"].s-out { background: var(--out); border-color: var(--out); color: #fff; }
.who { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 12px; font-size: 13px; }
.who li { display: flex; align-items: center; gap: 6px; color: var(--muted); }
.who li::before { content: ""; width: 8px; height: 8px; border-radius: 50%; border: 1.5px solid var(--muted); }
.who .st-in::before { background: var(--in); border-color: var(--in); }
.who .st-maybe::before { background: var(--maybe); border-color: var(--maybe); }
.who .st-out::before { background: var(--out); border-color: var(--out); }
.who .st-in, .who .st-maybe, .who .st-out { color: var(--ink); }
.tally { font: 600 12px var(--mono); color: var(--muted); }
details.past summary { cursor: pointer; color: var(--muted); font-weight: 700; padding-block: 4px; }
details.past[open] { display: flex; flex-direction: column; gap: 12px; }
.ev.is-past { opacity: .72; }

/* songs */
.search { width: 100%; border: 1px solid var(--line); background: var(--surface); border-radius: 999px; padding: 10px 16px; }
.songs { list-style: none; margin: 0; padding: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); }
.song { padding: 12px 14px; border-top: 1px solid var(--line); display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; align-items: baseline; }
.song:first-child { border-top: 0; }
.song-title { font-weight: 700; min-width: 0; overflow-wrap: anywhere; }
.specs { display: flex; gap: 10px; font: 500 12px var(--mono); color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.specs b { color: var(--ink); font-weight: 700; }
.song-notes { grid-column: 1 / -1; margin: 0; color: var(--muted); font-size: 14px; white-space: pre-wrap; overflow-wrap: anywhere; }
.song.open .song-notes { color: var(--ink); }
.song-toggle { display: flex; align-items: baseline; gap: 8px; background: none; border: 0; padding: 0; text-align: left; min-width: 0; }
.caret { color: var(--muted); font-size: 12px; transition: transform .15s; display: inline-block; }
.song.open .caret { transform: rotate(90deg); }
.song-peek { grid-column: 1 / -1; display: flex; align-items: center; gap: 6px; min-width: 0; background: none; border: 0; padding: 0 0 0 20px; text-align: left; color: var(--muted); font-size: 14px; }
.peek-text { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.song-peek .chip { padding: 1px 6px; flex: none; }

/* tab / chart with band notes */
.tab-wrap { grid-column: 1 / -1; display: flex; flex-direction: column; gap: 6px; margin-top: 6px; min-width: 0; }
.tab { background: var(--sunk); border: 1px solid var(--line); border-radius: 8px; padding: 8px 0; overflow-x: auto; display: flex; flex-direction: column; }
.tab-line, .cue { display: block; min-width: max-content; width: 100%; text-align: left; border: 0; background: none; padding: 0 12px; font: 500 13px/1.45 var(--mono); white-space: pre; color: var(--ink); }
.tab-line:hover, .tab-line:focus-visible { background: color-mix(in srgb, var(--accent) 12%, transparent); }
.cue { display: flex; align-items: baseline; gap: 6px; margin: 2px 0; padding-block: 3px; font: 700 13px/1.4 var(--body); color: var(--cue); background: color-mix(in srgb, var(--cue) 12%, transparent); box-shadow: inset 3px 0 0 var(--cue); white-space: normal; min-width: 0; }
.cue-arrow { font-size: 11px; flex: none; }
.cue-text { flex: 1; min-width: 0; }
.cue-who { flex: none; font: 600 11px var(--mono); color: var(--muted); }
div.cue { cursor: default; }
.cue.shared { color: var(--accent); background: color-mix(in srgb, var(--accent) 12%, transparent); box-shadow: inset 3px 0 0 var(--accent); }
.cue-band { flex: none; font: 700 10px/1.6 var(--mono); text-transform: uppercase; letter-spacing: .08em; padding: 0 6px; border-radius: 3px; background: var(--accent); color: var(--accent-ink); }
.chip.k-band { color: var(--accent); border-color: var(--accent); }
.notes-bar { display: flex; align-items: center; justify-content: space-between; gap: 8px 12px; flex-wrap: wrap; }
.switch { display: flex; align-items: center; gap: 8px; background: none; border: 0; padding: 4px 0; font-weight: 700; font-size: 14px; }
.switch .knob { width: 36px; height: 20px; border-radius: 999px; background: var(--line); position: relative; transition: background .15s; flex: none; }
.switch .knob::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: var(--surface); transition: transform .15s; }
.switch[aria-checked="true"] .knob { background: var(--cue); }
.switch[aria-checked="true"] .knob::after { transform: translateX(16px); }
textarea.mono { font: 500 13px/1.45 var(--mono); white-space: pre; overflow-x: auto; min-height: 180px; }
.hint { font-size: 12px; color: var(--muted); }

/* repeating events */
.ev-tags { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.repeat { font: 600 12px var(--mono); color: var(--muted); }

/* setlists */
.sets { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.set-card { text-align: left; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 14px; display: flex; flex-direction: column; gap: 6px; }
.set-card h3 { font: 800 22px/1.05 var(--display); text-transform: uppercase; margin: 0; }
.set-card .strip { height: 10px; border-radius: 2px; background: repeating-linear-gradient(90deg, var(--tape) 0 22px, transparent 22px 26px); opacity: .9; }
.tape { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; counter-reset: s; }
.tape li { background: var(--tape); color: var(--tape-ink); border-radius: 2px; padding: 8px 8px 8px 12px; display: grid; grid-template-columns: 2ch 1fr auto; gap: 10px; align-items: center; counter-increment: s; }
.tape li:nth-child(odd) { transform: rotate(-.35deg); }
.tape li:nth-child(even) { transform: rotate(.3deg); }
.tape li::before { content: counter(s); font: 700 13px var(--mono); text-align: right; }
.tape-title { font: 800 21px/1.1 var(--display); text-transform: uppercase; min-width: 0; overflow-wrap: anywhere; }
.tape-title { border: 0; background: none; padding: 0; color: inherit; text-align: left; cursor: pointer; }
.tape-note { font: 800 15px/1 var(--mono); text-transform: none; padding: 1px 6px; border-radius: 4px; background: var(--tape-ink); color: var(--tape); vertical-align: 3px; white-space: nowrap; }
.tape-title small { display: block; font: 600 11px var(--mono); text-transform: none; letter-spacing: .02em; opacity: .75; margin-top: 2px; }
.tape-ctl { display: flex; gap: 2px; }
.tape-ctl button { width: 30px; height: 30px; border: 0; border-radius: 4px; background: color-mix(in srgb, var(--tape-ink) 10%, transparent); color: var(--tape-ink); font-weight: 700; }
.tape-ctl button:disabled { opacity: .3; cursor: default; }
.add-row { display: flex; gap: 8px; }
.add-row select { flex: 1; min-width: 0; border: 1px solid var(--line); background: var(--surface); border-radius: 999px; padding: 9px 14px; }
.total { font: 600 13px var(--mono); color: var(--muted); font-variant-numeric: tabular-nums; }

/* board */
.board { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; align-items: start; }
.note { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 14px; display: flex; flex-direction: column; gap: 8px; }
.note.pinned { border-color: var(--accent); box-shadow: inset 0 3px 0 var(--accent); }
.note h3 { margin: 0; font: 700 17px/1.3 var(--body); overflow-wrap: anywhere; }
.note p { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.note-foot { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); }

/* sheet (form overlay) */
.sheet { position: fixed; inset: 0; z-index: 20; background: color-mix(in srgb, #000 45%, transparent); display: flex; align-items: flex-end; justify-content: center; }
.sheet form { background: var(--surface); width: 100%; max-width: 560px; max-height: 92%; overflow-y: auto; border-radius: 16px 16px 0 0; padding: 20px max(16px, env(safe-area-inset-right, 0px)) calc(20px + env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px)); display: flex; flex-direction: column; gap: 14px; }
@media (min-width: 600px) { .sheet { align-items: center; } .sheet form { border-radius: 16px; } }
.sheet h2 { font: 800 26px/1 var(--display); text-transform: uppercase; margin: 0; }
.field { display: flex; flex-direction: column; gap: 4px; }
.field label { font-size: 13px; font-weight: 700; color: var(--muted); }
.field input, .field select, .field textarea { border: 1px solid var(--line); background: var(--bg); border-radius: 8px; padding: 10px 12px; width: 100%; }
.field textarea { min-height: 110px; resize: vertical; }
.field.check { flex-direction: row; align-items: center; gap: 8px; }
.field.check input { width: auto; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.sheet-actions { display: flex; gap: 8px; justify-content: space-between; flex-wrap: wrap; padding-top: 4px; }
.sheet-actions .right { display: flex; gap: 8px; margin-left: auto; }
.form-error { color: var(--out); font-size: 14px; margin: 0; }

.toast { position: fixed; left: 50%; bottom: calc(20px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); background: var(--ink); color: var(--bg); padding: 10px 18px; border-radius: 999px; font-weight: 700; z-index: 30; max-width: calc(100% - 32px); }
.loading { color: var(--muted); padding: 40px 0; text-align: center; }

@media (prefers-reduced-motion: reduce) { .tape li:nth-child(odd), .tape li:nth-child(even) { transform: none; } } /* no tilt; dragging still moves rows */
@media (max-width: 420px) { .row2 { grid-template-columns: 1fr; } .ev { grid-template-columns: 54px 1fr; } .date b { font-size: 28px; } }

/* multi-band */
.band-switch { display: flex; align-items: center; gap: 6px; background: none; border: 0; padding: 0; min-width: 0; color: var(--ink); }
.band-switch span { color: var(--muted); font-size: 14px; }
.banner.warn { border-color: var(--maybe); }
.head-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.band-list { display: flex; flex-direction: column; gap: 8px; }
.band-opt { display: flex; justify-content: space-between; align-items: center; gap: 12px; text-align: left; border: 1px solid var(--line); background: var(--bg); border-radius: 8px; padding: 12px 14px; font: 800 20px/1.1 var(--display); text-transform: uppercase; }
.band-opt .sub { margin: 0; font: 400 13px var(--body); text-transform: none; }
.band-opt[aria-current="true"] { border-color: var(--accent); box-shadow: inset 3px 0 0 var(--accent); }
@media (max-width: 420px) { .me-name { display: none; } .me-btn { padding-right: 4px; } }

/* chat (Slack-style) */
main.chat-view { padding-bottom: 0; }
.tabs .badge { display: inline-grid; place-items: center; min-width: 18px; height: 18px; padding: 0 5px; margin-left: 6px; border-radius: 999px; background: var(--out); color: #fff; font: 700 11px/1 var(--mono); vertical-align: 1px; }
.chat { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 6px 0 10px; min-height: 40vh; }
.chat .empty { margin: 12px 14px; }
.older { text-align: center; }
.msg { display: grid; grid-template-columns: 36px 1fr auto; gap: 0 10px; padding: 6px 10px 2px 14px; align-items: start; }
.msg.cont { padding-top: 1px; }
.msg:hover { background: var(--sunk); }
.msg-av { width: 36px; height: 36px; border-radius: 8px; background: hsl(var(--h) 55% 40%); color: #fff; font: 700 14px var(--body); margin-top: 2px; }
.msg-gutter { display: flex; justify-content: flex-end; padding-top: 3px; }
.msg-gutter time { font: 500 10px var(--mono); color: var(--muted); visibility: hidden; white-space: nowrap; }
.msg:hover .msg-gutter time { visibility: visible; }
.msg-main { min-width: 0; }
.msg-meta { display: flex; align-items: baseline; gap: 8px; }
.msg-meta b { font-weight: 700; }
.msg-meta time { font: 500 11px var(--mono); color: var(--muted); }
.msg-body { white-space: pre-wrap; overflow-wrap: anywhere; }
.msg-body a { color: var(--accent); }
.edited { font-size: 12px; color: var(--muted); }
.msg-more { background: none; border: 0; color: var(--muted); font-size: 18px; line-height: 1; padding: 2px 6px; border-radius: 6px; opacity: 0; }
.msg:hover .msg-more, .msg-more:focus-visible { opacity: 1; }
@media (hover: none) { .msg-more { opacity: .45; } }
.day, .new-line { display: flex; align-items: center; gap: 10px; margin: 12px 14px 4px; font: 700 12px var(--body); color: var(--muted); }
.day::before, .day::after, .new-line::before, .new-line::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.day span { border: 1px solid var(--line); border-radius: 999px; padding: 2px 10px; background: var(--surface); }
.new-line { color: var(--out); margin-block: 6px; }
.new-line::before, .new-line::after { background: var(--out); }
.composer { position: sticky; bottom: 0; z-index: 4; display: flex; gap: 8px; align-items: flex-end; background: var(--bg); padding: 10px 0 calc(12px + env(safe-area-inset-bottom, 0px)); margin-top: -6px; }
.composer textarea { flex: 1; min-width: 0; resize: none; border: 1px solid var(--line); background: var(--surface); border-radius: 12px; padding: 10px 14px; min-height: 44px; max-height: 160px; line-height: 1.4; }
.composer .btn { min-height: 44px; }
.btn:disabled { opacity: .6; cursor: default; }

/* live show mode: a dark stage screen, whatever the phone's theme */
.live-btn { padding: 6px 14px; font-size: 13px; }
.set-links { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
body.live-on { background: #000; overscroll-behavior: none; }
body.live-on::before { background: #000; }
body.live-on.stage-light, body.live-on.stage-light::before { background: #fff; }
.live {
  --l-bg: #000; --l-ink: #f4f4f0; --l-muted: #9a9fab; --l-line: #2a2d35; --l-cue: #ff6b61; --l-band: #8fa0ff; --l-tape: #f2ce3d;
  --l-title: var(--l-tape); --l-panel: #0b0c10; --l-tab: #0d0f14; --l-field: #000; --l-hover: #15171d; --l-tape-ink: #211b04; --l-band-ink: #0d1230;
  color: var(--l-ink); background: var(--l-bg); min-height: 100vh; min-height: 100dvh;
  padding: 0 max(16px, env(safe-area-inset-right, 0px)) calc(96px + env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px));
  font-size: var(--fs); -webkit-user-select: none; user-select: none;
}
.live button { color: var(--l-ink); background: none; border: 1px solid var(--l-line); border-radius: 8px; font-weight: 700; }
.live-top { position: sticky; top: 0; z-index: 3; display: flex; align-items: center; gap: 10px; padding: calc(8px + env(safe-area-inset-top, 0px)) 0 8px; background: var(--l-bg); border-bottom: 1px solid var(--l-line); font-size: 14px; }
.live-exit { width: 40px; height: 40px; flex: none; position: relative; overflow: hidden; -webkit-touch-callout: none; }
.live-exit::after { content: ""; position: absolute; inset: auto 0 0; height: 0; background: color-mix(in srgb, var(--l-cue) 55%, transparent); }
.live-exit.holding::after { height: 100%; transition: height .7s linear; }
.live-pos { font: 600 14px var(--mono); color: var(--l-muted); white-space: nowrap; }
.live-pos b { color: var(--l-ink); }
.live-set { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--l-muted); }
.live-tools { display: flex; gap: 6px; flex: none; }
.live-tools button { height: 40px; min-width: 40px; padding: 0 10px; font-size: 14px; }
.live-song { padding-top: 16px; display: flex; flex-direction: column; gap: .7em; }
.live-song h1 { font: 800 calc(var(--fs) * 2.3)/1 var(--display); text-transform: uppercase; letter-spacing: .01em; margin: 0; color: var(--l-title); overflow-wrap: anywhere; }
.live-specs { margin: 0; display: flex; gap: 10px; flex-wrap: wrap; font: 500 calc(var(--fs) * .9) var(--mono); color: var(--l-muted); }
.live-specs b { color: var(--l-ink); }
.live-notes { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.45; }
.live-empty { color: var(--l-muted); margin: 0; }
.live-tab { background: var(--l-tab); border-color: var(--l-line); -webkit-user-select: text; user-select: text; }
.live-tab .tab-line { color: var(--l-ink); font-size: calc(var(--fs) * .85); cursor: default; }
.live-tab .cue { color: var(--l-cue); font-size: calc(var(--fs) * .9); background: color-mix(in srgb, var(--l-cue) 16%, transparent); box-shadow: inset 4px 0 0 var(--l-cue); }
.live-tab .cue.shared { color: var(--l-band); background: color-mix(in srgb, var(--l-band) 16%, transparent); box-shadow: inset 4px 0 0 var(--l-band); }
.live-tab .cue-band { background: var(--l-band); color: var(--l-band-ink); }
.live-edge { position: fixed; top: 50%; transform: translateY(-50%); font: 300 44px/1 var(--body); color: var(--l-ink); opacity: .14; pointer-events: none; }
.live-edge.left { left: 4px; } .live-edge.right { right: 4px; }
.live-next { position: fixed; left: 0; right: 0; bottom: 0; z-index: 3; display: flex; align-items: stretch; gap: 8px; background: var(--l-panel); border-top: 1px solid var(--l-line);
  padding: 8px max(12px, env(safe-area-inset-right, 0px)) calc(8px + env(safe-area-inset-bottom, 0px)) max(12px, env(safe-area-inset-left, 0px)); }
.live-next > button.live-prev, .live-next > button.live-nextbtn { width: 64px; font-size: 30px; flex: none; }
.live-next button:disabled { opacity: .3; }
.live-upnext { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: flex-start; justify-content: center; text-align: left; padding: 6px 12px; gap: 1px; }
.live .live-upnext { border-color: var(--l-line); }
.live-upnext span { font: 600 11px var(--mono); text-transform: uppercase; letter-spacing: .1em; color: var(--l-muted); }
.live-upnext b { font: 800 22px/1.05 var(--display); text-transform: uppercase; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.live-upnext small { font: 500 12px var(--mono); color: var(--l-muted); }
.live-upnext.end b { color: var(--l-muted); }
@media (max-width: 420px) { .live-set { display: none; } }

/* song folders and artists */
.seg { display: inline-flex; align-self: flex-start; border: 1px solid var(--line); border-radius: 999px; padding: 3px; background: var(--surface); gap: 2px; }
.seg button { border: 0; background: none; border-radius: 999px; padding: 6px 14px; font-weight: 700; font-size: 13px; color: var(--muted); }
.seg button[aria-pressed="true"] { background: var(--ink); color: var(--bg); }
.group { display: flex; flex-direction: column; gap: 8px; }
.group-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.group-toggle { display: flex; align-items: center; gap: 8px; background: none; border: 0; padding: 4px 0; min-width: 0; text-align: left; }
.group-toggle b { font: 800 20px/1.1 var(--display); text-transform: uppercase; letter-spacing: .02em; overflow-wrap: anywhere; }
.group-toggle .count { font: 600 12px var(--mono); color: var(--muted); border: 1px solid var(--line); border-radius: 999px; padding: 1px 8px; }
.group-toggle[aria-expanded="true"] .caret { transform: rotate(90deg); }
.song-artist { display: block; font: 400 13px var(--body); color: var(--muted); margin-top: 1px; }
.select-bar { position: sticky; top: 96px; z-index: 4; display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap;
  background: var(--surface); border: 1px solid var(--accent); border-radius: var(--r); padding: 8px 12px; font-weight: 700; font-size: 14px; }
.select-bar .btn { padding: 7px 12px; font-size: 13px; }
.song.picking { display: block; padding: 0; }
.song-pick { width: 100%; display: grid; grid-template-columns: 22px 1fr auto; gap: 2px 12px; align-items: center; text-align: left; background: none; border: 0; padding: 12px 14px; }
.song-pick .song-artist { grid-column: 2; }
.song-pick .chip { grid-row: 1; grid-column: 3; }
.song-pick .box { grid-row: 1 / span 2; width: 22px; height: 22px; border: 2px solid var(--line); border-radius: 6px; }
.song-pick[aria-pressed="true"] { background: color-mix(in srgb, var(--accent) 10%, transparent); }
.song-pick[aria-pressed="true"] .box { background: var(--accent); border-color: var(--accent); box-shadow: inset 0 0 0 3px var(--surface); }

/* tab columns: side by side when they fit, stacked when they don't */
.tab.tab-cols { flex-direction: row; flex-wrap: wrap; align-items: flex-start; row-gap: 12px; }
.tab-col { display: flex; flex-direction: column; flex: 0 0 auto; min-width: 0; padding-right: 12px; }
.tab-col + .tab-col { border-left: 1px dashed var(--line); padding-left: 0; }
.col-break { align-self: flex-start; margin: 0 12px 4px; padding: 1px 8px; border: 1px dashed var(--line); border-radius: 999px; background: none; font: 600 11px var(--mono); color: var(--muted); }
.live-tab.tab-cols .tab-col + .tab-col { border-left-color: var(--l-line); }

/* folder button row */
.seg-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.seg-row .btn { padding: 7px 14px; font-size: 13px; }
.group-empty { margin: 0 0 4px 22px; }
.field select + input { margin-top: 6px; }

/* big tabbed forms (song editor) */
.sheet form.wide { max-width: 1000px; height: 92%; }
@media (min-width: 600px) { .sheet form.wide { height: min(92vh, 1100px); } }
.form-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-top: -4px; }
.form-tabs button { background: none; border: 0; border-bottom: 3px solid transparent; padding: 8px 14px 9px; font-weight: 700; color: var(--muted); }
.form-tabs button[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--accent); }
.form-page { display: flex; flex-direction: column; gap: 14px; flex: 1; min-height: 0; }
.form-page[hidden] { display: none; }
.field.grow { flex: 1; min-height: 0; }
.field textarea.tall, .field textarea.editor { flex: 1; min-height: 40vh; resize: none; }
.field textarea.editor { font: 500 14px/1.5 var(--mono); tab-size: 4; padding: 14px 16px; }
.sheet form.wide .sheet-actions { position: sticky; bottom: calc(-20px - env(safe-area-inset-bottom, 0px)); background: var(--surface); margin: 0 -16px calc(-20px - env(safe-area-inset-bottom, 0px)); padding: 12px 16px calc(12px + env(safe-area-inset-bottom, 0px)); border-top: 1px solid var(--line); }

/* songs shared with another band */
.song-shared { display: inline-block; margin-left: 0; font: 600 11px var(--mono); color: var(--accent); border: 1px solid color-mix(in srgb, var(--accent) 45%, transparent); border-radius: 4px; padding: 0 6px; }
.song-artist .song-shared { margin-left: 6px; }
.song-artist .song-shared:first-child { margin-left: 0; }

/* paste a list: match marks in the review sheet */
.match-mark { display: inline-grid; place-items: center; width: 18px; height: 18px; border-radius: 50%; font: 700 11px/1 var(--mono); color: #fff; margin-right: 2px; vertical-align: 1px; }
.match-mark.m-ok { background: var(--in); }
.match-mark.m-maybe { background: var(--maybe); }
.match-mark.m-new { background: var(--accent); color: var(--accent-ink); }

/* home: one landing page for all your bands */
.home-btn { display: grid; place-items: center; width: 36px; height: 36px; flex: none; border: 1px solid var(--line); border-radius: 10px; background: var(--sunk); color: var(--ink); }
.home-sec { display: flex; flex-direction: column; gap: 10px; }
.home-h { margin: 6px 0 0; font: 800 20px/1.1 var(--display); text-transform: uppercase; letter-spacing: .02em; display: flex; align-items: center; gap: 8px; }
.home-h .count { font: 700 12px var(--mono); background: var(--out); color: #fff; border-radius: 999px; padding: 1px 8px; }
.home-bands { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }
.home-band { text-align: left; display: flex; flex-direction: column; gap: 4px; padding: 14px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); box-shadow: inset 4px 0 0 hsl(var(--h) 60% 50%); }
.home-band-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.home-band-top b { font: 800 24px/1.05 var(--display); text-transform: uppercase; }
.home-band .sub { margin: 0; }
.home-band .badge, .home-btn + .badge { min-width: 22px; height: 22px; padding: 0 7px; border-radius: 999px; background: var(--out); color: #fff; font: 700 12px/22px var(--mono); text-align: center; }
.band-tag { font: 700 11px var(--mono); text-transform: uppercase; letter-spacing: .06em; padding: 3px 8px; border-radius: 4px; color: hsl(var(--h) 60% 34%); background: hsl(var(--h) 70% 50% / .14); border: 1px solid hsl(var(--h) 60% 45% / .4); white-space: nowrap; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .band-tag { color: hsl(var(--h) 80% 72%); } }
:root[data-theme="dark"] .band-tag { color: hsl(var(--h) 80% 72%); }
.home-ev .rsvp .tally { margin-left: auto; }
.home-msgs { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); }
.home-msg { display: grid; grid-template-columns: 36px 1fr; gap: 10px; text-align: left; background: none; border: 0; border-top: 1px solid var(--line); padding: 10px 14px; }
.home-msg:first-child { border-top: 0; }
.home-msg-main { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.home-msg .msg-meta { flex-wrap: wrap; }
.home-msg-body { color: var(--ink); overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow-wrap: anywhere; }

/* full screen song list (live mode sidebar) */
.live-side { position: fixed; top: 0; bottom: 0; left: 0; z-index: 7; width: min(85vw, 300px); display: flex; flex-direction: column; gap: 8px;
  background: var(--l-panel); border-right: 1px solid var(--l-line); padding: calc(10px + env(safe-area-inset-top, 0px)) 10px calc(10px + env(safe-area-inset-bottom, 0px)) max(10px, env(safe-area-inset-left, 0px)); }
.live-side[hidden] { display: none; }
.live-side-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 16px; padding: 2px 2px 0 4px; }
.live-side-head button { width: 40px; height: 40px; font-size: 20px; }
.live-search { width: 100%; border: 1px solid var(--l-line); background: var(--l-field); color: var(--l-ink); border-radius: 999px; padding: 9px 14px; font-size: 15px; -webkit-user-select: text; user-select: text; }
.live-items { list-style: none; margin: 0; padding: 0; overflow-y: auto; flex: 1; display: flex; flex-direction: column; gap: 2px; }
.live-items li button { width: 100%; display: grid; grid-template-columns: auto 1fr auto; gap: 8px; align-items: center; text-align: left; padding: 9px 10px; border: 0; border-radius: 8px; background: none; font: 700 15px/1.25 var(--body); }
.live-items li button span { font: 700 12px var(--mono); color: var(--l-muted); min-width: 1.6em; text-align: right; }
.live-items li button small { font: 500 12px var(--mono); color: var(--l-muted); }
.live-items li button:hover { background: var(--l-hover); }
.live-items li button[aria-current="true"] { background: var(--l-tape); color: var(--l-tape-ink); }
.live-items li button[aria-current="true"] span, .live-items li button[aria-current="true"] small { color: var(--l-tape-ink); }
.live-letter { font: 800 13px var(--mono); color: var(--l-title); padding: 10px 10px 2px; position: sticky; top: 0; background: var(--l-panel); }
.live-none { color: var(--l-muted); padding: 10px; }
.live-scrim { position: fixed; inset: 0; z-index: 6; background: rgba(0, 0, 0, .6); }
.song-full { grid-column: 1 / -1; justify-self: start; }
@media (min-width: 900px) {
  .live.side-open { padding-left: calc(300px + 24px); }
  .live.side-open .live-side { width: 300px; }
  .live.side-open .live-next { left: 300px; }
}

/* bring the folded song list back: a button by the ✕ and, on wide screens, a tab on the left edge */
.live-listbtn { height: 40px; padding: 0 12px; flex: none; font-size: 14px; display: flex; align-items: center; gap: 6px; }
.live-listbtn[aria-expanded="true"] { background: var(--l-tape); color: var(--l-tape-ink); border-color: var(--l-tape); }
.live-handle { display: none; }
@media (min-width: 900px) {
  .live-handle { display: flex; position: fixed; left: 0; top: 50%; transform: translateY(-50%); z-index: 4; flex-direction: column; align-items: center; gap: 8px;
    padding: 14px 7px; border-radius: 0 10px 10px 0; border-left: 0; background: var(--l-panel); color: var(--l-ink); }
  .live-handle span { font-size: 18px; line-height: 1; }
  .live-handle b { writing-mode: vertical-rl; transform: rotate(180deg); font: 700 12px var(--mono); text-transform: uppercase; letter-spacing: .12em; color: var(--l-muted); }
  .live-handle:hover b { color: var(--l-ink); }
  .live:not(.side-open) .live-edge.left { display: none; }
}
@media (max-width: 420px) { .live-listbtn span { display: none; } }

.saved-offline { color: var(--in); white-space: nowrap; }

/* ---------- sign in ---------- */
.signin { min-height: 100vh; min-height: 100dvh; display: grid; place-items: center; padding-top: 24px; padding-bottom: 24px; }
.signin-card { width: 100%; max-width: 380px; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 28px 22px; display: flex; flex-direction: column; gap: 16px; }
.signin-head { display: flex; align-items: center; gap: 12px; }
.signin-head h1 { font: 800 30px/1 var(--display); text-transform: uppercase; letter-spacing: .02em; margin: 0; }
.signin-card > .sub { margin: -6px 0 4px; font-size: 14px; }
.signin-card p { margin: 0; }
.signin-form { display: flex; flex-direction: column; gap: 12px; }
.signin-form .btn { width: 100%; padding: 11px 16px; }
.signin-form .btn[disabled] { opacity: .6; }
#signin-code-in { font: 700 24px var(--mono); letter-spacing: .35em; text-align: center; }
.signin-links { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.signin-foot { text-align: center; font-size: 13px; margin-top: 4px; }
.signin-foot a { color: var(--muted); }
.or { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 13px; }
.or::before, .or::after { content: ''; flex: 1; border-top: 1px solid var(--line); }
/* Google's sign-in button: white, the "G" logo, "Sign in with Google". */
.google-btn { display: flex; align-items: center; justify-content: center; gap: 10px; height: 42px; border-radius: 999px; background: #fff; color: #1f1f1f; border: 1px solid #747775; font: 500 14px Roboto, system-ui, -apple-system, 'Segoe UI', sans-serif; text-decoration: none; }
.google-btn:hover { background: #f8f9fa; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .google-btn { background: #131314; color: #e3e3e3; border-color: #8e918f; } }
:root[data-theme="dark"] .google-btn { background: #131314; color: #e3e3e3; border-color: #8e918f; }

/* Light stage: full screen and live mode when the person picks "Same as the theme" and the theme is light */
.live.stage-light {
  --l-bg: #ffffff; --l-ink: #151a26; --l-muted: #586177; --l-line: #d3d8e2; --l-cue: #c62f27; --l-band: #2b44d6; --l-tape: #f2ce3d;
  --l-title: #151a26; --l-panel: #f3f4f7; --l-tab: #f7f8fa; --l-field: #ffffff; --l-hover: #e7e9ef; --l-tape-ink: #2a2306; --l-band-ink: #ffffff;
}
.live.stage-light .live-edge { opacity: .2; }

/* chat: replies, mentions, reactions, seen by, message menu */
.msg { transition: transform .15s ease-out, background .3s; }
.msg.flash { background: color-mix(in srgb, var(--accent) 16%, transparent); }
.msg.mentions-me { box-shadow: inset 3px 0 0 var(--tape); background: color-mix(in srgb, var(--tape) 9%, transparent); }
@media (hover: none) { .msg { -webkit-touch-callout: none; -webkit-user-select: none; user-select: none; } .msg-more { opacity: .55; } }
.msg-quote { display: block; width: 100%; text-align: left; margin: 2px 0 4px; padding: 4px 10px; border: 0; border-left: 3px solid var(--line); border-radius: 4px;
  background: var(--sunk); color: var(--muted); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.msg-quote b { color: var(--ink); }
.mention { color: var(--accent); font-weight: 700; background: color-mix(in srgb, var(--accent) 12%, transparent); border-radius: 4px; padding: 0 2px; }
.mention.me { color: var(--tape-ink); background: var(--tape); }
.rx-row { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.rx { display: inline-flex; align-items: center; gap: 4px; height: 26px; padding: 0 8px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); font-size: 14px; line-height: 1; }
.rx span { font: 600 12px var(--mono); color: var(--muted); }
.rx.mine { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 14%, transparent); }
.rx.mine span { color: var(--accent); }
.rx-add { color: var(--muted); opacity: 0; }
.msg:hover .rx-add, .rx-add:focus-visible { opacity: 1; }
@media (hover: none) { .rx-add { opacity: 1; } }
.seen-by { text-align: right; font-size: 12px; color: var(--muted); padding: 2px 14px 0; }
.composer { flex-direction: column; align-items: stretch; gap: 6px; }
.composer-row { display: flex; gap: 8px; align-items: flex-end; }
.reply-bar { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 6px 6px 6px 12px; border-left: 3px solid var(--accent);
  background: var(--surface); border-radius: 8px; font-size: 13px; color: var(--muted); }
.reply-bar span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.reply-bar b { color: var(--ink); }
.reply-bar button { border: 0; background: none; width: 30px; height: 30px; color: var(--muted); font-size: 15px; }
.mention-list { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; box-shadow: 0 6px 20px rgb(0 0 0 / .12); }
.mention-list[hidden] { display: none; }
.mention-list button { display: grid; grid-template-columns: 28px auto 1fr; align-items: center; gap: 8px; text-align: left; border: 0; background: none; padding: 7px 10px; }
.mention-list button .msg-av { width: 28px; height: 28px; font-size: 12px; margin: 0; }
.mention-list button small { color: var(--muted); }
.mention-list button[aria-selected="true"], .mention-list button:hover { background: var(--sunk); }
.msg-menu { gap: 12px; }
.msg-menu-quote { margin: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.quick-rx { display: flex; justify-content: space-between; gap: 4px; }
.quick-rx button, .more-grid button { font-size: 26px; line-height: 1; width: 46px; height: 46px; border-radius: 50%; border: 1px solid transparent; background: var(--sunk); }
.quick-rx button[aria-pressed="true"], .more-grid button[aria-pressed="true"] { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 16%, transparent); }
.more-rx { display: flex; flex-direction: column; gap: 8px; }
.more-rx[hidden] { display: none; }
.more-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(44px, 1fr)); gap: 6px; }
.more-grid button { width: 100%; height: 44px; font-size: 22px; border-radius: 10px; }
.rx-any { margin-top: 4px; width: 100%; border: 1px solid var(--line); background: var(--bg); border-radius: 8px; padding: 9px 12px; font-size: 20px; }
.menu-list { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.menu-list button { text-align: left; border: 0; border-top: 1px solid var(--line); background: var(--surface); padding: 13px 14px; font-weight: 700; }
.menu-list button:first-child { border-top: 0; }
.menu-list .danger-text { color: var(--out); }

/* "Mine": your private version of a song */
.song-tools { grid-column: 1 / -1; display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.view-seg { display: inline-flex; border: 1px solid var(--line); border-radius: 999px; padding: 2px; gap: 2px; background: var(--surface); }
.view-seg button { border: 0; background: none; border-radius: 999px; padding: 4px 12px; font-weight: 700; font-size: 13px; color: var(--muted); }
.view-seg button[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); }
.mine-tab { box-shadow: inset 3px 0 0 var(--accent); }
.mine-tab .tab-line { cursor: default; }
.mine-band { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.mine-band li { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; padding: 4px 10px; border-radius: 6px; color: var(--accent); background: color-mix(in srgb, var(--accent) 10%, transparent); font-weight: 700; font-size: 14px; }
.mine-band small { font: 500 12px var(--mono); color: var(--muted); }
.mine-band .cue-band { flex: none; }
.field-label { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
/* on the stage screen */
.live .view-seg { background: none; border-color: var(--l-line); height: 40px; align-items: center; }
.live .view-seg button { border: 0; height: 34px; padding: 0 12px; color: var(--l-muted); font-size: 14px; }
.live .view-seg button[aria-pressed="true"] { background: var(--l-band); color: var(--l-band-ink); }
.live .mine-tab { box-shadow: inset 4px 0 0 var(--l-band); }
.live .mine-band li { color: var(--l-band); background: color-mix(in srgb, var(--l-band) 14%, transparent); font-size: calc(var(--fs) * .85); }
.live .mine-band small { color: var(--l-muted); }
.live .mine-band .cue-band { background: var(--l-band); color: var(--l-band-ink); }
@media (max-width: 520px) { .live .view-seg button { padding: 0 8px; font-size: 13px; } }

/* audio: player cards, recorder, uploads, song recordings */
.audio-card { display: grid; grid-template-columns: 40px 1fr auto auto; align-items: center; gap: 10px; padding: 8px 10px; margin: 4px 0;
  border: 1px solid var(--line); border-radius: 12px; background: var(--surface); max-width: 460px; }
.audio-card.active { border-color: var(--accent); }
.au-play { width: 40px; height: 40px; border-radius: 50%; border: 0; background: var(--accent); color: var(--accent-ink); font-size: 14px; font-weight: 800; }
.au-main { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.au-top { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
.au-top b { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; }
.au-time { font: 500 12px var(--mono); color: var(--muted); white-space: nowrap; }
.au-seek { width: 100%; accent-color: var(--accent); margin: 0; }
.au-seek:disabled { opacity: .45; }
.au-speed, .au-more { border: 1px solid var(--line); background: none; border-radius: 999px; padding: 4px 9px; font: 700 12px var(--mono); color: var(--muted); }
.au-more { font: 700 16px/1 var(--body); padding: 4px 9px; }
.icon-btn { flex: none; width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--line); background: var(--surface); font-size: 19px; }
.rec-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 6px 6px 6px 14px; border: 1px solid var(--out); border-radius: 12px; background: var(--surface); }
.rec-bar.review { border-color: var(--accent); }
.rec-bar audio { flex: 1; min-width: 200px; height: 40px; }
.rec-bar .sub { margin: 0; flex: 1; }
.rec-bar #rec-time { font: 700 16px var(--mono); }
.rec-dot { width: 12px; height: 12px; border-radius: 50%; background: var(--out); animation: rec-pulse 1s ease-in-out infinite; }
@keyframes rec-pulse { 50% { opacity: .3; } }
@media (prefers-reduced-motion: reduce) { .rec-dot { animation: none; } }
.upload-bar { position: relative; height: 26px; border-radius: 8px; background: var(--sunk); overflow: hidden; }
.upload-bar span { position: absolute; inset: 0 auto 0 0; background: color-mix(in srgb, var(--accent) 30%, transparent); transition: width .2s; }
.upload-bar b { position: relative; display: block; text-align: center; font-size: 12px; line-height: 26px; }
.recordings { grid-column: 1 / -1; display: flex; flex-direction: column; gap: 4px; margin-top: 8px; }
.recordings-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.recordings .sub { margin: 0; }
.menu-link { display: block; border-top: 1px solid var(--line); padding: 13px 14px; font-weight: 700; color: var(--ink); text-decoration: none; background: var(--surface); }

/* finding audio: search, Audio view, kept/expiry, storage */
.search-panel { display: flex; flex-direction: column; gap: 10px; }
.search-row { display: flex; gap: 8px; }
.search-row .search { flex: 1; min-width: 0; }
.search-filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.search-filters select { border: 1px solid var(--line); background: var(--surface); border-radius: 999px; padding: 6px 12px; }
.chip-btn { border: 1px solid var(--line); background: var(--surface); border-radius: 999px; padding: 6px 12px; font-weight: 700; font-size: 13px; color: var(--muted); }
.chip-btn[aria-pressed="true"] { border-color: var(--accent); color: var(--accent); background: color-mix(in srgb, var(--accent) 10%, transparent); }
.search-hits { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); }
.search-hit { display: grid; grid-template-columns: 36px 1fr; gap: 10px; text-align: left; border: 0; border-top: 1px solid var(--line); background: none; padding: 10px 14px; }
.search-hit:first-child { border-top: 0; }
.search-hit:hover { background: var(--sunk); }
.hit-main { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.hit-audio { font-weight: 700; font-size: 14px; }
.hit-body { color: var(--ink); font-size: 14px; overflow-wrap: anywhere; }
mark { background: var(--tape); color: var(--tape-ink); border-radius: 3px; padding: 0 2px; }
.audio-card { grid-template-columns: 40px 1fr auto auto auto; }
.au-note { grid-column: 2 / -1; margin-top: -2px; }
.au-badge { font: 600 11px var(--mono); }
.au-badge.kept { color: var(--tape-ink); background: var(--tape); border-radius: 4px; padding: 1px 6px; }
.au-badge.exp { color: var(--maybe); }
.au-badge .link { font-size: 11px; padding: 0; }
.audio-gone { display: inline-block; margin: 4px 0; padding: 8px 12px; border: 1px dashed var(--line); border-radius: 10px; color: var(--muted); font-size: 13px; }
.audio-view { display: flex; flex-direction: column; gap: 10px; }
.audio-row { display: flex; flex-direction: column; gap: 0; }
.audio-row .audio-card { max-width: none; margin-bottom: 2px; }
.audio-meta { margin: 0 0 6px 4px; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.storage { display: flex; flex-direction: column; gap: 8px; margin-top: 8px; }
.storage p { margin: 0; }
.meter { height: 10px; border-radius: 999px; background: var(--sunk); overflow: hidden; border: 1px solid var(--line); }
.meter span { display: block; height: 100%; background: var(--accent); }
.danger-text { color: var(--out) !important; }

/* song editor: folded "More options"; extra notes at the end of a song */
.more-opts { border: 1px solid var(--line); border-radius: 8px; padding: 0 12px; }
.more-opts summary { cursor: pointer; padding: 10px 0; font-size: 13px; font-weight: 700; color: var(--muted); }
.more-opts[open] summary { border-bottom: 1px solid var(--line); margin-bottom: 10px; }
.more-opts .more-body { display: flex; flex-direction: column; gap: 14px; padding-bottom: 12px; }
.extra-notes { grid-column: 1 / -1; display: flex; flex-direction: column; gap: 2px; margin-top: 6px; }
.extra-notes > b { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }

/* styling in tabs: highlight blocks, bold, underline; and the editor toolbar */
.tab-line.hl-yellow { background: rgb(242 206 61 / .38); }
.tab-line.hl-green { background: rgb(52 199 89 / .28); }
.tab-line.hl-pink { background: rgb(255 92 168 / .26); }
.tab-line.hl-blue { background: rgb(64 120 255 / .26); }
.tab-line.fmt-b, .tab-line b { font-weight: 800; }
.tab-line.fmt-u, .tab-line u { text-decoration: underline; text-underline-offset: 3px; }
.live .tab-line.hl-yellow { background: rgb(242 206 61 / .30); }
.fmt-bar { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; padding: 4px; border: 1px solid var(--line); border-bottom: 0; border-radius: 8px 8px 0 0; background: var(--sunk); }
.fmt-bar + textarea { border-top-left-radius: 0; border-top-right-radius: 0; }
.fmt-bar button { min-width: 34px; height: 32px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); font-size: 14px; padding: 0 8px; }
.fmt-bar .fmt-hl { min-width: 28px; width: 28px; height: 28px; border-radius: 50%; padding: 0; }
.fmt-hl.hl-yellow { background: rgb(242 206 61); } .fmt-hl.hl-green { background: rgb(52 199 89); }
.fmt-hl.hl-pink { background: rgb(255 92 168); } .fmt-hl.hl-blue { background: rgb(64 120 255); }
.fmt-sep { width: 1px; height: 22px; background: var(--line); margin: 0 4px; }
.fmt-tip { font-size: 12px; color: var(--muted); margin-left: auto; }
@media (max-width: 520px) { .fmt-tip { display: none; } }

/* set breaks */
.tape li.set-break { background: none; color: var(--ink); padding: 14px 8px 4px 0; transform: none; counter-reset: s; counter-increment: none; grid-template-columns: 1fr auto; }
.tape li.set-break::before { content: none; }
.set-break-name { text-align: left; background: none; border: 0; padding: 0; font: 800 24px/1 var(--display); text-transform: uppercase; letter-spacing: .03em; color: var(--ink); border-bottom: 3px solid var(--tape); }
.set-break-name small { display: block; font: 600 12px var(--mono); text-transform: none; letter-spacing: 0; color: var(--muted); margin: 4px 0 6px; }
.tape li.set-break .tape-ctl button { background: var(--sunk); color: var(--ink); }
.form-heading { font: 800 18px/1.1 var(--display); text-transform: uppercase; letter-spacing: .03em; border-bottom: 2px solid var(--tape); padding: 6px 0 2px; }

/* monospace text exactly as typed: no ligatures (JetBrains Mono would join "==", "||" and others) */
.tab, .tab-line, textarea.mono, textarea.editor, .live-tab { font-variant-ligatures: none; font-feature-settings: "liga" 0, "calt" 0; }

/* drag to reorder setlists */
.drag-handle { cursor: grab; touch-action: none; font-size: 18px; line-height: 1; }
.drag-on, .drag-on * { cursor: grabbing !important; -webkit-user-select: none; user-select: none; }
.tape li { transition: transform .15s ease; }
.tape li.dragging { transition: none; z-index: 5; position: relative; box-shadow: 0 10px 24px rgb(0 0 0 / .25); opacity: .95; }
.tape li.set-break.dragging { background: var(--surface); }
@media (prefers-reduced-motion: reduce) { .tape li { transition: none; } }

/* images in tabs */
.tab-img { display: block; padding: 6px 12px; margin: 0; border: 0; background: none; cursor: zoom-in; text-align: left; }
.tab-img img { display: block; max-width: min(88vw, 720px); height: auto; border-radius: 6px; border: 1px solid var(--line); background: #fff; }
.live .tab-img img { max-width: min(92vw, 1200px); border-color: var(--l-line); }
.live.side-open .tab-img img { max-width: min(calc(92vw - 320px), 1200px); }
.lightbox { position: fixed; inset: 0; z-index: 40; background: rgb(0 0 0 / .92); display: flex; align-items: center; justify-content: center; overflow: auto; touch-action: pinch-zoom; }
.lightbox img { max-width: 100%; max-height: 100%; object-fit: contain; }
.lightbox-close { position: fixed; top: calc(12px + env(safe-area-inset-top, 0px)); right: 12px; width: 44px; height: 44px; border-radius: 50%; border: 0; background: rgb(255 255 255 / .15); color: #fff; font-size: 18px; }

/* tab maker (Tabs tab) */
.song-tools-l { display: flex; gap: 14px; flex-wrap: wrap; }
.tm-for { max-width: 46ch; }
.tm-opts { display: flex; flex-wrap: wrap; gap: 10px 12px; align-items: end; }
.tm-opts label { display: flex; flex-direction: column; gap: 3px; font-size: 12px; font-weight: 700; color: var(--muted); }
.tm-opts select { border: 1px solid var(--line); background: var(--surface); border-radius: 8px; padding: 8px 10px; font-weight: 400; font-size: 15px; color: var(--ink); }
/* The neck is dark in both themes, like the real thing. */
.tm-neck { --nk-bg: #151a26; --nk-ink: #e7eaf2; --nk-muted: #8a93a8; --nk-string: #59627a; --nk-hl: #8597ff;
  background: var(--nk-bg); border-radius: var(--r); padding: 8px 8px 2px; overflow-x: auto; overscroll-behavior-x: contain; }
.tm-neck-in { display: grid; grid-template-columns: 24px repeat(var(--frets), minmax(34px, 1fr)) 32px; min-width: max-content; }
.tm-nk-name { font: 700 14px/38px var(--mono); color: var(--nk-ink); text-align: center; }
.tm-fret { position: relative; height: 38px; padding: 0; border: 0; border-right: 2px solid #3a4255; background: linear-gradient(var(--nk-string), var(--nk-string)) center / 100% 2px no-repeat;
  color: var(--nk-ink); font: 600 13px var(--mono); }
.tm-fret.nut { border-right: 4px solid #c9b98f; }
.tm-fret.mute { border-right: 0; color: var(--nk-muted); }
.tm-fret:hover { background-color: color-mix(in srgb, var(--nk-hl) 22%, transparent); }
.tm-fret:active { background-color: color-mix(in srgb, var(--nk-hl) 45%, transparent); }
.tm-dot { font: 700 12px/16px var(--body); color: var(--nk-muted); text-align: center; letter-spacing: 2px; }
.tm-tools { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.tm-tools button { min-width: 40px; height: 40px; padding: 0 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--ink); font: 700 16px var(--mono); }
.tm-tools button.txt { font: 700 14px var(--body); }
.tm-tools button[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.tm-tools button:active { background: color-mix(in srgb, var(--accent) 22%, var(--surface)); }
.tm-sep { width: 1px; height: 26px; background: var(--line); margin: 0 4px; }
.tm-stave { background: var(--sunk); border: 1px solid var(--line); border-radius: 8px; padding: 6px 4px 10px; display: flex; flex-direction: column; gap: 8px; overflow-x: auto; }
.tm-sys { display: flex; align-items: stretch; }
.tm-col { position: relative; display: flex; flex-direction: column; padding: 0; border: 0; background: none; color: var(--ink); font: 500 15px/1.5 var(--mono); font-variant-ligatures: none; white-space: pre; text-align: left; }
.tm-col > span { min-height: 1.5em; }
.tm-col .tm-lab { font: 700 12px/1.9 var(--body); color: var(--accent); white-space: nowrap; overflow: visible; width: 0; }
.tm-col.lab { width: 3px; }
.tm-col.lab .tm-lab { position: relative; z-index: 1; cursor: pointer; }
.tm-head { color: var(--muted); padding-left: 6px; }
.tm-col:hover > span:not(.tm-lab) { background: color-mix(in srgb, var(--accent) 12%, transparent); }
.tm-col.cur::after { content: ""; position: absolute; right: -1px; top: 1.6em; bottom: 0; width: 2px; background: var(--accent); border-radius: 1px; animation: tm-blink 1.1s steps(1) infinite; }
@keyframes tm-blink { 50% { opacity: .25; } }
@media (prefers-reduced-motion: reduce) { .tm-col.cur::after { animation: none; } }
.tm-empty { align-self: center; margin-left: 12px; color: var(--muted); font-size: 13px; }
.notes-tab { background: var(--sunk); border: 1px solid var(--line); border-radius: 8px; padding: 8px 12px; overflow-x: auto; margin: 8px 0 0; font: 500 13px/1.45 var(--mono); font-variant-ligatures: none; white-space: pre; color: var(--ink); }
.tm-open { align-self: flex-start; margin: 4px 12px; padding: 3px 12px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--accent); font-size: 12px; font-weight: 700; }
.extra-notes .tm-open { margin: 4px 0 0; }
.live .notes-tab { background: var(--l-tab); border-color: var(--l-line); color: var(--l-ink); font-size: calc(var(--fs) * .85); }

/* a setlist spot's note (">", "(horns)") on the stage screen */
.live-note { font: 800 .7em/1 var(--mono); text-transform: none; color: var(--l-band); white-space: nowrap; vertical-align: .12em; }
.live-items .live-note { font-size: .85em; font-style: normal; }
/* a song opened on a setlist: the same view as the Songs tab, on a plain card under its strip */
.tape li.open { transform: none; }
.tape-song { grid-column: 1 / -1; display: grid; grid-template-columns: minmax(0, 1fr); gap: 6px; min-width: 0; margin: 2px -4px -4px -8px; padding: 10px 12px; border-radius: 6px; background: var(--surface); color: var(--ink); cursor: auto; }
.tape-song .sub { margin: 0; }
/* Fit to screen on the stage screen: pictures shrink with the text, so the whole song can fit */
.live.fit .tab-img img { max-width: min(92vw, calc(var(--fs) * 50)); }
.live.fit.side-open .tab-img img { max-width: min(calc(92vw - 320px), calc(var(--fs) * 50)); }
.live-tools button[aria-pressed="true"] { background: var(--l-band); color: var(--l-band-ink); border-color: var(--l-band); }
@media (max-width: 560px) { .live-tools [data-act="live-fit"] span { display: none; } }

/* ↻ refresh in the header */
.top-right { display: flex; align-items: center; gap: 8px; }
.sync-btn { display: grid; place-items: center; width: 36px; height: 36px; flex: none; border: 1px solid var(--line); border-radius: 10px; background: var(--sunk); color: var(--ink); }
.sync-btn.busy svg { animation: spin .9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .sync-btn.busy svg { animation: none; opacity: .5; } }

/* Marks on songs (the song canvas): drawn by placeMarks() in app.js, over the tab box.
   Colours are stored by name and follow the theme; "black" is the ink colour, so it
   shows on dark screens too. Highlighter sits under the text, pen and text boxes on top. */
:root {
  --mk-black: var(--ink); --mk-red: #d0342c; --mk-blue: #2456d6; --mk-green: #1d8448;
  --mk-hl-yellow: rgb(242 206 61); --mk-hl-pink: rgb(255 92 168); --mk-hl-green: rgb(52 199 89); --mk-hl-blue: rgb(64 120 255);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) { --mk-red: #ff7a70; --mk-blue: #8fb0ff; --mk-green: #5fd38d; }
}
:root[data-theme="dark"] { --mk-red: #ff7a70; --mk-blue: #8fb0ff; --mk-green: #5fd38d; }
.live { --mk-black: var(--l-ink); --mk-red: #ff7a70; --mk-blue: #8fb0ff; --mk-green: #5fd38d; }
.live.stage-light { --mk-red: #d0342c; --mk-blue: #2456d6; --mk-green: #1d8448; }
.tab { position: relative; isolation: isolate; }
.mk-layer { position: absolute; top: 0; left: 0; pointer-events: none; overflow: visible; }
.mk-layer path { fill: none; stroke-linecap: round; stroke-linejoin: round; }
.mk-under { z-index: -1; }
.mk-under path { stroke-opacity: .35; }
.mk-html { width: 0; height: 0; }
.mk-text { position: absolute; margin: 0; font-family: var(--body); font-weight: 700; line-height: 1.25; white-space: pre; }
.mk-text.wrap { white-space: pre-wrap; overflow-wrap: anywhere; }
.mk-changed { opacity: .75; outline: 1.5px dashed currentColor; outline-offset: 3px; border-radius: 2px; }
.mk-flag { position: absolute; transform: translateY(calc(-100% - 4px)); pointer-events: auto; white-space: nowrap;
  font: 700 11px/1.6 var(--body); padding: 0 8px; border-radius: 999px; border: 1px dashed var(--muted); background: var(--surface); color: var(--muted); }
.mk-flag:hover, .mk-flag:focus-visible { color: var(--ink); border-color: var(--ink); }

/* Mark up: drawing on a song. Top bar, the song big, tools fixed at the bottom. */
.markup { min-height: 100vh; min-height: 100dvh; padding: 0 max(12px, env(safe-area-inset-right, 0px)) calc(92px + env(safe-area-inset-bottom, 0px)) max(12px, env(safe-area-inset-left, 0px)); }
.mu-top { position: sticky; top: 0; z-index: 5; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding: calc(10px + env(safe-area-inset-top, 0px)) 0 10px; background: var(--bg); }
.mu-title { font: 800 22px/1.1 var(--display); text-transform: uppercase; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 40vw; }
.mu-status { font-size: 13px; color: var(--muted); }
.mu-status.bad { color: var(--out); font-weight: 700; }
.mu-right { margin-left: auto; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.mu-font { border: 1px solid var(--line); background: var(--surface); border-radius: 8px; padding: 4px 10px; font-weight: 700; }
.mu-song .tab { overflow-x: auto; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
.mu-song .tab-line, .mu-song .cue { font-size: var(--mfs); cursor: crosshair; }
.mu-song .tab-line:hover { background: none; }
.mu-song.tool-eraser .tab-line { cursor: cell; }
/* Drawing tools take the finger (unless only the pen draws); Move and Text let it scroll. */
.markup .mu-song [data-marks] { touch-action: pan-x pan-y pinch-zoom; }
.markup:not(.pencil) .mu-song:is(.tool-pen, .tool-hl, .tool-eraser) [data-marks] { touch-action: none; }
.mu-song.tool-move .tab-line, .mu-song.tool-move .cue { cursor: default; }
.mu-song.tool-text .tab-line, .mu-song.tool-text .cue { cursor: text; }
.mu-bar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 6; display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 14px;
  padding: 8px 10px calc(8px + env(safe-area-inset-bottom, 0px)); background: var(--surface); border-top: 1px solid var(--line); box-shadow: 0 -4px 16px rgb(0 0 0 / .08); }
.mu-group { display: flex; align-items: center; gap: 4px; }
.mu-bar button { border: 1px solid transparent; background: none; border-radius: 10px; min-width: 40px; min-height: 40px; padding: 2px 8px; font-size: 18px; line-height: 1; }
.mu-bar button:disabled { opacity: .35; cursor: default; }
.mu-group > button[aria-pressed="true"] { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 12%, transparent); }
.mu-tool { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.mu-tool small { font-size: 10px; font-weight: 700; color: var(--muted); }
.mu-dot i { display: block; width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--surface); box-shadow: 0 0 0 1px var(--line); }
.mu-size i { display: block; width: 22px; border-radius: 4px; background: var(--ink); }
.mu-size i.thin { height: 3px; } .mu-size i.thick { height: 8px; }
.mu-bar .mu-who button { min-height: 34px; min-width: 0; font-size: 13px; padding: 4px 12px; border: 0; border-radius: 999px; }
.mu-bar .mu-who button[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); }
.mk-ink path { fill: none; stroke-linecap: round; stroke-linejoin: round; }
.mu-hint { align-self: center; font-size: 13px; color: var(--muted); }
.mu-a { font: 800 14px/1 var(--body); } .mu-a.thick { font-size: 22px; }
/* Move: the selected mark, its buttons and the resize corner. */
.mk-selwrap { width: 0; height: 0; }
.mk-sel { position: absolute; border: 1.5px dashed var(--accent); border-radius: 6px; }
.mk-sel.personal { border-color: var(--muted); }
.mk-selbar { position: absolute; display: flex; gap: 4px; pointer-events: auto; white-space: nowrap; padding: 3px; border-radius: 10px;
  background: var(--surface); border: 1px solid var(--line); box-shadow: 0 4px 14px rgb(0 0 0 / .14); }
.mk-selbar button, .mk-selbar .mk-who { font: 700 13px/1 var(--body); padding: 7px 10px; border-radius: 7px; border: 0; background: none; color: var(--ink); }
.mk-selbar button:hover { background: var(--sunk); }
.mk-selbar .mk-who { color: var(--muted); }
.mk-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; vertical-align: 1px; border: 1.5px solid var(--muted); }
.mk-dot.band { background: var(--accent); border-color: var(--accent); }
.mk-selbar .danger-text { color: var(--out); }
.mk-handle { position: absolute; width: 22px; height: 22px; margin: -11px 0 0 -11px; border-radius: 50%; pointer-events: auto; cursor: nwse-resize; touch-action: none;
  background: var(--surface); border: 2px solid var(--accent); }
/* Typing a text box on the song. */
.mk-editor { position: absolute; z-index: 3; margin: 0; padding: 0 2px; border: 1.5px dashed var(--accent); border-radius: 4px; resize: none; overflow: hidden;
  background: color-mix(in srgb, var(--surface) 85%, transparent); font-family: var(--body); font-weight: 700; line-height: 1.25; white-space: pre; outline: none; -webkit-user-select: text; user-select: text; }
.mk-ink.mk-under path { stroke-opacity: .35; }

/* Print or save as PDF: a setlist, then each song on its own page. Always black on white. */
#print { display: none; }
@media print {
  @page { margin: 14mm; }
  body > :not(#print) { display: none !important; }
  html, body { background: #fff !important; }
  #print {
    display: block; color: #000; font: 11pt/1.4 var(--body);
    --ink: #000; --muted: #444; --sunk: #fff; --surface: #fff; --line: #bbb; --cue: #b3261e; --accent: #2B44D6; --bg: #fff;
  }
  #print h1, #print h2 { font: 800 26pt/1 var(--display); text-transform: uppercase; margin: 0 0 4pt; }
  #print h2 { font-size: 20pt; }
  #print h3 { font: 800 14pt/1 var(--display); text-transform: uppercase; margin: 14pt 0 4pt; border-bottom: 1pt solid #000; padding-bottom: 2pt; }
  #print .p-meta { color: #444; margin: 0 0 10pt; font-size: 10pt; }
  #print .p-list ol { margin: 0; padding-left: 22pt; }
  #print .p-list li { font-size: 14pt; padding: 2pt 0; break-inside: avoid; }
  #print .p-list li em { font-style: normal; color: #b3261e; font-weight: 700; }
  #print .p-list li small { margin-left: 8pt; font: 500 9pt var(--mono); color: #444; }
  #print .p-song { break-before: page; }
  #print .tab { overflow: visible; border: 0; padding: 0; background: none; }
  #print .tab-line { font-size: 9.5pt; min-width: 0; padding: 0; }
  #print .cue { break-inside: avoid; }
  #print .tab-img { padding: 4pt 0; }
  #print .tab-img img { max-width: 100%; max-height: 240mm; border: 0; }
  #print .tab.tab-cols { gap: 0 18pt; }
  #print .p-notes { margin-top: 10pt; }
  #print .song-notes { color: #000; font-size: 10.5pt; }
  #print .notes-tab { border: 0; padding: 0; background: none; overflow: visible; font-size: 9.5pt; }
  #print [class*="hl-"] { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

/* iPad: Safari blurs the top edge of the page, so the sticky top bars get a little more room there. */
@media (pointer: coarse) and (min-width: 700px) {
  .top-in { padding-top: 28px; }
  .select-bar { top: 112px; }
  .live-top { padding-top: calc(24px + env(safe-area-inset-top, 0px)); }
  .live-side { padding-top: calc(26px + env(safe-area-inset-top, 0px)); }
  .mu-top { padding-top: calc(26px + env(safe-area-inset-top, 0px)); }
  .lightbox-close { top: calc(28px + env(safe-area-inset-top, 0px)); }
}

/* ---------- song pages (docs/plan-song-canvas.md, version 2) ---------- */
/* The page is 800px wide at full size and scaled to its box by sizePages(); every
   position on it comes from page-layout.js, so text never wraps by itself here. */
.pg-wrap { position: relative; overflow: hidden; overflow: clip; touch-action: pan-x pan-y; } /* pinch zooms the page, not the app (app.js) */
.pg-wrap.pg-scroll { overflow-x: auto; overflow-y: hidden; } /* only a page zoomed wider than its box scrolls sideways (pgScale) */
.pg { position: absolute; top: 0; left: 0; width: 800px; /* wider pages set their own */ transform-origin: 0 0; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; color: var(--ink); }
.pg-block { position: absolute; }
.pg-text { position: absolute; }
.pg-line { position: absolute; left: 0; right: 0; margin: 0; white-space: pre; overflow: visible; font-family: var(--mono); font-weight: 500; tab-size: 1; font-variant-ligatures: none; font-feature-settings: "liga" 0, "calt" 0; }
.pg-line.hl-yellow { background: rgb(242 206 61 / .38); }
.pg-line.hl-green { background: rgb(52 199 89 / .28); }
.pg-line.hl-pink { background: rgb(255 92 168 / .26); }
.pg-line.hl-blue { background: rgb(64 120 255 / .26); }
.pg-line.fmt-b, .pg-line b { font-weight: 800; }
.pg-line.fmt-u, .pg-line u { text-decoration: underline; text-underline-offset: 3px; }
.pg-img { position: absolute; left: 0; padding: 0; border: 0; background: none; }
.pg-img img { display: block; width: 100%; height: 100%; object-fit: contain; border-radius: 4px; }
.pg-break { position: absolute; left: 0; right: 0; border-top: 2px dashed var(--muted); opacity: .6; pointer-events: none; }
.pg-break span { position: absolute; right: 8px; top: 2px; font: 600 11px var(--mono); color: var(--muted); text-transform: uppercase; letter-spacing: .08em; }
.pg-wait { padding: 24px; border: 1px dashed var(--line); border-radius: 8px; color: var(--muted); }
.pg-wait p { margin: 0; }
.live .pg { background: none; border-color: transparent; color: var(--l-ink); }
.live .pg-line.hl-yellow { background: rgb(242 206 61 / .30); }
.live .pg-wait { border-color: var(--l-line); color: var(--l-muted); }

/* ---------- Notebook ---------- */
main.nb-view { max-width: 1400px; padding-top: 12px; }
.nb { display: block; }
.nb-side { position: fixed; top: 0; bottom: 0; left: 0; z-index: 8; width: min(85vw, 300px); display: flex; flex-direction: column; gap: 8px;
  background: var(--surface); border-right: 1px solid var(--line);
  padding: calc(10px + env(safe-area-inset-top, 0px)) 10px calc(10px + env(safe-area-inset-bottom, 0px)) max(10px, env(safe-area-inset-left, 0px));
  --l-ink: var(--ink); --l-muted: var(--muted); --l-line: var(--line); --l-field: var(--bg); --l-hover: var(--sunk); --l-tape: var(--tape); --l-tape-ink: var(--tape-ink); --l-title: var(--accent); --l-panel: var(--surface); }
.nb-side[hidden] { display: none; }
.nb-side .live-items, .nb-secs { min-height: 0; } /* a flex child only scrolls when it may shrink; else the last songs fall off the end */
.nb-side .live-items { padding-bottom: 8px; }
/* the end of the list doesn't hand the scroll on to the page (which moved the docked list and stalled it) */
.nb-side .live-items, .nb-side .nb-secs { overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
.nb-zoom { display: inline-flex; gap: 2px; }
.nb-zoom .btn { min-width: 38px; padding: 6px 8px; font: 600 14px var(--mono); }
.nb-zoom .btn:disabled { opacity: .55; cursor: default; }
.nb-scrim { position: fixed; inset: 0; z-index: 7; background: rgba(0, 0, 0, .45); }
.nb-side-head { display: flex; align-items: center; gap: 8px; }
.nb-sec-btn { flex: 1; min-width: 0; display: flex; align-items: center; justify-content: space-between; gap: 8px; text-align: left; padding: 8px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); }
.nb-sec-btn b { font: 800 18px/1.1 var(--display); text-transform: uppercase; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nb-fold { width: 40px; height: 40px; flex: none; border: 1px solid var(--line); border-radius: 8px; background: none; font-size: 20px; }
.nb-side .live-search { color: var(--ink); }
.nb-side .live-items li button { color: var(--ink); }
.nb-side .live-items li button[aria-current="true"], .nb-side .live-items li button[aria-current="true"] span, .nb-side .live-items li button[aria-current="true"] small { color: var(--tape-ink); }
.nb-secs { list-style: none; margin: 0; padding: 0; overflow-y: auto; flex: 1; display: flex; flex-direction: column; gap: 2px; }
.nb-secs button { width: 100%; text-align: left; padding: 9px 10px; border: 0; border-radius: 8px; background: none; font: 700 15px/1.25 var(--body); color: var(--ink); }
.nb-secs button small { display: block; font: 500 12px var(--mono); color: var(--muted); }
.nb-secs button:hover { background: var(--sunk); }
.nb-secs .nb-sec-new { margin-top: 10px; }
.nb-secs .nb-sec-new button { text-align: center; border: 1px solid var(--line); font-weight: 700; }
.nb-edit .section-head { margin-top: 4px; }
.nb-secs button[aria-current="true"] { background: var(--tape); color: var(--tape-ink); }
.nb-secs button[aria-current="true"] small { color: var(--tape-ink); }
.nb-sec-h { font: 800 12px var(--mono); text-transform: uppercase; letter-spacing: .08em; color: var(--muted); padding: 12px 10px 2px; }
.nb-main { min-width: 0; display: flex; flex-direction: column; gap: 14px; }
.nb-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.nb-where { flex: 1; min-width: 0; font: 600 13px var(--mono); color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nb-where b { color: var(--ink); }
.nb-set { font-family: var(--body); font-weight: 700; color: var(--ink); margin-right: 6px; }
.nb-bar-r { display: flex; gap: 6px; flex: none; }
.nb-step { width: 40px; padding: 6px 0; font-size: 18px; line-height: 1; }
.nb-step:disabled { opacity: .35; }
.nb-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.nb-title h2 { font: 800 32px/1 var(--display); text-transform: uppercase; margin: 0; letter-spacing: .01em; overflow-wrap: anywhere; }
.nb-specs { margin: 6px 0 0; font: 500 13px var(--mono); color: var(--muted); display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.nb-specs b { color: var(--ink); }
.nb-head-r { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.nb-old { margin: 0; }
.nb-foot { display: flex; justify-content: space-between; gap: 12px; border-top: 1px solid var(--line); padding-top: 12px; }
.nb-nav { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; max-width: 48%; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); padding: 8px 14px; text-align: left; }
.nb-nav.next { align-items: flex-end; text-align: right; margin-left: auto; }
.nb-nav span { font: 600 11px var(--mono); text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.nb-nav b { font: 800 18px/1.1 var(--display); text-transform: uppercase; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
@media (max-width: 520px) { .nb-listbtn span { display: none; } .nb-title h2 { font-size: 26px; } }
@media (min-width: 900px) {
  .nb.side-open { display: grid; grid-template-columns: 280px minmax(0, 1fr); gap: 24px; align-items: start; }
  .nb.side-open .nb-side { position: sticky; top: calc(var(--top-h, 100px) + 12px); bottom: auto; left: auto; z-index: 1; width: auto;
    max-height: calc(100vh - var(--top-h, 100px) - 24px); max-height: calc(100dvh - var(--top-h, 100px) - 24px); border: 1px solid var(--line); border-radius: 12px; padding: 10px; }
  /* app.js nbSideFit() trims this to what's on screen, above the drawing tools */
}

/* ---------- drawing on the page (phase 4) ---------- */
.pg { isolation: isolate; } /* the highlighter layer sits under the text but over the paper */
.pg-draw .pg { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; touch-action: pan-x pan-y; cursor: crosshair; }
.pg-draw:not(.pencil):is(.tool-pen, .tool-hl, .tool-eraser) .pg { touch-action: none; }
.pg-draw.tool-move .pg { cursor: default; }
.pg-draw.tool-text .pg { cursor: text; }
.pg-draw.tool-eraser .pg { cursor: cell; }
.pg .mk-editor { font-family: var(--body); font-weight: 700; line-height: 1.25; }
.nb.has-bar { padding-bottom: 130px; }
.pg-bar { align-items: center; }
.pg-bar.just-me { box-shadow: inset 0 4px 0 var(--tape); }
.pg-bar .switch { min-height: 40px; font-size: 13px; padding: 0 6px; }
.pg-bar .switch[aria-checked="true"] .knob { background: var(--accent); }
.pg-bar .switch[data-act="pg-justme"][aria-checked="true"] .knob { background: var(--tape); }
.pg-switches { flex-wrap: wrap; gap: 2px 10px; }
.pg-bar .pg-close { font-size: 16px; color: var(--muted); }
.pg-fab { position: fixed; right: max(16px, env(safe-area-inset-right, 0px)); bottom: calc(16px + env(safe-area-inset-bottom, 0px)); z-index: 6; width: 56px; height: 56px;
  border-radius: 50%; border: 0; background: var(--accent); color: var(--accent-ink); font-size: 24px; box-shadow: 0 4px 14px rgb(0 0 0 / .25); }
@media (max-width: 520px) {
  .pg-bar { gap: 2px 6px; padding-top: 6px; }
  .pg-bar .mu-tool small { display: none; }
  .pg-bar button { min-width: 36px; min-height: 36px; }
  .pg-bar .switch { font-size: 12px; min-height: 32px; gap: 5px; }
  .pg-bar .switch .knob { width: 30px; height: 18px; }
  .pg-bar .switch .knob::after { width: 14px; height: 14px; }
  .pg-bar .switch[aria-checked="true"] .knob::after { transform: translateX(12px); }
  .nb.has-bar { padding-bottom: 150px; }
}

/* ---------- editing text on the page (phase 5) ---------- */
.pg-draw.tool-break .pg { cursor: row-resize; }
.pb-sel { position: absolute; border: 2px dashed var(--accent); border-radius: 4px; pointer-events: none; }
.pb-bar .pb-grip { cursor: move; touch-action: none; font-size: 16px; background: var(--sunk); }
.pb-wide { position: absolute; width: 16px; height: 44px; border-radius: 8px; background: var(--accent); border: 2px solid var(--surface);
  pointer-events: auto; touch-action: none; cursor: ew-resize; box-shadow: 0 1px 4px rgb(0 0 0 / .25); }
.pb-fixbar { position: fixed; top: calc(var(--top-h, 0px) + 8px); left: 50%; transform: translateX(-50%); z-index: 6; flex-wrap: wrap; justify-content: center;
  max-width: calc(100vw - 16px); background: var(--surface); border: 1px solid var(--line); box-shadow: 0 6px 20px rgb(0 0 0 / .25); }
body.live-on .pb-fixbar { display: none; }
.pb-fixbar button { padding: 7px 8px; }
/* the selected block takes the drag (fingers too, unless the Pencil draws and fingers scroll) */
.pg-draw.tool-move:not(.pencil) .pb-sel { pointer-events: auto; touch-action: none; cursor: move; }
.pg-draw.tool-move .pb-sel { cursor: move; }
.pb-bar .pb-ask { padding: 0 8px; font-weight: 700; white-space: nowrap; }
.pg-wrap.pb-on { overflow: visible; }
.pb-edit { position: absolute; z-index: 4; /* under the sticky header (5) */ background: var(--surface); border-radius: 4px; box-shadow: 0 0 0 2px var(--accent), 0 8px 28px rgb(0 0 0 / .2); }
.pb-edit .pb-ta { display: block; width: 100%; min-height: 0; margin: 0; border: 0; border-radius: 4px; outline: 0; resize: none; overflow: hidden; background: transparent;
  color: var(--ink); font-family: var(--mono); font-weight: 500; line-height: 1.5; white-space: pre-wrap; word-break: break-all; overflow-wrap: anywhere; tab-size: 1; box-shadow: none; }
.pb-tools { position: fixed; left: 0; right: 0; top: var(--top-h, 0px); z-index: 40; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px;
  padding: 8px max(12px, env(safe-area-inset-right, 0px)) 8px max(12px, env(safe-area-inset-left, 0px)); background: var(--surface); border-bottom: 1px solid var(--line); box-shadow: 0 4px 16px rgb(0 0 0 / .12); }
.pb-tools .fmt-bar { border: 0; background: none; padding: 0; border-radius: 0; }
.pb-status { flex: 1 1 160px; min-width: 0; font-size: 13px; color: var(--muted); }
.pb-status .link { font-size: 13px; }
.pb-btns { display: flex; gap: 6px; margin-left: auto; }
.pg-break .pg-unbreak { position: absolute; right: 112px; top: 0; pointer-events: auto; width: 28px; height: 28px; padding: 0; border-radius: 50%;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink); font-size: 13px; transform: translateY(-50%) scale(var(--ik, 1)); transform-origin: center; }
.pg-hint { position: absolute; left: 24px; right: 24px; top: 20px; margin: 0; color: var(--muted); font-size: 18px; line-height: 1.5; pointer-events: none; }
.nb-new { margin-top: 8px; width: 100%; }
.banner.nb-old { margin: 8px 0 12px; }

.add-row .set-del { margin-left: auto; }

/* ---------- metronome (next to a song's title) ---------- */
/* Small and quiet: a pendulum swinging at the song's BPM (--swing, set every frame),
   or the logo with its bars bouncing on the beat (--hit: 1 on the beat, fading). */
.metro { --swing: 0deg; --hit: 0; display: inline-flex; vertical-align: middle; margin: 0 0 .12em .35em; padding: 0; border: 0; background: none; cursor: pointer;
  height: .78em; width: .7em; color: var(--muted); -webkit-touch-callout: none; -webkit-user-select: none; user-select: none; touch-action: manipulation; position: relative; }
.metro::before { content: ''; position: absolute; inset: -10px; } /* a bigger target for a finger */
.metro svg { width: 100%; height: 100%; overflow: visible; }
.metro-body { fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linejoin: round; opacity: .55; }
.metro-arm { transform: rotate(var(--swing)); transform-origin: 12px 25px; transform-box: view-box; stroke: var(--accent); stroke-width: 1.6; stroke-linecap: round; }
.metro-bob { fill: var(--accent); stroke: none; opacity: calc(.55 + .45 * var(--hit)); }
.metro-logo { width: .7em; }
.metro-pick { fill: var(--accent); opacity: .35; }
.metro-bar { fill: var(--accent); transform-box: fill-box; transform-origin: center; transform: scaleY(calc(.5 + .5 * var(--hit))); }
.metro.stopped { opacity: .4; }
.metro:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }
.live .metro { color: var(--l-muted); }
.live .metro-arm { stroke: var(--l-band); }
.live .metro-bob, .live .metro-bar, .live .metro-pick { fill: var(--l-band); }
/* No swinging or bouncing when the device asks for less motion: the beat is a gentle fade. */
@media (prefers-reduced-motion: reduce) {
  .metro-arm { transform: none; }
  .metro-bar { transform: none; opacity: calc(.35 + .65 * var(--hit)); }
}
