/* Lamp design system (polish, Oct 2026). Calm, warm, quiet. Tokens first; see /workspace/bible-docs/DESIGN.md.
   Fonts are self-hosted (CSP is self-only): Literata (SIL OFL 1.1, fonts/Literata-OFL.txt) for scripture and headings, system sans for UI.
   Motion animates only transform and opacity, 150-350 ms, and is switched off under prefers-reduced-motion. */
@font-face { font-family: "Literata"; font-style: normal; font-weight: 400 650; font-display: optional; src: url(/fonts/literata-latin.woff2?v=1) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Literata"; font-style: normal; font-weight: 400 650; font-display: optional; src: url(/fonts/literata-latin-ext.woff2?v=1) format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0300-0303, U+0305-0307, U+0309-0328, U+032A-036F, U+1E00-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Literata"; font-style: normal; font-weight: 400 650; font-display: optional; src: url(/fonts/literata-cyrillic.woff2?v=1) format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }

:root {
  /* surfaces: warm parchment and ivory */
  --bg: #f6f0e4; --bg-deep: #efe6d4; --card: #fffcf6; --card-2: #fbf5ea; --field: #fffefb;
  /* ink */
  --ink: #2a231c; --ink-2: #4a4036; --muted: #6a5d4f; --line: #e6dac6; --line-soft: #efe5d4;
  /* candlelight accent (AA with white text) */
  --accent: #985818; --accent-ink: #8a4c10; --accent2: #c98a3c; --accent-soft: #f6e6cf; --glow: #f3b45a; --on-accent: #ffffff;
  --ok: #2f6f45; --warn: #9a3b2e; --on-warn: #ffffff;
  /* depth */
  --sh-1: 0 1px 2px rgba(72, 48, 16, .06), 0 1px 1px rgba(72, 48, 16, .04);
  --sh-2: 0 1px 2px rgba(72, 48, 16, .05), 0 6px 18px -6px rgba(72, 48, 16, .14);
  --sh-3: 0 2px 6px rgba(72, 48, 16, .07), 0 18px 40px -14px rgba(72, 48, 16, .26);
  --ring: 0 0 0 3px color-mix(in srgb, var(--accent2) 45%, transparent);
  /* shape, spacing and type scales */
  --r-xs: 8px; --r-sm: 12px; --r: 18px; --r-lg: 24px; --r-pill: 999px;
  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 20px; --s6: 28px; --s7: 40px;
  --t-xs: 12.5px; --t-sm: 14px; --t-md: 16px; --t-lg: 18px; --t-xl: 22px; --t-2xl: 28px;
  --serif: "Literata", "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Charter, "Noto Serif", "Noto Naskh Arabic", "Noto Serif Devanagari", "Noto Serif CJK SC", Georgia, serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", "Noto Sans Arabic", "Noto Sans Devanagari", "Noto Sans CJK SC", "Helvetica Neue", Arial, sans-serif;
  --ease: cubic-bezier(.2, .7, .2, 1); --ease-out: cubic-bezier(.16, 1, .3, 1); --d-fast: 160ms; --d: 240ms; --d-slow: 340ms;
  --font: 19px; --measure: 36em; --nav-h: 64px; --top-h: 58px;
  --hl-yellow: #fff0a6; --hl-green: #d9f0d0; --hl-blue: #d6e6f8; --hl-pink: #f8dbe6;
  color-scheme: light;
}
/* dark: warm deep brown-charcoal, never pure black, never grey-blue */
html.dark {
  --bg: #1d1915; --bg-deep: #171410; --card: #27211b; --card-2: #2e2720; --field: #221d18;
  --ink: #f2eadc; --ink-2: #dcd0bd; --muted: #b8a993; --line: #3d342a; --line-soft: #332b23;
  --accent: #e3a85c; --accent-ink: #ecb877; --accent2: #c98a3c; --accent-soft: #3a2c1c; --glow: #f3b45a; --on-accent: #1d1307;
  --ok: #8fcf9f; --warn: #f0a08f; --on-warn: #1d1307;
  --sh-1: 0 1px 2px rgba(0, 0, 0, .3); --sh-2: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 22px -8px rgba(0, 0, 0, .55);
  --sh-3: 0 2px 6px rgba(0, 0, 0, .35), 0 20px 44px -16px rgba(0, 0, 0, .7);
  --hl-yellow: #5a4c17; --hl-green: #26452b; --hl-blue: #1f3a55; --hl-pink: #55283a;
  color-scheme: dark;
}

/* ---------- base ---------- */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
html, body { margin: 0; background: var(--bg); color: var(--ink); }
body { font: 16px/1.55 var(--sans); -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; min-height: 100dvh;
  background: radial-gradient(1200px 520px at 50% -180px, color-mix(in srgb, var(--glow) 13%, transparent), transparent 70%) no-repeat, var(--bg);
  padding-bottom: calc(var(--nav-h) + 12px + env(safe-area-inset-bottom)); }
a { color: var(--accent-ink); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--accent2); outline-offset: 2px; border-radius: 6px; }
::selection { background: color-mix(in srgb, var(--glow) 40%, transparent); }
.ico svg, svg.ico { width: 20px; height: 20px; flex: 0 0 auto; display: block; }
hr { border: 0; border-top: 1px solid var(--line); margin: var(--s4) 0; }

/* ---------- header ---------- */
.top { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; justify-content: space-between; gap: var(--s2);
  min-height: var(--top-h); padding: calc(8px + env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) 8px max(16px, env(safe-area-inset-left));
  background: color-mix(in srgb, var(--bg) 82%, transparent); -webkit-backdrop-filter: saturate(1.4) blur(14px); backdrop-filter: saturate(1.4) blur(14px);
  border-bottom: 1px solid color-mix(in srgb, var(--line) 70%, transparent); }
.brand { display: inline-flex; gap: 9px; align-items: center; text-decoration: none; color: var(--ink); font: 600 23px/1 var(--serif); letter-spacing: .2px;
  min-height: 44px; padding-inline-end: 6px; border-radius: 12px; }
.brand img { width: 34px; height: 34px; display: block; margin-block-start: -4px; }
.brand:hover { text-decoration: none; }
.top-actions { display: flex; gap: var(--s2); align-items: center; }
.chip { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); background: var(--card); color: var(--ink); border-radius: var(--r-pill);
  padding: 7px 13px; font-size: var(--t-sm); cursor: pointer; min-height: 40px; min-width: 40px; justify-content: center; box-shadow: var(--sh-1); }
.chip .ico svg { width: 18px; height: 18px; }
#themeBtn { width: 42px; padding: 0; }
#themeBtn .i-moon { display: none; } html.dark #themeBtn .i-moon { display: block; } html.dark #themeBtn .i-sun { display: none; }

/* ---------- main column ---------- */
main { max-width: 760px; margin: 0 auto; padding: var(--s4) max(16px, env(safe-area-inset-right)) var(--s7) max(16px, env(safe-area-inset-left)); outline: none; overflow-wrap: anywhere; }
.card { position: relative; background: var(--card); border: 1px solid var(--line-soft); border-radius: var(--r); padding: var(--s5); margin: 0 0 var(--s4); box-shadow: var(--sh-2); }
h1 { font: 600 var(--t-2xl)/1.2 var(--serif); letter-spacing: -.2px; margin: var(--s2) 0 var(--s3); text-wrap: balance; }
h2 { font: 600 var(--t-xl)/1.28 var(--serif); margin: 0 0 var(--s3); text-wrap: balance; }
h3 { font: 600 var(--t-xs)/1.3 var(--sans); margin: var(--s4) 0 var(--s2); color: var(--muted); text-transform: uppercase; letter-spacing: .08em; }
p { margin: 0 0 var(--s3); }
.card > :last-child { margin-bottom: 0; }
.muted { color: var(--muted); font-size: var(--t-sm); }
.row { display: flex; gap: var(--s2); flex-wrap: wrap; align-items: center; }
.row > * { min-width: 0; }
.grow { flex: 1 1 auto; }
.center { text-align: center; }
.stack > * + * { margin-top: var(--s3); }
.stack > label { display: block; }
.err { color: var(--warn); font-size: var(--t-sm); }
img, svg { max-width: 100%; }

/* back links: one consistent, 44px pill */
.back { display: inline-flex; align-items: center; gap: 4px; min-height: 44px; padding: 6px 12px 6px 6px; margin: 0 0 var(--s1) -6px; border-radius: var(--r-pill);
  color: var(--accent-ink); text-decoration: none; font-weight: 600; font-size: var(--t-sm); }
