:root {
  --bg:#f6f7f9; --panel:#fff; --side:#f0f2f5; --ink:#1c2430; --muted:#5c6773; --line:#e3e7ec;
  --accent:#2f6f4f; --accent-deep:#245c40; --user:#2f6f4f; --radius:16px;
  /* "Noto Sans" behind Source Sans 3 is the Latin GAP face, not a second body font: it is cut to the
     handful of codepoints Source Sans 3 does not have (Hausa's ƙ Ƙ), so unicode-range means it is
     fetched only by a page that actually draws one. Per-language stacks override this whole variable
     from assets/fonts/<family>.css — see attachScriptFont in site.js (#89). */
  --sans:"Source Sans 3","Noto Sans",system-ui,-apple-system,sans-serif;
}
* { box-sizing:border-box; } html,body { margin:0; height:100%; }
body { font-family:var(--sans); color:var(--ink); background:var(--bg); }

/* Script-specific font stacks are NOT here. Each one lives in its own generated
   assets/fonts/<family>.css, attached by site.js only for the language in use — see attachScriptFont
   (#89). They override --sans rather than font-family, and that distinction is the whole reason the
   rule that used to sit on this line is gone:

     [lang="ur"] { font-family:"Noto Nastaliq Urdu",…; }

   worked while site.js set lang on #app and #landing (both inside <body>). On 2026-08-10, commit
   7a4c7bc correctly moved dir/lang to <html> so modals and toasts would inherit direction — and
   silently killed this rule, because `body { font-family:var(--sans) }` two lines up is an OWN
   declaration on body and beats anything inherited from <html>. From that day until 2026-08-15 every
   Urdu seeker read Naskh with Nastaʿlīq's line-height. Overriding the custom property instead cannot
   fail that way: --sans inherits, and body declares none of its own.

   The line-heights below stay here. Nastaʿlīq's diagonal baseline clips descenders without them, they
   are scoped to [lang="ur"] ONLY so Arabic and Farsi keep their correct Naskh metrics, and they are
   harmless on the fallback face if the font never arrives. */
