/* Shared styles. The band's colour (--brand, set by applyBrand() in common.js; yellow by default) on black,
   which is also the easiest to read outside at night.
   Text size is set on <html> (data-size) so everything sized in rem grows with it. */
:root {
  --bg: #0b0b0b; --panel: #191919; --panel-2: #242424; --line: #3a3a3a;
  --text: #ffffff; --muted: #cfcfcf; --accent: var(--brand, #ffe500); --accent-ink: var(--brand-ink, #000);
  --accent-text: var(--brand-on-dark, #ffe500); --red: #d7263d; --red-ink: #fff; --green: #2fa35a; --green-ink: #fff;
  --chorus: var(--chorus-dark, #fff4a3); --radius: 14px; --shadow: 0 2px 10px rgb(0 0 0 / .4);
  color-scheme: dark;
  font-size: 20px;
}
:root[data-size="large"] { font-size: 24px; }
:root[data-size="xl"] { font-size: 29px; }
:root[data-theme="light"] {
  --bg: #fffdf4; --panel: #ffffff; --panel-2: #f3f0e2; --line: #cfc9b0;
  --text: #111; --muted: #3d3d3d;
  --accent-text: var(--brand-on-light, #000); --chorus: var(--chorus-light, #5a4a00); --shadow: 0 2px 8px rgb(0 0 0 / .12);
  color-scheme: light;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); }
body { font-family: var(--font, system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif); line-height: 1.45; -webkit-text-size-adjust: 100%; }
img { max-width: 100%; }
a { color: var(--accent-text); }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .5rem; }
h1 { font-size: 1.6rem; } h2 { font-size: 1.3rem; } h3 { font-size: 1.1rem; }
p { margin: 0 0 .8rem; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.hidden, [hidden] { display: none !important; }
.wrap { max-width: 720px; margin: 0 auto; padding: 0 16px; }
:focus-visible { outline: 4px solid var(--accent); outline-offset: 2px; }

/* ----- header ----- */
.top { position: sticky; top: 0; z-index: 20; background: var(--bg); border-bottom: 2px solid var(--accent); }
.top .wrap { display: flex; align-items: center; gap: 10px; min-height: 64px; }
.top .logo { height: 46px; width: auto; }
.top .name { flex: 1; font-weight: 800; font-size: 1rem; line-height: 1.15; color: var(--text); text-decoration: none; min-width: 0; }
.top .name small { display: block; font-weight: 500; font-size: .75rem; color: var(--muted); }
.icon-btn { min-width: 52px; min-height: 52px; border-radius: 12px; border: 2px solid var(--line); background: var(--panel);
  color: var(--text); font: inherit; font-weight: 800; font-size: 1rem; cursor: pointer; padding: 0 10px; }
.top.sub .name { display: none; }
.top .home { display: flex; flex: none; padding: 6px 10px; margin: -6px -10px; -webkit-tap-highlight-color: transparent; }
.top.sub .home { margin: 0 auto; }
.back { display: inline-flex; align-items: center; gap: 6px; min-height: 52px; padding: 0 16px 0 10px; border-radius: 12px;
  border: 2px solid var(--line); background: var(--panel); color: var(--text); font: inherit; font-weight: 700; cursor: pointer; }

/* ----- buttons ----- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .5rem; min-height: 56px; padding: .5rem 1.1rem;
  border-radius: var(--radius); border: 2px solid transparent; background: var(--accent); color: var(--accent-ink);
  font: inherit; font-weight: 800; text-decoration: none; cursor: pointer; text-align: center; }
.btn.secondary { background: var(--panel-2); color: var(--text); border-color: var(--line); }
.btn.danger { background: var(--red); color: var(--red-ink); }
.btn.go { background: var(--green); color: var(--green-ink); }
.btn.block { display: flex; width: 100%; }
.btn.small { min-height: 44px; font-size: .85rem; padding: .3rem .8rem; }
.btn:disabled { opacity: .5; cursor: default; }
.row { display: flex; gap: 10px; flex-wrap: wrap; }
.row > .btn { flex: 1 1 auto; }

/* The home page's big buttons: one job each, icon + plain words. */
.menu { display: grid; gap: 14px; margin: 18px 0 28px; }
.menu a { display: flex; align-items: center; gap: 16px; min-height: 88px; padding: 14px 18px; border-radius: 18px;
  background: var(--panel); border: 2px solid var(--line); color: var(--text); text-decoration: none; box-shadow: var(--shadow); }
.menu a .ico { font-size: 2.1rem; width: 2.6rem; text-align: center; flex: none; }
.menu a b { display: block; font-size: 1.15rem; }
.menu a span.sub { display: block; color: var(--muted); font-size: .85rem; }
.menu a.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.menu a.primary span.sub { color: var(--accent-ink); opacity: .8; }
.menu a.give { border-color: var(--red); }

/* ----- cards and lists ----- */
.card { background: var(--panel); border: 2px solid var(--line); border-radius: 18px; padding: 16px; margin: 0 0 14px; }
.card.now { border-color: var(--accent); }
.tag { display: inline-block; font-size: .75rem; font-weight: 800; letter-spacing: .04em; text-transform: uppercase;
  background: var(--accent); color: var(--accent-ink); border-radius: 8px; padding: 2px 8px; }
.tag.red { background: var(--red); color: #fff; } .tag.grey { background: var(--panel-2); color: var(--text); }
.banner { background: var(--accent); color: var(--accent-ink); font-weight: 700; padding: 12px 16px; border-radius: 14px; margin: 14px 0; }
.list { list-style: none; margin: 0; padding: 0; }
.list > li { border-bottom: 1px solid var(--line); }
.list .item { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 64px; padding: 10px 4px; background: none; border: 0;
  color: var(--text); font: inherit; text-align: left; text-decoration: none; cursor: pointer; }
.list .item .t { flex: 1; font-weight: 700; }
.list .item .t small { display: block; font-weight: 400; color: var(--muted); font-size: .8rem; }
.list .item .num { min-width: 2.2rem; color: var(--muted); font-weight: 700; text-align: right; }
.chev { color: var(--muted); font-size: 1.3rem; }
.search { width: 100%; min-height: 56px; padding: 10px 16px; border-radius: 14px; border: 2px solid var(--line); background: var(--panel);
  color: var(--text); font: inherit; margin: 6px 0 10px; }

/* ----- lyrics ----- */
.lyrics { padding-bottom: 30px; }
.lyrics h1 { font-size: 1.7rem; margin-top: 14px; }
.lyrics .credit { color: var(--muted); font-size: .85rem; margin-bottom: 18px; }
.block { position: relative; margin: 0 0 1.3rem; padding: 4px 0 4px 2.1rem; font-size: 1.15rem; line-height: 1.5; white-space: pre-line; border-radius: 10px; }
.block .vn { position: absolute; left: 0; top: 4px; width: 1.6rem; text-align: right; color: var(--accent-text); font-weight: 800; }
.block.chorus { font-style: italic; color: var(--chorus); border-left: 4px solid var(--accent); padding-left: calc(2.1rem - 4px); }
.block.current { background: var(--panel-2); outline: 3px solid var(--accent); outline-offset: 4px; }
.block.current::before { content: "Singing now"; position: absolute; top: -1.35rem; right: 0; font-size: .7rem; font-style: normal; font-weight: 800;
  text-transform: uppercase; background: var(--accent); color: var(--accent-ink); padding: 1px 8px; border-radius: 6px; }
.notes { background: var(--panel); border-radius: 14px; padding: 12px 14px; color: var(--muted); font-size: .9rem; }

/* ----- now playing bar (bottom of every audience page) ----- */
.nowbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; background: var(--accent); color: var(--accent-ink); box-shadow: 0 -4px 14px rgb(0 0 0 / .35); }
.nowbar a { display: flex; align-items: center; gap: 12px; padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); color: inherit; text-decoration: none; max-width: 720px; margin: 0 auto; }
.nowbar .ico { font-size: 1.6rem; }
.nowbar .t { flex: 1; min-width: 0; }
.nowbar .t small { display: block; font-size: .75rem; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; }
.nowbar .t b { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nowbar .go { background: var(--accent-ink); color: var(--accent); border-radius: 10px; padding: 8px 12px; font-weight: 800; white-space: nowrap; }
body.has-nowbar main { padding-bottom: 110px; }

/* ----- votes ----- */
.choice { position: relative; display: block; width: 100%; margin: 0 0 12px; padding: 16px; min-height: 72px; border-radius: 16px; overflow: hidden;
  border: 2px solid var(--line); background: var(--panel); color: var(--text); font: inherit; text-align: left; cursor: pointer; }
.choice .bar { position: absolute; inset: 0 auto 0 0; background: var(--panel-2); transition: width .6s; }
.choice .in { position: relative; display: flex; align-items: center; gap: 10px; }
.choice .in b { flex: 1; }
.choice .pc { font-weight: 800; color: var(--accent-text); }
.choice.mine { border-color: var(--accent); }
.choice.mine .in b::after { content: "  ✓ Your vote"; color: var(--accent-text); font-size: .8rem; }

/* ----- dialogs ----- */
dialog { border: 0; border-radius: 20px; padding: 0; width: min(560px, calc(100vw - 24px)); background: var(--panel); color: var(--text); box-shadow: 0 10px 40px rgb(0 0 0 / .6); }
dialog::backdrop { background: rgb(0 0 0 / .65); }
dialog .in { padding: 20px; }
dialog h2 { margin-bottom: 12px; }
label.f { display: block; font-weight: 700; margin: 12px 0 4px; }
label.f small { font-weight: 400; color: var(--muted); }
input[type=text], input[type=password], input[type=email], input[type=url], input[type=number], input[type=date], input[type=time], input[type=tel], select, textarea {
  width: 100%; min-height: 54px; padding: 10px 14px; border-radius: 12px; border: 2px solid var(--line); background: var(--bg);
  color: var(--text); font: inherit; }
textarea { min-height: 120px; resize: vertical; }
.check { display: flex; align-items: center; gap: 10px; min-height: 48px; font-weight: 600; cursor: pointer; }
.check input { width: 26px; height: 26px; accent-color: var(--accent); flex: none; }
.seg { display: flex; border: 2px solid var(--line); border-radius: 14px; overflow: hidden; }
.seg button { flex: 1; min-height: 52px; border: 0; background: var(--panel); color: var(--text); font: inherit; font-weight: 700; cursor: pointer; }
.seg button[aria-pressed=true] { background: var(--accent); color: var(--accent-ink); }
.seg button + button { border-left: 2px solid var(--line); }

.toast { position: fixed; left: 16px; right: 16px; top: 80px; margin: 0 auto; width: fit-content; text-align: center; z-index: 50; background: var(--green); color: #fff; padding: 14px 20px;
  border-radius: 14px; font-weight: 800; box-shadow: var(--shadow); max-width: calc(100vw - 32px); }
.toast.err { background: var(--red); }
.thanks { text-align: center; padding: 10px 0; }
.thanks .big { font-size: 3rem; }

/* ----- band ----- */
.people { display: grid; gap: 12px; }
.person { display: flex; gap: 14px; align-items: flex-start; }
.person .pic { width: 84px; height: 84px; border-radius: 50%; object-fit: cover; flex: none; background: var(--panel-2); display: grid; place-items: center;
  font-weight: 800; font-size: 1.4rem; color: var(--accent-text); border: 3px solid var(--accent); }
.person b { display: block; font-size: 1.05rem; }
.person .ins { color: var(--accent-text); font-weight: 700; font-size: .9rem; }
.person p { margin: 4px 0 0; font-size: .9rem; color: var(--muted); }
.section-h { margin: 22px 0 10px; font-size: .9rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }

/* ----- programme ----- */
.prog { list-style: none; padding: 0; margin: 0; }
.prog li { border: 2px solid var(--line); background: var(--panel); border-radius: 16px; padding: 14px 16px; margin-bottom: 12px; }
.prog li.now { border-color: var(--accent); }
.prog li.interval { background: none; border-style: dashed; text-align: center; }
.prog .who { color: var(--muted); font-size: .9rem; }
.prog .n { color: var(--accent-text); font-weight: 800; margin-right: 6px; }
.prog p { margin: 8px 0 0; font-size: .95rem; }
.prog .btn { margin-top: 10px; }

footer.foot { text-align: center; color: var(--muted); font-size: .8rem; padding: 26px 16px 40px; }
.hero { text-align: center; padding: 18px 0 4px; }
.hero img { width: 150px; height: auto; aspect-ratio: auto; }
.hero h1 { margin-top: 8px; }
.empty { text-align: center; color: var(--muted); padding: 30px 10px; }

.back-at { font-size: 1.6rem; font-weight: 800; color: var(--accent-text); margin: 6px 0; }

.list-h { font-size: .8rem; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); padding: 18px 4px 6px; border-bottom: 2px solid var(--line) !important; }
#app:focus { outline: none; } /* focused on page change for screen readers; not a control */

/* Choose verses window (conductor, street mode) */
.verse-pick { align-items: flex-start; padding: 8px 0; border-bottom: 1px solid var(--line); }
.verse-pick span { display: flex; flex-direction: column; min-width: 0; }
.verse-pick small { color: var(--muted); font-weight: 400; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.verses-note { font-weight: 700; color: var(--accent-text); margin: 0 0 12px; }
.list-note { color: var(--muted); font-size: .9rem; padding: 8px 4px 10px; }

/* Report a problem */
.notice { border-style: dashed; }
.notice p { margin: 0 0 10px; }
.report-link { text-align: center; margin: 24px 0 8px; }
.linkish { background: none; border: 0; color: var(--accent-text); font: inherit; font-size: .9rem; text-decoration: underline; cursor: pointer; padding: 8px; }
.err-text { color: #ff8a8a; font-weight: 700; min-height: 1.2em; margin: 8px 0 0; }
:root[data-theme="light"] .err-text { color: #b00020; }

/* QR codes, with the band's logo in the middle when switched on */
.qr-code { position: relative; display: inline-block; line-height: 0; }
.qr-code .qr-img { width: 100%; height: 100%; }
.qr-code .qr-logo { position: absolute; left: 50%; top: 50%; width: 24%; height: 24%; transform: translate(-50%, -50%); object-fit: contain;
  background: #fff; padding: 2%; border-radius: 12%; }

/* "Nothing requested yet": a gentle pulse so people notice they can ask for one */
.nobody-asked { display: flex; align-items: center; gap: 14px; text-decoration: none; background: var(--accent); color: var(--accent-ink);
  border-radius: 18px; padding: 14px 18px; margin: 14px 0; font-weight: 800; animation: pulse 1.6s ease-in-out infinite; }
.nobody-asked .ico { font-size: 2rem; }
.nobody-asked small { display: block; font-weight: 600; opacity: .85; }
@keyframes pulse { 0%, 100% { transform: scale(1); box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 70%, transparent); } 50% { transform: scale(1.02); box-shadow: 0 0 0 10px transparent; } }
@media (prefers-reduced-motion: reduce) { .nobody-asked { animation: none; } }
.priv-link { color: var(--muted); }
/* A switch with long labels: one option per line */
.seg.seg-stack { flex-direction: column; }
.seg.seg-stack button + button { border-left: 0; border-top: 2px solid var(--line); }
.decline-dlg .reasons { display: grid; gap: 8px; }
.decline-dlg .reasons .btn { min-height: 52px; font-size: .95rem; justify-content: flex-start; text-align: left; }
.decline-dlg { max-height: calc(100dvh - 24px); overflow-y: auto; }
.reply { display: block; font-size: .85rem; color: var(--muted); font-weight: 400; }
.declined-dlg .said { font-size: 1.2rem; font-weight: 700; margin: 8px 0 0; color: var(--accent-text); }
.yours { position: fixed; left: 12px; right: 12px; top: 74px; z-index: 60; margin: 0 auto; max-width: 600px; display: flex; gap: 14px; align-items: center; text-align: left;
  background: var(--accent); color: var(--accent-ink); border: 0; border-radius: 18px; padding: 16px 18px; font: inherit; box-shadow: 0 8px 30px rgb(0 0 0 / .45); cursor: pointer;
  animation: pop .35s ease-out; }
.yours .ico { font-size: 2.2rem; }
.yours b { display: block; font-size: 1.2rem; }
.yours small { display: block; font-size: .95rem; opacity: .9; }
@keyframes pop { from { transform: translateY(-20px) scale(.95); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .yours { animation: none; } }
/* A phone's first visit: blank (not the wrong colours) until the band's look is known. See boot.js. */
html.brand-pending body { visibility: hidden; }
@media (prefers-color-scheme: light) { html.brand-pending, html.brand-pending body { background: #fffdf4; } }
.yours .txt { flex: 1; min-width: 0; }
.yours .x { flex: none; width: 48px; height: 48px; border-radius: 50%; border: 2px solid currentColor; background: transparent; color: inherit; font: inherit; font-size: 1.3rem; font-weight: 900; cursor: pointer; }