.back .ico svg { width: 18px; height: 18px; }
@media (hover: hover) { .back:hover { background: color-mix(in srgb, var(--accent) 9%, transparent); } }
html[dir=rtl] .back .ico svg, html[dir=rtl] .menu-row .chev svg { transform: scaleX(-1); }
.page-head { display: flex; align-items: center; gap: var(--s3); margin: var(--s1) 0 var(--s3); }
.page-head h1 { margin: 0; }
.page-head .badge-ico { width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; flex: 0 0 auto; color: var(--accent-ink);
  background: linear-gradient(160deg, var(--accent-soft), color-mix(in srgb, var(--accent-soft) 40%, var(--card))); border: 1px solid var(--line-soft); }
.page-head .badge-ico svg { width: 22px; height: 22px; }
.lede { color: var(--muted); font-size: var(--t-md); margin-top: calc(-1 * var(--s1)); }

/* ---------- form controls ---------- */
select, input, textarea, button { font: inherit; }
select, input[type=text], input[type=email], input[type=password], input[type=time], input[type=search], input[type=number], input[type=url], input[type=date], textarea {
  width: 100%; max-width: 100%; min-height: 46px; padding: 10px 14px; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--field); color: var(--ink);
  box-shadow: inset 0 1px 2px rgba(72, 48, 16, .05); }
select { appearance: none; -webkit-appearance: none; padding-inline-end: 36px; cursor: pointer;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 19px) 52%, calc(100% - 14px) 52%; background-size: 5px 5px, 5px 5px; background-repeat: no-repeat; text-overflow: ellipsis; }
html[dir=rtl] select { background-position: 14px 52%, 19px 52%; }
select:focus, input:focus, textarea:focus { outline: none; border-color: var(--accent2); box-shadow: var(--ring); }
textarea { min-height: 96px; resize: vertical; line-height: 1.5; }
input::placeholder, textarea::placeholder { color: color-mix(in srgb, var(--muted) 80%, transparent); }
input[type=checkbox], input[type=radio] { width: 20px; height: 20px; vertical-align: middle; accent-color: var(--accent); margin: 0 6px 0 0; }
html[dir=rtl] input[type=checkbox], html[dir=rtl] input[type=radio] { margin: 0 0 0 6px; }
label.check, .stack > label.check { display: flex; align-items: center; gap: 4px; min-height: 40px; }
details > summary { min-height: 44px; display: list-item; padding-block: 10px; cursor: pointer; color: var(--accent-ink); font-weight: 600; }

/* ---------- buttons: press scale + a soft glow where you touched ---------- */
.btn { position: relative; isolation: isolate; display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 46px; padding: 10px 18px;
  border: 0; border-radius: var(--r-sm); background: var(--accent); color: var(--on-accent); font-weight: 600; letter-spacing: .1px; cursor: pointer; text-decoration: none;
  vertical-align: middle; box-shadow: 0 1px 0 rgba(255, 255, 255, .18) inset, 0 1px 2px rgba(72, 48, 16, .18), 0 6px 14px -8px color-mix(in srgb, var(--accent) 80%, transparent);
  transition: transform var(--d-fast) var(--ease), opacity var(--d-fast) var(--ease); -webkit-tap-highlight-color: transparent; text-align: center; }
.btn::after { content: ""; position: absolute; inset: 0; border-radius: inherit; z-index: -1; pointer-events: none; opacity: 0;
  background: radial-gradient(circle at var(--rx, 50%) var(--ry, 50%), rgba(255, 255, 255, .42), rgba(255, 255, 255, 0) 62%); transition: opacity var(--d-slow) var(--ease); }
.btn.secondary::after, .chip::after { background: radial-gradient(circle at var(--rx, 50%) var(--ry, 50%), color-mix(in srgb, var(--glow) 38%, transparent), transparent 62%); }
.btn:hover { text-decoration: none; }
.btn:active, .btn.pressed { transform: scale(.97); }
.btn.pressed::after { opacity: 1; transition-duration: 60ms; }
.btn .ico svg { width: 18px; height: 18px; }
.btn.secondary { background: var(--card); color: var(--ink); border: 1px solid var(--line); box-shadow: var(--sh-1); }
.btn.secondary .ico { color: var(--accent-ink); }
.btn.ghost { background: transparent; color: var(--accent-ink); box-shadow: none; }
.btn.small { min-height: 40px; padding: 7px 13px; font-size: var(--t-sm); font-weight: 600; border-radius: 11px; }
.btn.small.swatch { min-width: 40px; min-height: 40px; padding: 0; }
.btn.danger { background: var(--warn); color: var(--on-warn); }
.btn.small.danger { background: transparent; color: var(--warn); border: 1px solid color-mix(in srgb, var(--warn) 40%, transparent); box-shadow: none; }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none; }
.btn.block { display: flex; width: 100%; }
.chip { position: relative; isolation: isolate; transition: transform var(--d-fast) var(--ease); }
.chip::after { content: ""; position: absolute; inset: 0; border-radius: inherit; z-index: -1; opacity: 0; transition: opacity var(--d-slow) var(--ease); pointer-events: none; }
.chip:active, .chip.pressed { transform: scale(.96); } .chip.pressed::after { opacity: 1; transition-duration: 60ms; }
.chip.on { outline: 0; border-color: var(--accent); box-shadow: var(--ring); }
.icon-btn { width: 44px; min-width: 44px; padding: 0; white-space: nowrap; }
.toolbar { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; padding: 4px; border-radius: 14px; background: var(--card-2); border: 1px solid var(--line-soft); width: fit-content; max-width: 100%; }
.toolbar .btn.small { min-height: 40px; background: transparent; border-color: transparent; box-shadow: none; }
.toolbar .btn.small:hover { background: var(--card); }
.toolbar .sep { width: 1px; height: 22px; background: var(--line); }

/* interactive cards rise on hover and settle on press (shadow lives in ::after so only opacity animates) */
a.card, .lift { display: block; text-decoration: none; color: var(--ink); transition: transform var(--d) var(--ease); -webkit-tap-highlight-color: transparent; }
a.card::after, .lift::after { content: ""; position: absolute; inset: -1px; border-radius: inherit; box-shadow: var(--sh-3); opacity: 0; transition: opacity var(--d) var(--ease); pointer-events: none; }
@media (hover: hover) { a.card:hover, .lift:hover { transform: translateY(-2px); } a.card:hover::after, .lift:hover::after { opacity: 1; } }
a.card:active, .lift:active { transform: translateY(0) scale(.99); }

/* ---------- bottom navigation ---------- */
.tabs { position: fixed; bottom: 0; left: 0; right: 0; z-index: 12; display: grid; grid-template-columns: repeat(6, 1fr);
  padding: 4px max(4px, env(safe-area-inset-right)) env(safe-area-inset-bottom) max(4px, env(safe-area-inset-left));
  background: color-mix(in srgb, var(--card) 88%, transparent); -webkit-backdrop-filter: saturate(1.5) blur(16px); backdrop-filter: saturate(1.5) blur(16px);
  border-top: 1px solid color-mix(in srgb, var(--line) 80%, transparent); box-shadow: 0 -8px 24px -18px rgba(72, 48, 16, .35); }
.tabs a { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; min-height: 56px; padding: 6px 2px 7px;
  text-decoration: none; color: var(--muted); font-size: 11.5px; font-weight: 500; letter-spacing: .1px; -webkit-tap-highlight-color: transparent; }
.tabs a span:last-child { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tabs .ico { position: relative; display: grid; place-items: center; width: 50px; height: 30px; border-radius: var(--r-pill); }
.tabs .ico::before { content: ""; position: absolute; inset: 0; border-radius: inherit; background: color-mix(in srgb, var(--accent) 14%, transparent);
  opacity: 0; transform: scaleX(.6); transition: opacity var(--d) var(--ease), transform var(--d) var(--ease-out); }
.tabs .ico svg { position: relative; width: 22px; height: 22px; transition: transform var(--d) var(--ease-out); }
.tabs a.on { color: var(--accent-ink); font-weight: 650; }
.tabs a.on .ico::before { opacity: 1; transform: none; }
.tabs a:active .ico svg { transform: scale(.9); }
.badge { position: absolute; top: 3px; inset-inline-end: calc(50% - 26px); min-width: 18px; height: 18px; line-height: 18px; text-align: center; background: var(--warn); color: var(--on-warn);
  border-radius: 999px; font-size: 11px; font-weight: 700; padding: 0 5px; box-shadow: 0 0 0 2px var(--card); }
@media (min-width: 700px) {
  body { padding-bottom: calc(var(--nav-h) + 34px + env(safe-area-inset-bottom)); }
  .tabs { left: 50%; right: auto; bottom: calc(12px + env(safe-area-inset-bottom)); width: min(620px, calc(100% - 32px)); transform: translateX(-50%); padding: 4px;
    border: 1px solid color-mix(in srgb, var(--line) 80%, transparent); border-radius: 22px; box-shadow: var(--sh-3); }
}

/* ---------- toast + bottom sheet ---------- */
#toast { position: fixed; left: 50%; bottom: calc(var(--nav-h) + 22px + env(safe-area-inset-bottom)); z-index: 40; max-width: min(90vw, 460px); padding: 11px 18px;
  border-radius: 14px; background: color-mix(in srgb, var(--ink) 94%, transparent); color: var(--bg); font-size: var(--t-sm); text-align: center; box-shadow: var(--sh-3);
  opacity: 0; transform: translate(-50%, 14px) scale(.98); transition: opacity var(--d) var(--ease), transform var(--d) var(--ease-out); pointer-events: none; }