[lang="ur"] .bubble, [lang="ur"] .landing-lead { line-height:2.0; }
[lang="ur"] .chip, [lang="ur"] #chatTitle, [lang="ur"] .hist-t { line-height:1.85; }
[lang="ur"] .input { line-height:1.9; }
[hidden] { display:none !important; } /* must win over .landing/.app display rules */
.btn { font:inherit; font-weight:600; font-size:.92rem; cursor:pointer; border-radius:10px; padding:.6rem 1rem; border:1px solid transparent; text-decoration:none; display:inline-block; text-align:center; }
.btn-primary { background:var(--accent); color:#fff; } .btn-primary:hover { background:var(--accent-deep); }
.btn-ghost { background:#fff; color:var(--accent-deep); border-color:var(--line); } .btn-ghost:hover { background:var(--bg); }
/* Sign in with Apple (#236). Apple's guidelines allow black, white, or white-with-outline and nothing
   else — the FaithBot green is not an option here, which is why this does not reuse .btn-primary. The
   mark is sized in `em` so it tracks the button's own font size across all 55 language packs, several
   of which set a larger line-height (see the [lang="ur"] rule above). */
.btn-apple { background:#000; color:#fff; border-color:#000; display:inline-flex; align-items:center; justify-content:center; gap:.45em; }
.btn-apple:hover { background:#1a1a1a; border-color:#1a1a1a; }
.btn-apple .apple-mark { width:1.05em; height:1.05em; flex:none; margin-block-start:-.12em; }
[hidden] { display:none !important; }
.btn.sm { padding:.4rem .7rem; font-size:.85rem; }

/* ── Landing ───────────────────────────────────────────── */
.landing { position:fixed; inset:0; display:grid; place-items:center; padding:1.2rem; background:var(--bg); overflow:auto; z-index:20; }
.landing-shell { display:grid; grid-template-columns:1.1fr .9fr; gap:0; max-width:900px; width:100%; background:var(--panel); border:1px solid var(--line); border-radius:22px; box-shadow:0 10px 50px rgba(16,29,47,.10); overflow:hidden; }
.landing-intro { padding:2.4rem 2rem; background:linear-gradient(160deg,#f2f7f3,#eef3f7); border-inline-end:1px solid var(--line); }
.landing-brand { display:flex; align-items:center; gap:.6rem; margin-bottom:1rem; }
.landing-brand h1 { font-size:1.8rem; color:var(--accent-deep); margin:0; }
.landing-lead { font-size:1.08rem; line-height:1.5; color:var(--ink); margin:0 0 1.3rem; }
.landing-points { list-style:none; padding:0; margin:0 0 1.3rem; display:flex; flex-direction:column; gap:.7rem; }
.landing-points li { display:flex; gap:.6rem; align-items:flex-start; font-size:.95rem; line-height:1.4; color:var(--ink); }
.landing-points li span:first-child { flex:none; font-size:1.05rem; }
.landing-points li span:last-child { min-width:0; flex:1; } /* text wraps instead of overflowing under the next column */
.landing-fine { font-size:.82rem; color:var(--muted); line-height:1.45; margin:0; }
.landing-panel { padding:2.4rem 2rem; display:flex; flex-direction:column; }
.landing-panel h2 { font-size:1.3rem; color:var(--accent-deep); margin:0 0 1.1rem; }
.landing-label { font-size:.78rem; font-weight:600; text-transform:uppercase; letter-spacing:.05em; color:var(--muted); margin-bottom:.5rem; }
.landing-lang-select { width:100%; font:inherit; font-size:1rem; padding:.6rem .7rem; border:1px solid var(--line); border-radius:10px; background:#fdfefe; color:var(--ink); margin-bottom:1.3rem; }
.landing-lang-select:focus { outline:none; border-color:var(--accent); box-shadow:0 0 0 3px rgba(47,111,79,.14); }
.landing-actions { display:flex; flex-direction:column; gap:.6rem; }
.landing-actions .btn { width:100%; }
.landing-note-sm { color:var(--muted); font-size:.83rem; margin:.9rem 0 0; line-height:1.4; }
.landing-note { color:var(--accent-deep); font-size:.85rem; margin-top:.7rem; }
.imb-footer { grid-column:1 / -1; text-align:center; padding:1rem 1.4rem calc(1rem + env(safe-area-inset-bottom)); font-size:.82rem; color:#e8eef5; background:#0a2a4e; border-top:1px solid rgba(255,255,255,.08); }
.imb-footer a { color:#fff; font-weight:600; text-decoration:underline; }
.imb-footer strong { color:#fff; }
.imb-footer-legal { display:block; margin-top:.5rem; opacity:.9; font-size:.78rem; }
@media (max-width:720px) {
  /* display:block (not grid) so the page scrolls when content is taller than the screen —
     otherwise grid place-items:stretch clamps it to viewport height and the guest/sign-in
     buttons fall below the fold with no way to reach them (short phones). */
  .landing { padding:0; display:block; overflow-y:auto; -webkit-overflow-scrolling:touch; }
  .landing-shell { grid-template-columns:1fr; border-radius:0; min-height:100%; box-shadow:none; }
  .landing-intro { border-inline-end:none; border-bottom:1px solid var(--line); padding:1.4rem 1.4rem 1.2rem; }
  .landing-panel { padding:1.4rem 1.4rem calc(1.8rem + env(safe-area-inset-bottom)); }
  .lang-chooser { max-height:104px; }
}

/* ── App layout ────────────────────────────────────────── */
.app { display:flex; height:100vh; height:100dvh; }
.sidebar { width:270px; flex:none; background:var(--side); border-inline-end:1px solid var(--line); display:flex; flex-direction:column; }
.side-top { padding:.9rem .8rem; border-bottom:1px solid var(--line); display:flex; flex-direction:column; gap:.6rem; }
.brand { font-weight:700; color:var(--accent-deep); display:flex; align-items:center; gap:.45rem; }
.dot { width:9px; height:9px; border-radius:50%; background:var(--accent); }
.side-new { width:100%; }
.side-lang { font-size:.78rem; color:var(--muted); display:flex; flex-direction:column; gap:.25rem; }
.side-lang select { font:inherit; font-size:.9rem; padding:.45rem .5rem; border:1px solid var(--line); border-radius:9px; background:#fff; color:var(--ink); }
.side-history { flex:1; overflow-y:auto; padding:.6rem .5rem; }
.side-label { font-size:.72rem; text-transform:uppercase; letter-spacing:.06em; color:var(--muted); padding:.2rem .4rem .4rem; }
.side-empty { color:var(--muted); font-size:.85rem; padding:.4rem; }
.hist { display:flex; flex-direction:column; width:100%; text-align:left; border:none; background:transparent; border-radius:9px; padding:.5rem .6rem; cursor:pointer; gap:.1rem; }
.hist:hover { background:#e6e9ee; } .hist.active { background:#e0e7e2; }
.hist-t { font-size:.9rem; color:var(--ink); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.hist-m { font-size:.72rem; color:var(--muted); }
.hist-row { display:flex; align-items:center; border-radius:9px; }
.hist-row:hover { background:#e6e9ee; } .hist-row.active { background:#e0e7e2; }
.hist-row .hist { flex:1; min-width:0; }
.hist-row:hover .hist, .hist-row.active .hist { background:transparent; }
.hist-del { flex:none; border:none; background:transparent; cursor:pointer; font-size:.82rem; line-height:1; padding:.4rem .5rem; border-radius:9px; opacity:.4; color:var(--muted); }
.hist-row:hover .hist-del { opacity:.8; }
.hist-del:hover { opacity:1; background:#e6d6d6; }
.confirm-card { text-align:left; }
.confirm-title { margin:0 0 .4rem; font-size:1.1rem; color:var(--ink); }
.confirm-sub { margin:0 0 1.1rem; color:var(--muted); font-size:.92rem; line-height:1.45; }
.confirm-actions { display:flex; gap:.6rem; justify-content:flex-end; }
.btn-danger { background:#c0392b; color:#fff; border-color:#c0392b; } .btn-danger:hover { background:#a93226; }
.acct-legal { margin-top:.6rem; font-size:.72rem; color:var(--muted); text-align:center; }
.acct-legal a { color:var(--muted); text-decoration:underline; }
.side-foot { border-top:1px solid var(--line); padding:.8rem; display:flex; flex-direction:column; gap:.5rem; }
.acct { display:flex; align-items:center; justify-content:space-between; gap:.5rem; }
.acct-name { font-size:.88rem; font-weight:600; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.acct-admin { font-size:.78rem; color:var(--accent-deep); } .acct-guest { font-size:.82rem; color:var(--muted); }

/* ── Chat pane ─────────────────────────────────────────── */
.chat { flex:1; display:flex; flex-direction:column; min-width:0; background:var(--panel); }
.chat-head { display:flex; align-items:center; gap:.6rem; padding:.6rem 1rem; border-bottom:1px solid var(--line); }
.chat-head #chatTitle { font-weight:600; color:var(--accent-deep); flex:1; }
.chat-head-actions { margin-inline-start:auto; }
.icon { border:1px solid var(--line); background:#fff; color:var(--muted); width:36px; height:36px; border-radius:9px; cursor:pointer; font-size:1rem; display:grid; place-items:center; }
.icon:hover { background:var(--bg); } .icon.on { background:var(--accent); color:#fff; border-color:var(--accent); }
#menuBtn { display:none; }
.transcript { flex:1; overflow-y:auto; padding:1.2rem; display:flex; flex-direction:column; gap:.7rem; max-width:820px; width:100%; margin:0 auto; }
.msg { display:flex; flex-wrap:wrap; } .msg.user { justify-content:flex-end; } .msg.assistant { justify-content:flex-start; }
.bubble { max-width:82%; padding:.65rem .9rem; border-radius:var(--radius); font-size:.98rem; line-height:1.55; word-wrap:break-word; }
.bubble.user { background:var(--user); color:#fff; border-bottom-right-radius:5px; }
.bubble.assistant { background:var(--bg); border:1px solid var(--line); border-bottom-left-radius:5px; }
.bubble p { margin:.3rem 0; } .bubble p:first-child { margin-top:0; } .bubble p:last-child { margin-bottom:0; }
.bubble ul, .bubble ol { margin:.3rem 0; padding-inline-start:1.2rem; } .bubble a { color:var(--accent-deep); }
[dir="rtl"] .bubble.user { border-bottom-right-radius:var(--radius); border-bottom-left-radius:5px; }
[dir="rtl"] .bubble.assistant { border-bottom-left-radius:var(--radius); border-bottom-right-radius:5px; }
.typing { display:inline-flex; gap:4px; } .typing span { width:7px; height:7px; border-radius:50%; background:var(--muted); opacity:.5; animation:fbb 1s infinite; }
.typing span:nth-child(2){ animation-delay:.15s; } .typing span:nth-child(3){ animation-delay:.3s; }
@keyframes fbb { 0%,60%,100%{ transform:translateY(0); opacity:.4; } 30%{ transform:translateY(-4px); opacity:.9; } }
.suggestions { display:flex; flex-wrap:wrap; gap:.5rem; padding:0 1rem .4rem; max-width:820px; width:100%; margin:0 auto; }
.chip { border:1px solid var(--line); background:#fff; color:var(--accent-deep); border-radius:999px; padding:.4rem .8rem; font:inherit; font-size:.85rem; cursor:pointer; }
.chip:hover { background:var(--bg); border-color:var(--accent); }
.composer { display:flex; align-items:flex-end; gap:.5rem; padding:.7rem 1rem 1rem; border-top:1px solid var(--line); max-width:820px; width:100%; margin:0 auto; }
.mic.on { background:var(--accent); color:#fff; border-color:var(--accent); }
.input { flex:1; resize:none; font:inherit; font-size:.98rem; color:var(--ink); padding:.6rem .8rem; border:1px solid var(--line); border-radius:12px; background:#fdfefe; max-height:160px; }
.input:focus { outline:none; border-color:var(--accent); box-shadow:0 0 0 3px rgba(47,111,79,.14); }
.send { flex:none; width:42px; height:42px; border-radius:12px; border:none; cursor:pointer; background:var(--accent); color:#fff; font-size:1.1rem; }
.send:hover:not(:disabled) { background:var(--accent-deep); } .send:disabled { opacity:.5; }
[dir="rtl"] .send { transform:scaleX(-1); }
.composer-note { text-align:center; color:var(--muted); font-size:.72rem; margin:0 auto; padding:0 1rem calc(.5rem + env(safe-area-inset-bottom)); max-width:820px; }
.usage-note { margin:.4rem auto 0; max-width:820px; font-size:.82rem; color:var(--muted); background:#f2f7f3; border:1px solid var(--line); border-radius:10px; padding:.55rem .8rem; line-height:1.4; }
.usage-note-link { margin-inline-start:.35rem; color:var(--accent-deep); font-weight:600; text-decoration:underline; }
.scrim { display:none; }

/* ── Verbatim Scripture — inline tappable references + popup ─ */
.verse-link { color:var(--accent-deep); font-weight:600; text-decoration:underline; text-decoration-style:dotted;
  text-underline-offset:2px; cursor:pointer; border-radius:4px; padding:0 .05em; }
.verse-link:hover { background:rgba(47,111,79,.10); }
.verse-sheet { text-align:start; }
.verse-ref { font-size:.85rem; font-weight:700; color:var(--accent-deep); margin-bottom:.5rem; }
.verse-text { font-size:1.05rem; line-height:1.6; color:var(--ink); }
.verse-attr { font-size:.72rem; color:var(--muted); margin-top:.7rem; }
/* Read-only verbatim passage/chapter block (from the Bible API), rendered inline in the conversation. */
.passage-block { align-self:stretch; flex-basis:100%; background:#f2f7f3; border:1px solid var(--line); border-radius:12px; padding:.85rem 1rem; margin:.3rem 0 .2rem; }
.passage-head { display:flex; justify-content:space-between; align-items:baseline; gap:.6rem; margin-bottom:.5rem; }
.passage-ref { font-weight:700; color:var(--accent-deep); font-size:.95rem; }
.passage-ver { font-size:.72rem; color:var(--muted); text-transform:uppercase; letter-spacing:.04em; }
.passage-text { font-size:1.02rem; line-height:1.7; color:var(--ink); max-height:55vh; overflow-y:auto; white-space:normal; }
.passage-attr { font-size:.72rem; color:var(--muted); margin-top:.7rem; }
.passage-actions { display:flex; flex-wrap:wrap; align-items:center; gap:.5rem; margin-top:.6rem; }
.passage-copy { margin-top:0; }
.passage-listen { display:inline-flex; align-items:center; gap:.3rem; }
.passage-audio { flex-basis:100%; width:100%; margin-top:.5rem; height:2.4rem; }
.passage-offers { flex-basis:100%; display:flex; flex-wrap:wrap; gap:.4rem; margin:.4rem .1rem .1rem; }
.offer-chip { border:1px solid var(--accent); background:#fff; color:var(--accent-deep); cursor:pointer; font-size:.82rem; padding:.35rem .65rem; border-radius:999px; font-weight:600; }
.offer-chip:hover { background:#f2f7f3; } .offer-chip:disabled { opacity:.6; cursor:default; }
.verse-sheet .btn-primary { width:100%; margin-top:1.1rem; }

/* ── Message actions (copy / feedback) ─────────────────── */
.msg-actions { flex-basis:100%; display:flex; gap:.5rem; margin:.4rem .1rem .1rem; } /* full-width → sits BELOW the reply, always visible */
.act { border:1px solid var(--line); background:#fff; color:var(--muted); cursor:pointer; font-size:.82rem; line-height:1; padding:.35rem .55rem; border-radius:8px; }
.act:hover { background:var(--bg); color:var(--ink); } .act.picked { background:#e0e7e2; border-color:var(--accent); color:var(--accent-deep); }
.f-note { width:100%; box-sizing:border-box; font:inherit; font-size:.95rem; padding:.6rem .7rem; border:1px solid var(--line); border-radius:10px; resize:vertical; min-height:90px; margin:.2rem 0 .9rem; color:var(--ink); background:#fdfefe; }
.f-note:focus { outline:none; border-color:var(--accent); box-shadow:0 0 0 3px rgba(47,111,79,.14); }
.act:hover { background:var(--bg); } .act.picked { background:#e0e7e2; }

/* ── Modal + forms ─────────────────────────────────────── */
.modal-overlay { position:fixed; inset:0; background:rgba(16,29,47,.45); display:grid; place-items:center; padding:1.2rem; z-index:40; }
.modal-card { position:relative; background:var(--panel); border-radius:18px; max-width:460px; width:100%; padding:1.6rem 1.5rem; box-shadow:0 20px 60px rgba(16,29,47,.25); max-height:90vh; overflow:auto; }
.modal-x { position:absolute; top:.6rem; inset-inline-end:.7rem; border:none; background:transparent; font-size:1.4rem; color:var(--muted); cursor:pointer; line-height:1; }
.f-form h2, .f-thanks h2 { color:var(--accent-deep); margin:0 0 .3rem; font-size:1.3rem; }
.f-sub { color:var(--muted); font-size:.9rem; margin:0 0 1rem; }
.f-lbl { display:block; font-size:.8rem; font-weight:600; color:var(--muted); margin-bottom:.7rem; }
.f-in { width:100%; font:inherit; font-size:.95rem; padding:.55rem .7rem; border:1px solid var(--line); border-radius:10px; background:#fdfefe; color:var(--ink); margin-top:.25rem; }
.f-in:focus { outline:none; border-color:var(--accent); box-shadow:0 0 0 3px rgba(47,111,79,.14); }
.f-row { display:flex; gap:.5rem; margin-top:.25rem; } .f-row select { flex:none; width:36%; } .f-row .f-in { margin-top:0; }
.f-check { display:flex; align-items:flex-start; gap:.5rem; font-size:.88rem; color:var(--ink); margin:.2rem 0 1rem; cursor:pointer; }
.f-check input { margin-top:.15rem; }
.f-err { color:#c0392b; font-size:.85rem; min-height:1em; margin:.2rem 0 .6rem; }
.f-form > .btn-primary { width:100%; }
.f-actions { display:flex; flex-direction:row; gap:.6rem; flex-wrap:wrap; } .f-actions .btn { flex:1; min-width:130px; }
.f-thanks { text-align:center; } .f-big { font-size:2.4rem; margin-bottom:.3rem; } .f-thanks p { color:var(--muted); margin:.4rem 0 1.2rem; }
.toast { position:fixed; left:50%; bottom:1.4rem; transform:translateX(-50%) translateY(20px); background:var(--ink); color:#fff; padding:.55rem 1rem; border-radius:999px; font-size:.88rem; opacity:0; pointer-events:none; transition:opacity .2s, transform .2s; z-index:50; }
.toast.show { opacity:.96; transform:translateX(-50%) translateY(0); }

/* ── First-run walkthrough / tour ──────────────────────── */
#tour-catch { position:fixed; inset:0; z-index:58; }
#tour-hole { position:fixed; z-index:59; border-radius:12px; box-shadow:0 0 0 9999px rgba(16,29,47,.62); pointer-events:none; transition:all .2s ease; border:2px solid var(--accent); }
#tour-hole.center { display:none; }
#tour-tip { position:fixed; z-index:60; background:var(--panel); border-radius:14px; box-shadow:0 12px 40px rgba(16,29,47,.3); width:min(320px,calc(100vw - 2rem)); padding:1.1rem 1.2rem; }
#tour-tip.center { top:50%; left:50%; transform:translate(-50%,-50%); }
#tour-tip h3 { margin:0 0 .4rem; color:var(--accent-deep); font-size:1.1rem; }
#tour-tip p { margin:0; color:var(--ink); font-size:.93rem; line-height:1.5; }
.tour-foot { display:flex; align-items:center; justify-content:space-between; margin-top:1rem; gap:.5rem; }
.tour-dots { display:flex; gap:.3rem; } .tour-dot { width:6px; height:6px; border-radius:50%; background:var(--line); } .tour-dot.on { background:var(--accent); }
.tour-btns { display:flex; gap:.4rem; }
.tour-skip { background:none; border:none; color:var(--muted); font:inherit; font-size:.83rem; cursor:pointer; text-decoration:underline; }

/* ── Mobile: off-canvas sidebar + touch-friendly polish ─── */
@media (max-width:820px) {
  #menuBtn { display:grid; }
  .sidebar { position:fixed; inset:0 auto 0 0; width:min(86vw,320px); z-index:30; transform:translateX(-100%); transition:transform .2s; box-shadow:0 0 40px rgba(0,0,0,.2); }
  body.side-open .sidebar { transform:translateX(0); }
  .scrim { display:block; position:fixed; inset:0; background:rgba(0,0,0,.35); z-index:25; }
  .scrim[hidden] { display:none; }

  /* Roomier chat, bigger tap targets, no iOS zoom on focus (needs ≥16px). */
  .chat-head { padding:.5rem .6rem; gap:.35rem; }
  .chat-head #chatTitle { font-size:.98rem; }
  .chat-head-actions { display:flex; gap:.15rem; }
  .icon { width:40px; height:40px; font-size:1.05rem; }
  .transcript { padding:1rem .8rem; gap:.6rem; }
  .bubble { max-width:90%; font-size:1rem; }
  .suggestions { padding:0 .8rem .4rem; }
  .chip { padding:.5rem .85rem; font-size:.9rem; }
  .composer { padding:.6rem .7rem calc(.7rem + env(safe-area-inset-bottom)); gap:.4rem; }
  .input, .f-in { font-size:16px; padding:.7rem .85rem; } /* ≥16px prevents iOS zoom-on-focus */
  .send { width:46px; height:46px; }
  .verse-link { padding:.05em .15em; } /* easier to tap */

  /* Modals become bottom sheets — thumb-reachable, full-width, slide up. */
  .modal-overlay { align-items:flex-end; padding:0; }
  .modal-card { max-width:none; width:100%; border-radius:20px 20px 0 0; padding:1.4rem 1.2rem calc(1.4rem + env(safe-area-inset-bottom)); max-height:88vh; animation:sheet-up .22s ease; }
  .verse-text { font-size:1.12rem; }
}
@keyframes sheet-up { from { transform:translateY(100%); } to { transform:translateY(0); } }

/* Guest sign-up nudge (assets/site.js → showSignupNudge). Rendered inside the shared .modal-card. */
.nudge h3 { margin:0 0 .5rem; font-size:1.15rem; }
.nudge-lead { margin:0 0 .9rem; color:var(--muted); font-size:.9rem; line-height:1.5; }
.nudge-list { margin:0 0 1.1rem; padding-inline-start:1.1rem; display:grid; gap:.45rem; font-size:.88rem; line-height:1.45; }
.nudge-list li { padding-inline-start:.1rem; }
.nudge-actions { display:flex; flex-wrap:wrap; gap:.5rem; }
.nudge-actions .btn { flex:1 1 auto; text-align:center; }
.nudge-fine { margin:.9rem 0 0; font-size:.76rem; color:var(--muted); }
/* RTL languages (Arabic, Urdu, Farsi, Hebrew, Kurdish) flip the list indent. */
/* superseded by padding-inline-start on .nudge-list — logical props mirror on their own */

/* A reply whose stream dropped partway. It stays in the transcript and in history — history must
   match what the seeker can see — but it is marked so they know it is incomplete rather than
   thinking FaithBot simply stopped mid-sentence. */
.bubble.interrupted { opacity: .82; border-inline-start: 3px solid var(--warn, #d08c3f); padding-inline-start: .6rem; }

/* The close X and the drawer were physically anchored, so both landed on the wrong side in RTL. */
[dir="rtl"] .sidebar { inset: 0 0 0 auto; transform: translateX(100%); }
[dir="rtl"] .sidebar.open { transform: translateX(0); }

/* Separator before the clear-my-data block in Settings. Deliberately understated — a seeker who needs
   to erase their traces should not have to feel they are doing something drastic to find it. */
.f-sep { border:none; border-top:1px solid var(--line, #e3e3e0); margin:1.1rem 0 .9rem; }

/* The only content that renders without JavaScript. Styled enough to look intentional rather than broken —
   a bare unstyled paragraph reads as a failure, which is the impression this exists to avoid. */
.noscript-note { max-width: 34rem; margin: 4rem auto; padding: 0 1.25rem; text-align: center; }
.noscript-note h1 { font-size: 1.6rem; margin: 0 0 .6rem; }
.noscript-note p { color: var(--muted); line-height: 1.5; }

/* For screen readers only — off-screen, but still in the accessibility tree, which display:none is not.
   Carries #srAnnounce, the atomic live region that announces a finished reply once. The transcript itself
   must never be a live region: site.js rewrites the reply bubble on every streamed token, so a live
   transcript is re-read from the top dozens of times per answer. */
.sr-only {
  position:absolute; width:1px; height:1px; padding:0; margin:-1px;
  overflow:hidden; clip:rect(0 0 0 0); clip-path:inset(50%); white-space:nowrap; border:0;
}

/* ── Documents the seeker asked for (core/documents.md) ────────────────────────────────────────
   The card that appears under a reply, the modal preview, and the printed page all render the same
   .doc node (documentNode in site.js), so what they see on screen is what comes out of the printer. */
.doc-card { align-self:stretch; flex-basis:100%; background:#f2f7f3; border:1px solid var(--line); border-radius:12px; padding:.85rem 1rem; margin:.3rem 0 .2rem; }
.doc-kind { font-size:.72rem; color:var(--muted); text-transform:uppercase; letter-spacing:.04em; }
.doc-title { font-weight:700; color:var(--accent-deep); font-size:1.02rem; margin:.15rem 0 .1rem; }
.doc-meta { font-size:.78rem; color:var(--muted); }
.doc-actions { display:flex; flex-wrap:wrap; gap:.5rem; margin-top:.6rem; }
.doc-pending .doc-building { font-size:.9rem; color:var(--muted); margin-top:.25rem; }
.doc-failed { font-size:.9rem; color:var(--muted); }

.doc-sheet .doc { max-height:62vh; overflow-y:auto; }
.doc-sheet .f-actions { margin-top:1rem; }
.doc-head { border-bottom:2px solid var(--accent); padding-bottom:.6rem; margin-bottom:1rem; }
.doc-brand { display:flex; align-items:center; gap:.45rem; font-weight:700; color:var(--accent-deep); margin-bottom:.4rem; }
.doc-doctitle { font-size:1.35rem; line-height:1.3; margin:0; color:var(--ink); }
.doc-section { margin-bottom:1.3rem; }
.doc-h { font-size:1.02rem; color:var(--accent-deep); margin:0 0 .35rem; }
.doc-prose { line-height:1.65; }
.doc-prose p { margin:0 0 .6rem; }
/* Scripture sits inside the document, verbatim and attributed, the way it does in the chat. */
.doc-passage { margin:.7rem 0; padding:.6rem .9rem; border-inline-start:3px solid var(--accent); background:#f7faf8; border-radius:0 8px 8px 0; }
.doc-passage-ref { font-size:.78rem; font-weight:700; color:var(--accent-deep); margin-bottom:.25rem; }
.doc-passage-text { line-height:1.7; }
.doc-closing { margin-top:1rem; font-style:italic; color:var(--muted); }
.doc-foot { border-top:1px solid var(--line); margin-top:1.2rem; padding-top:.6rem; }
.doc-attr { font-size:.72rem; color:var(--muted); }
.side-docs { padding:0 .5rem; }

/* Off-screen on screen; the print block below is what reveals it. `position:absolute` rather than
   `display:none` — a display:none subtree is not laid out, and some engines will not paint it when
   the print block flips it back. */
#printRoot { position:absolute; left:-10000px; top:0; width:1px; height:1px; overflow:hidden; }

/* ── Print ─────────────────────────────────────────────────────────────────────────────────────
   Save-as-PDF is the browser's own print dialog, which is why there is no PDF library in this repo.
   It also means the 21 lazily-attached Noto script faces (attachScriptFont) are what render Arabic,
   Urdu, Devanagari and CJK correctly on paper — a JS PDF renderer would have to embed each one. */
@page { margin:18mm 16mm; }
@media print {
  /* Colour-managed screen greens print muddy on most consumer printers; the document is ink on paper. */
  html, body { background:#fff !important; color:#000 !important; height:auto; }
  /* #app is the whole chat UI (sidebar, header, transcript, composer), so hiding it covers all of
     them — listing its children as well would just be selectors to keep in sync. #landing, #modal and
     .toast are its siblings and need saying separately. */
  #app, #landing, #modal, .toast { display:none !important; }
  #printRoot { position:static !important; left:auto; width:auto; height:auto; overflow:visible; }
  .doc-print { max-width:none; }
  .doc-head { border-bottom:2px solid #333; }
  .doc-brand, .doc-h, .doc-passage-ref { color:#000; }
  .doc-passage { background:#f4f4f4; border-inline-start:3px solid #555; }
  /* A heading stranded at the foot of a page, or a verse split across two, is the usual way a printed
     document goes wrong. Keep each section and each passage whole where the page box allows. */
  .doc-section, .doc-passage { break-inside:avoid; page-break-inside:avoid; }
  .doc-h { break-after:avoid; page-break-after:avoid; }
  .doc-sheet .doc { max-height:none; overflow:visible; }
  a[href]::after { content:""; }  /* the seeker's own document, not a web page printout */
}
