:root {
  --bg: #f4f5f1;
  --surface: #ffffff;
  --surface-2: #e9ece5;
  --ink: #1a231e;
  --ink-soft: #5d6b63;
  --line: #e0e4db;
  /* Inputs get their own token rather than reusing --surface. They sit INSIDE a
     card that is also --surface, so sharing it makes a field indistinguishable
     from the card around it — survivable in light mode, where the border still
     reads, and invisible in dark mode, where it did not. */
  --field: #ffffff;
  /* An empty text box is identified only by its outline, so that edge must
     clear 3:1 (WCAG 1.4.11). --line is 1.3:1 in light mode — fine for a card,
     which has its shadow and its contents, but it made fields nearly invisible.
     3.8:1 on a white field, 3.2:1 on the --surface-2 note box. Dark and
     high-contrast --line already clear it, so only light mode needs its own. */
  --field-line: #7a867f;
  --brand: #15795f;      /* deep evergreen */
  --brand-ink: #0f5f4a;
  --accent: #2f9e79;
  --accent-soft: #e2f1ea;
  --verse: #0f5f4a;
  /* Text in --danger must clear 4.5:1 (WCAG 1.4.3) on the page, on a card AND on
     its own tinted pill (the "Live" badge: 15% danger over the card) — #c0392b
     missed the pill at 4.34. Each theme below sets its own; the dark one used to
     inherit this and sat at 2.45 on dark cards. */
  --danger: #b03226;
  /* A solid fill that text sits on (primary buttons, chosen-option buttons) and
     the colour of that text. Separate from --accent, which is too light in light
     mode for white text (3.3:1) and too light in dark mode for any white at all —
     every dark-mode primary button was white on mint, 2.3:1 or worse. */
  --accent-fill: #1c8262;  /* white on it 4.75:1 */
  /* Words of Jesus (red-letter). Its own token rather than the danger red,
     because it means "Jesus is speaking", never "something is wrong". Clears 4.5:1 on the page, on cards
     and inside the green verse box (5.6:1) in every theme. */
  --wj: #b3261e;
  --on-fill: #ffffff;
  --ok: #15795f;
  /* The "Support our team" tab. Warm clay, deliberately outside the evergreen
     family so it is the one tab that stands apart. White on it is 5.8:1. */
  --support: #a8481f;
  --support-ink: #ffffff;
  /* Presenter notes revealed one at a time. Ochre, so on the live screen a
     "next note" is never mistaken for a "next passage" (evergreen). White on
     --note is 5.9:1. */
  --note: #87590a;
  --note-ink: #ffffff;
  --note-soft: #f6eedc;
  color-scheme: light;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(20,40,30,.04), 0 8px 24px rgba(20,40,30,.06);
  --maxw: 760px;
}
@media (prefers-color-scheme: dark) {
  /* Rebuilt 2026-08-29. The old palette was near-black and almost flat: a card
     sat at 1.11:1 against the page and a border at 1.27:1 against its card, so
     cards did not read as cards and INPUT FIELDS WERE EFFECTIVELY INVISIBLE —
     a presenter signing in from a dim sanctuary had to hunt for the box.

     Text contrast was never the problem (body was already 14:1). Separation was.
     Dark mode fails by being flat far more often than by being low-contrast, and
     the fix is elevation and edges, not brighter text. Values solved against
     WCAG targets rather than picked by eye:

       card vs page      1.30:1   a card reads as raised
       border vs card    3.03:1   WCAG 1.4.11, the bar for a UI boundary
       muted vs card     7.29:1   comfortably past the 4.5:1 for body text
       body vs card     12.79:1

     Keep --line light enough to clear 3:1 if the surfaces are ever retuned; it
     is the single value holding up every input, card edge and divider. */
  :root:not([data-theme="light"]) {
    color-scheme: dark;   /* native controls (dropdowns, scrollbars) match */
    --bg: #0b1210; --surface: #1d2c26; --surface-2: #2a3c34; --ink: #eaf2ed;
    --ink-soft: #a8bcb2; --line: #59796a; --brand: #4fbf98; --brand-ink: #7fd3b4;
    --accent: #4fbf98; --accent-soft: #1c2f27; --verse: #7fd3b4;
    --danger: #ff8a7a;   /* 4.9:1 on its pill, 6.4 on a card, 8.3 on the page */
    --accent-fill: #4fbf98; --on-fill: #0b1210;   /* dark text on fills, 8.3:1+ */
    --wj: #ff6b5e;   /* 5.1:1 in the verse box, 5.2:1 on a card — vivid red, chosen by Charles 2026-10-07 */
    --support: #f0a868; --support-ink: #1a1208;   /* 9.3:1 */
    --note: #e2b35a; --note-ink: #1a1208; --note-soft: #2c2716;
    /* Recessed rather than raised: an input reads as a well cut into its card. */
    --field: #101a16;
    --field-line: #7c9c8c;   /* 5.9:1 on the field, 3.9:1 on the --surface-2 note box (--line was 2.4) */
    --shadow: 0 1px 2px rgba(0,0,0,.3), 0 10px 30px rgba(0,0,0,.35);
  }
}
/* Chosen in Settings → Display: dark whatever the device says. The SAME
   values as the block above — test/accessibility.test.js fails if they drift. */
:root[data-theme="dark"] {
  color-scheme: dark;   /* native controls (dropdowns, scrollbars) match */
  --bg: #0b1210; --surface: #1d2c26; --surface-2: #2a3c34; --ink: #eaf2ed;
  --ink-soft: #a8bcb2; --line: #59796a; --brand: #4fbf98; --brand-ink: #7fd3b4;
  --accent: #4fbf98; --accent-soft: #1c2f27; --verse: #7fd3b4;
  --danger: #ff8a7a;   /* 4.9:1 on its pill, 6.4 on a card, 8.3 on the page */
  --accent-fill: #4fbf98; --on-fill: #0b1210;   /* dark text on fills, 8.3:1+ */
  --wj: #ff6b5e;   /* 5.1:1 in the verse box, 5.2:1 on a card — vivid red, chosen by Charles 2026-10-07 */
  --support: #f0a868; --support-ink: #1a1208;   /* 9.3:1 */
  --note: #e2b35a; --note-ink: #1a1208; --note-soft: #2c2716;
  /* Recessed rather than raised: an input reads as a well cut into its card. */
  --field: #101a16;
  --field-line: #7c9c8c;   /* 5.9:1 on the field, 3.9:1 on the --surface-2 note box (--line was 2.4) */
  --shadow: 0 1px 2px rgba(0,0,0,.3), 0 10px 30px rgba(0,0,0,.35);
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg); color: var(--ink); line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--brand); }
.wrap { max-width: var(--maxw); margin: 0 auto; padding: 20px 18px 80px; }
.narrow { max-width: 460px; }
/* Every surface that renders text someone typed lives inside .wrap, so the rule
   goes here once rather than on each note/heading/name class — a new one added
   later inherits it instead of having to remember it. Pasted text can contain a
   run with no break opportunity (a long URL, a wall of decorative Unicode with
   no spaces); the browser default lets that run push its card past the viewport
   and pan the entire page sideways, which on a phone mid-service drags every
   other card off-screen with it.

   `break-word` rather than `anywhere`, deliberately. The two wrap identically —
   the difference is that `anywhere` ALSO shrinks intrinsic min-content width,
   and inside a flex container that lets every text run collapse to one character
   wide. `.checkline` is `display:flex`, so `anywhere` here broke "Keep these
   notes private" into "pri / vat / e" down the side of the checkbox. `break-word`
   leaves min-content alone and chrome lays out normally. */
.wrap { overflow-wrap: break-word; }
/* The exception: these two flex rows hold a BARE TEXT NODE of user text — the
   passage reference, appended directly in segmentNode(). An anonymous flex item
   can't be given min-width:0, so only `anywhere` will let a pathological
   reference give way instead of stretching the row off-screen. Scoped to the two
   rows that actually need it rather than applied page-wide. */