#toast.on { opacity: 1; transform: translate(-50%, 0); }
@media (min-width: 700px) { #toast { bottom: calc(var(--nav-h) + 44px + env(safe-area-inset-bottom)); } }
.modal { position: fixed; inset: 0; z-index: 50; display: flex; align-items: flex-end; justify-content: center; background: rgba(30, 20, 8, .42); animation: fade-in var(--d) var(--ease) both; }
.modal[hidden] { display: none; }
.modal.closing { animation: fade-out 180ms var(--ease) both; }
.sheet { width: 100%; max-width: 560px; max-height: 86vh; overflow: auto; background: var(--card); border-radius: 24px 24px 0 0; padding: 10px 18px calc(24px + env(safe-area-inset-bottom));
  box-shadow: var(--sh-3); animation: sheet-up var(--d-slow) var(--ease-out) both; }
.sheet::before { content: ""; display: block; width: 40px; height: 5px; border-radius: 99px; background: var(--line); margin: 0 auto 12px; }
.modal.closing .sheet { animation: sheet-down 180ms var(--ease) both; }
@media (min-width: 700px) { .modal { align-items: center; } .sheet { border-radius: 24px; } }
.langlist button { display: flex; justify-content: space-between; align-items: center; width: 100%; min-height: 50px; padding: 12px 14px; margin: 0 0 8px; cursor: pointer;
  border: 1px solid var(--line); border-radius: 14px; background: var(--card-2); color: var(--ink); font-size: 17px; transition: transform var(--d-fast) var(--ease); }
.langlist button:active { transform: scale(.98); }
.langlist button.on { border-color: var(--accent); box-shadow: var(--ring); background: var(--card); }
.langlist small { color: var(--muted); }

/* ---------- motion: route entrance (fade + rise, staggered), skeletons, progress ---------- */
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes fade-out { from { opacity: 1; } to { opacity: 0; } }
@keyframes sheet-up { from { transform: translateY(40px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes sheet-down { from { transform: none; opacity: 1; } to { transform: translateY(40px); opacity: 0; } }
@keyframes shimmer { from { transform: translateX(-100%); } to { transform: translateX(100%); } }
@keyframes fill { from { transform: scaleX(0); } }
@keyframes flicker { 0%, 100% { transform: scale(1, 1) rotate(0); opacity: 1; } 22% { transform: scale(.97, 1.04) rotate(-1.4deg); } 48% { transform: scale(1.02, .97) rotate(1deg); opacity: .94; }
  71% { transform: scale(.98, 1.03) rotate(-.6deg); } }
main.enter > * { animation: rise 300ms var(--ease-out) both; }
main.enter > :nth-child(2) { animation-delay: 40ms; } main.enter > :nth-child(3) { animation-delay: 80ms; } main.enter > :nth-child(4) { animation-delay: 120ms; }
main.enter > :nth-child(5) { animation-delay: 150ms; } main.enter > :nth-child(n+6) { animation-delay: 180ms; }
.stagger > * { animation: rise 280ms var(--ease-out) both; }
.stagger > :nth-child(2) { animation-delay: 35ms; } .stagger > :nth-child(3) { animation-delay: 70ms; } .stagger > :nth-child(4) { animation-delay: 100ms; }
.stagger > :nth-child(5) { animation-delay: 125ms; } .stagger > :nth-child(n+6) { animation-delay: 150ms; }
.skeleton { display: grid; gap: 12px; padding: var(--s5); border-radius: var(--r); background: var(--card); border: 1px solid var(--line-soft); margin-bottom: var(--s4); animation: fade-in var(--d) var(--ease) 80ms both; }
.skeleton i { position: relative; display: block; height: 14px; border-radius: 7px; background: var(--line-soft); overflow: hidden; }
.skeleton i:nth-child(1) { height: 22px; width: 46%; } .skeleton i:nth-child(3) { width: 92%; } .skeleton i:nth-child(4) { width: 78%; } .skeleton i:nth-child(5) { width: 64%; }
.skeleton i::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--card) 70%, transparent), transparent); animation: shimmer 1.3s ease-in-out infinite; }
.bar { position: relative; height: 10px; border-radius: 999px; background: var(--line-soft); overflow: hidden; margin-block: var(--s2); box-shadow: inset 0 1px 2px rgba(72, 48, 16, .08); }
.bar > span { display: block; height: 100%; width: 100%; border-radius: 999px; transform-origin: 0 50%; transform: scaleX(var(--p, 0));
  background: linear-gradient(90deg, var(--accent2), var(--accent)); animation: fill var(--d-slow) var(--ease-out) 120ms both; transition: transform var(--d-slow) var(--ease-out); }
html[dir=rtl] .bar > span { transform-origin: 100% 50%; }
.lamp-flame { transform-box: fill-box; transform-origin: 50% 100%; }
.flicker .lamp-flame { animation: flicker 3.2s ease-in-out infinite; }
::view-transition-old(root), ::view-transition-new(root) { animation-duration: 280ms; animation-timing-function: ease; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 1ms !important; animation-delay: 0ms !important; animation-iteration-count: 1 !important; transition-duration: 1ms !important; scroll-behavior: auto !important; }
  .flicker .lamp-flame, .breath, .skeleton i::after { animation: none !important; }
}

/* ---------- reader ---------- */
.reader-tools { display: grid; gap: var(--s3); }
.picker { display: grid; grid-template-columns: 1.5fr 1.3fr .8fr; gap: var(--s2); }
.picker > * { min-width: 0; }
.searchrow { display: flex; gap: var(--s2); }
.searchrow .grow { flex: 1 1 auto; min-width: 0; }
.searchrow .btn { flex: none; white-space: nowrap; }
.search-wrap { position: relative; }
.search-wrap .ico { position: absolute; inset-inline-start: 13px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.search-wrap .ico svg { width: 18px; height: 18px; }
.search-wrap input { padding-inline-start: 40px; }
.tr-meta { display: flex; gap: 6px 10px; flex-wrap: wrap; align-items: center; }
.chapter-head { display: flex; align-items: flex-end; justify-content: space-between; gap: var(--s3); flex-wrap: wrap; margin-bottom: var(--s4); }
.chapter-head h1 { margin: 0; font-size: 32px; }
.chapter-head .kicker { display: block; font: 600 var(--t-xs)/1.2 var(--sans); letter-spacing: .1em; text-transform: uppercase; color: var(--accent-ink); margin-bottom: 6px; }
.reader { font-family: var(--serif); font-size: var(--font); line-height: 1.8; max-width: var(--measure); margin-inline: auto; color: var(--ink); hanging-punctuation: first; }
.reader .v { padding: 2px 3px; border-radius: 6px; cursor: pointer; -webkit-box-decoration-break: clone; box-decoration-break: clone; }
@media (hover: hover) { .reader .v:hover { background: color-mix(in srgb, var(--glow) 12%, transparent); } }
.reader .v sup { color: var(--accent-ink); font: 650 .58em/1 var(--sans); margin-inline-end: 3px; letter-spacing: .02em; }
.reader .v.sel { background: color-mix(in srgb, var(--glow) 22%, transparent); box-shadow: inset 0 -2px 0 var(--accent2); }
.reader .v.speaking { background: var(--hl-blue); }
.hl-yellow { background: var(--hl-yellow); } .hl-green { background: var(--hl-green); } .hl-blue { background: var(--hl-blue); } .hl-pink { background: var(--hl-pink); }
.attr { max-width: var(--measure); margin: var(--s5) auto 0; font-size: 13px; color: var(--muted); border-top: 1px solid var(--line); padding-top: var(--s3); }
.attr b { color: var(--ink); font-weight: 650; }
.navrow { display: flex; justify-content: space-between; align-items: center; gap: var(--s2); margin-top: var(--s4); }
.verse-actions { position: sticky; bottom: calc(var(--nav-h) + 14px + env(safe-area-inset-bottom)); z-index: 4; display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; align-items: center;
  margin-top: var(--s3); padding: 10px; border-radius: 18px; background: color-mix(in srgb, var(--card) 94%, transparent); border: 1px solid var(--line);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); box-shadow: var(--sh-3); animation: sheet-up var(--d) var(--ease-out) both; }
