/* LiveChurch look (from the mockup): big buttons, plain words, one coloured band. */
:root {
  --bg: #eef0f6;
  --surface: #ffffff;
  --ink: #151a2d;
  --muted: #5a6078;
  --line: #d9dce8;
  --accent: #3d3fb0;
  --accent-ink: #ffffff;
  --accent-soft: #e7e7fb;
  --go: #17803d;
  --on-go: #ffffff;
  --go-soft: #e3f4e8;
  --pause: #9a5600;
  --pause-soft: #fdf0dc;
  --stop: #b42318;
  --stop-soft: #fde8e6;
  --font: "Atkinson Hyperlegible", Verdana, system-ui, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1220; --surface: #191d2e; --ink: #eef0f8; --muted: #a6abc2; --line: #2c3148;
    --accent: #a3a6ff; --accent-ink: #11132a; --accent-soft: #262a5c;
    --go: #4cc677; --on-go: #0a1a10; --go-soft: #15301f;
    --pause: #f0b057; --pause-soft: #33270f; --stop: #ff8a7e; --stop-soft: #3a1b18;
    color-scheme: dark;
  }
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink); font-family: var(--font); font-size: 18px; line-height: 1.5;
  padding-block: 16px 40px;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
}
h1 { font-size: 1.6rem; line-height: 1.2; margin: 0; text-wrap: balance; }
h2 { font-size: 1.15rem; margin: 0; }
p { margin: 0; }
a { color: var(--accent); }
.lead { color: var(--muted); }
.note { color: var(--muted); font-size: 0.9rem; }
.eyebrow { font-size: 0.8rem; font-weight: 700; letter-spacing: 0.07em; text-transform: uppercase; color: var(--accent); }
.spacer { flex: 1; }
.warn { color: var(--stop); font-weight: 700; }
.num { font-variant-numeric: tabular-nums; }

/* ----- helper pages ----- */
.wrap { max-width: 520px; margin: 0 auto; display: grid; gap: 14px; }
.top { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 1.2rem; }
.brand svg { width: 28px; height: 28px; flex: none; }
.pill { font-size: 0.8rem; font-weight: 700; background: var(--pause-soft); color: var(--pause); padding: 4px 10px; border-radius: 999px; }
.testnote { background: var(--pause-soft); color: var(--ink); border-radius: 14px; padding: 10px 14px; font-size: 0.95rem; }
.device { background: var(--surface); border: 1px solid var(--line); border-radius: 28px; min-height: 640px; padding: 22px 20px; position: relative; overflow: hidden; display: flex; flex-direction: column; gap: 12px; }
@media (max-width: 480px) { .device { border-radius: 20px; min-height: calc(100dvh - 120px); padding: 20px 16px; } }
.screen { display: flex; flex-direction: column; gap: 16px; flex: 1; min-width: 0; }

.btn { display: flex; align-items: center; justify-content: center; gap: 10px; min-height: 58px; border-radius: 16px; border: 2px solid transparent; font: inherit; font-weight: 700; font-size: 1.1rem; cursor: pointer; padding: 12px 18px; width: 100%; text-decoration: none; text-align: center; }
.btn.primary { background: var(--accent); color: var(--accent-ink); }
.btn.go { background: var(--go); color: var(--on-go); min-height: 84px; font-size: 1.35rem; }
.btn.pause { background: var(--pause-soft); color: var(--pause); border-color: var(--pause); }
.btn.stop { background: var(--stop-soft); color: var(--stop); border-color: var(--stop); }
.btn.plain { background: transparent; color: var(--accent); border-color: var(--line); }
.btn:disabled { opacity: 0.6; cursor: wait; }
.link { background: none; border: 0; color: var(--accent); font: inherit; text-decoration: underline; cursor: pointer; padding: 6px 0; min-height: 44px; text-align: left; }
button:focus-visible, a:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

.card { border: 1px solid var(--line); border-radius: 18px; padding: 16px; display: grid; gap: 10px; background: var(--surface); }
.card p b { overflow-wrap: anywhere; }

.band { border-radius: 18px; padding: 16px; display: grid; gap: 4px; }
.band.on { background: var(--go-soft); color: var(--go); }
.band.paused { background: var(--pause-soft); color: var(--pause); }
.band.practice { background: var(--accent-soft); color: var(--accent); }
.band .state { font-size: 1.5rem; font-weight: 700; display: flex; align-items: center; gap: 10px; }
.band .sub { color: var(--ink); }
.pulse { width: 14px; height: 14px; border-radius: 50%; background: currentColor; flex: none; }
@media (prefers-reduced-motion: no-preference) { .band.on .pulse, .band.practice .pulse { animation: pulse 1.6s infinite; } }
@keyframes pulse { 50% { opacity: 0.3; } }