.point h3, .reveal-head { overflow-wrap: anywhere; }

/* header */
.topbar {
  position: sticky; top: 0; z-index: 20;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(1.2) blur(8px);
  border-bottom: 1px solid var(--line);
}
.topbar .inner { max-width: var(--maxw); margin: 0 auto; padding: 10px 18px;
  display: flex; align-items: center; gap: 10px; }
.brand { font-weight: 700; letter-spacing: .2px; display: flex; align-items: center; gap: 8px; white-space: nowrap; flex: none; }
.brand .mark { width: 26px; height: 26px; border-radius: 7px; background: linear-gradient(135deg,var(--brand),var(--accent));
  display: grid; place-items: center; color: #fff; font-size: 15px; flex: none; }
/* The presenter's church, beside the logo. A thin divider separates it from the
   product name so the two read as "SynchedWord | Grace Community" rather than
   one cramped, wrapped label. One line always; a long name is cut with "…". */
.church-tag { display: block; min-width: 0; max-width: 220px; padding-left: 12px; margin-left: 2px;
  border-left: 1px solid var(--line); font-size: .9rem; font-weight: 600; color: var(--ink-soft);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; line-height: 1.6; }
.church-tag[hidden] { display: none; }
/* Keep its full width (up to the cap): the menu buttons wrap onto a second row
   before the church name is cut short. */
.topbar .church-tag { flex: 0 0 auto; }
.spacer { flex: 1; }
/* top-bar actions must stay compact and on one line, never overflow */
.topbar .inner button, .topbar .inner .btn { padding: 7px 11px; font-size: .82rem; white-space: nowrap; flex: none; }
@media (max-width: 480px) {
  .topbar .inner { gap: 7px; padding: 10px 12px; flex-wrap: wrap; row-gap: 7px; }
  .topbar .inner button, .topbar .inner .btn { padding: 6px 9px; font-size: .8rem; }
  .topbar .spacer { display: none; }     /* let the tabs pack left and wrap instead of overflowing */
  .brand-label { display: none; }        /* show only the ✦ mark on small phones */
  .topbar .church-tag { display: none; } /* hide church name in the bar on mobile */
}
/* The tabs themselves come from nav.js, identical on every page. */
.topnav { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }
/* On a phone the tabs share the logo's row and wrap under themselves, rather
   than the whole group dropping below the logo — that cost a third row of a
   sticky bar that sits over the sermon. */
@media (max-width: 480px) { .topnav { gap: 7px; justify-content: flex-start; flex: 1; min-width: 0; } }
/* A link drawn as a button reads as a button; the link underline only made it look broken. */
a.btn { text-decoration: none; }
.topnav [aria-current="page"] { background: var(--surface-2); border-color: color-mix(in srgb, var(--brand) 45%, var(--line)); }
.topbar .inner .btn-support { background: var(--support); color: var(--support-ink); border-color: var(--support); }
.topbar .inner .btn-support:hover { filter: brightness(1.06); }
.topbar .inner .btn-support[aria-current="page"] { box-shadow: 0 0 0 2px color-mix(in srgb, var(--support) 40%, transparent); }

/* type */
h1 { font-size: 1.7rem; margin: .2em 0 .3em; letter-spacing: -.01em; }
h2 { font-size: 1.25rem; margin: 1.2em 0 .5em; }
.muted { color: var(--ink-soft); }
.small { font-size: .85rem; }
.center { text-align: center; }

/* cards & buttons */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px; box-shadow: var(--shadow); }
.card + .card { margin-top: 14px; }
.stack > * + * { margin-top: 12px; }

button, .btn {
  font: inherit; cursor: pointer; border: 1px solid transparent; border-radius: 10px;
  padding: 11px 16px; background: var(--surface-2); color: var(--ink); font-weight: 600;
  transition: transform .04s ease, filter .15s ease; display: inline-flex; align-items: center; gap: 8px; justify-content: center;
}
button:active, .btn:active { transform: translateY(1px); }
.btn-primary { background: linear-gradient(135deg,var(--brand),var(--brand-ink)); color: var(--on-fill); }
.btn-accent { background: linear-gradient(135deg,var(--accent-fill),var(--brand-ink)); color: var(--on-fill); }
.btn-ghost { background: transparent; border-color: var(--line); }
.btn-danger { background: transparent; color: var(--danger); border-color: color-mix(in srgb,var(--danger) 40%,var(--line)); }
.btn-lg { padding: 15px 20px; font-size: 1.05rem; width: 100%; }
button:disabled { opacity: .5; cursor: not-allowed; }
.row { display: flex; gap: 10px; flex-wrap: wrap; }
.row.tight { gap: 6px; }

/* forms */
label { display: block; font-weight: 600; font-size: .9rem; margin: 0 0 5px; }
input, textarea, select {
  font: inherit; width: 100%; padding: 11px 13px; border: 1px solid var(--field-line);
  border-radius: 10px; background: var(--field); color: var(--ink); resize: vertical;
}
input:focus, textarea:focus { outline: 2px solid color-mix(in srgb,var(--accent) 60%,transparent); border-color: var(--accent); }
textarea { min-height: 70px; }
.field + .field { margin-top: 12px; }
/* Side by side (City | State, Date | Version) the second field must not take the
   stacked gap, or it sits 12px lower than its neighbour. .row's own gap still
   spaces them when they wrap onto two lines on a narrow phone. */
.row > .field + .field { margin-top: 0; }
/* A native <select> renders ~3px shorter than an <input> with the same padding;
   match the input's height (line + padding + border) so a row lines up. */
.field select { min-height: calc(1.5em + 24px); }
.checkline { display: flex; align-items: flex-start; gap: 9px; font-size: .9rem; cursor: pointer; line-height: 1.4; color: var(--ink); }
.checkline input[type="checkbox"], .checkline input[type="radio"] { width: auto; margin: 2px 0 0; padding: 0; flex: none; accent-color: var(--brand); }
.privtoggle { margin-top: 10px; }
.privtoggle.is-private { border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); color: var(--verse); }
.live-status { display: flex; align-items: center; gap: 8px; margin-top: 14px; padding: 10px 14px; border-radius: 10px;
  background: color-mix(in srgb, var(--danger) 12%, var(--surface)); color: var(--danger); font-size: .9rem; }
.live-status .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--danger); animation: pulse 1.4s infinite; }

/* sermon points */
.point { background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--accent);
  border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow); }
.point + .point { margin-top: 14px; }
.point .num { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 50%;
  background: var(--accent-soft); color: var(--verse); font-weight: 700; font-size: .8rem; margin-right: 8px; }
.point h3 { margin: 0 0 6px; font-size: 1.15rem; display: flex; align-items: center; }
.point .body { white-space: pre-wrap; }
.verse { margin-top: 12px; padding: 12px 14px; background: var(--accent-soft); border-radius: 10px;
  color: var(--verse); }
.verse .ref { font-weight: 700; display: block; margin-bottom: 4px; letter-spacing: .02em; }
.verse .text { font-style: italic; white-space: pre-wrap; }

.passage-text { font-size: 1.08rem; line-height: 1.85; margin: 8px 0 4px; color: var(--ink); }
.pastor-note { margin-top: 12px; padding: 12px 14px; background: var(--accent-soft); border-radius: 10px;
  color: var(--verse); white-space: pre-wrap; }
.pastor-note-label { display: block; font-size: .72rem; text-transform: uppercase; letter-spacing: .05em;
  font-weight: 700; margin-bottom: 4px; opacity: .85; }