.verse-actions strong { flex-basis: 100%; text-align: center; font: 600 var(--t-sm)/1.3 var(--serif); color: var(--accent-ink); }
@media (min-width: 700px) { .verse-actions { bottom: calc(var(--nav-h) + 36px + env(safe-area-inset-bottom)); } }
.results { display: grid; gap: var(--s2); margin-top: var(--s2); }
.result { display: block; width: 100%; text-align: start; cursor: pointer; border: 1px solid var(--line-soft); border-radius: 14px; padding: 12px 14px; background: var(--card-2);
  color: var(--ink); font: 16px/1.6 var(--serif); transition: transform var(--d-fast) var(--ease); }
.result:active { transform: scale(.99); }
.result .ref { display: block; margin-top: 4px; font: 600 13px/1.3 var(--sans); color: var(--accent-ink); }
.quote { font-family: var(--serif); font-size: var(--t-lg); line-height: 1.65; }
.quote .ref { display: block; margin-top: var(--s2); font: 650 var(--t-sm)/1.3 var(--sans); color: var(--accent-ink); }
.planbar { display: flex; gap: var(--s2); align-items: center; flex-wrap: wrap; padding: 10px 12px; margin-block: 0 var(--s4); border: 1px solid var(--line); border-radius: 14px; background: var(--card-2); }
.planbar .grow, .row .grow, .dlrow .grow { flex: 1 1 auto; min-width: 0; }

/* ---------- Today: hero verse ---------- */
.hero { overflow: hidden; padding: var(--s6) var(--s5) var(--s5);
  background: radial-gradient(420px 220px at 88% -10%, color-mix(in srgb, var(--glow) 22%, transparent), transparent 70%), linear-gradient(180deg, var(--card), var(--card-2)); }