.preview { border: 1px solid var(--line); border-radius: 18px; overflow: hidden; display: flex; flex-direction: column; flex: 1; min-height: 260px; }
.ptabs { display: flex; border-bottom: 1px solid var(--line); overflow-x: auto; }
.ptabs button { flex: 1; min-width: 90px; min-height: 48px; font: inherit; font-weight: 700; background: none; border: 0; border-bottom: 3px solid transparent; color: var(--muted); cursor: pointer; white-space: nowrap; }
.ptabs button[aria-selected="true"] { color: var(--accent); border-bottom-color: var(--accent); }
.lines { flex: 1 1 0; min-height: 200px; overflow-y: auto; padding: 12px 14px; display: flex; flex-direction: column; gap: 8px; }
.lines .song { border-inline-start: 4px solid var(--accent); padding-inline-start: 12px; }
.lines .song small { display: block; font-size: 0.85rem; color: var(--accent); font-weight: 700; }
.lines .empty { color: var(--muted); }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

.dialog-back { position: absolute; inset: 0; background: rgb(0 0 0 / 0.45); display: flex; align-items: flex-end; padding: 16px; }
.dialog { background: var(--surface); border-radius: 20px; padding: 20px; display: grid; gap: 12px; width: 100%; }

.bigcheck { width: 72px; height: 72px; color: var(--go); }
ul.sum { margin: 0; padding: 0; list-style: none; display: grid; gap: 8px; }
ul.sum li { border: 1px solid var(--line); border-radius: 14px; padding: 10px 14px; }
ul.sum b { display: block; font-size: 0.85rem; color: var(--muted); }

/* ----- phone page ----- */
body.phone { padding-block: 12px 0; }
.phonewrap { max-width: 680px; margin: 0 auto; min-height: calc(100dvh - 12px); display: flex; flex-direction: column; gap: 16px; }
.phonewrap > section { display: flex; flex-direction: column; gap: 14px; flex: 1; min-height: 0; }
.churchhead { display: flex; align-items: center; gap: 12px; }
.logo { width: 48px; height: 48px; border-radius: 14px; background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; font-weight: 700; flex: none; }
.tiles { display: grid; gap: 10px; }
.langbtn { display: flex; justify-content: space-between; align-items: center; gap: 12px; min-height: 68px; border: 2px solid var(--line); border-radius: 16px; padding: 12px 18px; font: inherit; background: var(--surface); color: var(--ink); cursor: pointer; width: 100%; text-align: start; }
.langbtn .n { font-size: 1.3rem; font-weight: 700; }
.langbtn .e { color: var(--muted); font-size: 0.95rem; }
.pbar { display: flex; justify-content: space-between; align-items: center; gap: 8px; border-bottom: 1px solid var(--line); padding-bottom: 6px; }
.reader { flex: 1; display: flex; flex-direction: column; gap: 14px; font-size: var(--rs, 24px); line-height: 1.45; padding-bottom: 8px; }
.reader p { overflow-wrap: anywhere; }
.reader .song { border-inline-start: 4px solid var(--accent); padding-inline-start: 12px; }
.reader .song small { display: block; font-size: 0.9rem; color: var(--accent); font-weight: 700; }
@media (prefers-reduced-motion: no-preference) { .reader p, .lines p { animation: appear 0.4s ease-out; } }
@keyframes appear { from { opacity: 0; } to { opacity: 1; } }
.notice { background: var(--accent-soft); color: var(--ink); border-radius: 14px; padding: 12px 16px; font-size: 1.05rem; }
.notice.paused { background: var(--pause-soft); }
.tools {
  position: sticky; bottom: 0; background: var(--bg); display: grid; grid-template-columns: 1fr 1fr; gap: 8px;
  border-top: 1px solid var(--line); padding: 10px 0 max(12px, env(safe-area-inset-bottom, 0px));
}
.tools .btn { min-height: 52px; font-size: 1.1rem; }
.tools:has(.listen:not([hidden])) { grid-template-columns: 1fr 1fr 2fr; }
.tools .listen[aria-pressed="true"] { background: var(--accent-soft); color: var(--ink); border: 2px solid var(--accent); }
.voicehint { background: var(--accent-soft); color: var(--ink); border-radius: 14px; padding: 10px 14px; font-size: 1rem; }