.note-area { margin-top: 12px; }
.note-area label { color: var(--ink-soft); font-size: .8rem; text-transform: uppercase; letter-spacing: .05em; }
.note-area textarea { background: var(--surface-2); border-style: dashed; }
.save-hint { font-size: .78rem; color: var(--ink-soft); height: 1em; }
/* For messages that can run to a sentence or two (Settings → Your data, Login & security). */
.save-hint.wrap { display: block; height: auto; min-height: 1em; }
/* Loopback-address warning on the present screen. */
.qr-warning { border: 1px solid var(--danger, #b3261e); border-radius: 10px; padding: 12px 14px;
  margin-bottom: 14px; text-align: left; background: color-mix(in srgb, var(--danger, #b3261e) 8%, transparent); }
.qr-warning code { word-break: break-all; font-size: .85em; padding: 1px 4px;
  border-radius: 4px; background: var(--surface-2); }

/* A button that reads as a link — used for inline retries. */
.linklike { background: none; border: 0; padding: 0; font: inherit; font-size: .82rem;
  color: var(--brand); text-decoration: underline; cursor: pointer; }  /* same as links; --accent is 3:1 */

/* Sub-processor table on the privacy page. Scrolls inside itself on a phone
   rather than forcing the whole page sideways. */
.legal-table { width: 100%; border-collapse: collapse; margin: 12px 0; font-size: .9rem; display: block; overflow-x: auto; }
.legal-table th, .legal-table td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--surface-2); vertical-align: top; }
.legal-table th { font-weight: 700; white-space: nowrap; }

/* A message preached more than once: earlier services tuck under the newest. */
.series { margin-bottom: 2px; }
.series-past > summary { cursor: pointer; font-size: .82rem; color: var(--ink-soft); padding: 6px 4px 6px 14px; }
.series-past > summary:hover { color: var(--ink); }
.series-past .sub-item { margin-left: 14px; border-left: 2px solid var(--surface-2); }

.note-meta { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-top: 4px; }
.note-count { font-size: .78rem; color: var(--ink-soft); height: 1em; white-space: nowrap; }
.note-count.warn { color: var(--danger, #b3261e); font-weight: 600; }

/* pill / status */
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px;
  font-size: .78rem; font-weight: 700; background: var(--surface-2); color: var(--ink-soft); }
.pill.live { background: color-mix(in srgb, var(--danger) 15%, var(--surface)); color: var(--danger); }
.pill.live .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--danger); animation: pulse 1.4s infinite; }
.pill.archived { background: var(--accent-soft); color: var(--verse); }
@keyframes pulse { 0%,100%{opacity:1} 50%{opacity:.3} }

/* list items */
.list-item { display: flex; align-items: center; gap: 12px; padding: 14px 16px; background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); cursor: pointer; }
.list-item + .list-item { margin-top: 10px; }
.list-item:hover { border-color: var(--accent); }
.list-item .grow { flex: 1; min-width: 0; }
.list-item .title { font-weight: 700; }
.list-item .sub { color: var(--ink-soft); font-size: .85rem; }

/* present controls */
.present-hero { text-align: center; padding: 26px 18px; }
.qr-box { display: inline-block; max-width: 100%; background: #fff; padding: 14px; border-radius: 16px; box-shadow: var(--shadow); }
.qr-box img { display: block; width: 260px; height: auto; max-width: 100%; aspect-ratio: 1; }
/* Service codes: a font whose zero carries a slash (or dot), so 0 can never be
   read as the letter O — which is never in a code anyway. */
.code-text, .joincode { font-family: ui-monospace, "SF Mono", "Cascadia Mono", "Roboto Mono", Menlo, Consolas, "Liberation Mono", monospace;
  font-variant-numeric: slashed-zero; font-feature-settings: "zero" 1; }
.joincode { font-size: 2.4rem; font-weight: 800; letter-spacing: .18em; color: var(--brand);
  font-variant-numeric: tabular-nums; }
.control-bar { position: sticky; bottom: 0; background: color-mix(in srgb,var(--bg) 92%,transparent);
  backdrop-filter: blur(8px); border-top: 1px solid var(--line); padding: 12px 0; margin-top: 20px; }
.control-bar .inner { max-width: var(--maxw); margin: 0 auto; padding: 0 18px; display: flex; gap: 10px; }
.control-bar .inner button { flex: 1; min-width: 0; }
/* On a phone, Back and Stop take only what they need and Next gets the rest —
   its label is the one that has to be read, and "Stop" must never be pushed
   off the edge. */
@media (max-width: 560px) {
  .control-bar .inner { padding: 0 12px; gap: 8px; }
  .control-bar .inner #ctlBack, .control-bar .inner #ctlEnd { flex: 0 0 auto; padding-left: 12px; padding-right: 12px; white-space: nowrap; }
}
.progress { height: 6px; background: var(--surface-2); border-radius: 999px; overflow: hidden; margin: 10px 0; }
.progress > span { display: block; height: 100%; background: linear-gradient(90deg,var(--brand),var(--accent)); transition: width .3s ease; }

.reveal-item { padding: 14px 16px; border: 1px solid var(--line); border-radius: 12px;
  background: var(--surface); margin-bottom: 10px; opacity: .5; transition: opacity .2s, box-shadow .2s; }
.reveal-item.shown { opacity: 1; border-left: 4px solid var(--accent); }
.reveal-item.current { box-shadow: 0 0 0 2px var(--accent); }
.reveal-head { display: flex; align-items: center; gap: 10px; }
.reveal-head .idx { width: 26px; height: 26px; border-radius: 50%; background: var(--surface-2); color: var(--ink-soft);
  display: grid; place-items: center; font-weight: 700; font-size: .8rem; flex: none; }
.reveal-item.shown .reveal-head .idx { background: var(--accent-fill); color: var(--on-fill); }
.reveal-head strong { font-size: 1.05rem; }
.reveal-body { white-space: pre-wrap; margin: 10px 0 0; padding-left: 36px; color: var(--ink); }
.reveal-item .verse { margin-left: 36px; }
.reveal-upcoming { padding-left: 36px; margin-top: 6px; }
.reveal-item.current .reveal-head .tag { color: var(--danger); font-weight: 700; }
/* The next passage: evergreen, matching the Next button when it shows a passage. */
.reveal-item.is-next { opacity: 1; border: 2px dashed var(--brand); }
.reveal-item.is-next .reveal-head .tag { color: var(--brand); font-weight: 700; }
.reveal-notes { list-style: none; margin: 10px 0 0; padding: 0 0 0 36px; display: grid; gap: 6px; }
.reveal-note { padding: 8px 10px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface); opacity: .6; }
.reveal-note.shown { opacity: 1; background: var(--accent-soft); border-color: transparent; }
.reveal-note.is-next { opacity: 1; border: 2px dashed var(--note); background: var(--note-soft); }
.reveal-note.is-private { opacity: 1; border-style: dashed; color: var(--ink-soft); }
.reveal-note-top { display: flex; justify-content: space-between; gap: 8px; font-size: .72rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: .05em; color: var(--ink-soft); margin-bottom: 2px; }
.reveal-note.is-next .reveal-note-top { color: var(--note); }
.reveal-note.shown .reveal-note-top { color: var(--verse); }

/* The Next button: what kind of step on the first line, what exactly on the second. */
.ctl-next { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px;
  line-height: 1.2; min-height: 52px; text-align: center; }