.hero .kicker { display: inline-flex; align-items: center; gap: 6px; font: 650 var(--t-xs)/1 var(--sans); letter-spacing: .1em; text-transform: uppercase; color: var(--accent-ink); margin-bottom: var(--s3); }
.hero .quote { font-size: 20px; line-height: 1.7; position: relative; }
.hero { position: relative; }
.hero::before { content: "\201C"; position: absolute; inset-inline-end: 18px; top: 4px; font: 96px/1 var(--serif); color: color-mix(in srgb, var(--accent2) 22%, transparent); pointer-events: none; }
.hero .hero-foot { display: flex; justify-content: space-between; align-items: center; gap: var(--s2); flex-wrap: wrap; margin-top: var(--s3); }
.label-box { margin-top: var(--s3); padding: 12px 14px; border-radius: 14px; background: color-mix(in srgb, var(--accent) 8%, var(--card)); border: 1px solid color-mix(in srgb, var(--accent) 26%, transparent); font-size: var(--t-sm); }
.label-box b { display: block; }
.notif { border: 1px solid var(--line-soft); border-radius: 16px; padding: 13px 15px; background: var(--card-2); margin: var(--s2) 0; }
.notif .t { font-weight: 650; font-size: 15px; display: flex; gap: 9px; align-items: center; }
.notif .t img { width: 22px; height: 22px; border-radius: 6px; flex: 0 0 auto; }
.notif .b { white-space: pre-wrap; font-size: 15px; margin-top: 5px; }
.notif.unread { border-color: color-mix(in srgb, var(--accent2) 70%, transparent); box-shadow: inset 3px 0 0 var(--accent2); }
html[dir=rtl] .notif.unread { box-shadow: inset -3px 0 0 var(--accent2); }
.topics { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.topics label, .days label { display: flex; align-items: center; gap: 2px; min-height: 42px; border: 1px solid var(--line); border-radius: 12px; padding: 6px 10px; font-size: var(--t-sm); background: var(--card-2); cursor: pointer; }
.days { display: flex; gap: 6px; flex-wrap: wrap; }

/* ---------- lists, pills, misc ---------- */
.pill { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 600; padding: 3px 9px; border-radius: 999px; border: 1px solid var(--line); color: var(--muted); background: var(--card); white-space: nowrap; }
.pill.pending { border-color: color-mix(in srgb, var(--warn) 45%, transparent); color: var(--warn); background: color-mix(in srgb, var(--warn) 6%, var(--card)); }
.pill.ok { border-color: color-mix(in srgb, var(--ok) 45%, transparent); color: var(--ok); background: color-mix(in srgb, var(--ok) 7%, var(--card)); }
.vbadge { display: inline-flex; align-items: center; font-size: 12px; background: color-mix(in srgb, var(--ok) 13%, transparent); color: var(--ok); border-radius: 999px; padding: 2px 9px; font-weight: 650; }
.trlist .tr { display: flex; justify-content: space-between; gap: 10px; padding: 12px 0; border-bottom: 1px solid var(--line-soft); }
.trlist .tr:last-child { border-bottom: 0; }
.trlist .tr.disabled { opacity: .62; }
.ev { display: flex; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line-soft); }
.ev:last-child { border-bottom: 0; }
.ev .d { min-width: 96px; font-weight: 650; font-size: var(--t-sm); color: var(--ink-2); }
.ev.communion .d { color: var(--accent-ink); }
.post { border-bottom: 1px solid var(--line-soft); padding: 12px 0; }
.post:last-child { border-bottom: 0; }
.post .who { font-size: 13px; color: var(--muted); display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.post .txt { white-space: pre-wrap; margin: 4px 0 8px; }
.post.hidden { opacity: .5; }
.room { display: block; text-decoration: none; color: var(--ink); }
.room-card { display: grid !important; grid-template-columns: 48px 1fr auto; gap: 4px 14px; align-items: center; }
.room-card .room-ico { grid-row: span 2; width: 48px; height: 48px; border-radius: 15px; display: grid; place-items: center; color: var(--accent-ink);
  background: linear-gradient(160deg, var(--accent-soft), color-mix(in srgb, var(--accent-soft) 35%, var(--card))); }
.room-card .room-ico svg { width: 24px; height: 24px; }
.room-card h2 { margin: 0; font-size: 19px; }
.room-card p { margin: 0; grid-column: 2 / 4; }
.room .n { float: none; font-size: 12px; color: var(--muted); white-space: nowrap; display: inline-flex; align-items: center; gap: 5px; }
.room .n::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--line); }
.room .n.live::before { background: var(--glow); box-shadow: 0 0 0 3px color-mix(in srgb, var(--glow) 25%, transparent); }
.breath { width: 160px; height: 160px; border-radius: 50%; margin: 24px auto; background: radial-gradient(circle, color-mix(in srgb, var(--glow) 50%, transparent), transparent 70%); animation: breathe 10s ease-in-out infinite; }
@keyframes breathe { 0%, 100% { transform: scale(.7); opacity: .6; } 50% { transform: scale(1.05); opacity: 1; } }
.err-card { text-align: center; }
.offline-bar { background: color-mix(in srgb, var(--warn) 14%, var(--bg)); color: var(--ink); text-align: center; font-size: var(--t-sm); padding: 7px 12px; border-block-end: 1px solid var(--line); }
.offline-bar[hidden] { display: none; }
.days-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 6px; }
.days-list a { display: block; padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; text-decoration: none; color: var(--ink); font-size: 13px; background: var(--card-2); min-height: 44px; }
.days-list a.done { background: color-mix(in srgb, var(--ok) 12%, var(--card)); border-color: color-mix(in srgb, var(--ok) 50%, transparent); }
.reading { gap: 8px; align-items: center; padding-block: 10px; border-block-end: 1px solid var(--line-soft); }
.reading.na { opacity: .6; }
.note { border-block-end: 1px solid var(--line-soft); padding-block: 12px; }
.note .txt { white-space: pre-wrap; overflow-wrap: anywhere; margin-block: 4px 6px; }
.note .meta { font-size: 13px; color: var(--muted); }
.note textarea, #newNote, #verseNoteText { width: 100%; min-height: 96px; }
.dlrow { align-items: center; }
.dl-actions { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.dlrow progress { width: 120px; accent-color: var(--accent); }
.notice { display: flex; gap: 10px; align-items: flex-start; background: color-mix(in srgb, var(--accent) 7%, var(--card)); border: 1px solid color-mix(in srgb, var(--accent) 22%, transparent); border-radius: 14px; padding: 12px 14px; font-size: var(--t-sm); margin-block: var(--s2) var(--s4); color: var(--ink-2); }
.goal-card .goal-title { text-decoration: none; color: inherit; }
.goal-card .goal-title h2 { margin: 0; }
.goal-amount { font: 600 var(--t-xl)/1.2 var(--serif); }
.chips { flex-wrap: wrap; gap: 8px; }
#pledgeChips .chip { min-width: 64px; font-weight: 650; }
#pledgeForm input[type=number], #goalCreate input[type=number] { max-width: 180px; }
.small-print { font-size: 13px; }
.legal-links { font-size: var(--t-sm); flex-basis: 100%; margin: var(--s2) 0 0; color: var(--muted); }

/* ---------- Me: account + menu lists ---------- */
.account { display: flex; gap: var(--s4); align-items: center; }
.account .me-av { width: 56px; height: 56px; flex: 0 0 auto; border-radius: 50%; display: grid; place-items: center; font: 600 20px/1 var(--serif); color: var(--on-accent);
  background: linear-gradient(150deg, var(--accent2), var(--accent)); box-shadow: 0 0 0 4px var(--accent-soft); }
.account h2 { margin: 0 0 2px; font-size: 20px; }
.account p { margin: 0; }
.menu { padding: 6px; }
.menu-row { position: relative; display: flex; align-items: center; gap: 14px; min-height: 54px; padding: 8px 12px; border-radius: 13px; color: var(--ink); text-decoration: none; font-weight: 550;
  transition: transform var(--d-fast) var(--ease); -webkit-tap-highlight-color: transparent; }
.menu-row + .menu-row::before { content: ""; position: absolute; top: 0; inset-inline: 58px 12px; border-top: 1px solid var(--line-soft); }
.menu-row:hover { text-decoration: none; }
@media (hover: hover) { .menu-row:hover { background: var(--card-2); } }
.menu-row:active { transform: scale(.985); }
.menu-row .mi { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; color: var(--accent-ink); background: var(--accent-soft); flex: 0 0 auto; }
.menu-row .mi svg { width: 19px; height: 19px; }
.menu-row .grow { min-width: 0; }
.menu-row .chev { color: var(--muted); } .menu-row .chev svg { width: 18px; height: 18px; }
.menu .legal-links { padding: 4px 12px 8px; margin: 0; }

/* ---------- onboarding ---------- */
body.onboarding .tabs { display: none; }
body.onboarding { padding-bottom: env(safe-area-inset-bottom); }
.onboard { padding: var(--s6) var(--s5) var(--s5); }
.onboard h1 { margin-top: 0; }
.ob-mark { display: block; width: 76px; height: 76px; margin: 2px auto 6px; }
.onboard[data-step="1"] h1 { text-align: center; font-size: 30px; }
.onboard[data-step="1"] > p:first-of-type { text-align: center; }
.ob-top { align-items: center; }
.ob-dots { display: flex; gap: 6px; }
.ob-dots span { position: relative; flex: 1; height: 4px; border-radius: 999px; background: var(--line); overflow: hidden; }
.ob-dots span::after { content: ""; position: absolute; inset: 0; background: var(--accent); transform-origin: 0 50%; transform: scaleX(0); transition: transform var(--d-slow) var(--ease-out); }
html[dir=rtl] .ob-dots span::after { transform-origin: 100% 50%; }
.ob-dots span.on::after { transform: scaleX(1); }
.ob-nav { margin-top: var(--s4); }
.ob-check { display: flex !important; gap: 10px; align-items: center; padding: 10px 0; font-weight: 600; }
.onboard .langlist { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.onboard .langlist button { margin: 0; min-height: 50px; justify-content: center; }
.trpicks { display: grid; gap: 8px; margin-top: 8px; }
.trpick { display: flex; gap: 10px; align-items: center; text-align: start; width: 100%; min-height: 56px; padding: 11px 14px; border: 1px solid var(--line); border-radius: 14px;
  background: var(--card-2); color: var(--ink); cursor: pointer; font: inherit; transition: transform var(--d-fast) var(--ease); }
.trpick:active { transform: scale(.985); }
.trpick small { display: block; }
.trpick.on { border-color: var(--accent); box-shadow: var(--ring); background: var(--card); }
.trpick:disabled { opacity: .55; cursor: not-allowed; }

/* ---------- static legal pages ---------- */
body.legal { padding-bottom: 40px; }
body.legal main { max-width: 760px; }
body.legal li { margin-block: 6px; }
body.legal .card { line-height: 1.65; }
.legal-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: var(--s3); }

/* ---------- small screens and desktop ---------- */
@media (max-width: 380px) {
  .picker { grid-template-columns: 1fr 1fr; }
  .picker #trSel { grid-column: 1 / -1; }
  main { padding-top: 12px; }
  .card { padding: 16px 14px; }
  .tabs a { font-size: 10.5px; }
  .tabs .ico { width: 44px; }
  h1 { font-size: 25px; }
  .chapter-head h1 { font-size: 28px; }
  #langLabel { max-width: 72px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
}
@media (min-width: 1024px) {
  main { max-width: 820px; padding-top: var(--s6); }
  .reader { font-size: calc(var(--font) + 1px); }
  .card { padding: var(--s6); }
}
html[dir=rtl] .picker { direction: rtl; }
[dir=rtl] .reader, .reader[dir=rtl] { text-align: right; }

/* ---------- one-thread Gather design (BIBLE_FEATURE_THREAD, live since Oct 6) ---------- */
.thread { display: flex; flex-direction: column; gap: 12px; max-height: 62vh; overflow-y: auto; overscroll-behavior: contain; padding: 14px 10px; }
.pastor-thread { max-height: none; padding: 4px 0; box-shadow: none; }
.msg { --bub: hsl(var(--hue, 30) 55% 93%); --edge: hsl(var(--hue, 30) 40% 55%); display: flex; gap: 8px; align-items: flex-start; max-width: 92%; }
html.dark .msg { --bub: hsl(var(--hue, 30) 22% 21%); --edge: hsl(var(--hue, 30) 35% 55%); }
.msg.mine { flex-direction: row-reverse; margin-inline-start: auto; }
.msg.hidden { opacity: .55; }
.msg.flash .bubble { box-shadow: 0 0 0 3px var(--accent2); }
.avatar { flex: 0 0 36px; width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; font: 700 14px/1 var(--sans); color: #fff; background: hsl(var(--hue, 30) 38% 46%); }
.msg-body { min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.msg.mine .msg-body { align-items: flex-end; }
.msg-who { font-size: 13px; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.msg.mine .msg-who { justify-content: flex-end; }
.msg-label { font-size: 12px; color: var(--muted); font-style: italic; }
.bubble { background: var(--bub); color: var(--ink); border-radius: 18px; border-start-start-radius: 6px; padding: 9px 13px; border: 1px solid color-mix(in srgb, var(--edge) 25%, transparent); max-width: 100%; }
.msg.mine .bubble { border-start-start-radius: 18px; border-start-end-radius: 6px; }
.bubble .txt { white-space: pre-wrap; overflow-wrap: anywhere; }
.quote-mini { display: block; width: 100%; text-align: start; font: inherit; cursor: pointer; border: 0; color: var(--ink); font-size: 13px; padding: 5px 9px; margin-bottom: 6px; border-radius: 10px;
  border-inline-start: 3px solid hsl(var(--hue, 30) 40% 50%); background: color-mix(in srgb, var(--card) 60%, transparent); overflow: hidden; }
.quote-mini .q { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
.quote-mini b { display: block; font-size: 12px; }
.msg-acts { display: flex; gap: 2px 10px; flex-wrap: wrap; }
.msg.mine .msg-acts { justify-content: flex-end; }
.linkbtn { background: none; border: 0; color: var(--muted); font: 13px/1 var(--sans); padding: 8px 2px; min-height: 32px; cursor: pointer; border-radius: 8px; }
.linkbtn:hover, .linkbtn:focus-visible { color: var(--accent-ink); }
.linkbtn.danger { color: var(--warn); }
.composer { position: sticky; bottom: calc(var(--nav-h) + 8px + env(safe-area-inset-bottom)); z-index: 3; background: color-mix(in srgb, var(--card) 94%, transparent); border: 1px solid var(--line);
  border-radius: 18px; padding: 8px; margin-top: -4px; box-shadow: var(--sh-3); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); }
@media (min-width: 700px) { .composer { bottom: calc(var(--nav-h) + 30px + env(safe-area-inset-bottom)); } }
.composer textarea { min-height: 46px; resize: none; }
.composer-row { align-items: flex-end; flex-wrap: nowrap; }
.reply-bar { display: flex; gap: 8px; align-items: center; padding: 6px 8px; margin-bottom: 6px; border-inline-start: 3px solid var(--accent); background: var(--card-2); border-radius: 10px; font-size: 13px; }
.reply-bar[hidden] { display: none; }
.reply-bar .grow { min-width: 0; }
.reply-bar .q1 { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
#thread, .composer-row .grow { min-width: 0; }
.thread-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: var(--s2); }
.thread-head h1 { margin: 0; }

/* ---------- phone-texting layout (George's rule, Oct 7, 2026). Only active with html.texting = BIBLE_FEATURE_TEXTING + THREAD ----------
   Own messages: right side (left in RTL), solid accent bubble. Others: left side (right in RTL), neutral bubble. Colour identity stays in
   the avatar and the name. Tight same-sender runs, one tail per run, 17px text, WCAG AA contrast in light and dark. Logical properties. */
html.texting { --tx-me-bg: #985818; --tx-me-ink: #ffffff; --tx-me-sub: #fff1df; --tx-me-q: #7a440d;
  --tx-them-bg: #efe8dc; --tx-them-ink: #1f1b17; --tx-them-sub: #4a4239; --tx-them-q: #e0d7c8; --tx-sep: #6a6157; }
html.texting.dark { --tx-me-bg: #e0a458; --tx-me-ink: #1a1206; --tx-me-sub: #3a2a12; --tx-me-q: #c98a3c;
  --tx-them-bg: #3a322a; --tx-them-ink: #f3ede2; --tx-them-sub: #d2c8b8; --tx-them-q: #2b251f; --tx-sep: #b8ab99; }
.texting .thread { gap: 0; padding: 10px 12px 14px; max-height: max(300px, calc(100dvh - 330px)); }
.texting .pastor-thread { max-height: none; padding: 4px 4px 8px; }
html.texting .msg { --bub: var(--tx-them-bg); --bink: var(--tx-them-ink); --bsub: var(--tx-them-sub); --bq: var(--tx-them-q);
  display: grid; grid-template-columns: 30px minmax(0, 1fr); column-gap: 8px; row-gap: 2px; align-items: end; max-width: 86%; margin-block-start: 2px; }
html.texting .msg.mine { --bub: var(--tx-me-bg); --bink: var(--tx-me-ink); --bsub: var(--tx-me-sub); --bq: var(--tx-me-q); grid-template-columns: minmax(0, 1fr); max-width: 80%; }
.texting .msg > .msg-body { display: contents; }   /* avatar sits beside the bubble row, so opening the actions never moves it */
.texting .msg > .avatar { grid-column: 1; grid-row: 2; }
.texting .msg-who, .texting .bubble, .texting .msg-acts { grid-column: 2; justify-self: start; }
.texting .msg-who { grid-row: 1; } .texting .bubble { grid-row: 2; } .texting .msg-acts { grid-row: 3; }
.texting .msg.mine .msg-who, .texting .msg.mine .bubble, .texting .msg.mine .msg-acts { grid-column: 1; justify-self: end; }
.texting .msg.run-start { margin-block-start: 12px; }
.texting .time-sep + .msg { margin-block-start: 4px; }
.texting .time-sep { align-self: center; font-size: 13px; color: var(--tx-sep); margin-block: 14px 2px; padding: 2px 10px; text-align: center; }
.texting .time-sep:first-child { margin-block-start: 2px; }
.texting .avatar { width: 30px; height: 30px; font-size: 13px; background: hsl(var(--hue, 30) 42% 31%); }
.texting .msg:not(.run-end) .avatar { visibility: hidden; height: 1px; }
.texting .msg.mine .avatar { display: none; }
.texting .msg.mine .msg-who, .texting .msg.run-cont .msg-who { display: none; }
.texting .msg-who { padding-inline-start: 12px; font-size: 14px; }
.texting .msg-who > span.muted { display: none; }
.texting .msg-who strong { color: hsl(var(--hue, 30) 60% 27%); }
html.texting.dark .msg-who strong { color: hsl(var(--hue, 30) 65% 75%); }
.texting .bubble { position: relative; background: var(--bub); color: var(--bink); border: 0; padding: 7px 13px 8px; font-size: 17px; line-height: 1.42;
  border-radius: 18px; border-start-start-radius: 6px; border-end-start-radius: 6px; cursor: pointer; -webkit-tap-highlight-color: transparent; box-shadow: 0 1px 1px rgba(72, 48, 16, .08); }
.texting .msg.run-start .bubble { border-start-start-radius: 18px; }
.texting .msg.mine .bubble { border-radius: 18px; border-start-end-radius: 6px; border-end-end-radius: 6px; }
.texting .msg.mine.run-start .bubble { border-start-end-radius: 18px; }
.texting .bubble .txt { color: var(--bink); outline-offset: 3px; }
.texting .bubble .txt:focus-visible { outline: 2px solid var(--bink); border-radius: 4px; }
/* the tail: only on the last bubble of a run, drawn on the sender's side */
.texting .bubble.tail::after { content: ""; position: absolute; bottom: 0; inset-inline-start: -9px; width: 16px; height: 20px; pointer-events: none;
  background: radial-gradient(circle 20px at -11px 2px, transparent 19.5px, var(--bub) 20px); }
.texting .msg.mine .bubble.tail::after { inset-inline-start: auto; inset-inline-end: -9px;
  background: radial-gradient(circle 20px at calc(100% + 11px) 2px, transparent 19.5px, var(--bub) 20px); }
html.texting[dir=rtl] .bubble.tail::after { background: radial-gradient(circle 20px at calc(100% + 11px) 2px, transparent 19.5px, var(--bub) 20px); }
html.texting[dir=rtl] .msg.mine .bubble.tail::after { background: radial-gradient(circle 20px at -11px 2px, transparent 19.5px, var(--bub) 20px); }
.texting .bubble .msg-label { font-size: 14px; line-height: 1.35; font-style: normal; font-weight: 600; color: var(--bsub); margin-block-end: 3px; }
.texting .bubble .msg-label + .txt { margin-block-start: 2px; }
.texting .bub-meta { font-size: 13px; color: var(--bsub); text-align: end; margin-block-start: 2px; }
.texting .quote-mini { background: var(--bq); color: var(--bink); font-size: 15px; border-inline-start-color: currentColor; margin-block-end: 5px; }
.texting .quote-mini b { color: var(--bink); font-size: 13px; }
.texting .msg-acts[hidden] { display: none; }
.texting .msg-acts { padding-inline: 6px; align-items: center; gap: 0 10px; animation: fade-in var(--d-fast) var(--ease) both; }
.texting .msg-time { font-size: 13px; color: var(--muted); }
.texting .linkbtn { font-size: 14px; color: var(--ink); min-height: 36px; padding: 8px 6px; }
.texting .linkbtn.danger { color: var(--warn); }
.texting .msg.open .bubble { box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 45%, transparent); }
.texting .composer { border-radius: 24px; padding: 6px 6px 6px 8px; }
.texting .composer textarea { border-radius: 20px; font-size: 17px; padding: 10px 15px; min-height: 46px; }
.texting .composer #postBtn { border-radius: 22px; background: var(--tx-me-bg); color: var(--tx-me-ink); }
.texting .reply-bar { font-size: 14px; border-radius: 12px; }
.about-word { display: block; height: 64px; width: auto; margin: 0 0 var(--s2); }
.dark-only { display: none !important; } html.dark .dark-only { display: block !important; } html.dark .light-only { display: none !important; }
/* legal pages have no script, so they follow the device theme */
@media (prefers-color-scheme: dark) {
  html.legal-doc { --bg: #1d1915; --bg-deep: #171410; --card: #27211b; --card-2: #2e2720; --field: #221d18; --ink: #f2eadc; --ink-2: #dcd0bd; --muted: #b8a993;
    --line: #3d342a; --line-soft: #332b23; --accent: #e3a85c; --accent-ink: #ecb877; --accent-soft: #3a2c1c; --on-accent: #1d1307; --warn: #f0a08f; color-scheme: dark; }
}

.legal .notice { display: block; }

/* ---------- motion completion (George's order, Oct 10, 2026): every screen eases in, every control responds ----------
   Rules: transform and opacity only, 150-350 ms, one shared ease. Hover lifts only on hover-capable devices. Press always wins over
   hover (declared after it). Everything here is switched off by the prefers-reduced-motion block above (it uses !important). */
@keyframes soft-in { from { opacity: .35; } to { opacity: 1; } }
@keyframes pop { 0% { transform: scale(.94); } 60% { transform: scale(1.03); } 100% { transform: none; } }
@keyframes msg-in { from { opacity: 0; transform: translateY(10px) scale(.96); } to { opacity: 1; transform: none; } }
@keyframes swap-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes step-in { from { opacity: 0; transform: translateX(18px); } to { opacity: 1; transform: none; } }
@keyframes step-in-rtl { from { opacity: 0; transform: translateX(-18px); } to { opacity: 1; transform: none; } }
/* same-screen refreshes (after Pray, Save, Follow...) fade softly instead of replaying the whole entrance */
main.refresh > * { animation: soft-in var(--d-fast) var(--ease) both; }
/* onboarding: each step slides in from the reading direction */
main.enter > .onboard { animation-name: step-in; } html[dir=rtl] main.enter > .onboard { animation-name: step-in-rtl; }
/* swapped content inside a screen (sign-in/sign-up toggle, note edit, verse note, reply bar, search results) */
.swap-in, .verse-note, .reply-bar:not([hidden]), .err:not(:empty) { animation: swap-in var(--d) var(--ease-out) both; }
#view > .swap-in { animation: swap-in var(--d) var(--ease-out) both; }   /* beats the screen entrance when a whole card is swapped */
/* staggered lists inside cards (calendar events, licences, notes, pledges, feedback, reports, readings, marks, topics, day pickers) */
.stagger-in > * { animation: rise var(--d) var(--ease-out) both; }
.stagger-in > :nth-child(2) { animation-delay: 30ms; } .stagger-in > :nth-child(3) { animation-delay: 60ms; } .stagger-in > :nth-child(4) { animation-delay: 90ms; }
.stagger-in > :nth-child(5) { animation-delay: 115ms; } .stagger-in > :nth-child(6) { animation-delay: 135ms; } .stagger-in > :nth-child(n+7) { animation-delay: 150ms; }
/* expanding sections: a rotating chevron and the body eases open */
details > summary { list-style: none; display: flex; align-items: center; gap: 8px; transition: transform var(--d-fast) var(--ease), opacity var(--d-fast) var(--ease); border-radius: 10px; }
details > summary::-webkit-details-marker { display: none; }
details > summary::before { content: ""; flex: 0 0 auto; width: 7px; height: 7px; border: solid currentColor; border-width: 0 2px 2px 0; transform: rotate(-45deg); transition: transform var(--d) var(--ease-out); margin-inline: 3px 2px; }
html[dir=rtl] details > summary::before { transform: rotate(135deg); }
details[open] > summary::before, html[dir=rtl] details[open] > summary::before { transform: rotate(45deg); }
details[open] > :not(summary) { animation: swap-in var(--d) var(--ease-out) both; }
@media (hover: hover) { details > summary:hover { opacity: .8; } }
details > summary:active { transform: scale(.98); }
/* chat: a new message pops up from its own side; the selected pledge amount pops */
.msg.arrive { animation: msg-in 300ms var(--ease-out) both; transform-origin: 0 100%; }
.msg.mine.arrive { transform-origin: 100% 100%; }
html[dir=rtl] .msg.arrive { transform-origin: 100% 100%; } html[dir=rtl] .msg.mine.arrive { transform-origin: 0 100%; }
.chip.on.just { animation: pop 260ms var(--ease-out) both; }
/* empty states: calm, centred, with a soft icon (never a bare grey line) */
.empty { display: grid; justify-items: center; gap: 6px; text-align: center; padding: var(--s5) var(--s3); color: var(--muted); font-size: var(--t-sm); }
.empty .ico { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 14px; color: var(--accent-ink); background: var(--accent-soft); }
.empty .ico svg { width: 22px; height: 22px; }
.empty p { margin: 0; }
.card.empty { padding: var(--s6) var(--s4); }
/* loading inside a screen (search, note search) */
.skeleton.mini { padding: var(--s3) 0; border: 0; background: none; box-shadow: none; margin: 0; gap: 10px; }
/* ---- press / hover feedback on every control that did not have it yet ---- */
.btn { transition: transform var(--d-fast) var(--ease), opacity var(--d-fast) var(--ease); }
@media (hover: hover) {
  .btn:not(:disabled):hover { transform: translateY(-1px); } .btn:not(:disabled):hover::after { opacity: .45; }
  .chip:hover { transform: translateY(-1px); } .chip:hover::after { opacity: .6; }
  .tabs a:hover .ico::before { opacity: .55; transform: none; }
  .linkbtn:hover, .quote-mini:hover { opacity: .78; }
  .result:hover, .trpick:not(:disabled):hover, .langlist button:hover, .days-list a:hover, .topics label:hover, .days label:hover { transform: translateY(-1px); }
  .texting .bubble:hover { opacity: .92; }
  select:hover, input[type=checkbox]:hover, input[type=radio]:hover { opacity: .85; }
  .brand:hover img { transform: rotate(-4deg); }
  a:not([class]):hover, .goal-title:hover, .legal-links a:hover { opacity: .78; }
}
.btn:not(:disabled):active, .btn.pressed { transform: scale(.97); }
.chip:active, .chip.pressed { transform: scale(.96); }
.tabs a { transition: transform var(--d-fast) var(--ease), opacity var(--d-fast) var(--ease); }
.tabs a:active { transform: scale(.95); }
.linkbtn, .quote-mini, .back, .brand, .days-list a, .topics label, .days label, label.check, .ob-check, .goal-title, .room-card .chev,
select, input[type=checkbox], input[type=radio], a:not([class]), .legal-links a, .texting .bubble {
  transition: transform var(--d-fast) var(--ease), opacity var(--d-fast) var(--ease); -webkit-tap-highlight-color: transparent; }
.brand img { transition: transform var(--d) var(--ease-out); }
.linkbtn:active, .quote-mini:active { transform: scale(.94); opacity: .8; }
.back:active, .brand:active { transform: scale(.96); }
.days-list a:active, .topics label:active, .days label:active, label.check:active, .ob-check:active { transform: scale(.97); }
select:active { transform: scale(.99); }
input[type=checkbox]:active, input[type=radio]:active { transform: scale(.88); }
a:not([class]):active, .legal-links a:active, .goal-title:active { opacity: .6; }
.texting .bubble:active { transform: scale(.98); }
.trpick:active, .langlist button:active, .result:active { transform: scale(.98); }
.trpick, .langlist button, .result { transition: transform var(--d-fast) var(--ease), opacity var(--d-fast) var(--ease); }
/* the static legal pages ease in too */
body.legal main > * { animation: rise 300ms var(--ease-out) both; }
body.legal main > :nth-child(2) { animation-delay: 40ms; } body.legal main > :nth-child(3) { animation-delay: 80ms; } body.legal main > :nth-child(n+4) { animation-delay: 120ms; }
/* offline download progress fills smoothly between books */
.bar.live > span { animation: none; }
.dl-actions .bar { width: 120px; margin: 0; }

/* ---------- S'gaw Karen (Oct 11, 2026): label font, flag, Karen style ---------- */
/* A 7 KB subset of Noto Sans Myanmar (SIL OFL 1.1) with ONLY the letters of the Karen/Burmese names shown in the pickers
   ("ကညီကျိာ်" and the KSW/JVB titles). unicode-range = exactly those code points, so it downloads only where they appear.
   The full Myanmar font lives in /karen.css and is loaded only for the ksw UI or a Myanmar-script Bible. */
@font-face { font-family: "Lamp Myanmar Label"; font-weight: 400 700; font-display: swap; src: url(/fonts/noto-sans-myanmar-label.woff2?v=1) format("woff2");
  unicode-range: U+1000, U+1005, U+1006, U+100A, U+1012, U+1014, U+1019, U+101A, U+101C, U+101E, U+102C-102F, U+1036, U+1038, U+103A-103C, U+103E; }
.lang-native { font-family: var(--sans), "Lamp Myanmar Label"; }
[data-lang=ksw] .lang-native, .trpick [lang=ksw], .trpick [lang=my] { font-family: "Lamp Myanmar Label", var(--sans); line-height: 1.7; }
.lang-name { display: inline-flex; align-items: center; gap: 10px; }
.flag { flex: 0 0 auto; width: 27px; height: 18px; border-radius: 3px; box-shadow: 0 0 0 1px rgba(0, 0, 0, .14); overflow: hidden; display: block; }
.lang-en { font-size: 12.5px; color: var(--muted); font-weight: 500; }

/* Karen style: accents from traditional Karen woven dress (deep red, white, a touch of indigo and black). Applied automatically
   when the UI language is S'gaw Karen (settings: Automatic / Karen style / Classic Lamp). AA contrast checked by the tests. */
html.karen {
  --bg: #f7f1ea; --bg-deep: #efe5db; --card: #fffcf8; --card-2: #fbf4ee; --line: #e8d9cf; --line-soft: #f0e4dc;
  --ink: #26201f; --ink-2: #463b39; --muted: #67595a;
  --accent: #9b1b26; --accent-ink: #8a1621; --accent2: #c0414c; --accent-soft: #f6e1df; --glow: #e58a8f; --on-accent: #ffffff;
  --indigo: #2b3a6b; --weave-white: #ffffff;
  --weave: repeating-linear-gradient(90deg, #9b1b26 0 12px, var(--weave-white) 12px 14px, var(--indigo) 14px 19px, var(--weave-white) 19px 21px, #9b1b26 21px 33px, #18161b 33px 35px);
}
html.karen.dark {
  --bg: #1b1820; --bg-deep: #15131a; --card: #25212a; --card-2: #2c2732; --field: #211d26; --line: #3d3542; --line-soft: #332c38;
  --ink: #f3ece6; --ink-2: #ddd2cc; --muted: #bbaeb0;
  --accent: #ee8d94; --accent-ink: #f4a6ac; --accent2: #c9525c; --accent-soft: #3f2328; --glow: #e0707a; --on-accent: #1c0b0e;
  --indigo: #7f8fd0; --weave-white: #e9e1da;
}
html.karen.texting { --tx-me-bg: #9b1b26; --tx-me-ink: #ffffff; --tx-me-sub: #ffe8e9; --tx-me-q: #7a131d;
  --tx-them-bg: #ede6e2; --tx-them-ink: #1f1a1a; --tx-them-sub: #4a3f3f; --tx-them-q: #ded3cf; --tx-sep: #67595a; }
html.karen.texting.dark { --tx-me-bg: #ec8890; --tx-me-ink: #1c0b0e; --tx-me-sub: #3d1419; --tx-me-q: #c9525c;
  --tx-them-bg: #3a3340; --tx-them-ink: #f3ece6; --tx-them-sub: #d5cad0; --tx-them-q: #2b2531; --tx-sep: #bbaeb0; }
/* the woven band, used sparingly: under the header, and along the top of the Today hero and the church front card */
html.karen .top::after { content: ""; position: absolute; inset-inline: 0; bottom: -4px; height: 4px; background: var(--weave); pointer-events: none; }
html.karen .hero::after, html.karen .church-hero::after { content: ""; position: absolute; inset-inline: 0; top: 0; height: 4px; background: var(--weave); opacity: .92; pointer-events: none; }
html.karen .page-head .badge-ico { box-shadow: inset 0 -3px 0 color-mix(in srgb, var(--indigo) 55%, transparent); }

/* ---------- church front page, invites, members (Oct 11, 2026) ---------- */
.church-hero { overflow: hidden; padding-top: var(--s6); }
.church-hero h1 { margin: 0 0 4px; font-family: var(--serif); font-size: var(--t-2xl); line-height: 1.25; }
.church-hero .city { color: var(--muted); margin: 0 0 var(--s3); }
.church-hero .welcome { font-family: var(--serif); font-size: var(--t-lg); line-height: 1.65; white-space: pre-line; margin: var(--s3) 0; }
.church-hero .join-row { display: flex; gap: var(--s2); flex-wrap: wrap; align-items: center; margin-top: var(--s4); }
.pastor-line { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.pastor-line .avatar { width: 40px; height: 40px; font-size: 15px; }
.honesty { font-size: var(--t-sm); color: var(--muted); }
.invite-banner { display: flex; gap: 12px; align-items: center; padding: 12px 14px; border-radius: 14px; margin-bottom: var(--s4);
  background: color-mix(in srgb, var(--accent) 9%, var(--card)); border: 1px solid color-mix(in srgb, var(--accent) 28%, transparent); }
.invite-banner .ico { color: var(--accent-ink); }
.inv-result { display: grid; gap: var(--s3); }
.inv-link { font: 600 14px/1.4 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; word-break: break-all; padding: 10px 12px; border-radius: 12px; background: var(--card-2); border: 1px dashed var(--line); user-select: all; }
.inv-code { font: 700 28px/1.2 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; letter-spacing: .12em; text-align: center; padding: 8px; }
.qr-box { display: grid; place-items: center; padding: var(--s3); }
.qr-box img { width: min(260px, 70vw); height: auto; border-radius: 12px; background: #fff; padding: 6px; box-shadow: var(--sh-2); animation: qr-in var(--d-slow) var(--ease-out) both; }
@keyframes qr-in { from { opacity: 0; transform: scale(.94); } to { opacity: 1; transform: none; } }
.inv-row { display: flex; gap: 10px; align-items: center; padding: 10px 0; border-top: 1px solid var(--line-soft); }
.inv-row:first-of-type { border-top: 0; }
.inv-row .pill.on { border-color: color-mix(in srgb, var(--ok) 45%, transparent); color: var(--ok); }
.member-row { display: flex; gap: 10px; align-items: center; padding: 8px 0; border-top: 1px solid var(--line-soft); }
.member-row .avatar { width: 32px; height: 32px; font-size: 12.5px; }
.stay-sheet .ob-check { display: flex; gap: 8px; align-items: flex-start; padding: 10px 0; }
.code-row { display: flex; gap: var(--s2); }
.code-row input { text-transform: uppercase; letter-spacing: .1em; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
@media (prefers-reduced-motion: reduce) { .qr-box img { animation: none; } }
.section-title { font-size: var(--t-lg); margin: var(--s5) 4px var(--s3); }
.church-hero .kicker { display: block; font: 650 var(--t-xs)/1.2 var(--sans); letter-spacing: .1em; text-transform: uppercase; margin-bottom: 6px; }
.inv-row > .btn, .inv-row > .pill, .member-row > .btn { flex: 0 0 auto; white-space: nowrap; }
.inv-row .grow, .member-row .grow { min-width: 0; }
/* Church governance (Oct 11, 2026): calm "no pastor" state, invite-only notice, member vote. Motion: transform/opacity only, 150-350 ms. */
.no-pastor { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; margin: var(--s3) 0; border-radius: 14px;
  background: var(--card-2); border: 1px solid var(--line-soft); }
.no-pastor b { font-family: var(--serif); font-size: var(--t-lg); display: block; margin-bottom: 4px; }
.no-pastor p { margin: 4px 0 0; }
.no-pastor .np-ico { flex: 0 0 auto; display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; background: var(--accent-soft); color: var(--accent-ink); }
.ask-invite { flex: 1 1 100%; padding: 12px 14px; border-radius: 14px; background: var(--card-2); border: 1px dashed var(--line); }
.ask-invite b { display: flex; gap: 6px; align-items: center; }
.ask-invite p { margin: 4px 0 0; }
.gov-card h2 { display: flex; gap: 8px; align-items: center; }
.gov-q { font-family: var(--serif); font-size: var(--t-lg); line-height: 1.5; margin: 0 0 var(--s3); }
.gov-note { margin: 0 0 var(--s3); padding: 10px 14px; border-inline-start: 3px solid var(--accent); background: var(--card-2); border-radius: 0 12px 12px 0; white-space: pre-line; }
[dir=rtl] .gov-note { border-radius: 12px 0 0 12px; }
.gov-meter { height: 8px; border-radius: 999px; background: var(--line-soft); overflow: hidden; margin: var(--s2) 0; }
.gov-meter span { display: block; height: 100%; background: var(--accent); border-radius: inherit; transform-origin: left center; animation: gov-grow 320ms var(--ease-out) both; }
[dir=rtl] .gov-meter span { transform-origin: right center; margin-inline-start: auto; }
@keyframes gov-grow { from { transform: scaleX(0); } to { transform: scaleX(1); } }
.vote-row { display: flex; gap: var(--s2); margin: var(--s3) 0 var(--s2); }
.vote-row .vote-btn { flex: 1 1 0; min-height: 48px; font-size: var(--t-lg); justify-content: center; }
.vote-btn.chosen { box-shadow: 0 0 0 3px var(--accent-soft); }
.gov-last { display: flex; flex-direction: column; gap: 2px; padding: 10px 14px; border-radius: 12px; background: var(--card-2); margin: var(--s2) 0 var(--s3); }
.step-down { border-style: dashed; }
@media (prefers-reduced-motion: reduce) { .gov-meter span { animation: none; } }
.gov-card .honesty { display: flex; gap: 6px; align-items: flex-start; }
.gov-card .honesty .ico { flex: 0 0 auto; margin-top: 3px; }
/* church board + approval (Oct 11, 2026) */
.board-card h2, .approval-card h2 { display: flex; gap: 8px; align-items: center; }
.board-card .member-row.bd-admin { background: color-mix(in srgb, var(--accent, #b07a2a) 7%, transparent); border-radius: 10px; padding-inline: 8px; }
.board-card .pill[data-admin] { margin-inline-end: 4px; }
.bd-form { margin-top: var(--s3); padding-top: var(--s3); border-top: 1px solid var(--line-soft); }
.bd-form select { width: 100%; }
.check-row { display: flex; gap: 8px; align-items: center; min-height: 44px; cursor: pointer; }
.check-row input { width: 20px; height: 20px; flex: 0 0 auto; }
.approval-card .pill.pending { animation: none; }
#apDecisions h3 { margin: var(--s3) 0 0; }
#bdYou { display: flex; gap: 6px; align-items: center; }
