<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" href="https://seemychurch.org/wp-sitemap-index.xsl" ?>
<sitemapindex xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"><sitemap><loc>https://seemychurch.org/wp-sitemap-posts-post-1.xml</loc></sitemap><sitemap><loc>https://seemychurch.org/wp-sitemap-posts-page-1.xml</loc></sitemap><sitemap><loc>https://seemychurch.org/wp-sitemap-posts-cv_church_page-1.xml</loc></sitemap><sitemap><loc>https://seemychurch.org/wp-sitemap-taxonomies-category-1.xml</loc></sitemap><sitemap><loc>https://seemychurch.org/wp-sitemap-users-1.xml</loc></sitemap></sitemapindex>

<!-- cvfb-render-fired v1.0.0 -->
<style id="cvfb-styles">
  /* Scoped so plugin CSS can't leak into the host theme */
  #cvfb-root, #cvfb-root *{box-sizing:border-box}
  #cvfb-root{position:fixed;bottom:20px;right:20px;z-index:999990;font-family:-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,Oxygen,Ubuntu,Arial,sans-serif}
  #cvfb-fab{background:linear-gradient(135deg,#c9a84c,#f0d06a);color:#0a0f1a;border:none;border-radius:99px;padding:14px 22px;font-size:15px;font-weight:700;cursor:pointer;box-shadow:0 10px 30px rgba(201,168,76,.35),0 2px 6px rgba(0,0,0,.15);transition:transform .2s,box-shadow .2s;display:flex;align-items:center;gap:8px}
  #cvfb-fab:hover{transform:translateY(-2px);box-shadow:0 14px 36px rgba(201,168,76,.45),0 4px 8px rgba(0,0,0,.2)}
  #cvfb-fab-icon{width:22px;height:22px;display:inline-block;flex-shrink:0;background:#0a0f1a;color:#c9a84c;border-radius:50%;line-height:22px;text-align:center;font-size:14px;font-weight:900}
  #cvfb-panel{display:none;position:fixed;bottom:80px;right:20px;width:380px;max-width:calc(100vw - 40px);max-height:70vh;background:#0d1828;border:1px solid rgba(201,168,76,.25);border-radius:18px;box-shadow:0 25px 60px rgba(0,0,0,.5),0 0 0 1px rgba(201,168,76,.08);overflow:hidden;flex-direction:column;color:#e2e8f0}
  #cvfb-panel.open{display:flex}
  #cvfb-head{padding:18px 20px 14px;background:linear-gradient(135deg,rgba(201,168,76,.15),transparent);border-bottom:1px solid rgba(201,168,76,.15);flex-shrink:0}
  #cvfb-head-title{font-size:15px;font-weight:700;color:#f0d06a;margin:0 0 4px;display:flex;align-items:center;gap:8px}
  #cvfb-head-sub{font-size:13px;color:#94a3b8;margin:0;line-height:1.5}
  #cvfb-close{position:absolute;top:12px;right:14px;background:transparent;border:none;color:#94a3b8;cursor:pointer;font-size:22px;width:28px;height:28px;border-radius:50%;display:flex;align-items:center;justify-content:center;line-height:1;padding:0}
  #cvfb-close:hover{background:rgba(255,255,255,.05);color:#fff}
  #cvfb-body{flex:1;overflow-y:auto;padding:14px 16px 18px}
  #cvfb-body::-webkit-scrollbar{width:6px}
  #cvfb-body::-webkit-scrollbar-thumb{background:rgba(201,168,76,.3);border-radius:3px}
  .cvfb-cat{margin:18px 0 8px}
  .cvfb-cat:first-child{margin-top:4px}
  .cvfb-cat-title{font-size:11px;font-weight:700;color:#94a3b8;letter-spacing:1.2px;text-transform:uppercase;margin:0 0 8px;padding:0 4px}
  .cvfb-q-btn{display:block;width:100%;text-align:left;background:rgba(255,255,255,.03);border:1px solid rgba(255,255,255,.06);color:#e2e8f0;padding:11px 14px;border-radius:10px;font-size:13.5px;margin-bottom:6px;cursor:pointer;transition:all .15s;line-height:1.4;font-family:inherit}
  .cvfb-q-btn:hover{background:rgba(201,168,76,.08);border-color:rgba(201,168,76,.3);color:#f0d06a}
  .cvfb-answer{background:rgba(201,168,76,.06);border:1px solid rgba(201,168,76,.2);border-radius:12px;padding:16px;margin:12px 4px;color:#e2e8f0;font-size:13.5px;line-height:1.65}
  .cvfb-answer p{margin:0 0 10px}
  .cvfb-answer p:last-child{margin-bottom:0}
  .cvfb-btns{display:flex;flex-wrap:wrap;gap:8px;margin-top:14px}
  .cvfb-btn{display:inline-block;padding:8px 16px;border-radius:99px;font-size:12.5px;font-weight:700;text-decoration:none;transition:all .15s;line-height:1.2;border:1.5px solid transparent;font-family:inherit;cursor:pointer}
  .cvfb-btn.primary{background:linear-gradient(135deg,#c9a84c,#f0d06a);color:#0a0f1a}
  .cvfb-btn.primary:hover{color:#0a0f1a;opacity:.9;transform:translateY(-1px)}
  .cvfb-btn.secondary{background:transparent;border-color:rgba(201,168,76,.4);color:#f0d06a}
  .cvfb-btn.secondary:hover{background:rgba(201,168,76,.1);color:#f0d06a}
  .cvfb-btn.ghost{background:transparent;border-color:rgba(255,255,255,.15);color:#94a3b8}
  .cvfb-btn.ghost:hover{color:#e2e8f0;border-color:rgba(255,255,255,.25)}
  .cvfb-back{background:transparent;border:none;color:#94a3b8;cursor:pointer;font-size:13px;padding:6px 10px;border-radius:8px;display:inline-flex;align-items:center;gap:6px;margin:8px 0 0;font-family:inherit}
  .cvfb-back:hover{color:#f0d06a;background:rgba(255,255,255,.03)}
  @media (max-width:480px){
    #cvfb-panel{right:10px;left:10px;width:auto;bottom:140px;max-height:70vh}
    #cvfb-root{bottom:80px;right:14px}
    #cvfb-fab{padding:11px 16px;font-size:13px}
    #cvfb-fab-icon{width:20px;height:20px;line-height:20px;font-size:13px}
  }
</style>

<div id="cvfb-root">
  <button id="cvfb-fab" aria-label="Open help chat" aria-expanded="false">
    <span id="cvfb-fab-icon">?</span>
    <span>Help</span>
  </button>

  <div id="cvfb-panel" role="dialog" aria-label="Help chat">
    <div id="cvfb-head">
      <button id="cvfb-close" aria-label="Close">&times;</button>
      <div id="cvfb-head-title">💬 ChurchVault Help</div>
      <p id="cvfb-head-sub">Hi 👋 — what can I help you with?</p>
    </div>
    <div id="cvfb-body">
      <div id="cvfb-view-questions">
          <div class="cvfb-cat">
          <div class="cvfb-cat-title">🎯 Getting Started</div>
            <button class="cvfb-q-btn" data-qid="signup_how">How do I sign up?</button>
            <button class="cvfb-q-btn" data-qid="free_trial">Is there a free trial?</button>
            <button class="cvfb-q-btn" data-qid="free_plan">Do you have a free plan?</button>
            <button class="cvfb-q-btn" data-qid="setup_time">How quickly will my account be set up?</button>
            <button class="cvfb-q-btn" data-qid="tutorial_videos">Are there tutorial videos I can watch?</button>
          </div>
          <div class="cvfb-cat">
          <div class="cvfb-cat-title">💰 Pricing &amp; Billing</div>
            <button class="cvfb-q-btn" data-qid="pricing">How much does ChurchVault cost?</button>
            <button class="cvfb-q-btn" data-qid="setup_fees">Are there setup fees?</button>
            <button class="cvfb-q-btn" data-qid="annual_savings">Can I pay yearly to save money?</button>
            <button class="cvfb-q-btn" data-qid="branch_costs">What about branch costs?</button>
            <button class="cvfb-q-btn" data-qid="auto_renew">Do you auto-renew?</button>
            <button class="cvfb-q-btn" data-qid="cancel">How do I cancel?</button>
            <button class="cvfb-q-btn" data-qid="upgrade_later">Can I upgrade later?</button>
            <button class="cvfb-q-btn" data-qid="payment_methods">What payment methods do you accept?</button>
          </div>
          <div class="cvfb-cat">
          <div class="cvfb-cat-title">🏛 Features</div>
            <button class="cvfb-q-btn" data-qid="benefits">What are the benefits of ChurchVault?</button>
            <button class="cvfb-q-btn" data-qid="multi_branch">Does ChurchVault support multiple branches?</button>
            <button class="cvfb-q-btn" data-qid="branch_dashboard">Can I see all branch figures on one dashboard?</button>
            <button class="cvfb-q-btn" data-qid="multi_currency">Can branches use different currencies?</button>
            <button class="cvfb-q-btn" data-qid="approval_system">What is the expense approval system?</button>
            <button class="cvfb-q-btn" data-qid="online_giving">Can I collect tithes and offerings online?</button>
            <button class="cvfb-q-btn" data-qid="tax_calculator">Do you support tax calculations?</button>
            <button class="cvfb-q-btn" data-qid="bank_import">Can I import my bank statements?</button>
            <button class="cvfb-q-btn" data-qid="international">Do you work outside Nigeria?</button>
          </div>
          <div class="cvfb-cat">
          <div class="cvfb-cat-title">🔐 Security &amp; Data</div>
            <button class="cvfb-q-btn" data-qid="data_safety">Is our data and financial figures safe?</button>
            <button class="cvfb-q-btn" data-qid="data_access">Who can see our data?</button>
            <button class="cvfb-q-btn" data-qid="data_export">Can I export my data?</button>
            <button class="cvfb-q-btn" data-qid="data_after_cancel">What happens to my data if I cancel?</button>
          </div>
          <div class="cvfb-cat">
          <div class="cvfb-cat-title">🤝 Partner Programme</div>
            <button class="cvfb-q-btn" data-qid="partner_how">How can I become a partner?</button>
            <button class="cvfb-q-btn" data-qid="partner_earnings">How much do partners earn?</button>
            <button class="cvfb-q-btn" data-qid="partner_refer">How do I refer other churches?</button>
            <button class="cvfb-q-btn" data-qid="partner_withdraw">When can partners withdraw earnings?</button>
            <button class="cvfb-q-btn" data-qid="partner_cap">Is there a cap on referrals?</button>
            <button class="cvfb-q-btn" data-qid="partner_fee">Is there a fee to join the Partner Programme?</button>
            <button class="cvfb-q-btn" data-qid="partner_marketing">Do I need a marketing budget to partner?</button>
            <button class="cvfb-q-btn" data-qid="partner_church_cancel">What happens if a church I referred cancels?</button>
          </div>
          <div class="cvfb-cat">
          <div class="cvfb-cat-title">📞 Support</div>
            <button class="cvfb-q-btn" data-qid="support_contact">How do I contact support?</button>
            <button class="cvfb-q-btn" data-qid="onboarding">Do you offer onboarding help?</button>
            <button class="cvfb-q-btn" data-qid="enterprise">Enterprise or denomination enquiry?</button>
            <button class="cvfb-q-btn" data-qid="talk_to_human">Talk to a human</button>
          </div>
      </div>
      <div id="cvfb-view-answer" style="display:none"></div>
    </div>
  </div>
</div>

<script id="cvfb-script">
(function(){
  'use strict';
  // Q&A data embedded directly — no extra HTTP request needed
  var CVFB_DATA = [{"id":"signup_how","cat":"start","q":"How do I sign up?","a":"Pick a plan and create your account in a few minutes. Starter is free forever. Essential, Professional, and Premium Pro are paid plans.","buttons":[{"label":"Sign up free (Starter)","url":"https:\/\/seemychurch.org\/signup\/?plan=starter","style":"primary"},{"label":"See paid plans","url":"https:\/\/seemychurch.org\/#pricing","style":"secondary"},{"label":"Watch 90-sec tour","url":"https:\/\/www.youtube.com\/watch?v=whZWS29JvZA","style":"ghost"}]},{"id":"free_trial","cat":"start","q":"Is there a free trial?","a":"No free trial \u2014 but we have a Starter plan that's free forever. Use it as long as you like. When you outgrow it, upgrade to Essential or above.","buttons":[{"label":"Start free Starter","url":"https:\/\/seemychurch.org\/signup\/?plan=starter","style":"primary"},{"label":"See paid plans","url":"https:\/\/seemychurch.org\/#pricing","style":"secondary"}]},{"id":"free_plan","cat":"start","q":"Do you have a free plan?","a":"Yes \u2014 Starter is free forever for single churches. It includes 1 church location, income & expense recording, 1 bank account, basic dashboard, and a free public church page. No credit card needed.","buttons":[{"label":"Start free","url":"https:\/\/seemychurch.org\/signup\/?plan=starter","style":"primary"}]},{"id":"setup_time","cat":"start","q":"How quickly will my account be set up?","a":"Within 24\u201372 hours of receiving your reply to the setup instructions email. Most setups complete within 24 hours.","buttons":[]},{"id":"tutorial_videos","cat":"start","q":"Are there tutorial videos I can watch?","a":"Yes \u2014 we have six videos on YouTube: Partner Programme Overview, Quick Features Tour (90s), Full Features Tour (deep dive), FAQ, Signup Walkthrough, and Dashboard Tour.","buttons":[{"label":"YouTube channel","url":"https:\/\/www.youtube.com\/@seemychurch","style":"primary"},{"label":"Quick 90-sec tour","url":"https:\/\/www.youtube.com\/watch?v=whZWS29JvZA","style":"secondary"},{"label":"Full features tour","url":"https:\/\/www.youtube.com\/watch?v=hqQYr-TYko0","style":"ghost"}]},{"id":"pricing","cat":"pricing","q":"How much does ChurchVault cost?","a":"Starter is free forever. Essential is \u20a69,900\/month or \u20a699,000\/year (saves 2 months). Professional is \u20a619,900\/month or \u20a6199,000\/year \u2014 includes HQ plus unlimited branches. Premium Pro is \u20a629,900\/month or \u20a6299,000\/year \u2014 everything plus Budget Planning, Tax Calculator, and Gift Aid. No setup fees. Cancel anytime.","buttons":[{"label":"See full pricing","url":"https:\/\/seemychurch.org\/#pricing","style":"primary"},{"label":"Sign up","url":"https:\/\/seemychurch.org\/signup\/","style":"secondary"}]},{"id":"setup_fees","cat":"pricing","q":"Are there setup fees?","a":"No. No setup fees. No hidden charges. What you see is what you pay.","buttons":[]},{"id":"annual_savings","cat":"pricing","q":"Can I pay yearly to save money?","a":"Yes \u2014 annual billing saves you 2 months compared to paying monthly. That applies to Essential, Professional, and Premium Pro.","buttons":[{"label":"Sign up for annual","url":"https:\/\/seemychurch.org\/signup\/","style":"primary"}]},{"id":"branch_costs","cat":"pricing","q":"What about branch costs?","a":"If you run HQ + branches (Professional or Premium Pro plans), branches are billed per location. Branch Pro: \u20a64,500\/mo or \u20a650,000\/yr. Branch Premium: \u20a65,900\/mo or \u20a665,000\/yr.","buttons":[{"label":"See multi-branch pricing","url":"https:\/\/seemychurch.org\/#pricing","style":"primary"}]},{"id":"auto_renew","cat":"pricing","q":"Do you auto-renew?","a":"Yes \u2014 we auto-charge the card you signed up with on your renewal date. You can cancel auto-renewal anytime from your dashboard or from any reminder email (one-click, no login needed).","buttons":[{"label":"Log in","url":"https:\/\/seemychurch.org\/cv-access\/","style":"primary"}]},{"id":"cancel","cat":"pricing","q":"How do I cancel?","a":"Contact support anytime. Your data remains accessible for 30 days after cancellation so you can export records.","buttons":[{"label":"Email support","url":"mailto:support@seemychurch.org","style":"primary"},{"label":"WhatsApp","url":"https:\/\/wa.me\/2348023507395","style":"secondary"}]},{"id":"upgrade_later","cat":"pricing","q":"Can I upgrade later?","a":"Yes. Contact support and we'll migrate your existing data to the new plan with any new features enabled.","buttons":[{"label":"Email support","url":"mailto:support@seemychurch.org","style":"primary"}]},{"id":"payment_methods","cat":"pricing","q":"What payment methods do you accept?","a":"Payment is processed via Paystack. All major cards (Verve, Mastercard, Visa), plus direct bank transfer and mobile money in supported countries.","buttons":[]},{"id":"benefits","cat":"features","q":"What are the benefits of ChurchVault?","a":"Purpose-built for churches \u2014 not generic accounting software. You get multi-currency income and expense tracking, live bank account balances, a 2-person expense approval workflow, HQ + branch network dashboards, budget planning, tax calculator (7 countries and others), and a free public church page.","buttons":[{"label":"See all features","url":"https:\/\/seemychurch.org\/#features","style":"primary"},{"label":"Watch the full tour","url":"https:\/\/www.youtube.com\/watch?v=hqQYr-TYko0","style":"secondary"}]},{"id":"multi_branch","cat":"features","q":"Does ChurchVault support multiple branches?","a":"Yes \u2014 Professional and Premium Pro plans give you an HQ plus unlimited branches. Each branch has its own dashboard; the HQ sees everything consolidated.","buttons":[{"label":"See multi-branch plans","url":"https:\/\/seemychurch.org\/#pricing","style":"primary"}]},{"id":"branch_dashboard","cat":"features","q":"Can I see all branch figures on one dashboard?","a":"Yes \u2014 that's exactly what HQ Mode does. The HQ Admin sees every branch's income, expenses, bank balances, and pending approvals consolidated in one view, with per-branch breakdowns. Each branch pastor sees only their own branch.","buttons":[]},{"id":"multi_currency","cat":"features","q":"Can branches use different currencies?","a":"Yes. Each branch can be set to NGN, USD, GBP, or EUR. Income and expenses are recorded in the selected currency and displayed separately \u2014 no confusing cross-rate mixing.","buttons":[]},{"id":"approval_system","cat":"features","q":"What is the expense approval system?","a":"Every expense requires sign-off from 2 people other than the person who recorded it. Balances update immediately for accounting accuracy, while the audit trail requires two approvers. You nominate those people during setup.","buttons":[]},{"id":"online_giving","cat":"features","q":"Can I collect tithes and offerings online?","a":"Yes. Every paid subscriber gets a free public church page at seemychurch.org\/church\/yourchurch where your congregation can give online via Paystack.","buttons":[]},{"id":"tax_calculator","cat":"features","q":"Do you support tax calculations?","a":"Yes \u2014 the Premium Pro plan includes a Tax Calculator covering 7 countries and others, with PAYE, WHT, and VAT support. Countries include Nigeria, UK, USA, South Africa, Ghana, Kenya, and Uganda.","buttons":[{"label":"See Premium Pro","url":"https:\/\/seemychurch.org\/#pricing","style":"primary"}]},{"id":"bank_import","cat":"features","q":"Can I import my bank statements?","a":"Yes \u2014 from the Essential plan up, you can import bank statements in CSV, XLS, or PDF format.","buttons":[]},{"id":"international","cat":"features","q":"Do you work outside Nigeria?","a":"Yes \u2014 ChurchVault supports NGN, USD, GBP, and EUR. Churches in the UK, US, Ghana, Kenya, and beyond use the platform.","buttons":[]},{"id":"data_safety","cat":"security","q":"Is our data and financial figures safe?","a":"Yes. ChurchVault uses role-based access control (no user sees another church's data), prepared SQL statements (SQL injection protected), nonce verification on all forms, HTTPS encryption in transit, and your Paystack keys are never visible to subscribers.","buttons":[]},{"id":"data_access","cat":"security","q":"Who can see our data?","a":"Only you and the people you invite to your church. Not other churches. Not advertisers. Not us, except for support reasons with your permission.","buttons":[]},{"id":"data_export","cat":"security","q":"Can I export my data?","a":"Yes, anytime. Your data is yours \u2014 no lock-in. Contact support if you need help exporting before cancellation.","buttons":[{"label":"Email support","url":"mailto:support@seemychurch.org","style":"primary"}]},{"id":"data_after_cancel","cat":"security","q":"What happens to my data if I cancel?","a":"Your data remains accessible for 30 days after cancellation so you can export records. After that, it's deleted.","buttons":[]},{"id":"partner_how","cat":"partner","q":"How can I become a partner?","a":"Anyone can apply \u2014 you don't need to be a pastor. It's free to join. Apply through the Partner Programme page.","buttons":[{"label":"Apply now","url":"https:\/\/seemychurch.org\/partner-apply\/","style":"primary"},{"label":"How the programme works","url":"https:\/\/www.youtube.com\/watch?v=R_QstcApIv8","style":"secondary"}]},{"id":"partner_earnings","cat":"partner","q":"How much do partners earn?","a":"30% recurring commission on every church you refer \u2014 for as long as they remain a customer. That means \u20a62,970\/mo per Essential referral, \u20a65,970\/mo per Professional, or \u20a68,970\/mo per Premium Pro. Every month they stay, you earn.","buttons":[{"label":"Become a partner","url":"https:\/\/seemychurch.org\/partner-apply\/","style":"primary"}]},{"id":"partner_refer","cat":"partner","q":"How do I refer other churches?","a":"From your partner dashboard \u2192 Share My Link. Every church that signs up via your link is attributed to you automatically (30-day cookie). You can also submit offline referrals manually from the dashboard \u2014 our team reviews within 48 hours.","buttons":[{"label":"Log in to partner dashboard","url":"https:\/\/seemychurch.org\/partner-dashboard\/","style":"primary"}]},{"id":"partner_withdraw","cat":"partner","q":"When can partners withdraw earnings?","a":"Withdrawals are processed on the 1st and 15th of each month. Your balance must be at least \u20a650,000. Requests before midnight on those dates are transferred within 2\u20133 working days.","buttons":[]},{"id":"partner_cap","cat":"partner","q":"Is there a cap on referrals?","a":"No cap. Refer 1 church or 100 \u2014 you earn 30% on every active subscription indefinitely.","buttons":[]},{"id":"partner_fee","cat":"partner","q":"Is there a fee to join the Partner Programme?","a":"No. The partner programme is completely free to join.","buttons":[{"label":"Apply now","url":"https:\/\/seemychurch.org\/partner-apply\/","style":"primary"}]},{"id":"partner_marketing","cat":"partner","q":"Do I need a marketing budget to partner?","a":"No. You decide your own approach. Some partners use free social media, others invest in ads. ChurchVault doesn't require or specify a marketing budget.","buttons":[]},{"id":"partner_church_cancel","cat":"partner","q":"What happens if a church I referred cancels?","a":"Commissions stop from the month they cancel. All previously credited commissions remain in your balance.","buttons":[]},{"id":"support_contact","cat":"support","q":"How do I contact support?","a":"Email support@seemychurch.org or WhatsApp +234 802 350 7395. We respond during business hours (WAT).","buttons":[{"label":"Email support","url":"mailto:support@seemychurch.org","style":"primary"},{"label":"WhatsApp","url":"https:\/\/wa.me\/2348023507395","style":"secondary"}]},{"id":"onboarding","cat":"support","q":"Do you offer onboarding help?","a":"Yes \u2014 every new customer gets a free onboarding chat on WhatsApp. We walk you through setup, answer questions, and help you get your first transactions recorded.","buttons":[{"label":"Start WhatsApp chat","url":"https:\/\/wa.me\/2348023507395?text=Hi%2C%20I%27m%20a%20new%20ChurchVault%20customer%20and%20I%27d%20like%20onboarding%20help","style":"primary"}]},{"id":"enterprise","cat":"support","q":"Enterprise or denomination enquiry?","a":"We offer custom arrangements for large denominations, church networks, and enterprise customers. Email us directly for a quote.","buttons":[{"label":"Email enterprise team","url":"mailto:support@seemychurch.org?subject=Enterprise%20Enquiry","style":"primary"}]},{"id":"talk_to_human","cat":"support","q":"Talk to a human","a":"No problem. Choose how to reach us:","buttons":[{"label":"WhatsApp now","url":"https:\/\/wa.me\/2348023507395","style":"primary"},{"label":"Email us","url":"mailto:support@seemychurch.org","style":"secondary"}]}];
  var CVFB_REST_URL   = "https:\/\/seemychurch.org\/wp-json\/cvfb\/v1\/click";
  var CVFB_REST_NONCE = "1c84a8d052";

  var fab   = document.getElementById('cvfb-fab');
  var panel = document.getElementById('cvfb-panel');
  var close = document.getElementById('cvfb-close');
  var viewQ = document.getElementById('cvfb-view-questions');
  var viewA = document.getElementById('cvfb-view-answer');
  var body  = document.getElementById('cvfb-body');

  function openPanel(){
    panel.classList.add('open');
    fab.setAttribute('aria-expanded','true');
    showQuestions();
  }
  function closePanel(){
    panel.classList.remove('open');
    fab.setAttribute('aria-expanded','false');
  }
  function showQuestions(){
    viewQ.style.display = 'block';
    viewA.style.display = 'none';
    body.scrollTop = 0;
  }
  function showAnswer(qid){
    var qa = null;
    for (var i=0; i<CVFB_DATA.length; i++){
      if (CVFB_DATA[i].id === qid){ qa = CVFB_DATA[i]; break; }
    }
    if (!qa) return;

    // Build answer HTML
    var html = '';
    html += '<button class="cvfb-back" type="button">← Back to questions</button>';
    html += '<div class="cvfb-answer">';
    html += '<p style="margin:0 0 10px;font-weight:700;color:#f0d06a">' + escapeHtml(qa.q) + '</p>';
    // Answer text — split on double newline for paragraphs
    var paragraphs = qa.a.split(/\n\n+/);
    paragraphs.forEach(function(p){
      html += '<p>' + escapeHtml(p) + '</p>';
    });
    if (qa.buttons && qa.buttons.length){
      html += '<div class="cvfb-btns">';
      qa.buttons.forEach(function(btn){
        var style = (btn.style || 'primary').toLowerCase();
        if (style !== 'primary' && style !== 'secondary' && style !== 'ghost') style = 'primary';
        html += '<a class="cvfb-btn ' + style + '" href="' + escapeAttr(btn.url) + '" target="_blank" rel="noopener">' + escapeHtml(btn.label) + '</a>';
      });
      html += '</div>';
    }
    html += '</div>';
    viewA.innerHTML = html;
    viewQ.style.display = 'none';
    viewA.style.display = 'block';
    body.scrollTop = 0;

    // Track the click asynchronously
    trackClick(qid);

    // Wire up the back button
    var backBtn = viewA.querySelector('.cvfb-back');
    if (backBtn) backBtn.addEventListener('click', showQuestions);
  }
  function trackClick(qid){
    // Fire-and-forget. Failure is silent — tracking must never break UX.
    try {
      fetch(CVFB_REST_URL, {
        method: 'POST',
        headers: {
          'Content-Type': 'application/json',
          'X-WP-Nonce': CVFB_REST_NONCE
        },
        body: JSON.stringify({ qid: qid }),
        credentials: 'same-origin'
      }).catch(function(){});
    } catch(e){}
  }
  function escapeHtml(s){
    if (s === null || s === undefined) return '';
    return String(s).replace(/[&<>"']/g, function(c){
      return { '&':'&amp;', '<':'&lt;', '>':'&gt;', '"':'&quot;', "'":'&#39;' }[c];
    });
  }
  function escapeAttr(s){ return escapeHtml(s); }

  // Event listeners
  fab.addEventListener('click', function(){
    if (panel.classList.contains('open')) closePanel(); else openPanel();
  });
  close.addEventListener('click', closePanel);
  document.addEventListener('keydown', function(e){
    if (e.key === 'Escape' && panel.classList.contains('open')) closePanel();
  });
  // Question buttons — event delegation for efficiency
  viewQ.addEventListener('click', function(e){
    var btn = e.target.closest('.cvfb-q-btn');
    if (btn) showAnswer(btn.getAttribute('data-qid'));
  });
})();
</script>
    