.ctl-next-kind { font-weight: 800; font-size: .95rem; }
.ctl-next-detail { font-weight: 500; font-size: .8rem; opacity: .92; max-width: 100%;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ctl-next-detail:empty { display: none; }
.control-bar .inner .ctl-next.is-note { background: var(--note); color: var(--note-ink); }

/* Passage cards in the editor: the notes block. */
.passage-top { justify-content: space-between; align-items: flex-start; flex-wrap: wrap; row-gap: 8px; }
/* The reference keeps whole words: on a phone the buttons move below it rather
   than squeezing "Ephesians" into "Ephe / sians". */
.passage-top h3 { flex: 1 1 12em; overflow-wrap: break-word; }
.pnotes { margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--line); }
.pnotes-title { font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-soft); margin-bottom: 6px; }
.reveal-choice { margin: 0 0 10px; }
.reveal-choice-label { display: block; font-size: .85rem; font-weight: 600; margin-bottom: 6px; }
.reveal-choice-hint { margin: 6px 0 0; }
.seg-toggle { display: inline-flex; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.seg-toggle .seg-opt { border: 0; border-radius: 0; background: transparent; padding: 8px 12px; font-size: .85rem; font-weight: 600; color: var(--ink-soft); }
.seg-toggle .seg-opt + .seg-opt { border-left: 1px solid var(--line); }
.seg-toggle .seg-opt[aria-checked="true"] { background: var(--accent-soft); color: var(--verse); }
.seg-toggle .seg-opt[aria-checked="true"]:last-child { background: var(--note-soft); color: var(--note); }
.seg-toggle .seg-opt:disabled { cursor: not-allowed; opacity: .7; }
.pnotes-list { list-style: none; margin: 0 0 8px; padding: 0; display: grid; gap: 8px; }
.pnote { padding: 10px 12px; border-radius: 10px; background: var(--surface-2); }
.pnote.is-private { background: transparent; border: 1px dashed var(--line); }
.pnote-mark { display: block; font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--verse); margin-bottom: 2px; }
.pnote.is-private .pnote-mark { color: var(--ink-soft); }
.pnote-body { white-space: pre-wrap; }
.pnote-ctl { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.pnote-ctl button { padding: 4px 10px; font-size: .8rem; min-height: 30px; }
.pnote-ctl .privtoggle { margin-top: 0; }
.pnote-form { display: grid; gap: 8px; margin-top: 6px; }
.pnote-form .field { margin: 0; }
.pnotes-add { margin-top: 2px; }

/* Congregation: each presenter note its own item; a newly revealed one glows briefly. */
.pastor-note-list { display: grid; gap: 8px; }
.pastor-note-item + .pastor-note-item { padding-top: 8px; border-top: 1px solid color-mix(in srgb, var(--verse) 20%, transparent); }
.pastor-note-item.just-revealed { animation: note-in .9s ease; }
@keyframes note-in { from { background: color-mix(in srgb, var(--accent) 25%, transparent); } to { background: transparent; } }
@media (prefers-reduced-motion: reduce) { .pastor-note-item.just-revealed { animation: none; } }

.toast { position: fixed; left: 50%; bottom: 90px; transform: translateX(-50%); background: var(--ink);
  color: var(--bg); padding: 10px 16px; border-radius: 999px; font-size: .9rem; opacity: 0;
  transition: opacity .2s, transform .2s; pointer-events: none; z-index: 50; }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(-6px); }

/* QR scanner + connected-code line */
.scan-overlay { position: fixed; inset: 0; z-index: 70; background: #000; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 18px; padding: 24px; }
.scan-box { position: relative; width: min(78vw, 320px); aspect-ratio: 1; border-radius: 18px; overflow: hidden; background: #111; }
.scan-box video { width: 100%; height: 100%; object-fit: cover; }
.scan-frame { position: absolute; inset: 14%; border: 3px solid rgba(255,255,255,.92); border-radius: 14px; }
.scan-msg { color: #fff; text-align: center; max-width: 320px; margin: 0; }
.code-line { margin-top: 6px; font-size: .95rem; color: var(--ink); background: var(--surface-2);
  display: inline-block; padding: 6px 12px; border-radius: 10px; }
.code-line strong { letter-spacing: .08em; }

.hidden { display: none !important; }
.empty { text-align: center; color: var(--ink-soft); padding: 40px 20px; }
.err { color: var(--danger); font-size: .9rem; min-height: 1.1em; }
.waiting { text-align: center; color: var(--ink-soft); padding: 30px; }
.waiting .dots::after { content: '…'; animation: dots 1.4s steps(4) infinite; }
@keyframes dots { 0%{content:''}25%{content:'.'}50%{content:'..'}75%{content:'...'} }
.grip { cursor: grab; color: var(--ink-soft); padding: 0 4px; user-select: none; }
.tag { font-size: .75rem; color: var(--ink-soft); }

/* ---- Bible reader drawer ---- */
.bible-overlay { position: fixed; inset: 0; z-index: 60; background: rgba(20,16,10,.45);
  display: flex; justify-content: flex-end; opacity: 0; pointer-events: none;
  /* visibility, not just opacity: an invisible drawer must also be out of the Tab
     order and the screen reader's reading order, on every page that loads it. */
  visibility: hidden; transition: opacity .2s, visibility 0s linear .2s; }
.bible-overlay.show { opacity: 1; pointer-events: auto; visibility: visible; transition: opacity .2s; }
.bible-panel { width: min(480px, 100%); height: 100%; background: var(--bg); display: flex; flex-direction: column;
  box-shadow: -8px 0 40px rgba(0,0,0,.25); transform: translateX(24px); transition: transform .22s ease; }
.bible-overlay.show .bible-panel { transform: translateX(0); }
.bible-top { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-bottom: 1px solid var(--line);
  background: var(--surface); }
.bible-top .bible-title { flex: 1; font-weight: 800; font-size: 1.1rem; text-align: center; }
.bible-trans { flex: none; width: auto; padding: 7px 9px; border-radius: 9px; font-size: .8rem; font-weight: 700;
  background: var(--surface-2); border: 1px solid var(--line); color: var(--ink); cursor: pointer; }
.bible-back, .bible-close { background: var(--surface-2); border: 1px solid var(--line); border-radius: 9px;
  width: 38px; height: 38px; font-size: 1rem; cursor: pointer; color: var(--ink); display: grid; place-items: center; }
.bible-scroll { flex: 1; overflow-y: auto; padding: 14px 16px 40px; -webkit-overflow-scrolling: touch; }
.bible-loading { text-align: center; color: var(--ink-soft); padding: 50px 20px; }
.bible-filter { margin-bottom: 12px; }
.book-suggest { position: absolute; left: 0; right: 0; top: calc(100% + 4px); z-index: 20; margin: 0; padding: 4px;
  list-style: none; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow);
  max-height: 260px; overflow-y: auto; }
.book-suggest li { padding: 10px 12px; border-radius: 7px; cursor: pointer; font-weight: 600; }
.book-suggest li[aria-selected="true"], .book-suggest li:hover { background: var(--accent-soft); color: var(--verse); }

.bible-section { font-size: .78rem; text-transform: uppercase; letter-spacing: .06em; color: var(--verse);
  font-weight: 700; margin: 16px 2px 8px; }
.bible-books { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.bible-book { text-align: left; background: var(--surface); border: 1px solid var(--line); border-radius: 10px;
  padding: 12px 12px; font-weight: 600; font-size: .95rem; }
.bible-book:hover { border-color: var(--accent); }
.bible-chapters { display: grid; grid-template-columns: repeat(auto-fill, minmax(52px, 1fr)); gap: 8px; }
.bible-chapter { aspect-ratio: 1; background: var(--surface); border: 1px solid var(--line); border-radius: 10px;
  font-weight: 700; font-size: 1rem; display: grid; place-items: center; }
.bible-chapter:hover { border-color: var(--accent); background: var(--accent-soft); color: var(--verse); }
.bible-heading { margin: 4px 0 14px; font-size: 1.5rem; color: var(--brand); }
.bible-text { font-size: 1.12rem; line-height: 1.85; color: var(--ink); }
.bible-verse { }
.bible-vnum { color: var(--verse); font-weight: 700; font-size: .72em; margin-right: 3px; vertical-align: super; }
.bible-nav { display: flex; justify-content: space-between; gap: 10px; margin-top: 26px; }
.bible-nav .btn { flex: 1; }
.bible-source { text-align: center; color: var(--ink-soft); font-size: .78rem; margin-top: 20px; }
.bible-usepassage { width: 100%; margin-bottom: 14px; }
.addon-pill { background: var(--accent-soft); color: var(--verse); font-size: .68rem; padding: 2px 8px; vertical-align: middle; margin-left: 6px; }
/* "Now": where the presenter is. Matches the presenter's own "On screen now". */
.point.is-now { box-shadow: 0 0 0 2px var(--accent); }
.now-pill { background: var(--brand); color: var(--surface); font-size: .68rem; padding: 2px 8px; vertical-align: middle; margin-left: 6px; }
.note-later { display: inline-block; margin: 0 0 4px; }
.orphan-notes { border-left-color: var(--line); }
.orphan-notes h3 { font-size: 1rem; }
.orphan-note + .orphan-note { margin-top: 10px; }
.orphan-note .body { margin-top: 2px; }
#bibleBtn { cursor: pointer; }

/* ---- accessibility ---- */
/* Visible keyboard focus on every interactive element (WCAG 2.4.7). */
a:focus-visible, button:focus-visible, .btn:focus-visible,
input:focus-visible, textarea:focus-visible, select:focus-visible,
[tabindex]:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
  border-radius: 8px;
}
/* Move focus to a view heading without drawing a box around body text. */
h1[tabindex="-1"]:focus, [tabindex="-1"]:focus:not(a):not(button):not(input):not(textarea) { outline: none; }

/* Screen-reader-only text and skip link. */
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip-link {
  position: absolute; left: 8px; top: -60px; z-index: 200;
  background: var(--surface); color: var(--ink); border: 1px solid var(--line);
  padding: 10px 14px; border-radius: 10px; box-shadow: var(--shadow);
  transition: top .15s ease;
}
.skip-link:focus { top: 8px; }

/* Respect users who ask for less motion (WCAG 2.3.3 / vestibular safety). */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important; animation-iteration-count: 1 !important;
    transition-duration: .001ms !important; scroll-behavior: auto !important;
  }
}