/* Sound: microphone choice and level bar */
.field { display: grid; gap: 6px; font-weight: 700; }
.field select { font: inherit; font-weight: 400; padding: 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); }
.meter { height: 14px; border-radius: 999px; background: var(--line); overflow: hidden; }
.meter.small { height: 6px; }
.meter .level { height: 100%; width: 0; background: var(--go); border-radius: inherit; transition: width 80ms linear; }
.meter .level.hot { background: var(--stop, #c62828); }
#not-sending { display: grid; gap: 8px; }

/* Set up: the 3 questions */
.dots { display: flex; gap: 6px; }
.dots span { width: 28px; height: 6px; border-radius: 3px; background: var(--line); }
.dots span.on { background: var(--accent); }
.field input[type="text"], .field input[type="email"], .field input[type="password"] { font: inherit; font-weight: 400; width: 100%; min-height: 56px; border: 2px solid var(--line); border-radius: 14px; padding: 10px 14px; background: var(--bg); color: var(--ink); }
.tile { display: flex; align-items: center; gap: 14px; border: 2px solid var(--line); border-radius: 16px; padding: 12px 16px; cursor: pointer; min-height: 60px; background: var(--surface); }
.tile input { width: 24px; height: 24px; accent-color: var(--accent); flex: none; margin: 0; }
.tile:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.tile:has(input:disabled) { opacity: 0.6; cursor: not-allowed; }
.tile:has(input:focus-visible) { outline: 3px solid var(--accent); outline-offset: 2px; }
.tile .txt { display: grid; min-width: 0; }
.tile .big { font-weight: 700; }
.tile .small { color: var(--muted); font-size: 0.9rem; }
h1:focus { outline: none; }

/* The poster: always black on white, so it prints well. */
.poster { background: #fff; color: #111; border-radius: 18px; padding: 28px 22px; display: grid; gap: 12px; justify-items: center; text-align: center; border: 1px solid var(--line); }
.poster h2 { font-size: 1.8rem; }
.poster .asks { display: grid; gap: 4px; }
.poster .asks p { font-size: 1.3rem; font-weight: 700; }
.poster .qr { width: min(260px, 70vw); }
.poster .qr svg { display: block; width: 100%; height: auto; }
.poster .note { color: #444; }
.poster b { overflow-wrap: anywhere; }
.poster .church { font-weight: 700; font-size: 1.2rem; }
@media print {
  body { background: #fff; padding: 0; }
  .noprint { display: none !important; }
  .poster { border: 0; padding-top: 40px; }
  .poster h2 { font-size: 2.6rem; }
  .poster .asks p { font-size: 1.8rem; }
  .poster .qr { width: 320px; }
}

/* Logins */
.field .note { font-weight: 400; }
.who { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: flex-end; min-width: 0; }
.who .note { overflow-wrap: anywhere; }
.who .link { min-height: 32px; padding: 0; }
.links { display: flex; gap: 6px 18px; flex-wrap: wrap; }
ul.people { margin: 0; padding: 0; list-style: none; display: grid; gap: 8px; }
ul.people li { border: 1px solid var(--line); border-radius: 14px; padding: 10px 14px; display: grid; gap: 4px; }
ul.people li > div:first-child { display: grid; }
ul.people b { overflow-wrap: anywhere; }
.acts { display: flex; gap: 4px 16px; flex-wrap: wrap; }
.acts .link { min-height: 36px; padding: 0; }
.link.danger { color: var(--stop); }
.given { background: var(--go-soft); border-color: var(--go); }
.given .pw { font-size: 1.3rem; letter-spacing: 0.04em; font-variant-numeric: tabular-nums; }

/* Headsets: links on the Sunday page, and the headset page */
details.hslink { border: 1px solid var(--line); border-radius: 14px; padding: 10px 14px; }
details.hslink summary { cursor: pointer; min-height: 32px; display: flex; align-items: center; gap: 8px; }
details.hslink[open] { display: grid; gap: 10px; }
.hsqr { background: #fff; border-radius: 12px; padding: 8px; width: min(220px, 70vw); justify-self: center; }
.hsqr svg { display: block; width: 100%; height: auto; }
.hsurl { overflow-wrap: anywhere; font-size: 0.8rem; }
.newlinks { display: grid; gap: 2px; }
.hs-lang { font-size: 2.2rem; }
.hs-lang .note { font-size: 1rem; font-weight: 400; }
.field input[type="range"] { width: 100%; accent-color: var(--accent); min-height: 32px; }
#hs-on { display: grid; gap: 14px; }
#hs-on[hidden] { display: none; }
#hs-last { min-height: 3em; font-size: 1.05rem; color: var(--ink); }

/* Big screen card on the Sunday page */
.looks { display: grid; gap: 8px; }
.look { display: grid; grid-template-columns: 1fr 64px 52px 64px; align-items: center; gap: 8px; }
.look .btn { min-height: 48px; padding: 6px; }
.look b { text-align: center; }

/* The big screen: white on black, big, nothing else */
body.screen { background: #000; color: #fff; margin: 0; padding: 0; height: 100vh; overflow: hidden; cursor: none; color-scheme: dark; }
#captions {
  position: fixed; inset: 0; padding: 4vh 5vw; display: flex; flex-direction: column; justify-content: flex-end; gap: 0.35em;
  font-size: var(--size, 5.9vh); line-height: 1.25; font-weight: 700; overflow: hidden;
}
#captions p { margin: 0; overflow-wrap: anywhere; transition: opacity 0.6s ease; }
#captions p.old { opacity: 0.55; }
#captions.quiet p { opacity: 0; transition: opacity 1.2s ease; }
.fs-hint {
  position: fixed; top: 2vh; left: 50%; transform: translateX(-50%); background: rgb(255 255 255 / 0.12); color: #fff;
  font: 600 18px var(--font); padding: 8px 16px; border-radius: 999px; opacity: 0; transition: opacity 0.4s; pointer-events: none;
}
.fs-hint.show { opacity: 1; }
@media (prefers-reduced-motion: reduce) { #captions p, #captions.quiet p { transition: none; } }