/* ---- settings page ---- */
.settings-section { border-top: 1px solid var(--line); padding-top: 14px; margin-top: 6px; }
.settings-label { display: block; font-size: .72rem; font-weight: 700; letter-spacing: .08em;
  text-transform: uppercase; color: var(--ink-soft); margin-bottom: 8px; }
.settings-link { display: block; padding: 10px 2px; color: var(--brand); text-decoration: none; font-weight: 600; }
.settings-link + .settings-link { border-top: 1px solid var(--line); }
/* Two-factor login (two-factor.js): the setup QR on white so any theme scans, and
   the one-time recovery codes in two columns. */
.tf-qr { display: block; background: #fff; padding: 8px; border-radius: 10px; width: 200px; height: 200px; }
.tf-codes { columns: 2; column-gap: 24px; margin: 0; padding-left: 1.6em; font-size: 1rem; line-height: 1.8; }
.tf-row { display: flex; gap: 8px; flex-wrap: wrap; }
.tf-head { display: flex; align-items: center; gap: 8px; }
.tf-status { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: .72rem; letter-spacing: .04em; }
.tf-status.on { background: var(--accent-fill); color: var(--on-fill); }
.tf-status.off { background: var(--surface-2); color: var(--ink); }
.tf-off-block { margin-top: 10px; padding-top: 12px; border-top: 1px dashed var(--line); }

/* Passkeys (passkeys.js): the "or" between password and passkey sign-in, and the
   list in Settings. */
.or-line { display: flex; align-items: center; gap: 10px; margin: 4px 0 0; color: var(--ink-soft); font-size: .85rem; }
.or-line::before, .or-line::after { content: ''; flex: 1; border-top: 1px solid var(--line); }
.pk-list { display: flex; flex-direction: column; gap: 8px; }
.pk-list:empty { display: none; }
.pk-item { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 12px;
  border: 1px solid var(--line); border-radius: 10px; }
.pk-item .btn { flex: none; padding: 6px 12px; min-height: 36px; }
.pk-confirm { padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; }

/* Settings menu (follow.html #settingsHome) and the pages it opens. */
.settings-menu { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; margin-top: 6px; }
.settings-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 13px 14px;
  color: var(--ink); text-decoration: none; min-height: 44px; }
.settings-row + .settings-row { border-top: 1px solid var(--line); }
.settings-row:hover, .settings-row:focus-visible { background: var(--surface-2); }
.settings-row > span:first-child { display: flex; flex-direction: column; gap: 2px; }
.settings-row-sub { font-size: .82rem; color: var(--ink-soft); }
.settings-row-danger strong { color: var(--danger); }
.settings-chev { font-size: 1.4rem; color: var(--ink-soft); line-height: 1; }
.settings-pagehead { display: flex; flex-direction: column; gap: 4px; }
.settings-pagehead h1 { margin: 0; }
.settings-pagehead h1:focus { outline: none; }
.settings-back { color: var(--brand); text-decoration: none; font-weight: 600; font-size: .95rem; align-self: flex-start; padding: 6px 0; }
.settings-back:hover { text-decoration: underline; }
.settings-pagehead + .settings-section, .settings-pagehead + .hidden + .settings-section { border-top: 0; padding-top: 0; }
.tf-row .btn { flex: 1 1 140px; }
.settings-link:hover { text-decoration: underline; }

/* ---- storage / cookie notice ---- */
.consent-check {
  display: flex; gap: 10px; align-items: flex-start;
  font-size: .84rem; color: var(--ink); line-height: 1.45;
  background: var(--surface-2); border: 1px solid var(--line);
  border-radius: 10px; padding: 12px 14px; cursor: pointer;
}
.consent-check input { flex: none; margin-top: 2px; width: 18px; height: 18px; cursor: pointer; }
.consent-check a { color: var(--ink); }
/* The arbitration line under the Terms box: what it means and how to opt out,
   said where people agree rather than only inside the Terms. */
.consent-note { display: block; margin-top: 6px; font-size: .85em; color: var(--ink-soft); }
/* A disabled primary button has to LOOK unavailable, or the page reads as broken
   rather than as waiting for the tick above it. */
.btn-primary:disabled, .btn-primary[disabled] { opacity: .5; cursor: not-allowed; }

.consent-line { margin: -4px 0 0; font-size: .82rem; color: var(--ink-soft); text-align: center; }
.consent-line a { color: var(--ink-soft); }

/* ---- last-resort error notice (errors.js) ----
   Top of the viewport, not the bottom: the storage notice already owns the
   bottom, and these two can be on screen at once. */
.error-notice {
  position: fixed; left: 12px; right: 12px; top: 12px; z-index: 200;
  max-width: 640px; margin: 0 auto;
  background: color-mix(in srgb, var(--danger) 10%, var(--surface));
  color: var(--ink);
  border: 1px solid color-mix(in srgb, var(--danger) 40%, var(--line));
  border-radius: 12px; box-shadow: var(--shadow);
  padding: 14px 16px; display: flex; gap: 10px; align-items: center; flex-wrap: wrap;
}
.error-notice p { margin: 0; font-size: .88rem; flex: 1 1 260px; }
.error-notice .btn { flex: none; }

.app-footer { margin: 30px auto 8px; text-align: center; color: var(--ink-soft); font-size: .82rem; }
.app-footer a { color: var(--ink-soft); }

/* ---- user display preferences (set on <html> by a11y.js) ---- */
/* Words of Jesus — see public/red-letter.js. Off in Settings → Display keeps the
   markup and simply drops the colour. */
.wj { color: var(--wj); }
:root[data-red-letter="off"] .wj { color: inherit; }
:root[data-text-scale="large"]  { font-size: 112.5%; }  /* ~18px base */
:root[data-text-scale="xlarge"] { font-size: 125%; }    /* ~20px base */

/* Text-size dock on the sermon screen (follow.html). Bottom corner, clear of the
   phone's home bar; the page's own bottom padding keeps the last note box from
   sitting underneath it. Sized in px so it does not grow with the text it sets. */
.textsize-dock { position: fixed; right: 14px; bottom: calc(14px + env(safe-area-inset-bottom, 0px)); z-index: 30;
  display: flex; border: 1px solid var(--line); border-radius: 999px; overflow: hidden;
  background: var(--surface); box-shadow: var(--shadow); }
.textsize-btn { min-width: 52px; height: 44px; padding: 0 12px; border: 0; border-radius: 0; background: transparent;
  color: var(--ink); font-size: 15px; font-weight: 700; line-height: 1; }
.textsize-btn + .textsize-btn { border-left: 1px solid var(--line); }
.textsize-big { font-size: 19px; }
.textsize-btn:disabled { color: var(--ink-soft); opacity: .55; cursor: default; }
.textsize-btn:not(:disabled):hover { background: var(--surface-2); }

:root[data-contrast="high"] {
  --bg: #ffffff; --surface: #ffffff; --surface-2: #ececec;
  --ink: #000000; --ink-soft: #2b2b2b; --line: #6c6c6c; --field-line: var(--line);
  --brand: #0a4a39; --brand-ink: #083a2d; --accent: #0a5c46; --accent-soft: #d8ebe3; --verse: #083a2d;
  --support: #8a3a17;
  --note: #6b4500; --note-soft: #f3e6c8;
  --danger: #8f1d12; --accent-fill: #0a5c46; --on-fill: #ffffff; --wj: #8f1d12;
}
@media (prefers-color-scheme: dark) {
  :root[data-contrast="high"]:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #000000; --surface: #0c130f; --surface-2: #18241d;
    --ink: #ffffff; --ink-soft: #dbe7e0; --line: #7c8f85;
    --brand: #8fe8c6; --brand-ink: #b4f0d8; --accent: #8fe8c6; --accent-soft: #16241d; --verse: #b4f0d8;
    --support: #ffc28e; --support-ink: #1a1208;
    --note: #ffd27a; --note-ink: #000000; --note-soft: #261f0e;
    --danger: #ffa598; --accent-fill: #8fe8c6; --on-fill: #000000; --wj: #ffa598;
  }
}
:root[data-theme="dark"][data-contrast="high"] {
  color-scheme: dark;
  --bg: #000000; --surface: #0c130f; --surface-2: #18241d;
  --ink: #ffffff; --ink-soft: #dbe7e0; --line: #7c8f85;
  --brand: #8fe8c6; --brand-ink: #b4f0d8; --accent: #8fe8c6; --accent-soft: #16241d; --verse: #b4f0d8;
  --support: #ffc28e; --support-ink: #1a1208;
  --note: #ffd27a; --note-ink: #000000; --note-soft: #261f0e;
  --danger: #ffa598; --accent-fill: #8fe8c6; --on-fill: #000000; --wj: #ffa598;
}
.stream-row { margin-top: 10px; }
.stream-row label { display: block; font-weight: 600; font-size: .9rem; margin-bottom: 4px; }
.stream-row select { width: 100%; max-width: 360px; }
.ended-option + .ended-option { border-top: 1px solid var(--line); padding-top: 14px; }
.a11y-scalebtns { display: flex; gap: 8px; }
.a11y-scalebtns .btn { flex: 1; }
.a11y-scalebtns .btn.active { background: var(--accent-fill); color: var(--on-fill); border-color: var(--accent-fill); }

/* ---- rich text (presenter notes) ---------------------------------------
   The renderer in richtext.js emits real elements and explicit <br>, so a
   container showing rendered notes must not ALSO be pre-wrap — the source
   newlines are still in the text nodes and would double every line break.
   `.rich` is applied by renderInto() and overrides the pre-wrap that
   .pastor-note / .point .body / .reveal-body set for plain text. */
.rich { white-space: normal; }
.rich ul, .rich ol { margin: 6px 0; padding-left: 22px; }
.rich li { margin: 2px 0; }
.rich strong { font-weight: 700; }
.rich em { font-style: italic; }
.rich u { text-decoration: underline; }

.rich-toolbar { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 6px; }
.rich-btn { padding: 4px 10px; font-size: .82rem; line-height: 1.4; cursor: pointer;
  border: 1px solid var(--line); border-radius: 7px;
  background: var(--surface-2); color: var(--ink); }
.rich-btn:hover { border-color: var(--accent); }
.rich-preview-wrap { margin-top: 8px; padding: 10px 12px; border-radius: 10px;
  background: var(--accent-soft); }
.rich-preview-label { display: block; font-size: .72rem; text-transform: uppercase;
  letter-spacing: .05em; font-weight: 700; margin-bottom: 4px; opacity: .85; color: var(--verse); }
.rich-preview { color: var(--verse); }

/* ---- support page -------------------------------------------------------
   Amounts are a row of equal buttons rather than a select: on a phone in a pew,
   tapping a visible number beats opening a picker. */
.amount-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 6px; }
.amount-btn { width: 100%; font-size: 1.05rem; padding: 14px 6px; }
.amount-btn.active { background: var(--accent-fill); color: var(--on-fill); border-color: var(--accent-fill); }
.amount-custom { display: flex; align-items: center; gap: 8px; }
.amount-custom span { font-size: 1.1rem; color: var(--ink-soft); }
/* The sentence stating amount and cadence before the button. Given a real
   surface and a border so it reads as a statement to be checked, not fine print
   to be skimmed past. */
.support-confirm {
  margin: 14px 0 12px; padding: 11px 13px; border-radius: 10px;
  background: var(--surface-2); border: 1px solid var(--line);
  color: var(--ink-soft); font-size: .92rem; line-height: 1.45;
}
.support-confirm.is-set { color: var(--ink); border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); }
@media (max-width: 380px) { .amount-grid { grid-template-columns: 1fr; } }

/* Settings → Delete account: a presenter's sermons that stay for listeners. */
.kept-box { margin: 4px 0 12px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-2); }

/* Add passage: "private" (who sees it) and "one at a time" (when it appears)
   are different kinds of choice, so they look different. Private is grey and
   dashed, like a private note on the card; one-at-a-time is ochre, the colour of
   a "next note" on the live screen. */
.note-options { display: grid; gap: 8px; }
.opt { display: flex; align-items: flex-start; gap: 10px; padding: 10px 12px; border-radius: 10px; cursor: pointer; }
.opt input[type="checkbox"] { width: auto; margin: 3px 0 0; flex: none; }
.opt-text { display: grid; gap: 1px; }
.opt-kicker { font-size: .68rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; }
.opt-title { font-size: .95rem; }
.opt-desc { font-size: .8rem; color: var(--ink-soft); }
.opt-private { border: 1px dashed var(--line); background: transparent; }
.opt-private .opt-kicker { color: var(--ink-soft); }
.opt-private .opt-title { font-style: italic; color: var(--ink-soft); font-weight: 600; }
.opt-private input { accent-color: var(--ink-soft); }
.opt-reveal { border: 1px solid color-mix(in srgb, var(--note) 55%, var(--line)); background: var(--note-soft); }
.opt-reveal .opt-kicker { color: var(--note); }
.opt-reveal .opt-title { color: var(--note); font-weight: 800; letter-spacing: .01em; }
.opt-reveal input { accent-color: var(--note); }
.opt.is-off { opacity: .5; cursor: not-allowed; }
.opt-hint { margin: 0; }

/* Bible drawer, choosing a passage: tap the first verse, then the last. */
.bible-pickbar { position: sticky; top: -14px; z-index: 2; margin: -14px -16px 14px; padding: 12px 16px;
  background: var(--surface); border-bottom: 1px solid var(--line); display: grid; gap: 8px; }
.bible-pickmsg { font-weight: 600; font-size: .92rem; }
.bible-pickrow { display: flex; gap: 8px; flex-wrap: wrap; }
.bible-pickrow .btn { flex: 1 1 auto; }
.bible-verse.pickable { cursor: pointer; border-radius: 4px; -webkit-box-decoration-break: clone; box-decoration-break: clone; }
.bible-verse.pickable:hover { background: var(--surface-2); }
.bible-verse.pickable:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.bible-verse.in-range, .bible-verse.in-range:hover { background: var(--accent-soft); color: var(--verse); }
.bible-verse.range-edge { box-shadow: inset 0 -2px 0 var(--accent); font-weight: 600; }

/* Sermons a listener records themselves: ochre throughout, so they are never
   mistaken for one a presenter shared (evergreen). */
.btn-mine { background: var(--note); color: var(--note-ink); border-color: var(--note); font-weight: 700; }
.btn-mine:hover { filter: brightness(1.06); }
.mine-pill { background: var(--note-soft); color: var(--note); font-weight: 700; }
.list-item.mine { border-left: 4px solid var(--note); }
.list-item.mine:hover { border-color: var(--note); }
.mine-card, .mine-add { border-color: color-mix(in srgb, var(--note) 45%, var(--line)); }
.mine-add { margin-top: 14px; border-style: dashed; }
.point.mine-point { border-left-color: var(--note); }
.point.mine-point .num { background: var(--note-soft); color: var(--note); }
.mine-start { border-style: dashed; border-color: color-mix(in srgb, var(--note) 45%, var(--line)); }
.mine-invite { margin-top: 22px; text-align: center; }
#pmNotes { min-height: 140px; }

/* Shown under a text box when a paste was cut at the limit, or a file was dropped. */
.limit-notice { margin: 6px 0 0; font-size: .82rem; color: var(--danger); }

/* Report this sermon */
.report-reasons { border: 0; margin: 0; padding: 0; display: grid; gap: 8px; }
#reportCard { scroll-margin-top: 120px; }
/* Content taken down after a report: a quiet line where it was (listeners), or a
   marked note (presenter). Never the text, for listeners. */
.note-removed { color: var(--ink-soft); font-style: italic; }
.hold-banner { margin-top: 10px; padding: 10px 14px; border-radius: 12px; background: var(--note-soft);
  border: 1px solid color-mix(in srgb, var(--note) 45%, var(--line)); color: var(--ink); }
.hold-banner strong { color: var(--note); }
.pause-banner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 14px;
  margin-top: 12px; padding: 12px 14px; border-radius: 12px; border: 1px solid color-mix(in srgb, var(--danger) 45%, var(--line));
  background: color-mix(in srgb, var(--danger) 8%, var(--surface)); }
.pause-banner.is-paused { border-color: color-mix(in srgb, var(--note) 50%, var(--line)); background: var(--note-soft); }
.pause-banner p { flex: 1 1 240px; }
.is-locked { opacity: .55; }
.pill.taken-down { background: color-mix(in srgb, var(--danger) 15%, var(--surface)); color: var(--danger); }
.takedown-box { border-color: color-mix(in srgb, var(--danger) 45%, var(--line)); margin-bottom: 12px; }
.pnote-removed { margin: 0 0 6px; font-size: .85rem; color: var(--danger); }
.note-removed-card { border-style: dashed; }
.my-note-text { white-space: pre-wrap; margin-top: 6px; }   /* clear of the sticky top bar when opened from the top link */
.report-top { margin: 6px 0 0; text-align: right; }
.report-top .linklike { color: var(--ink-soft); font-size: .8rem; }
.report-line { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 12px;
  margin-top: 16px; padding: 12px 14px; border: 1px dashed var(--line); border-radius: 12px; }
.report-reasons legend { margin-bottom: 4px; }

/* ---- How it works (how-it-works.html) -------------------------------------
   Two guides side by side — presenter on the left, listener on the right — under
   one bar that stays in view while they scroll. Below 760px half a screen is too
   narrow for the step previews, so the bar becomes a switch between the two
   (how-it-works.js). Presenter = evergreen, listener = ochre: the same split the
   app uses (ochre is the listener's own sermons and notes). The previews are
   built from the app's tokens, not screenshots, so they follow every theme. */
.wrap.howto { max-width: 1080px; padding-top: 28px; }
.howto-hero { margin-bottom: 24px; }
.howto-hero h1 { font-size: clamp(1.9rem, 4.2vw, 2.7rem); line-height: 1.12; letter-spacing: -.015em; margin: 0 0 12px; }
.howto-lead { font-size: 1.12rem; color: var(--ink-soft); margin: 0; max-width: 34em; }
.howto-scene { display: flex; align-items: center; gap: 10px; }
.howto-scene .mock { flex: 1; margin: 0; }
.howto-arrow { flex: none; font-size: 1.6rem; font-weight: 700; color: var(--brand); }
/* In step 7 the picture runs top to bottom: the column is too narrow for two
   cards side by side. */
.howto-scene-step { flex-direction: column; align-items: stretch; gap: 6px; margin-top: 12px; }
.howto-scene-step .howto-arrow { align-self: center; line-height: 1; }

.howto-bar { position: sticky; top: var(--howto-top, 0px); z-index: 15; display: grid; grid-template-columns: 1fr 1fr;
  gap: 16px; padding: 10px 0; background: var(--bg); }
.howto-pick { display: block; padding: 12px 16px; border-radius: 12px; border: 1px solid var(--line);
  background: var(--surface); color: var(--ink); text-decoration: none; box-shadow: var(--shadow); }
.howto-pick.is-presenter { border-top: 4px solid var(--brand); }
.howto-pick.is-listener { border-top: 4px solid var(--note); }
.howto-pick-title { display: block; font-weight: 700; font-size: 1.12rem; }
.howto-pick-sub { display: block; font-size: .85rem; color: var(--ink-soft); }

.howto-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: start; }
.howto-col { min-width: 0; scroll-margin-top: calc(var(--howto-top, 0px) + 100px); }
.howto-steps { list-style: none; margin: 0; padding: 0; counter-reset: step; }
.howto-steps > li { counter-increment: step; position: relative; margin-top: 14px; padding: 18px 18px 16px 62px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.howto-steps > li::before { content: counter(step); position: absolute; left: 16px; top: 16px; width: 32px; height: 32px;
  border-radius: 50%; display: grid; place-items: center; font-weight: 700; background: var(--accent-fill); color: var(--on-fill); }
#listener .howto-steps > li::before { background: var(--note); color: var(--note-ink); }
/* A thread from each number down to the next, so the steps read as one path. */
.howto-steps > li:not(:last-child)::after { content: ''; position: absolute; left: 31px; top: 52px; bottom: -15px;
  border-left: 2px dashed color-mix(in srgb, var(--brand) 35%, var(--line)); }
#listener .howto-steps > li:not(:last-child)::after { border-left-color: color-mix(in srgb, var(--note) 40%, var(--line)); }
.howto-steps h3 { margin: 4px 0 6px; font-size: 1.08rem; }
.howto-steps p { margin: 0 0 8px; }
.howto-tip { font-size: .92rem; color: var(--ink-soft); border-left: 3px solid var(--brand); padding-left: 10px; }
.howto-go { margin: 18px 0 0; text-align: center; }
kbd { font: inherit; font-size: .85em; padding: 1px 6px; border: 1px solid var(--field-line); border-bottom-width: 2px;
  border-radius: 6px; background: var(--surface-2); white-space: nowrap; }

.mock { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; padding: 12px; border-radius: 12px;
  background: var(--bg); border: 1px solid var(--line); font-size: .88rem; line-height: 1.4; user-select: none; }
.mock-center { align-items: center; text-align: center; }
.mock-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.mock-row > .mock-field { flex: 1; min-width: 0; }
.mock-label { font-size: .7rem; text-transform: uppercase; letter-spacing: .07em; font-weight: 700; color: var(--ink-soft); }
.mock-muted { color: var(--ink-soft); font-size: .9em; font-weight: 400; }
.mock-field { display: block; padding: 8px 10px; border: 1px solid var(--field-line); border-radius: 8px; background: var(--field); color: var(--ink); }
.mock-select { position: relative; padding-right: 28px; }
.mock-select::after { content: ''; position: absolute; right: 11px; top: 50%; width: 6px; height: 6px; margin-top: -5px;
  border-right: 2px solid var(--ink-soft); border-bottom: 2px solid var(--ink-soft); transform: rotate(45deg); }
.mock-note { border-style: dashed; background: var(--surface-2); color: var(--ink-soft); min-height: 2.8em; }
.mock-typed { color: var(--ink); }
/* An empty box showing its hint text, like a real placeholder. */
.mock-hint { color: var(--ink-soft); }
.mock-codefield, .mock-code { font-weight: 700; letter-spacing: .14em; text-align: center; font-size: 1.15rem; }
.mock-code b { color: var(--brand); }
.mock-btn { display: inline-block; flex: none; text-align: center; padding: 7px 12px; border-radius: 9px; border: 1px solid var(--line);
  background: var(--surface); color: var(--ink); font-weight: 600; }
.mock-btn-primary { background: linear-gradient(135deg, var(--brand), var(--brand-ink)); color: var(--on-fill); border-color: transparent; }
.mock-btn-mine { background: var(--note); color: var(--note-ink); border-color: var(--note); }
.mock-btn-on { background: var(--accent-fill); color: var(--on-fill); border-color: var(--accent-fill); }
.mock-wide { display: block; }
.mock-card { display: flex; flex-direction: column; gap: 2px; padding: 10px 12px; border-radius: 10px; background: var(--surface);
  border: 1px solid var(--line); border-left: 4px solid var(--accent); font-weight: 600; }
.mock-num { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 6px; margin-right: 6px;
  background: var(--accent-soft); color: var(--verse); font-weight: 700; font-size: .8rem; }
.mock-ref { display: flex; align-items: center; gap: 4px; font-weight: 700; }
.mock-verse { padding: 8px 10px; border-radius: 8px; background: var(--accent-soft); color: var(--verse); }
.mock-chip { align-self: flex-start; padding: 5px 11px; border-radius: 999px; border: 1px dashed var(--field-line); font-weight: 600; font-size: .9em; }
.mock-chip-note { border-style: solid; background: var(--note-soft); color: var(--note); border-color: color-mix(in srgb, var(--note) 45%, var(--line)); }
.mock-qr { display: block; width: 92px; height: 92px; padding: 6px; border-radius: 8px; background: #fff; box-shadow: 0 0 0 1px var(--line); }
.mock-qr svg { display: block; width: 100%; height: 100%; }
.mock-presenter, .mock-phone { background: var(--surface); box-shadow: var(--shadow); }
.mock-phone { border-radius: 22px; border-width: 2px; }

.howto-faq { margin-top: 44px; }
.howto-faq h2 { margin-bottom: 4px; }
.howto-faq-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 14px; margin-top: 12px; }
.howto-faq-grid > div { padding: 14px 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.howto-faq-grid h3 { margin: 0 0 6px; font-size: 1rem; }
.howto-faq-grid p { margin: 0; color: var(--ink-soft); }
.mock-col { display: flex; flex-direction: column; gap: 4px; flex: 1; min-width: 0; }
.mock-row > .mock-col { align-self: flex-start; }
.mock-flabel { font-size: .78rem; font-weight: 700; color: var(--ink); }
/* The support ask in Quick answers: clay, the same colour as the Support tab,
   so it reads as the one place to give and is not lost in grey text. */
.howto-faq-support { border-color: color-mix(in srgb, var(--support) 50%, var(--line)) !important; }
.btn-support-cta { display: block; margin-top: 12px; text-align: center; font-weight: 700;
  background: var(--support); color: var(--support-ink); border-color: var(--support); }
.btn-support-cta:hover { filter: brightness(1.06); }

@media (max-width: 760px) {
  .howto-hero { margin-bottom: 18px; }
  .howto-lead { font-size: 1.02rem; }
  .howto-bar { gap: 8px; padding: 8px 0; }
  .howto-pick { padding: 10px 8px; text-align: center; box-shadow: none; }
  .howto-pick-sub { display: none; }
  .howto-cols { grid-template-columns: 1fr; }
  /* Only once the script has picked a guide; without it both simply stack. */
  .howto-tracks[data-show="presenter"] #listener, .howto-tracks[data-show="listener"] #presenter { display: none; }
  .howto-pick.is-presenter[aria-current="true"] { background: var(--accent-fill); color: var(--on-fill); border-color: var(--accent-fill); }
  .howto-pick.is-listener[aria-current="true"] { background: var(--note); color: var(--note-ink); border-color: var(--note); }
  .howto-steps > li { padding-left: 56px; }
  .howto-steps > li::before { left: 12px; }
  .howto-steps > li:not(:last-child)::after { left: 27px; }
}

/* ---- Add a passage: its notes, and the tap-by-tap preview (pastor.html) ---- */
.field-label { display: block; font-weight: 600; font-size: .9rem; margin-bottom: 6px; }
.draft-notes { list-style: none; margin: 0 0 8px; padding: 0; display: grid; gap: 10px; }
.draft-note { padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.draft-note.is-private { border-style: dashed; }
.draft-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 6px; }
.draft-note textarea { min-height: 64px; }
.draft-private { margin-top: 8px; font-size: .9rem; }
.tap-preview { padding: 12px 14px; border-radius: 12px; background: var(--note-soft); border: 1px solid color-mix(in srgb, var(--note) 35%, var(--line)); }
.tap-preview-title { display: block; font-size: .75rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--note); margin-bottom: 6px; }
.tap-preview { margin-top: 12px; }
.tap-steps { margin: 6px 0 0; padding-left: 1.4em; display: grid; gap: 4px; font-size: .92rem; }
.tap-steps li::marker { color: var(--note); font-weight: 700; }
.tap-preview p { margin: 0; }
.tap-preview p + p, .tap-preview ol + p { margin-top: 8px; }

/* The note box: a what-you-see editor standing in for the textarea (richtext.js).
   Looks like the other fields; formatting shows as formatting. */
.rich-editor { min-height: 70px; padding: 11px 13px; border: 1px solid var(--field-line); border-radius: 10px;
  background: var(--field); color: var(--ink); white-space: pre-wrap; overflow-wrap: break-word; line-height: 1.5; cursor: text; }
.rich-editor:focus { outline: 2px solid color-mix(in srgb, var(--accent) 60%, transparent); border-color: var(--accent); }
.rich-editor.is-empty::before { content: attr(data-placeholder); color: var(--ink-soft); pointer-events: none; }
.rich-editor ul, .rich-editor ol { margin: 4px 0; padding-left: 1.4em; }
.rich-btn[aria-pressed="true"] { background: var(--accent-soft); color: var(--verse); border-color: var(--accent); }
.grip { cursor: grab; touch-action: none; }
.grip.is-off { cursor: default; opacity: .35; }

/* "New note" — a presenter note revealed out of sight (follow.js offerNewNote).
   Bottom left, clear of the text-size buttons; ochre like notes on the live screen. */
.new-note-hint { position: fixed; left: 14px; bottom: calc(14px + env(safe-area-inset-bottom, 0px)); z-index: 30;
  height: 44px; padding: 0 16px; border-radius: 999px; border: 1px solid var(--note);
  background: var(--note); color: var(--note-ink); font-weight: 700; font-size: 15px; box-shadow: var(--shadow); }

/* Date boxes on phones: iOS draws <input type=date> at its own intrinsic width,
   which pushed past the field and over the Bible version box next to it. */
.field { min-width: 0; }
input[type="date"] { min-width: 0; max-width: 100%; display: block; -webkit-appearance: none; appearance: none; min-height: calc(1.5em + 24px); }

/* "Still presenting?" on the live screen (pastor.html #stillThere). */
.still-there { display: grid; gap: 10px; margin-top: 12px; padding: 14px 16px; border-radius: 12px;
  background: var(--note-soft); border: 2px solid var(--note); }
/* The Display controls, moved under Reading & display when signed in, carry the
   borderless inline style of their stand-alone card; give them a divider here. */
#displaySlot .settings-section { border-top: 1px solid var(--line) !important; padding-top: 14px !important; margin-top: 6px; }
