<!DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head id="Head1">
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="Content-Language" content="en" />

<meta property="og:image" content="https://w2.chabad.org/media/images/1075/rXwt10754616.png" itemprop="image" width="150" height="150" />
<meta property="og:image:width" content="150" />
<meta property="og:image:height" content="150" />
<meta name="keywords" content="Planned,Giving,Council" />
<meta name="title" content="Planned Giving Council - Harford Chabad" />
<meta property="og:type" content="website" />
<meta name="scope-aids" content="1245574-1245582-7008784-3007823-3007851-3007855" />
<meta name="article-keywords" content="19478-19479-19958-20962-8495-8972-18927-19353-19480-8503-21139-2170-2898" />
<meta name="scope-aid" content="1245574" />
<meta name="scope-aid" content="1245582" />
<meta name="scope-aid" content="7008784" />
<meta name="scope-aid" content="3007823" />
<meta name="scope-aid" content="3007851" />
<meta name="scope-aid" content="3007855" />
<meta name="article-keyword" content="19478" />
<meta name="article-keyword" content="19479" />
<meta name="article-keyword" content="19958" />
<meta name="article-keyword" content="20962" />
<meta name="article-keyword" content="8495" />
<meta name="article-keyword" content="8972" />
<meta name="article-keyword" content="18927" />
<meta name="article-keyword" content="19353" />
<meta name="article-keyword" content="19480" />
<meta name="article-keyword" content="8503" />
<meta name="article-keyword" content="21139" />
<meta name="article-keyword" content="2170" />
<meta name="article-keyword" content="2898" />
<meta property="og:url" content="https://www.harfordchabad.org/templates/articlecco_cdo/aid/3007855/jewish/Planned-Giving-Council.htm" />
<meta property="twitter:card" content="summary_large_image" />
<meta property="twitter:site" content="@chabad" />
<meta property="og:title" content="Planned Giving Council - Harford Chabad" /><link rel="canonical" href="https://www.harfordchabad.org/templates/articlecco_cdo/aid/3007855/jewish/Planned-Giving-Council.htm" />
<link rel="icon" type="image/png" href="https://www.harfordchabad.org/media/images/1075/rXwt10754616.png" />
<link rel="Stylesheet" href="/css/fonts/font-awesome/font-awesome-5.css?v=CE3D9C0A" id="kfont-awesome" type="text/css"/>
<link rel="Stylesheet" href="/css/DefaultGrid.css?v=44B79007" id="kgrid" type="text/css"/>
<link rel="Stylesheet" href="/css/Elements.css?v=E669C926" id="k6" type="text/css"/>
<link rel="Stylesheet" href="/css/vendor/ds/tokens/sites.css?v=B42347C0" id="ksites-ds-css" type="text/css"/>
<link rel="Stylesheet" href="/css/new/main.css?v=180B7FFC" id="k7" type="text/css"/>
<link rel="Stylesheet" href="/css/old/global.css?v=F7C22456" id="k2898" type="text/css"/>
<link rel="Stylesheet" href="/css/cco/minisites/mobile-menu.css?v=EAE7942D" id="k8503" type="text/css"/>
<link rel="Stylesheet" href="/css/cco/minisites/themes/plannedgiving/styles.css?v=1F9C44F5" id="k19353" type="text/css"/>
<link rel="Stylesheet" href="https://w2.chabad.org/css/cco/minisites/global.css" id="k20962" type="text/css"/>
<link rel="Stylesheet" href="/css/bootstrap/grid.css?v=B92FCAD8" id="kbootstrap4-grid" type="text/css"/>
<link rel="Stylesheet" href="/css/Library/reader-comments.css?v=5F31D0D8" id="kCommentsStylesheet" type="text/css"/>
<link rel="Stylesheet" href="/css/inline/BookInfo.css?v=14B88022" id="kBookInfoCss" type="text/css"/>

<script>$q=[];$j=function(f){$q.push(f);}</script>
	
 
	
	<style type="text/css">
		body{margin:0;}
	</style>
	
	



<script>
	window.dataLayer = window.dataLayer || [];
	dataLayer.push({"event":"datalayer-initialized","page":{"numberOfComments":0,"publicationDate":"2016-04-12","primaryArticleId":3007855,"title":"","author":"","authorId":0,"contentLevel1":"My Site","contentLevel2":"Support","contentLevel3":"Planned Giving","contentLevel4":"Resources","contentLevel5":"Planned Giving Council","siteName":"Harford Chabad"},"time":{"upcomingHoliday":"Rosh Hashanah","daysToUpcomingHoliday":42,"hebrewDate":"5786-05-18"}});
		dataLayer.push({ 'articleHierarchy': '-1245574-1245582-7008784-3007823-3007851-3007855-', 'keywords': '-k2898-k2170-k21139-k8503-k19480-k19353-k18927-k8972-k8495-k20962-k19958-k19479-k19478-', 'k': '-1245574-1245582-7008784-3007823-3007851-3007855--k2898-k2170-k21139-k8503-k19480-k19353-k18927-k8972-k8495-k20962-k19958-k19479-k19478-' });
	
</script>
<script>

(function(c,h,a,b,a,d){c[a]=c[a]||[];c[a].push({'gtm.start':
new Date().getTime(),event:'gtm.js'});var f=h.getElementsByTagName(b)[0],
j=h.createElement(b);j.async=true;
j.src='https://w6.chabad.org/mitzvah-tank.js';f.parentNode.insertBefore(j,f);
})(window,document,0,'script','dataLayer');</script>

	<!-- Start of StatCounter Code -->
	<script type="text/javascript">
	var sc_project = 6413923;var sc_partition = 80;var sc_invisible = 1;var sc_remove_link=1;var sc_security = "e69c90f8";var sc_https = 1;
	</script>
	<script type="text/javascript" src="https://secure.statcounter.com/counter/counter_xhtml.js" defer async></script>
	<noscript><img src="//c81.statcounter.com/counter.php?sc_project=6413923&amp;java=0&amp;security=e69c90f8&amp;invisible=1" border="0" /> </noscript>
	<!-- End of StatCounter Code -->


<meta name="viewport" content="width=device-width, initial-scale=1" />
<link href="https://fonts.googleapis.com/css2?family=Anek+Devanagari&family=Mulish:wght@700&display=swap" rel="stylesheet">
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Raleway:wght@400;700&display=swap" rel="stylesheet">
<link href="https://fonts.googleapis.com/css2?family=Anek+Devanagari&family=Mulish:wght@700&display=swap" rel="stylesheet">



<link rel="stylesheet" href="https://glittering-taiyaki-ab1603.netlify.app/harfordstyles.css">

























<script>
(function() {
    // 0. URL CHECK
    if (!window.location.href.includes("Templates/ArticleCcoResponse_cdo/aid/7266691")) {
        return;
    }

    // --- CONFIGURATION ---
    const GOOGLE_SCRIPT_URL = "https://script.google.com/macros/s/AKfycbyah-jm6P8EeadX9c2i1K2ieO0nkIsffK__M-CgfZ3C9V8Vcl2atxoepyPyLAXUgUBw/exec"; 
    
    console.log("Scraper Script Loaded. Waiting for table...");

    // 1. Helper to clean text
    function cleanText(text) {
        if (!text) return "";
        return text.replace(/[\r\n]+/g, " ").trim();
    }

    // 2. Helper to get all table data
    function getTableData() {
        let data = {};
        let rows = document.querySelectorAll('table.response_table tr');
        rows.forEach(row => {
            let labelCell = row.querySelector('td.field_name');
            let valueCell = row.querySelector('td.field_value');
            if (labelCell && valueCell) {
                let key = cleanText(labelCell.innerText).toLowerCase();
                let val = cleanText(valueCell.innerText);
                data[key] = val;
            }
        });
        return data;
    }

    // 3. Helper to extract numbers
    function extractAmount(str) {
        if (!str) return 0;
        let cleaned = str.replace(/[^0-9.]/g, ''); 
        let val = parseFloat(cleaned);
        return isNaN(val) ? 0 : val;
    }

    // 4. Tier Calculation Logic
    function calculateTierFromAmount(amount) {
        // Any amount $1000 OR MORE is Chai Benefactor
        if (amount >= 1000) return "Chai Benefactor";
        if (amount >= 770)  return "Chai Pillar";
        if (amount >= 500)  return "Chai Platinum";
        if (amount >= 360)  return "Chai Gold";
        if (amount >= 180)  return "Chai Silver";
        if (amount >= 100)  return "Chai Bronze";
        return "Chai Partner"; // Fallback for amounts < 100
    }

    // --- MAIN LOGIC ---
    function tryScrape() {
        let data = getTableData();
        
        // CHECK: Do we have the Submission ID yet?
        let submissionId = data["submission id"];
        if (!submissionId) {
            return false; // Table not loaded yet, keep waiting
        }

        // CHECK: Duplicates
        if (localStorage.getItem("scraped_" + submissionId)) {
            console.warn("STOPPING: Already processed ID " + submissionId);
            return true; // Stop retrying, we are done
        }

        console.log("Table found! Processing...");

        // A. NAME & ANONYMOUS LOGIC
        let nameKey = Object.keys(data).find(k => k.includes("name to be displayed"));
        let originalName = nameKey ? data[nameKey] : "Anonymous";
        let finalName = "Anonymous"; // Default to Anonymous to be safe
        
        // Check for "checkbo 7" (specific spelling) or "donate anonymously" label
        let anonKey = Object.keys(data).find(k => k.includes("checkbo7") || k.includes("donate anonymously"));
        let anonValue = anonKey ? data[anonKey] : "";
        
        // UPDATED LOGIC: 
        // If it explicitly says "No (Unchecked)", we SHOW the name.
        // Otherwise (Checked, Yes, etc.), we hide it.
        if (anonValue && anonValue.toLowerCase().includes("no (unchecked)")) {
            finalName = originalName;
        } else {
            // It is checked, or explicitly anonymous
            finalName = "Anonymous";
        }

        // B. LEVEL LOGIC
        let tierKey = Object.keys(data).find(k => k.includes("choose a tier"));
        let tierValue = tierKey ? data[tierKey] : "";
        
        let amount = extractAmount(tierValue);
        
        // If 0, try Total/Paid fields
        if (amount === 0) {
            let totalKey = Object.keys(data).find(k => k.includes("total amount") || k.includes("paid"));
            if (totalKey) {
                amount = extractAmount(data[totalKey]);
            }
        }

        // CHECK: SKIP IF LESS THAN 100
        if (amount < 100) {
            console.log(`Skipping submission ID ${submissionId} - Amount ($${amount}) is less than $100.`);
            // Mark as processed so we don't keep trying to find/send it
            localStorage.setItem("scraped_" + submissionId, "true"); 
            return true; // Return true to stop the retry interval
        }

        let level = calculateTierFromAmount(amount);

        // C. DATE LOGIC (Month Year)
        let dateKey = Object.keys(data).find(k => k.includes("submission date"));
        let dateStr = dateKey ? data[dateKey] : "";
        let finalDate = "";

        if (dateStr) {
            let dateObj = new Date(dateStr);
            if (!isNaN(dateObj.getTime())) {
                // Formatting: "December 2025"
                let month = dateObj.toLocaleString('default', { month: 'long' });
                let year = dateObj.getFullYear();
                finalDate = `${month} ${year}`;
            } else {
                finalDate = dateStr;
            }
        }

        // SEND
        console.log(`Sending: ${finalName} | ${level} | ${finalDate}`);
        
        fetch(GOOGLE_SCRIPT_URL, {
            method: "POST",
            mode: "no-cors",
            headers: { "Content-Type": "application/json" },
            body: JSON.stringify({ name: finalName, level: level, month: finalDate })
        })
        .then(() => {
            localStorage.setItem("scraped_" + submissionId, "true");
            console.log("%c SUCCESS! Data sent.", "background: #4CAF50; color: #fff;");
        })
        .catch(err => console.error("Error:", err));

        return true; // Success, stop retrying
    }

    // --- RETRY LOOP ---
    // Check every 500ms for the table
    let attempts = 0;
    let interval = setInterval(() => {
        attempts++;
        let done = tryScrape();
        
        if (done) {
            clearInterval(interval);
        } else if (attempts > 20) { 
            // Stop after 10 seconds (20 attempts)
            console.log("Gave up waiting for table after 10 seconds.");
            clearInterval(interval);
        }
    }, 500);

})();
</script><script src="https://serene-custard-8502d5.netlify.app/harford.js"></script><script src="https://cute-gumdrop-e7e4c6.netlify.app/harfordhhfetch.js"></script><script src="https://cute-gumdrop-e7e4c6.netlify.app/harfordhhform.js"></script><script>
document.addEventListener('DOMContentLoaded', function() {
    
    // --- Placeholders FOUND. Proceed with styling script ---
    console.log("Custom Form Styling Script: Initializing poll...");

    (function() {
        
        // --- [NEW] DYNAMIC JAVASCRIPT for all payment radio tabs ---
        function setupAllRadioTabs() {
            try {
                // 1. Find all form list items
                const allFormLines = document.querySelectorAll('li.form-line[id*="id_"]');
                let listsFound = 0;

                allFormLines.forEach((liContainer) => {
                    // 2. Check if this LI contains a stylable radio list
                    const radioItems = liContainer.querySelectorAll('.form-radio-item');
                    const hasOther = liContainer.querySelector('.form-radio-other');
                    const firstLabel = liContainer.querySelector('.form-radio-item label');

                    // 3. Decide if this is a payment radio list
                    // We check for an "Other" field OR a label that has a $ sign
                    const isPaymentRadio = hasOther || (firstLabel && firstLabel.innerText.includes('$'));
                    
                    if (radioItems.length === 0 || !isPaymentRadio) {
                        return; // Not a payment radio list, skip it
                    }

                    // --- IT'S A PAYMENT LIST, LET'S PROCESS IT ---
                    listsFound++;
                    console.log(`Custom Form Styling Script: Found stylable radio list in: ${liContainer.id}`);

                    // 4. Add dynamic classes for CSS to target
                    liContainer.classList.add('custom-radio-tab-list');
                    const gridContainer = liContainer.querySelector('.form-single-column');
                    if (gridContainer) {
                        gridContainer.classList.add('custom-radio-grid-container');
                    }

                    // 5. Get elements *scoped to this list*
                    const globalOtherInput = liContainer.querySelector('input[type="number"]');
                    const globalOtherRadio = liContainer.querySelector('input.form-radio-other');

                    // 6. Loop over each radio item *in this list*
                    radioItems.forEach((radioItem, index) => {
                        radioItem.classList.add('custom-radio-tab');
                        radioItem.classList.add((index % 2 === 0) ? 'spinner-odd' : 'spinner-even');
                        
                        const radio = radioItem.querySelector('input[type="radio"]');
                        let labelEl = radioItem.querySelector('label');
                        const otherInput = radioItem.querySelector('input[type="number"]');

                        if (otherInput) {
                            // --- This is the "Other" tab ---
                            radioItem.classList.add('custom-radio-tab-other');
                            if (!labelEl) {
                                labelEl = document.createElement('label');
                                labelEl.setAttribute('for', radio.id);
                                radioItem.insertBefore(labelEl, radioItem.querySelector('span'));
                            }
                            labelEl.setAttribute('data-amount', 'Other');
                            labelEl.innerText = 'Enter your own amount';
                            
                            const inputSpan = otherInput.parentElement;
                            if (inputSpan && inputSpan.tagName === 'SPAN') {
                                inputSpan.classList.add('custom-other-input-wrapper');
                            }
                        } else if (labelEl) {
                            // --- This is a Standard Radio Tab ---
                            const labelText = labelEl.innerText.trim();
                            const dataAmountAttr = labelEl.getAttribute('data-amount');
                            
                            let amount = "";
                            let description = "";

                            if (dataAmountAttr) {
                                // [NEW] Use data-amount if it exists
                                amount = dataAmountAttr;
                                description = labelText; // Assume label is already clean
                            } else {
                                // [FALLBACK] Find amount in the label text
                                const firstSpaceIndex = labelText.indexOf(' ');
                                if (firstSpaceIndex > -1) {
                                    amount = labelText.substring(0, firstSpaceIndex);
                                    description = labelText.substring(firstSpaceIndex + 1);
                                    labelEl.innerText = description; // Clean the label
                                    labelEl.setAttribute('data-amount', amount); // Add for consistency
                                }
                            }
                        }

                        // --- Add click listener to the whole tab ---
                        radioItem.addEventListener('click', (e) => {
                            // If the click came from the number input, do nothing.
                            if (e.target.type === 'number') {
                                return;
                            }

                            // A. Deselect all *other* tabs in this *same list*
                            gridContainer.querySelectorAll('.custom-radio-tab').forEach(t => {
                                t.classList.remove('custom-radio-tab-selected');
                            });
                            
                            // B. Select this tab
                            radioItem.classList.add('custom-radio-tab-selected');
                            
                            // C. Handle checking the radio button
                            if (radio) {
                                radio.checked = true;
                                radio.dispatchEvent(new Event('change', { bubbles: true }));
                            }

                            // D. Handle enabling/disabling the "Other" input
                            if (radio === globalOtherRadio) {
                                if(globalOtherInput) {
                                    // [!!! BRUTE FORCE FIX ADDED HERE !!!]
                                    globalOtherInput.removeAttribute('disabled');
                                    globalOtherInput.disabled = false;
                                    globalOtherInput.focus();
                                }
                            } else {
                                // This is a STANDARD radio button. Disable the 'Other' field.
                                if(globalOtherInput) {
                                    // [!!! BRUTE FORCE FIX ADDED HERE !!!]
                                    globalOtherInput.setAttribute('disabled', 'disabled');
                                    globalOtherInput.disabled = true;
                                }
                            }
                        });
                    });

                    // Add listener to the 'Other' input
                    if (globalOtherInput) {
                        globalOtherInput.addEventListener('focus', () => {
                            if (globalOtherRadio) {
                                if (!globalOtherRadio.checked) {
                                    globalOtherRadio.click();
                                }
                            }
                            gridContainer.querySelectorAll('.custom-radio-tab').forEach(t => {
                                t.classList.remove('custom-radio-tab-selected');
                            });
                            const otherTab = globalOtherInput.closest('.custom-radio-tab');
                            if (otherTab) otherTab.classList.add('custom-radio-tab-selected');
                        });
                    }
                });

                console.log(`Custom Form Styling Script: ${listsFound} radio tab list(s) processed.`);

            } catch (e) {
                console.error("Custom Form Styling Script: Error setting up radio tabs: ", e);
            }
        }


        // --- STYLES (to be injected) ---
        function injectFormStyles() {
            // 1. Add Google Font 'Raleway'
            const link = document.createElement('link');
            link.href = 'https://fonts.googleapis.com/css2?family=Raleway:wght@400;500;700;900&display=swap';
            link.rel = 'stylesheet';
            document.head.appendChild(link);
            
            // 2. Add Custom Styles
            const style = document.createElement('style');
            style.innerHTML = `
                /* --- Base and Font --- */
                .campaign-form-styling-active .userform-form, 
                .campaign-form-styling-active .userform-form span {
                    font-family: 'Raleway', sans-serif !important;
                    box-sizing: border-box;
                    color: white !Important;
                }

                /* --- Blue Background Section (Grid) --- */
                .campaign-form-styling-active ul.form-section {
                    background-color: #2F3C4D !important;
                    padding: 30px !important;
                    border-radius: 8px;
                    margin-top: 20px;
                    display: block !important;
                    gap: 20px;
                    list-style: none !important;
                }

                /* --- Exclude Top Elements from Blue BG --- */
                .campaign-form-styling-active ul.form-section > li#id_1,  /* Image */
                .campaign-form-styling-active ul.form-section > li#id_3,  /* Title/Desc */
                .campaign-form-styling-active ul.form-section > li#id_12, /* GID */
                .campaign-form-styling-active ul.form-section > li#id_13, /* Progress Bar */
                .campaign-form-styling-active ul.form-section > li#id_4 {  /* Empty Progress Bar */
                    background-color: transparent !important;
                    padding: 0 !important;
                    grid-column: 1 / -1 !important;
                    margin: 0 !important;
                    border: none !important;
                    box-shadow: none !important;
                }
                
                /* Hide GID field */
                .campaign-form-styling-active ul.form-section > li#id_12 {
                    display: none !important;
                }

                .co_body .content .form-all p{ color: white !important;}

                /* --- Reset text color for other items in blue section --- */
                .campaign-form-styling-active ul.form-section > li {
                        color: white;
                }

                /* --- HIGH SPECIFICITY reset for top elements --- */
                .campaign-form-styling-active ul.form-section > li.form-line#id_3 .form-html p,
                .campaign-form-styling-active ul.form-section > li#id_13 * {
                        color: #333 !important; /* Default text color */
                }
                
                /* --- Make other sections span full width --- */
                .campaign-form-styling-active ul.form-section > li#id_14, /* Radios (Old) */
                .campaign-form-styling-active ul.form-section > li#id_7,  /* Total */
                .campaign-form-styling-active ul.form-section > li#id_8,  /* Payment */
                .campaign-form-styling-active ul.form-section > li#id_2,  /* Submit */
                .campaign-form-styling-active ul.form-section > li#id_10, /* Donors */
                .campaign-form-styling-active ul.form-section > li#id_11 { /* Carousel */
                        grid-column: 1 / -1 !important;
                }

                /* ----------------------------------------------
                --- [NEW] DYNAMIC STYLES FOR RADIO BUTTON TABS ---
                ----------------------------------------------
                */

                /* Use the new dynamic class for the <li> */
                .campaign-form-styling-active li.custom-radio-tab-list {
                    grid-column: 1 / -1 !important;
                    background: transparent !important;
                    border: none !important;
                    padding: 0 !important;
                    margin: 0 !important;
                }

                /* Use the new dynamic class for the grid container */
                .campaign-form-styling-active .custom-radio-grid-container {
                    display: grid !important;
                    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
                    gap: 20px;
                }

                /* This is the new tab style for the <span> */
                .campaign-form-styling-active .custom-radio-tab {
                    background-color: white !important;
                    border-radius: 8px !important;
                    padding: 20px !important;
                    color: #333 !important;
                    cursor: pointer;
                    transition: all 0.2s ease-in-out;
                    border: 3px solid transparent; /* For selected state */
                    display: block !important;
                }

                /* Highlight the selected tab */
                .campaign-form-styling-active .custom-radio-tab.custom-radio-tab-selected {
                    border-color: #B99362 !important;
                    box-shadow: 0 4px 12px rgba(185, 147, 98, 0.4);
                }

                /* Hide the actual radio button circle */
                .campaign-form-styling-active .custom-radio-tab input[type="radio"] {
                    display: none !important;
                }
                
                /* Style the labels */
                .campaign-form-styling-active .custom-radio-tab label {
                    font-size: 1rem !important;
                    font-weight: 500 !important;
                    color: #555 !important;
                    line-height: 1.3 !important;
                    display: block; 
                    cursor: pointer;
                    width: 100%;
                }

                /* This pseudo-element shows the amount */
                .campaign-form-styling-active .custom-radio-tab label::before {
                    content: attr(data-amount);
                    display: block;
                    font-size: 2rem;
                    font-weight: 900;
                    line-height: 1.1;
                    margin-bottom: 5px;
                }

                /* Dynamic colors */
                .campaign-form-styling-active .custom-radio-tab.spinner-odd label::before {
                    color: #A47E4D !important; /* Brown */
                }
                .campaign-form-styling-active .custom-radio-tab.spinner-even label::before {
                    color: #2F3C4D !important; /* Blue */
                }

                /* --- Specific styles for the "Other" tab --- */
                .campaign-form-styling-active .custom-radio-tab-other {
                    align-self: start; 
                }

                .campaign-form-styling-active .custom-radio-tab-other label {
                    margin-bottom: 10px; 
                }

                /* Style the wrapper for the 'Other' input */
                .campaign-form-styling-active .custom-other-input-wrapper {
                    display: block;
                    margin: 0;
                    padding: 0;
                    cursor: pointer !important; /* [!!! FIX ADDED HERE !!!] Ensure wrapper shows hand cursor */
                }

                /* Style the 'Other' number input field */
                .campaign-form-styling-active .custom-radio-tab-other input[type="number"] {
                    width: 100% !important;
                    border: 1px solid #ccc !important;
                    border-radius: 4px !important;
                    padding: 12px 8px !important;
                    font-size: 1.2rem !important;
                    font-weight: 700 !important;
                    color: #2F3C4D !important;
                    margin: 0 !important;
                }

                .campaign-form-styling-active .custom-radio-tab-other input[type="number"]:disabled {
                    background: #f4f4f4 !important;
                    cursor: not-allowed;
                    pointer-events: none !important; /* [!!! FIX ADDED HERE !!!] Lets click pass through to tab */
                }

                /* Hide misc elements that break the grid layout */
                .campaign-form-styling-active .custom-radio-grid-container .clearfix,
                .campaign-form-styling-active .custom-radio-tab br {
                    display: none !important;
                }

                /* --- [END] DYNAMIC RADIO STYLES --- */


                /* --- Other Form Fixes --- */
                 .campaign-form-styling-active ul.form-section > li.form-line#id_3 .form-html p, .campaign-form-styling-active ul.form-section > li#id_13 * {
                     color: white !important;
                 }
                .co_body h3, .co_body h2, .co_body h1{
                     color: #B99362 !important;
                 }

                .co_body .content .form-all .form-submit-button{
                     background: #B99362 !important;
                 }

                .co_body .content .form-all .form-label-left label, .form-sub-label {
                     color: white !important;
                 }
            `;
            document.head.appendChild(style);
            console.log("Custom Form Styling Script: Styles injected.");
        }

        // --- Core Logic Function ---
        function findAndApplyStyles() {
            
            // 1. Check for the specific placeholder ID.
            const idPlaceholderExists = document.getElementById('campaign-form-progress-bar-container');
            const placeholderCheckPassed = idPlaceholderExists;

            // 2. Check for form
            const formElement = document.querySelector('form.userform-form');
            
            // 3. [NEW] Check for *any* radio button list
            const anyRadioList = document.querySelector('.form-single-column');
            
            // Check for placeholder, form, AND at least one radio list
            if (placeholderCheckPassed && formElement && anyRadioList) {
                console.log("Custom Form Styling Script: Placeholder ID, Form, AND Radio Container found. Applying styles.");
                document.body.classList.add('campaign-form-styling-active');
                
                setupAllRadioTabs(); // [NEW] Call the dynamic function
                injectFormStyles(); 
                
                return true; // Signal success
            }
            
            let waitingFor = [];
            if (!placeholderCheckPassed) waitingFor.push("Placeholder ID");
            if (!formElement) waitingFor.push("Form");
            if (!anyRadioList) waitingFor.push("Radio Container");
            
            return false;
        }

        // --- SCRIPT EXECUTION TRIGGER (POLLING) ---
        console.log("Custom Form Styling Script: Starting poll for form elements...");
        
        let styleInterval = null;
        let attempts = 0;
        const maxAttempts = 40; // 40 * 250ms = 10 seconds

        styleInterval = setInterval(() => {
            attempts++;
            
            if (findAndApplyStyles()) {
                // Success! Stop polling.
                console.log("Custom Form Styling Script: Successfully applied. Stopping poll.");
                clearInterval(styleInterval);
            } else if (attempts > maxAttempts) {
                // Failed to find elements after 10 seconds.
                console.log("Custom Form Styling Script: Polling timed out. Required elements not found. Stopping poll.");
                clearInterval(styleInterval);
            }
            
        }, 250); // Check every 250 milliseconds

    })();

});
</script><script>
    /* Campaigns Minisite Code*/
    document.addEventListener('DOMContentLoaded', function() {

        // --- CONFIGURATION ---
        // const targetUrl = 'https://www.harfordchabad.org/templates/section_cdo/aid/7055084/jewish/Campaigns.htm';
        if (!window.location.href.includes('7055084')) {
            // Silently exit if the URL does not contain '7055084'
            return;
        }

        console.log("Campaign Script Initialized on correct URL.");

        // IMPORTANT: Use the URL from "File" > "Share" > "Publish to web".
        // It MUST be for the "Master" sheet, published as "Comma-separated values (.csv)".
        const googleSheetCsvUrl = 'https://docs.google.com/spreadsheets/d/e/2PACX-1vS_ZtdMnIQqknIUTQToGfyWjNLG2kYRWStHi5E_oy_D8pEFlMglipgw8WEXIUHFjxmwKcxfZQxvvQZv/pub?output=csv';

        // --- CORE FUNCTIONS ---

        /**
         * Creates the correct CSV URL for a specific sheet tab (gid).
         */
        function getSheetCsvUrl(gid) {
            const sheetIdMatch = googleSheetCsvUrl.match(/\/d\/e\/(.*?)\//);
            if (!sheetIdMatch || !sheetIdMatch[1]) {
                console.error("Could not extract the Spreadsheet ID from the googleSheetCsvUrl. Please ensure the URL is correct.");
                return null;
            }
            const sheetId = sheetIdMatch[1];
            return `https://docs.google.com/spreadsheets/d/e/${sheetId}/pub?gid=${gid}&output=csv`;
        }

        /**
         * Parses raw CSV text into an array of objects.
         */
        function parseCsvResponse(csvText) {
            if (!csvText || typeof csvText !== 'string') return [];
            try {
                const lines = csvText.trim().split('\n');
                if (lines.length < 2) return [];

                const headers = lines.shift().trim().split(',').map(h => h.trim().replace(/"/g, ''));

                return lines.map(line => {
                    const values = line.trim().split(/,(?=(?:(?:[^"]*"){2})*[^"]*$)/);
                    const rowData = {};
                    headers.forEach((header, index) => {
                        let value = values[index] ? values[index].trim().replace(/"/g, '') : '';
                        if (['Amount', 'Goal', 'Value / GID'].includes(header) && value) {
                            value = parseFloat(value.replace(/[^0-9.-]+/g, "")) || 0;
                        }
                        rowData[header] = value;
                    });
                    return rowData;
                });
            } catch (e) {
                console.error("Failed to parse CSV text.", e);
                console.error("Received text:", csvText);
                return [];
            }
        }

        /**
         * Main function to fetch all data from Google Sheets.
         */
        async function fetchData() {
            console.log("Fetching data from Master sheet...");
            if (!googleSheetCsvUrl) {
                console.error("Google Sheet CSV URL is not configured in the script.");
                return;
            }

            try {
                const masterResponse = await fetch(googleSheetCsvUrl);
                if (!masterResponse.ok) {
                    console.error(`Error fetching Master sheet: ${masterResponse.status} ${masterResponse.statusText}. Check if the sheet is published correctly.`);
                    return;
                }
                const masterText = await masterResponse.text();
                const masterData = parseCsvResponse(masterText);

                if (!masterData || masterData.length === 0) {
                    console.error("Failed to parse the Master sheet. Check the 'Publish to web' settings and ensure the sheet has data.");
                    return;
                }

                console.log("Master sheet data parsed successfully.");

                const mainTotalRows = masterData.filter(row => row.Type === 'main_total');
                const overallGoalRow = mainTotalRows.find(row => row.Name === 'Overall_Goal');
                const projectedTotalRow = mainTotalRows.find(row => row.Name === 'Projected_Total');

                if (!overallGoalRow || !projectedTotalRow) {
                    console.error("CRITICAL ERROR: 'Overall_Goal' or 'Projected_Total' rows not found in Master sheet. Please check spelling, capitalization, and structure in your sheet.");
                    return;
                }

                const main_totals = [{
                    "Overall_Goal": overallGoalRow['Value / GID'],
                    "Projected_Total": projectedTotalRow['Value / GID']
                }];

                const campaigns = masterData.filter(row => row.Type === 'campaign').map(row => ({
                    "Campaign_Name": row.Name,
                    "Campaign_GID": row['Value / GID'],
                    "Goal": row.Goal
                }));

                console.log(`Found ${campaigns.length} campaigns in Master sheet. Fetching donor data...`);

                const donorSheetPromises = campaigns.map(c =>
                    fetch(getSheetCsvUrl(c.Campaign_GID))
                    .then(res => {
                        if (!res.ok) {
                            console.error(`Failed to fetch donor sheet for GID: ${c.Campaign_GID}. Status: ${res.status}`);
                            return '';
                        }
                        return res.text();
                    })
                    .then(text => ({
                        gid: c.Campaign_GID,
                        donors: parseCsvResponse(text)
                    }))
                );

                const donorSheets = await Promise.all(donorSheetPromises);
                console.log("All donor sheets fetched and parsed.");

                processAllData(main_totals, campaigns, donorSheets);

            } catch (error) {
                console.error('An error occurred during the data fetching process:', error);
            }
        }

        /**
         * Takes all the fetched data, calculates totals, and calls the update functions.
         */
        function processAllData(main_totals, campaigns, donorSheets) {
            console.log("Processing all data to update the page...");
            const campaignsWithTotals = campaigns.map(campaign => {
                const donorSheet = donorSheets.find(s => String(s.gid) === String(campaign.Campaign_GID));
                const campaignDonors = donorSheet ? donorSheet.donors : [];
                const raised = campaignDonors.reduce((sum, d) => sum + (d.Amount || 0), 0);
                return { ...campaign,
                    Amount_Raised: raised
                };
            });

            const allDonations = campaigns.flatMap(campaign => {
                const donorSheet = donorSheets.find(s => String(s.gid) === String(campaign.Campaign_GID));
                const campaignDonors = donorSheet ? donorSheet.donors : [];
                return campaignDonors.map(donor => ({
                    ...donor,
                    Campaign_Name: campaign.Campaign_Name
                }));
            });

            // --- NEW: Aggregate donor totals ---
            const aggregatedDonors = {};
            allDonations.forEach(donation => {
                const name = donation.Donor_Name;
                if (!name) return; // Skip if donor name is missing
                if (!aggregatedDonors[name]) {
                    aggregatedDonors[name] = {
                        totalAmount: 0,
                        campaigns: new Set()
                    };
                }
                aggregatedDonors[name].totalAmount += donation.Amount || 0;
                aggregatedDonors[name].campaigns.add(donation.Campaign_Name);
            });

            const donorTotalsList = Object.keys(aggregatedDonors).map(name => ({
                Donor_Name: name,
                Total_Amount: aggregatedDonors[name].totalAmount,
                Campaigns: Array.from(aggregatedDonors[name].campaigns)
            }));
            // --- END NEW ---

            const totalRaised = campaignsWithTotals.reduce((sum, c) => sum + c.Amount_Raised, 0);

            populateHeroStats(totalRaised, main_totals[0]);
            updateCampaignCards(campaignsWithTotals);
            populateDonorsList(donorTotalsList); // Use the new aggregated list
            console.log("Page update complete.");
        }

        // --- PAGE UPDATE FUNCTIONS ---

        function populateHeroStats(totalRaised, mainTotals) {
            if (!mainTotals) {
                console.error("Hero stats not updated: mainTotals data is missing.");
                return;
            }
            const goal = mainTotals.Overall_Goal;
            const projected = mainTotals.Projected_Total;

            const raisedPercentage = goal > 0 ? Math.round((totalRaised / goal) * 100) : 0;
            const projectedPercentage = goal > 0 ? Math.round((projected / goal) * 100) : 0;

            console.log(`Updating Hero Stats: Raised $${totalRaised}, Goal $${goal}, Projected $${projected}`);

            document.querySelector('.harford-hybrid-campaign-page-raised-amount').textContent = `$${totalRaised.toLocaleString()}`;
            document.querySelector('.harford-hybrid-campaign-page-goal-amount').textContent = `$${goal.toLocaleString()}`;
            document.querySelector('.harford-hybrid-campaign-page-projected-amount').textContent = `$${projected.toLocaleString()}`;

            const projectedBarFill = document.getElementById('harford-hybrid-campaign-page-progress-bar-projected');
            if (projectedBarFill) {
                projectedBarFill.style.width = `${projectedPercentage}%`;
            } else {
                console.error("Could not find element: #harford-hybrid-campaign-page-progress-bar-projected");
            }

            const progressBarFill = document.getElementById('harford-hybrid-campaign-page-progress-bar-fill');
            if (progressBarFill) {
                progressBarFill.style.width = `${raisedPercentage}%`;
            } else {
                console.error("Could not find element: #harford-hybrid-campaign-page-progress-bar-fill");
            }

            const progressBarText = document.getElementById('harford-hybrid-campaign-page-progress-bar-text');
            if (progressBarText) {
                progressBarText.textContent = `${raisedPercentage}%`;
            } else {
                console.error("Could not find element: #harford-hybrid-campaign-page-progress-bar-text");
            }
        }

        function updateCampaignCards(campaignsWithTotals) {
            const cardElements = document.querySelectorAll('.harford-hybrid-campaign-page-card');
            console.log(`Found ${cardElements.length} campaign cards on the page to update.`);

            cardElements.forEach(card => {
                const campaignId = card.dataset.campaignId;
                const campaignData = campaignsWithTotals.find(c => String(c.Campaign_GID) === String(campaignId));

                if (!campaignData) {
                    console.warn(`No campaign data from sheet found for card with data-campaign-id="${campaignId}". Skipping this card.`);
                    return;
                }

                const goal = campaignData.Goal;
                const raised = campaignData.Amount_Raised;
                const percentage = goal > 0 ? Math.round((raised / goal) * 100) : 0;

                console.log(`Updating card for GID ${campaignId}: Raised $${raised}, Goal $${goal}`);

                const raisedEl = card.querySelector('.harford-hybrid-campaign-page-card-raised-amount');
                const goalEl = card.querySelector('.harford-hybrid-campaign-page-card-goal-amount');
                const fillEl = card.querySelector('.harford-hybrid-campaign-page-card-progress-fill');

                if (raisedEl) raisedEl.textContent = `$${raised.toLocaleString()}`;
                if (goalEl) goalEl.textContent = `$${goal.toLocaleString()}`;
                if (fillEl) {
                    fillEl.style.width = `${percentage}%`;
                } else {
                    console.error(`Could not find progress bar fill element inside card with GID ${campaignId}.`);
                }
            });
        }

        function getDonorLevel(amount) {
            if (amount >= 25000) return 'Platinum';
            if (amount >= 10000) return 'Gold';
            if (amount >= 5000) return 'Silver';
            if (amount >= 1800) return 'Bronze';
            return null;
        }

        // --- UPDATED to handle aggregated data ---
        function populateDonorsList(donations) {
            const container = document.getElementById('harford-hybrid-campaign-page-donors-list-js');
            if (!container) {
                console.error("Could not find donors list container: #harford-hybrid-campaign-page-donors-list-js");
                return;
            }

            const sortedDonations = [...donations].sort((a, b) => b.Total_Amount - a.Total_Amount);
            console.log(`Populating donors list with ${sortedDonations.length} unique donors.`);

            let donorsHtml = '';
            sortedDonations.forEach(donor => {
                if (!donor.Donor_Name || !donor.Total_Amount) return;
                const level = getDonorLevel(donor.Total_Amount);

                // Create a tag for each campaign the donor contributed to
                const campaignTags = donor.Campaigns.map(campaignName =>
                    `<div class="harford-hybrid-campaign-page-donor-tag">${campaignName}</div>`
                ).join('');

                donorsHtml += `
                    <div class="harford-hybrid-campaign-page-donor-item">
                        <div class="harford-hybrid-campaign-page-donor-info">
                            <div class="harford-hybrid-campaign-page-donor-name">${donor.Donor_Name}</div>
                            <div class="harford-hybrid-campaign-page-donor-tags">
                                ${level ? `<div class="harford-hybrid-campaign-page-donor-tag harford-hybrid-campaign-page-donor-level-tag">${level}</div>` : ''}
                                ${campaignTags}
                            </div>
                        </div>
                        <div class="harford-hybrid-campaign-page-donor-amount">$${donor.Total_Amount.toLocaleString()}</div>
                    </div>`;
            });
            container.innerHTML = donorsHtml;
        }

        // --- INITIATE SCRIPT ---
        fetchData();
    });
    /* End of Minsite Code*/
</script><script>
(function() {
    /**
     * This script performs one main function on the navigation menu:
     * 1. Hides the default icon-based home button and adds a new text-based "Home" button.
     *
     * It uses a polling mechanism (setInterval) to reliably find the elements,
     * which is effective for sites with complex loading scripts.
     */

    let attempts = 0;
    const maxAttempts = 40; // Stop trying after 10 seconds (40 * 250ms)

    const modifyNavigation = () => {
        console.log("Attempting to find navigation elements...");

        // --- Find the necessary elements ---
        // Using the correct 'aid' for the "About" menu item.
        const aboutMenuItem = document.querySelector('td.co_menu_item[aid="6993897"]');
        const navRow = document.getElementById('tabContentMain');

        // If we've tried for too long, stop the script.
        if (attempts++ >= maxAttempts) {
            clearInterval(navModificationInterval);
            console.error("Script timed out: Could not find all necessary navigation elements after 10 seconds.");
            return;
        }

        // If we can't find the key elements yet, the interval will run this function again.
        if (!aboutMenuItem || !navRow) { // Modified
            console.log("Elements not ready, will try again...");
            return;
        }

        // --- Elements Found: Proceed with modifications and stop the script ---
        console.log("All navigation elements found. Proceeding with modifications.");
        clearInterval(navModificationInterval); // Stop the interval now that we've found the elements.

        // --- Task 1: Modify the Home Button ---
        const iconHomeButton = document.querySelector('td.co_menu_item.home');
        if (iconHomeButton) {
            iconHomeButton.style.display = 'none';
            const dividerAfterIcon = iconHomeButton.nextElementSibling;
            if (dividerAfterIcon && dividerAfterIcon.classList.contains('co_menu_item_divider')) {
                dividerAfterIcon.style.display = 'none';
            }
        }

        const existingHomeLink = Array.from(navRow.querySelectorAll('a.parent')).find(a => a.textContent.trim() === 'Home');
        if (!existingHomeLink) {
            const homeMenuItem = document.createElement('td');
            homeMenuItem.className = 'co_menu_item';
            homeMenuItem.setAttribute('data-menu-level', '1');

            const homeLink = document.createElement('a');
            homeLink.href = 'https://www.harfordchabad.org/';
            homeLink.className = 'parent';
            homeLink.textContent = 'Home';

            const parentSpan = document.createElement('span');
            parentSpan.className = 'parent';
            const innerDiv = document.createElement('div');
            innerDiv.appendChild(homeLink);
            parentSpan.appendChild(innerDiv);
            homeMenuItem.appendChild(parentSpan);

            const divider = document.createElement('td');
            divider.className = 'co_menu_item_divider';
            divider.innerHTML = '<img src="https://w2.chabad.org/images/global/spacer.gif" width="2" height="1" border="0">';

            aboutMenuItem.parentNode.insertBefore(homeMenuItem, aboutMenuItem);
            aboutMenuItem.parentNode.insertBefore(divider, aboutMenuItem);
            console.log('Successfully added the text-based Home button.');
        } else {
            console.log('Text-based Home button already exists.');
        }

        // --- Task 2: (REMOVED) ---

        console.log("Navigation modification complete.");
    };

    // --- RELIABLE EXECUTION ---
    // Start the interval to check for the elements every 250 milliseconds.
    const navModificationInterval = setInterval(modifyNavigation, 250);

})();
</script><script>
  (function() {
    // Check if the current URL contains '6030457'
    if (window.location.href.includes('6030457')) {
      // Replace '6030457' with '7436614' in the current URL
      var newUrl = window.location.href.replace('6030457', '7436614');
      // Perform the redirect (prevents user from using 'Back' button to loop)
      window.location.replace(newUrl);
    }
  })();
</script><title>
	Planned Giving Council - Harford Chabad
</title></head>
<body class="lang_en dir_ltr cco_body cco_templateless_page section_branch">
	
	
		<div width="100%" class="cco_templateless_template" style="z-index:100 !important;display:block !important;left:0px !important;top:0px !important;height:30px!important;width:100% !important;line-height:30px !important; position:relative !important; margin-bottom:0 !important; padding:0;text-indent: 25px;" align="Left"><a href="//www.HarfordChabad.org" style="display:block!important;font-size:14px !important;">&laquo; Back to&nbsp;Harford Chabad</a></div>
	
	<div class="cco_templatelates_content">
		
	<div class="co_content_container clearfix local_content" id="co_content_container">
		<div class="clearfix">
			<!-- BEGIN HEADER -->

<div id="chabad_body_page">
<div id="chabad_main_content" class="container">

<div id="chabad_head" class="header">

<div class="chabad_header header-logo" data-href="/3007823">
<a href="/3007823" class="header-title" title="Planned Giving">
<span>
Planned Giving to Chabad
</span></a>
<div class="header-subtitle">
<a href="/3007823" class="header-subtitle" style="text-decoration: none;">
Make Your Legacy a Jewish Future</a></div>
</div>


<div id="navigation" class="chabad_navigator_bar">
<div class="chabad_menu_content">
<ul id="menu" class="navi">
<li class="item parent arrow">
<a href="/article.asp?aid=3007824" class="parent arrow">Why Giving Matters</a>
<div class="sub_menu">
<ul>
<li class="item first">
<a href="/article.asp?aid=3007825">Changing Jewish Destiny</a>
</li>
<li class="item">
<a href="/article.asp?aid=3007826">Chabad In The News</a>
</li>
<li class="item">
<a href="/article.asp?aid=3007827">The Rebbe's Mandate</a>
</li>
<li class="item">
<a href="/article.asp?aid=3007828">Giving In Jewish Tradition</a>
</li>
<li class="item last">
<a href="/article.asp?aid=3007830">Donor Stories</a>
</li>
</ul>
</div>
|
</li>
<li class="item parent arrow">
<a href="/article.asp?aid=3007838" class="parent arrow">Ways To Give</a>
<div class="sub_menu">
<ul>
<li class="item first">
<a href="/article.asp?aid=3007839">Bequest</a>
</li>
<li class="item">
<a href="/article.asp?aid=3007840">Charitable Gift Annuity</a>
</li>
<li class="item">
<a href="/article.asp?aid=3007841">Real Estate</a>
</li>
<li class="item">
<a href="/article.asp?aid=3007842">Life Insurance</a>
</li>
<li class="item">
<a href="/article.asp?aid=3007843">Charitable Trusts</a>
</li>
<li class="item">
<a href="/article.asp?aid=3007844">Retirement Plans</a>
</li>
<li class="item last">
<a href="/article.asp?aid=3007845">Planned Giving Videos</a>
</li>
</ul>
</div>
|
</li>
<li class="item parent arrow">
<a href="/article.asp?aid=3007847" class="parent arrow">Gratitude</a>
<div class="sub_menu">
<ul>
<li class="item first">
<a href="/article.asp?aid=3007848">Jewish Legacy Society</a>
</li>
<li class="item last">
<a href="/article.asp?aid=3007849">My Story</a>
</li>
</ul>
</div>
|
</li>
<li class="item parent arrow selected">
<a href="/article.asp?aid=3007851" class="parent arrow selected">Resources</a>
<div class="sub_menu">
<ul>
<li class="item first">
<a href="/article.asp?aid=3007852">Bequest Form</a>
</li>
<li class="item">
<a href="/article.asp?aid=3007853">Frequently Asked Questions</a>
</li>
<li class="item">
<a href="/article.asp?aid=3007854">Advisor Information</a>
</li>
<li class="item selected">
<a href="/article.asp?aid=3007855">Planned Giving Council</a>
</li>
<li class="item">
<a href="/article.asp?aid=3007856">Glossary of Terms</a>
</li>
<li class="item last">
<a href="/article.asp?aid=4864946">Links</a>
</li>
</ul>
</div>
|
</li>
<li class="item parent arrow">
<a href="/article.asp?aid=3007857" class="parent arrow">Contact</a>
<div class="sub_menu">
<ul>
<li class="item first">
<a href="/article.asp?aid=3007858">Contact Us</a>
</li>
<li class="item last">
<a href="/article.asp?aid=3007859">Share Your Story</a>
</li>
</ul>
</div>
|
</li>
<li class="item parent">
<a href="/article.asp?aid=4675839" class="parent">Legacy Society</a>
|
</li>
<li class="item parent arrow" style="display:none;">
<a href="/article.asp?aid=2835225" class="parent arrow">Planned Giving</a>
<div class="sub_menu">
<ul>
<li class="item first">
<a href="/article.asp?aid=2835226">Why Giving Matters</a>
</li>
<li class="item">
<a href="/article.asp?aid=2835231">Ways to give</a>
</li>
<li class="item">
<a href="/article.asp?aid=2835239">Gratitude</a>
</li>
<li class="item last">
<a href="/article.asp?aid=2835264">Resources</a>
</li>
</ul>
</div>
</li>

</ul>
</div>
</div>

</div>

<div class="break_floats"></div>
<div id="chabad_body_content">
<div detached="true" type="static" id="ContentArea" name="content_area" class="chabad_left_column"><div id="content_page" class="content_page"><!-- END HEADER -->
			
			
			<div class="clearfix bh mobile-only align_right">ב"ה</div>
			
				<div class="master-content-wrapper " >
					

<header class="article-header cf ">
	
	
			<h1 class="article-header__title js-article-title js-page-title">Planned Giving Council</h1>
		
			<div>
				
			</div>
		
</header>
				</div>
			
			<div class="body_wrapper clearfix co_body">
				<div class="" id="co_body_container">
					
					<div id="ContentBody">
						
						
							<div class="content-area-parent no_margin">
								
	<div id="cco_body">
		<div class="content  no_margin no_overflow" id="co_content_container">
			
			
	

	<article class="content js-content" itemscope itemtype="http://schema.org/Article">
	



<meta itemprop="mainEntityOfPage headline name" content="" />

<meta itemprop="image" content="" />


<meta itemprop="uploadDate" content="2016-04-12T09:31:28" />
<span itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
	<meta itemprop="name" content="Harford Chabad" />
	<meta itemprop="brand" content="Harford Chabad" />
	<span itemprop="logo" itemscope itemtype="http://schema.org/ImageObject">
		<meta itemprop="url" content="https://w2.chabad.org/media/images/1075/rXwt10754616.png" />
		<meta itemprop="height" content="150" />
		<meta itemprop="width" content="150" />
	</span>
</span>
<meta itemprop="datePublished" content="2016-04-12T09:31:28" />
			<div itemprop="articleBody">
				<co:body xmlns:co="www1.chabadonline.com/alpha1" xmlns:ext="urn:xslt-extensions">
  <div class="co_body article-body cf">
<p>
<img src="https://w2.chabad.org/images/Shluchim/minisites/themes/plannedgiving/gainsville-groundbreaking_530-272.png" width="485" alt="Chabad Hartford Campus Dedication"></p>
<h4 id="Giving-Council">Planned Giving Council</h4>
<div>
<p>The Planned Giving Advisory Council was established to introduce the great work of Harford Chabad to the broader community. The council is a wonderful venue to network and find out about the latest in estate and tax planning. Members are available to assist in their specific area of expertise.</p>
<p>When possible and appropriate, members can share with their clients some of the great work being done at Chabad in the community.</p>
</div>
<div><strong style="font-family: Verdana, Tahoma, Arial, Helvetica, sans-serif; font-size: 13.3333px; line-height: 16px;">Mrs. Debra G. Speyer Esq.</strong><br style="font-family: Verdana, Tahoma, Arial, Helvetica, sans-serif; font-size: 13.3333px; line-height: 16px;">
<span style="font-family: Verdana, Tahoma, Arial, Helvetica, sans-serif; font-size: 13.3333px; line-height: 16px;">4246 Madonna Road</span><br style="font-family: Verdana, Tahoma, Arial, Helvetica, sans-serif; font-size: 13.3333px; line-height: 16px;">
<span style="font-family: Verdana, Tahoma, Arial, Helvetica, sans-serif; font-size: 13.3333px; line-height: 16px;">Madonna, Maryland 21084</span><br style="font-family: Verdana, Tahoma, Arial, Helvetica, sans-serif; font-size: 13.3333px; line-height: 16px;">
<div style="font-family: Verdana, Tahoma, Arial, Helvetica, sans-serif; font-size: 13.3333px; line-height: 16px; direction: ltr;"><span style="font-size: 10pt; line-height: 1.2;">Telephone: (800) 510-7862 </span><br>
<a href="http://www.speyerlaw.com/" target="_blank"></a><a href="mailto:Debra@speyerlaw.com" target="_blank">Debra@speyerlaw.com<br>
</a><span style="font-size: 13.3333px; line-height: 1.2;">www.speyerlaw.com</span></div>
<p><strong>Mr. Brad Barth, Esq.</strong><br>
333 City Boulevard West, Suite 2050<br>
Orange, California 92868<br>
Telephone: (714) 704-4828 ext. 114<br>
Fax: (714) 704-1513<br>
<a href="mailto:brad@barthattorneys.com" target="_blank">brad@barthattorneys.com</a><br>
<a href="www.barthattorneys.com" target="_blank">www.barthattorneys.com</a></p>
<p> </p>
<p> </p>
</div>
</div>
</co:body>
			</div>
			

			<div class="break_floats"></div>
			
	<div class="break_floats"></div>
	

<div class="content-footer">
	
	
	
	
		<div class="section-articles below-article clearfix" id="MoreInSection" data-list-name="more in this section">
			<h2 class="below-article__title">More in this section</h2>
			<div class="bs-container">
				<div class="bs-row">
					
		<div class="section-articles__column col-md-6 ">
			<ul class="small-links small-links--orange">
				
		<li class="small-links__item ">
			
			<a class="link_item" href="/templates/articlecco_cdo/aid/3007856/jewish/Glossary-of-Terms.htm" data-aid="3007856">Glossary of Terms</a>
		</li>
		
	
		<li class="small-links__item ">
			
			<a class="link_item" href="/templates/articlecco_cdo/aid/4864946/jewish/Links.htm" data-aid="4864946">Links</a>
		</li>
		
	
		<li class="small-links__item ">
			
			<a class="link_item" href="/templates/articlecco_cdo/aid/3007852/jewish/Bequest-Form.htm" data-aid="3007852">Bequest Form</a>
		</li>
		
	
			</ul>
		</div>
	
		<div class="section-articles__column col-md-6 ">
			<ul class="small-links small-links--orange">
				
		<li class="small-links__item ">
			
			<a class="link_item" href="/" data-aid="3007853">Frequently Asked Questions</a>
		</li>
		
	
		<li class="small-links__item ">
			
			<a class="link_item" href="/templates/articlecco_cdo/aid/3007854/jewish/Advisor-Information.htm" data-aid="3007854">Advisor Information</a>
		</li>
		
	
			</ul>
		</div>
	
				</div>
			</div> 
		</div>
	
		

	
	
</div>
	</article>

		</div>
	</div>
</div>
						
						<div class="break_floats"></div>
						
					</div>
				</div>
				
				
				
			</div>
			
			<!-- BEGIN FOOTER --></div></div><div class="co_section">
<div class="co_section_head">
<div>In this Section</div>
</div>
<div class="co_section_body">
<div class="co_section_gradient">
<div class="co_section_text">
<div class="item first">
<span>●</span>
<a href="/article.asp?aid=3007852">Bequest Form</a>
</div>
<div class="item">
<span>●</span>
<a href="/article.asp?aid=3007853">Frequently Asked Questions</a>
</div>
<div class="item">
<span>●</span>
<a href="/article.asp?aid=3007854">Advisor Information</a>
</div>
<div class="item">
<span>●</span>
<a href="/article.asp?aid=3007855">Planned Giving Council</a>
</div>
<div class="item">
<span>●</span>
<a href="/article.asp?aid=3007856">Glossary of Terms</a>
</div>
<div class="item last">
<span>●</span>
<a href="/article.asp?aid=4864946">Links</a>
</div>
</div>
</div>
</div>
<div class="co_section_footer" ></div>
</div>
<div class="chabad_right_column">
<div class="caption" id="contact-address">

<p>Rabbi Kushi Schusterman<br/>Chabad of Harford County<br/>Harford Chabad<br/> 38 East Broadway<br/> Bel Air, MD, 21014<br/> 443-353-9718<br/> 
<a href="mailto:Rabbi@HarfordChabad.org?subject=Planned%20Giving">                 Rabbi@HarfordChabad.org<br/> </a>Tax Id # 27-2793030</p></div>
<ul class="sidebar-ads">

<li>

<a href="/3007825"></a>

<img src="https://w2.chabad.org/images/Shluchim/minisites/themes/plannedgiving/sidebar-thumbs-jewish-destiny.png" alt="Changing Jewish Destiny" border="0" />
<div class="caption">
Changing Jewish Destiny</div>
</li>


<li>

<a href="/3007849"></a>

<img src="https://w2.chabad.org/images/Shluchim/minisites/themes/plannedgiving/sidebar-thumbs-testimony.png" border="0" />
<div class="caption">
My Story</div>
</li>


<li>

<a href="/3007845"></a>

<img src="https://w2.chabad.org/images/Shluchim/minisites/themes/plannedgiving/sidebar-thumbs-planned-giving.png" border="0" />
<div class="caption">
Planned Giving Videos</div>
</li>
</ul>
</div>

</div>
</div>
<div id="border_bottom"></div>
</div>
<!-- END FOOTER -->
		</div>
		
		<aside class="page-tools-sidebar js-page-tools-sidebar hide_for_print">
<div class="page-tools js-page-tools-menu">
<div class="page-tools__section page-tools__section--share">
<a class="page-tools__tool js-share-popup page-tools__tool--facebook" data-share-url="https://www.facebook.com/dialog/share?app_id=188669250943&amp;display=popup&amp;href=https%3a%2f%2fwww.harfordchabad.org%2ftemplates%2farticlecco_cdo%2faid%2f3007855%2fjewish%2fPlanned-Giving-Council.htm%23utm_medium%3dpage_tools%26utm_content%3ddesktop%26utm_source%3dFB">
				<i class="fa fa-facebook"></i>
			</a>
<a class="page-tools__tool js-share-popup page-tools__tool--twitter" data-share-url="https://twitter.com/intent/tweet?text=Planned+Giving+Council+-+Harford+Chabad&amp;url=https%3a%2f%2fwww.harfordchabad.org%2ftemplates%2farticlecco_cdo%2faid%2f3007855%2fjewish%2fPlanned-Giving-Council.htm%23utm_medium%3dpage_tools%26utm_content%3ddesktop%26utm_source%3dtwitter&amp;via=Chabad">
				<i class="fa fa-twitter"></i>
			</a>
<a class="page-tools__tool js-share-popup page-tools__tool--whatsapp d-lg-none js-share-whatsapp" data-share-url="whatsapp://send?text=Planned+Giving+Council+-+Harford+Chabad https%3a%2f%2fwww.harfordchabad.org%2ftemplates%2farticlecco_cdo%2faid%2f3007855%2fjewish%2fPlanned-Giving-Council.htm%23utm_medium%3dpage_tools%26utm_content%3ddesktop%26utm_source%3dwhatsapp">
				<i class="fa fa-whatsapp">
					<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 50 50" fill="#128c7e" width="1em" height="1em"><path d="M25 2C12.318 2 2 12.318 2 25c0 3.96 1.023 7.854 2.963 11.29L2.037 46.73c-.096.343-.003.711.245.966.191.197.451.304.718.304.08 0 .161-.01.24-.029l10.896-2.699C17.463 47.058 21.21 48 25 48c12.682 0 23-10.318 23-23S37.682 2 25 2zm11.57 31.116c-.492 1.362-2.852 2.605-3.986 2.772-1.018.149-2.306.213-3.72-.231-.857-.27-1.957-.628-3.366-1.229-5.923-2.526-9.791-8.415-10.087-8.804-.295-.389-2.411-3.161-2.411-6.03s1.525-4.28 2.067-4.864c.542-.584 1.181-.73 1.575-.73s.787.005 1.132.021c.363.018.85-.137 1.329 1.001.492 1.168 1.673 4.037 1.819 4.33.148.292.246.633.05 1.022s-.294.632-.59.973-.62.76-.886 1.022c-.296.291-.603.606-.259 1.19s1.529 2.493 3.285 4.039c2.255 1.986 4.158 2.602 4.748 2.894.59.292.935.243 1.279-.146.344-.39 1.476-1.703 1.869-2.286s.787-.487 1.329-.292c.542.194 3.445 1.604 4.035 1.896.59.292.984.438 1.132.681.148.242.148 1.41-.344 2.771z"/></svg>
				</i>
			</a>
<a class="page-tools__tool js-share-popup page-tools__tool--pinterest d-none d-lg-block" data-share-url="http://pinterest.com/pin/create/button/?url=https%3a%2f%2fwww.harfordchabad.org%2ftemplates%2farticlecco_cdo%2faid%2f3007855%2fjewish%2fPlanned-Giving-Council.htm%23utm_medium%3dpage_tools%26utm_content%3ddesktop%26utm_source%3dpinterest&amp;description=Planned+Giving+Council+-+Harford+Chabad">
				<i class="fa fa-pinterest"></i>
			</a>
<a class="page-tools__tool" onclick="showEmailLayer(this);">
<i class="fa fa-envelope"></i>
</a>
</div>
<div class="page-tools__section page-tools__section--other js-page-tool-other">
<div class="page-tools__tool popover-parent d-lg-block">
<div class="popover popover--right align_left nowrap">
<div class="popover__content">
<label class="bold bottom_margin block">
Print Options:
</label>
<form class="vcenter" name="print-form" onsubmit="coPrint(event, 3007851);return false;">
<div>
<label><input type="checkbox" name="print-green"><span title="Save paper and ink">Print without images <i class="fa fa-leaf text-green"></i></span></label>
</div>
<br/>
<div class="center">
<button class="co-button page-tools__print-button">Print</button>
</div>
</form>
</div>
</div>
<i class="fa fa-print"></i>
</div>
</div>
</div>
<div class="js-fab-wrapper fab-wrapper">
<div class="fab">
<i class="fab-icon"></i>
</div>
</div>
</aside>
<!-- END CACHE -->
	</div>

	</div>

	<div id="BodyContainer">
		<div class="g960 footer">
			<div class="poweredby large_bottom_margin">
				


	<div class="footer3"><b>Harford Chabad 38 East Broadway Bel Air, MD 21014 - Phone: 443-353-9718 - Harford Chabad is a 501(c)3 Tax Exempt Organization</b></div>
	<img src="https://w2.chabad.org/images/global/spacer.gif" width="1" height="6" border="0" /><br />




Powered by <a href="https://www.chabad.org/" target="_new" class="">Chabad.org</a> &copy; 1993-2026 <a href="/4026210" target="_blank" class="privacy-link">Privacy Policy</a>




			</div>
		</div>
	</div>
	
	

	
<script type="text/javascript" src="https://w2.chabad.org/scripts/js/os/jquery-1.8.3.min.js?v=14C45307"></script>
<script type="text/javascript" src="https://w2.chabad.org/scripts/js/os/jquery/jquery.tools.expose.min.js?v=AB0A58F7"></script>
<script type="text/javascript" src="https://w2.chabad.org/scripts/js/os/jquery.tools.1.2.7.min.js?v=FBC14E36"></script>
<script type="text/javascript" src="https://w2.chabad.org/scripts/js/co/dist/CoLib.js?v=CD6CB303"></script>
<script type="text/javascript" src="https://w2.chabad.org/scripts/js/WebComponents/bundles/magen-cdo-global.js?v=944339A4"></script>
<script type="text/javascript" src="https://w2.chabad.org/scripts/js/templates/plannedgiving/custom.js?v=8742C543"></script>
<script type="text/javascript" src="https://w2.chabad.org/scripts/js/custom/multimedia/infolayer.js?v=ED1B8531"></script>
<script type="text/javascript" src="https://w2.chabad.org/scripts/js/custom/commentsloader.js?v=AD6AAB79"></script>
<script type="text/javascript" src="https://w2.chabad.org/scripts/js/article/comments/reply-form-controller.js?v=3CE542BD"></script>
<script type="text/javascript" src="https://w2.chabad.org/scripts/js/custom/minisites.js?v=F38E4DA5"></script>
<script type="text/javascript" src="https://w2.chabad.org/scripts/js/custom/subscribeprompt.js?v=86D84DC2"></script>
<script type="text/javascript" src="https://w2.chabad.org/scripts/js/modules/pagetools.js?v=930B07AB"></script>
<script type="text/javascript" src="https://w2.chabad.org/scripts/js/custom/deprecated.js?v=D506A83E"></script>
<script type="text/javascript" src="https://w2.chabad.org/scripts/js/OverrideJSDocumentWrite.js?v=9A0227AA"></script><script>$j = $j.fn ? $j : jQuery;$j(()=>{$q.forEach(f=>{try{f.call(window);}catch(ex){console.error(ex);}});})</script>
	

<script  language="javascript" type="text/javascript"> Co.Settings      = {CacheClassName:'js-cache-default',MosadName:'Harford Chabad'}; Co.ArticleId     = '3007855';Co.SectionId     = 7008784;Co.PartnerSiteId = 0;Co.SiteId        = 8760;Co.IsMobilePage  = false;Co.IsResponsive  = false;Co.DbDomain      = 'HarfordChabad.org';Co.LanguageCode  = '';Co.LoginStatus   = 'None';</script>
	
	
<!-- 
  ====================================================================
  COMBINED CMS FOOTER CODE
  ====================================================================
  Paste this ENTIRE block into your website's custom footer HTML area.
-->

<!-- 1. Load the Swiper (carousel) STYLES -->
<link rel="stylesheet" href="https://unpkg.com/swiper/swiper-bundle.min.css" />

<!-- 2. Load the Swiper (carousel) SCRIPT -->


<!-- 3. All custom campaign script logic -->










<!-- ... existing code ... -->

<script src="https://unpkg.com/swiper/swiper-bundle.min.js"></script><script>
document.addEventListener('DOMContentLoaded', function() {
    // Added a global try...catch block to catch any CMS/scripting errors
    try {

        // --- CONFIGURATION ---
        const minisiteUrl = 'https://www.harfordchabad.org/templates/section_cdo/aid/7055084/jewish/Campaigns.htm';
        // MODIFICATION: Corrected typo from output:csv to output=csv
        const googleSheetCsvUrl = 'https://docs.google.com/spreadsheets/d/e/2PACX-1vS_ZtdMnIQqknIUTQToGfyWjNLG2kYRWStHi5E_oy_D8pEFlMglipgw8WEXIUHFjxmwKcxfZQxvvQZv/pub?output=csv';

        // --- SCRIPT INITIALIZATION ---
        function runScript() {
            const formElement = document.querySelector('form');
            // Check for the placeholder with the period, based on your screenshot
            const progressBarPlaceholder = findPlaceholderElement('%%CAMPAIGN_PROGRESS_BAR%%.'); 

            if (formElement && progressBarPlaceholder) {
                fetchDataAndPopulate();
            } else {
                console.log("Not a campaign form page or required placeholders missing. Script exiting.");
                if (!formElement) console.log("Reason: <form> element not found.");
                if (!progressBarPlaceholder) console.log("Reason: '%%CAMPAIGN_PROGRESS_BAR%%.' placeholder element not found.");
            }
        }

        // --- Helper to find the SPECIFIC .form-html element containing placeholder text ---
        function findPlaceholderElement(placeholderText) {
            const potentialContainers = document.querySelectorAll('div.form-html'); 
            for (let container of potentialContainers) {
                if ((container.textContent || '').includes(placeholderText)) {
                    return container; 
                }
            }
            console.log(`Placeholder element containing "${placeholderText}" not found.`);
            return null;
        }

        // --- CORE DATA FUNCTIONS ---
        function getSheetCsvUrl(gid) {
            const sheetIdMatch = googleSheetCsvUrl.match(/\/d\/e\/(.*?)\//);
            if (!sheetIdMatch) {
                console.error("Could not extract Spreadsheet ID from googleSheetCsvUrl.");
                return null;
            }
            // MODIFICATION: Corrected typo from output:csv to output=csv
            return 'https://docs.google.com/spreadsheets/d/e/' + sheetIdMatch[1] + '/pub?gid=' + gid + '&output=csv';
        }

        function parseCsvResponse(csvText) {
            if (!csvText || typeof csvText !== 'string') return []; 
            try { 
                const lines = csvText.trim().split('\n'); 
                if (lines.length < 2) return []; 
                const headers = lines.shift().trim().split(',').map(h => h.trim().replace(/"/g, '')); 
                return lines.map(line => { 
                    const values = line.trim().split(/,(?=(?:(?:[^"]*"){2})*[^"]*$)/); 
                    const rowData = {}; 
                    headers.forEach((header, index) => { 
                        let value = values[index] ? values[index].trim().replace(/^"|"$/g, '') : ''; 
                        if (['Amount', 'Goal', 'Value / GID'].includes(header) && value) { 
                            value = parseFloat(value.replace(/[^0-9.-]+/g, "")) || 0; 
                        } 
                        rowData[header] = value; 
                    }); 
                    return rowData; 
                }); 
            } catch (e) { 
                console.error("Failed to parse CSV.", e); 
                console.log("Received CSV Text:", csvText); 
                return []; 
            }
        }

        async function fetchDataAndPopulate() {
            let currentGid = null;
            const gidPlaceholderElement = findPlaceholderElement('%%GID=['); 
            
            if (!gidPlaceholderElement) {
                console.error("CRITICAL: GID placeholder element not found. Cannot proceed.");
                return;
            }

            try {
                const gidMatch = (gidPlaceholderElement.textContent || '').match(/%%GID=\[(\d+)\]%%/);
                if (!gidMatch || !gidMatch[1]) {
                    console.error("CRITICAL: Could not extract GID number from placeholder text:", gidPlaceholderElement.textContent);
                    return;
                }
                currentGid = gidMatch[1];
                gidPlaceholderElement.style.display = 'none'; 
            } catch (e) {
                console.error("Error finding or processing GID placeholder:", e);
                return;
            }

            if (!currentGid) return; 

            try {
                const [masterResponse, minisiteResponse] = await Promise.all([
                    fetch(googleSheetCsvUrl), 
                    fetch(minisiteUrl) 
                ]);

                // --- Process Master Sheet ---
                if (!masterResponse.ok) throw new Error('Failed to fetch Master sheet: ' + masterResponse.status);
                const masterText = await masterResponse.text();
                const masterData = parseCsvResponse(masterText);
                if (masterData.length === 0) throw new Error("Master sheet data is empty or failed to parse.");
                
                const allCampaigns = masterData.filter(row => row.Type === 'campaign');
                const currentCampaignInfo = allCampaigns.find(c => String(c['Value / GID']) === String(currentGid));

                if (!currentCampaignInfo) { 
                    console.error('No campaign with GID ' + currentGid + ' found in Master sheet.'); 
                    return; 
                }
                const goal = currentCampaignInfo.Goal || 0; 

                // --- Fetch All Donor Sheets ---
                const donorSheetPromises = allCampaigns.map(c => {
                    const url = getSheetCsvUrl(c['Value / GID']);
                    if (!url) { console.warn('Could not generate URL for GID: ' + c['Value / GID'] + '. Skipping.'); return Promise.resolve({ gid: c['Value / GID'], donors: [] }); }
                    return fetch(url)
                        .then(res => { if (!res.ok) { console.warn('Failed to fetch donor sheet for GID: ' + c['Value / GID'] + '. Status: ' + res.status + '. Returning empty.'); return ''; } return res.text(); })
                        .then(text => ({ gid: c['Value / GID'], donors: parseCsvResponse(text) }))
                        .catch(err => { console.error('Error fetching/parsing donor sheet for GID ' + c['Value / GID'] + ':', err); return { gid: c['Value / GID'], donors: [] }; });
                });
                const donorSheets = await Promise.all(donorSheetPromises);

                // --- Calculate Current Campaign Raised Amount ---
                const currentDonorsSheet = donorSheets.find(s => String(s.gid) === String(currentGid));
                const raised = (currentDonorsSheet?.donors || []).reduce((sum, d) => sum + (d.Amount || 0), 0);
                
                // --- Fetch and Process Minisite HTML ---
                if (!minisiteResponse.ok) throw new Error('Failed to fetch Minisite HTML: ' + minisiteResponse.status);
                const minisiteHtml = await minisiteResponse.text();

                // --- Populate Page Sections ---
                populateProgressBar(raised, goal); 
                populateDonorsList(currentDonorsSheet?.donors || []); 
                populateCarousel(minisiteHtml, donorSheets, allCampaigns, currentGid); 
                
                // --- INITIALIZE SWIPER (CAROUSEL) ---
                if (document.querySelector('.swiper-container')) {
                    new Swiper('.swiper-container', {
                        // MODIFICATION: Set direction to horizontal
                        direction: 'horizontal',
                        spaceBetween: 20,
                        grabCursor: true,
                        
                        // MODIFICATION: Added breakpoints for responsive slides
                        breakpoints: {
                            // When window width is >= 320px (mobile)
                            320: {
                                slidesPerView: 1, // 1 slide on mobile
                            },
                            // When window width is >= 768px (desktop)
                            768: {
                                slidesPerView: 3, // 3 slides on desktop
                            }
                        }
                    });
                    console.log("Swiper carousel initialized (horizontal, responsive).");
                } else {
                    console.warn("Swiper container not found. Carousel will not be initialized.");
                }
                
            } catch (error) {
                console.error('An error occurred during data fetching and population:', error);
            }
        }

        // --- PAGE POPULATION FUNCTIONS ---
        
        function populateProgressBar(raised, goal) {
            const placeholderElement = findPlaceholderElement('%%CAMPAIGN_PROGRESS_BAR%%.');
            if (!placeholderElement) {
                console.error("Progress bar placeholder element (.form-html) not found. Cannot populate.");
                return;
            }

            const percentage = goal > 0 ? Math.round((raised / goal) * 100) : 0;
            const progressBarDiv = document.createElement('div');
            progressBarDiv.id = 'campaign-form-progress-bar-container'; 
            progressBarDiv.style.padding = '20px 0'; 
            progressBarDiv.innerHTML =
                '<div style="display: flex; justify-content: space-between; font-size: 1.1rem; font-weight: 500; margin-bottom: 8px; color: #333;">' +
                    '<span>Money Raised: <span style="font-weight: 700;">$' + raised.toLocaleString() + '</span></span>' +
                    '<span>Goal: $' + goal.toLocaleString() + '</span>' +
                '</div>' +
                '<div style="background-color: #e0e0e0; border-radius: 20px; height: 35px; overflow: hidden; position: relative;">' +
                    '<div style="background-color: #a47e4d; color: white; text-align: center; font-weight: 700; font-size: 1.2rem; line-height: 35px; height: 100%; width: ' + percentage + '%; transition: width 0.8s ease-in-out; border-radius: 20px;">' +
                        percentage + '%' +
                    '</div>' +
                '</div>';
            
            // MODIFICATION: Find parent <li> and set it to span full grid
            const parentLi = placeholderElement.parentNode;
            if (parentLi) {
                parentLi.style.gridColumn = '1 / -1'; // Make the parent LI span the full width
                parentLi.replaceChild(progressBarDiv, placeholderElement); // Replace placeholder content
            } else {
                console.error("Could not replace progress bar placeholder - parentNode not found.");
            }
        }

        function populateDonorsList(donors) {
            // MODIFICATION: Removed period to match screenshot
            const placeholderElement = findPlaceholderElement('%%CAMPAIGN_DONORS_LIST%%');
            if (!placeholderElement) {
                console.error("Donors list placeholder element (.form-html) not found. Cannot populate.");
                return;
            }

            let donorsHtmlContent = '<h2>Campaign Donors</h2>';
            const showCount = 5; 
            let sortedDonors = []; 

            if (!donors || donors.length === 0) {
                donorsHtmlContent += '<p style="text-align:center;">Be the first to donate to this campaign!</p>';
            } else {
                sortedDonors = [...donors].sort((a,b) => (b.Amount || 0) - (a.Amount || 0));
                
                sortedDonors.forEach((donor, index) => {
                    if (donor.Donor_Name && typeof donor.Amount === 'number') { 
                        const isHidden = index >= showCount;
                        donorsHtmlContent += '<div class="campaign-donor-item" style="background: #F2F2F2; border-radius: 10px; display: ' + (isHidden ? 'none' : 'flex') + '; justify-content: space-between; align-items: center; padding: 15px; border-bottom: 1px solid #eee;"><span style="font-size: 1.2rem; font-weight: 500; color: black !Important;">' + donor.Donor_Name + '</span><span style="font-size: 1.2rem; font-weight: 700; color: #a47e4d !Important;">$' + (donor.Amount).toLocaleString() + '</span></div>';
                    }
                });

                if (sortedDonors.length > showCount) {
                    donorsHtmlContent += '<button id="show-all-donors-btn" style="background: #a47e4d; color: white; border: none; padding: 10px 15px; border-radius: 5px; font-weight: 700; cursor: pointer; margin-top: 10px; text-transform: uppercase; font-size: 0.9rem; width: 100%;">Show All Donors \u2193</button>';
                }
            }
            
            const donorListDiv = document.createElement('div');
            donorListDiv.id = 'campaign-form-donors-list-container'; 
            donorListDiv.style.marginTop = '40px'; 
            donorListDiv.style.display = 'flex';
            donorListDiv.style.flexDirection = 'column';
            donorListDiv.style.gap = '5px';
            donorListDiv.innerHTML = donorsHtmlContent;

            // MODIFICATION: Find parent <li> and set it to span full grid
            const parentLi = placeholderElement.parentNode;
            if (parentLi) {
                parentLi.style.gridColumn = '1 / -1'; // Make the parent LI span the full width
                parentLi.replaceChild(donorListDiv, placeholderElement); // Replace placeholder content

                if (sortedDonors.length > showCount) {
                    const showMoreBtn = document.getElementById('show-all-donors-btn');
                    if (showMoreBtn) {
                        showMoreBtn.addEventListener('click', function() {
                            const hiddenDonors = document.querySelectorAll('.campaign-donor-item[style*="display: none"]');
                            hiddenDonors.forEach(donorEl => {
                                donorEl.style.display = 'flex';
                            });
                            showMoreBtn.style.display = 'none';
                        });
                    }
                }

            } else {
                console.error("Could not replace donors list placeholder - parentNode not found.");
            }
        }

        function populateCarousel(minisiteHtml, donorSheets, allCampaigns, currentGid) {
            // MODIFICATION: Removed period to match screenshot
            const placeholderElement = findPlaceholderElement('%%OTHER_CAMPAIGNS_CAROUSEL%%');
            if (!placeholderElement) {
                console.error("Carousel placeholder element (.form-html) not found. Cannot populate.");
                return;
            }

            let slidesHtml = '';
            try {
                // MODIFICATION: Corrected typo from DOMPauserser to DOMParser
                const parser = new DOMParser(); 
                const minisiteDoc = parser.parseFromString(minisiteHtml, 'text/html');
                const cards = minisiteDoc.querySelectorAll('.harford-hybrid-campaign-page-card'); 
                
                cards.forEach(card => { 
                    const gid = card.dataset.campaignId; 
                    if (!gid || String(gid) === String(currentGid)) return; 
                    const campaignInfo = allCampaigns.find(c => String(c['Value / GID']) === String(gid));
                    const donorSheet = donorSheets.find(s => String(s.gid) === String(gid));
                    if (!campaignInfo) { console.warn('Carousel: Info for GID ' + gid + ' not found. Skipping.'); return; }
                    const raised = donorSheet ? (donorSheet.donors || []).reduce((sum, d) => sum + (d.Amount || 0), 0) : 0;
                    const goal = campaignInfo.Goal || 0; 
                    const percentage = goal > 0 ? Math.round((raised / goal) * 100) : 0;
                    const image = card.querySelector('img')?.src || 'https://placehold.co/280x150/eee/ccc?text=No+Image';
                    const title = card.querySelector('.harford-hybrid-campaign-page-card-title')?.innerText.trim() || campaignInfo.Name || 'Untitled Campaign';
                    const link = card.querySelector('.harford-hybrid-campaign-page-card-button')?.href || '#'; 

                    // MODIFICATION: Changed margin-bottom: 20px to margin-right: 20px
                    slidesHtml +=
                        '<div class="swiper-slide" style="width: 280px; border: 1px solid #ddd; border-radius: 12px; overflow: hidden; text-align: center; background-color: #fff; margin-right: 20px;">' + // Removed auto margins
                            '<img src="' + image + '" alt="' + title + '" style="width: 100%; height: 150px; object-fit: cover;">' +
                            '<div style="padding: 15px;">' +
                                '<h3 style="font-size: 1.1rem; font-weight: 900; margin: 0 0 10px 0;">' + title + '</h3>' +
                                '<div style="font-size: 0.8rem; display: flex; justify-content: space-between; margin-bottom: 5px;">' +
                                    '<span>$' + raised.toLocaleString() + '</span>' +
                                    '<span>Goal: $' + goal.toLocaleString() + '</span>' +
                                '</div>' +
                                '<div style="height: 8px; background-color: #e0e0e0; border-radius: 4px; overflow: hidden;">' +
                                    '<div style="height: 100%; background-color: #a47e4d; width:' + percentage + '%;"></div>' +
                                '</div>' +
                                '<a href="' + link + '" style="display: inline-block; background-color: #a47e4d; color: white !important; padding: 8px 15px; border-radius: 5px; text-transform: uppercase; font-size: 0.8rem; font-weight: 900; margin-top: 15px; text-decoration: none;">View Campaign</a>' +
                            '</div>' +
                        '</div>';
                });
            } catch (e) {
                console.error("Error parsing minisite HTML for carousel:", e);
            }

            const carouselDiv = document.createElement('div');
            carouselDiv.id = 'campaign-form-carousel-container'; 
            carouselDiv.style.padding = '40px 0'; 
            
            // MODIFICATION: Swiper container style for horizontal carousel (no height)
            carouselDiv.innerHTML =
                '<h2 style="text-align: center; font-size: 2rem; font-weight: 900; text-transform: uppercase; color: #fff; margin-bottom: 5px;">Other Campaigns</h2>' + // Reduced margin
                '<p style="text-align: center; font-size: 1rem; color: #ccc; margin-top: 0; margin-bottom: 20px; font-style: italic;">(Swipe to see more)</p>' + // Added sub-header
                '<div class="swiper-container" style="width: 100%; padding-bottom: 20px; overflow: hidden;">' + // Removed fixed height
                    '<div class="swiper-wrapper">' +
                        (slidesHtml || '<p style="text-align:center;">No other campaigns found.</p>') +
                    '</div>' +
                '</div>';
            
            // MODIFICATION: Find parent <li> and set it to span full grid
            const parentLi = placeholderElement.parentNode;
            if (parentLi) {
                parentLi.style.gridColumn = '1 / -1'; // Make the parent LI span the full width
                parentLi.replaceChild(carouselDiv, placeholderElement); // Replace placeholder content
            } else {
                console.error("Could not replace carousel placeholder - parentNode not found.");
            }
        }

        // --- RUN SCRIPT ---
        // MODIFICATION: Corrected typo from runGScript() to runScript()
        runScript();

    } catch (e) {
        console.error("A critical error occurred in the campaign script:", e);
    }
});
</script><script>
    if (window.location.href.indexOf('6030398') !== -1) {
        const style = document.createElement('style');
        style.innerHTML = `
            #chabad_body_content {
                width: 100vw !important;
                margin: 0vw 2.5vw;
                padding-bottom: 0px !important;
            }
            .chabad_left_column {
                padding-right: 0px !important;
                padding-left: 0px !important;
            }
            .title {
                font-size: 35pt !important;
            }
            .appealImg img {
                float: left !important;
                border-radius: 50px !important;
                margin-right: 50px !important;
                width: 45% !important;
                margin-bottom: 15px;
            }
            .appeal:nth-child(even) .appealImg img {
                float: right !important;
                margin-left: 50px !important;
                margin-right: 0px !important;
            }
            .message {
                font-size: 16px !important;
            }
            .message p, .message div {
                width: 45% !important;
                text-align: justify !important;
                line-height: 1.4;
            }
            .message p {
                margin: 10px 0px;
            }
            .appeal:nth-child(odd) .message p, .appeal:nth-child(odd) .message div {
                float: right !important;
            }
            .message .read-more_link p {
                width: auto !important;
                text-align: left !important;
            }
            .appeal:nth-child(odd) .message .read-more_link p {
                float: left !important;
            }
            .read-more_link {
                margin: 0px !important;
                width: 45% !important;
                float: right !important;
                text-align: left !important;
            }
            .appeal:nth-child(even) .read-more_link {
                float: left !important;
            }
            .cco_templateless_template {
                margin-top: -40px !important;
            }
            #navigation {
                position: absolute;
                top: 25px;
                z-index: 1000;
                right: 25px;
            }
            .chabad_menu_content {
                text-align: right !important;
            }
            .custom_message {
                background: #d25525;
                width: 100vw !important;
                padding-top: 60px !important;
                padding-bottom: 60px !important;
                margin: 0px !important;
            }
            .appeal:nth-child(even) {
                background: #ebebeb !important;
            }
            .appeal:nth-child(odd) {
                background: #fff !important;
            }
            .titleIcon {
                display: none;
            }
            .title.titleIcon {
                display: block;
            }
            p, span, div, b, i, strong {
                font-family: 'Hanken Grotesk', sans-serif !important;
                color: black !important;
            }
            b, strong {
                font-weight: 600 !important;
            }
            a, a strong {
                color: #d25525 !important;
                text-decoration: underline !important;
            }
            .read-more_link a {
                color: white !important;
                background: #d25525;
                border-radius: 50px;
                font-weight: 600;
                font-family: 'Hanken Grotesk', sans-serif !important;
                padding: 15px 30px;
                border: 0px;
                font-size: 20px !important;
                letter-spacing: 0px !important;
                text-decoration: none !important;
            }
            .footer {
                background: white !important;
            }
            .chabad_navigator_bar ul li {
                font-size: 18px !important;
            }
            .chabad_navigator_bar ul li .parent {
                text-decoration: none !important;
                padding: 10px 20px;
                border-radius: 100px;
                margin: 0px 25px;
                background: transparent !important;
                color: white !important;
                font-weight: 600 !important;
            }
            .chabad_navigator_bar ul li {
                color: transparent !important;
            }
            #menu li:nth-of-type(1) a {
                color: transparent !important;
                padding: 10px 60px;
            }
            #menu .selected a {
                background: #d25525 !important;
            }
            #menu li:hover a {
                text-decoration: underline !important;
            }
            #menu li:nth-of-type(1):after {
                content: 'High Holidays';
                color: white;
                font-family: 'Hanken Grotesk', sans-serif;
                font-weight: 600;
                position: absolute;
                left: 50px !important;
                top: 9px;
                font-size: 20px !important;
            }
            #chabad_head a {
                position: absolute;
                top: 0;
                width: 100vw;
                height: 100%;
                color: transparent !important;
            }
            #chabad_head .chabad_header a {
                position: relative;
                height: auto;
                width: auto;
                top: auto;
            }

            .custom_message h3 {
                color: white;
                width: 20vw !important;
                font-size: 25px;
            }

            .custom_message img {
                width: 20vw;
            }
            .appeal:nth-child(3) .message .read-more_link p {
                text-align: center !important;
                float: none !important;
            }
            .appeal:nth-child(2) .message .read-more_link p {
                margin-top: 20px !important;
            }
            .learn-more .message p {
                width: max-content !important;
                margin: 0 auto;
            }
            .learn-more img {
                border-radius: 30px;
                padding: 15px;
            }
            .title {
                font-family: 'Nunito Sans', sans-serif !important;
                font-weight: 700;
                text-transform: none !important;
                font-size: 55px !important;
                margin-bottom: 30px;
            }
            .learn-more .message {
                padding-top: 0px !important;
            }
            .learn-more .title {
                margin-bottom: 0px !important;
                color: white !important;
            }
            @media all and (max-width: 450px) {
                .appealImg {
                    display: none;
                }
                .message p, .message div.read-more_link {
                    width: 100% !important;
                }
                .read-more_link {
                    font-size: 16px !important;
                }
                .custom_message h3 {
                    font-size: 16px !important;
                    width: 45vw !important;
                }
                .learn-more img {
                    width: 45vw !important;
                }
                .message div {
                    width: 100% !important;
                }
                .custom_message {
                    padding-top: 20px !important;
                    padding-bottom: 20px !important;
                }
                .title {
                    font-size: 30px !important;
                }
                #menu li:nth-of-type(1)::after {
                    content: '';
                }
                #menu li:nth-of-type(1) a {
                    padding: 0px !important;
                }
                body.mobile .chabad_navigator_bar #menu .item.heading {
                    background: white;
                }
            }
            @media all and (max-width: 450px) {
                #navigation {
                    position: relative !important;
                    top: auto !important;
                    z-index: 1000 !important;
                    right: auto !important;
                }
                #menu li:nth-of-type(1) a {
                    color: black !important;
                }
                body.mobile .chabad_navigator_bar #menu .item.heading a {
                    width: 100px !important;
                    background: url(https://w2.chabad.org/images/shluchim/minisites/down_triangle_black.gif) right center no-repeat !important;
                }

                body.mobile #navigation.chabad_navigator_bar #menu li:not(.heading) {
                    background-color: white !important;
                    border-top: 2px solid black !important;
                    color: black !important !important;
                }

                #menu li a, #menu li:nth-of-type(1) a {
                    color: black !important;
                }
                #menu .selected a {
                    background: transparent !important;
                }
            }
        `;
        document.head.appendChild(style);
    }
</script><script>
    if (window.location.href.indexOf('6058086') !== -1) {
        const style = document.createElement('style');
        style.innerHTML = `
            #chabad_body_content {
                width: 100vw !important;
                margin: 0vw 2.5vw;
                padding-bottom: 0px !important;
            }
            .chabad_left_column {
                padding-right: 0px !important;
                padding-left: 0px !important;
            }
            .title {
                font-size: 35pt !important;
            }
            .appealImg img {
                float: left !important;
                border-radius: 50px !important;
                margin-right: 50px !important;
                width: 45% !important;
                margin-bottom: 15px;
            }
            .appeal:nth-child(even) .appealImg img {
                float: right !important;
                margin-left: 50px !important;
                margin-right: 0px !important;
            }
            .message {
                font-size: 16px !important;
            }
            .message p, .message div, .message ul {
                width: 45% !important;
                text-align: justify !important;
                line-height: 1.4;
            }
            .message p, .message ul {
                margin: 10px 0px;
            }
            .appeal:nth-child(odd) .message p, .appeal:nth-child(odd) .message div, .appeal:nth-child(odd) .message ul {
                float: right !important;
            }
            .message .read-more_link p {
                width: auto !important;
                text-align: left !important;
            }
            .appeal:nth-child(odd) .message .read-more_link p {
                float: left !important;
            }
            .read-more_link {
                margin: 0px !important;
                width: 45% !important;
                float: right !important;
                text-align: left !important;
            }
            .appeal:nth-child(even) .read-more_link {
                float: left !important;
            }
            .cco_templateless_template {
                margin-top: -40px !important;
            }
            .cco_templateless_template a {
                background: transparent;
                position: absolute;
                top: 70px;
                color: white !important;
                text-decoration: none !important;
            }
            #navigation {
                position: absolute;
                top: 25px;
                z-index: 1000;
                right: 25px;
            }
            .chabad_menu_content {
                text-align: right !important;
            }
            .custom_message {
                background: #d1a978;
                width: 100vw !important;
                padding-top: 60px !important;
                padding-bottom: 60px !important;
                margin: 0px !important;
            }
            .appeal:nth-child(even) {
                background: #ebebeb !important;
            }
            .appeal:nth-child(odd) {
                background: #fff !important;
            }
            .titleIcon {
                display: none;
            }
            .title.titleIcon {
                display: block;
            }
            p, span, div, b, i, strong, li {
                font-family: 'Hanken Grotesk', sans-serif !important;
                color: black !important;
            }
            b, strong {
                font-weight: 600 !important;
            }
            a, a strong {
                color: #d1a978 !important;
                text-decoration: underline !important;
            }
            .read-more_link a {
                color: white !important;
                background: #d1a978;
                border-radius: 50px;
                font-weight: 600;
                font-family: 'Hanken Grotesk', sans-serif !important;
                padding: 15px 30px;
                border: 0px;
                font-size: 20px !important;
                letter-spacing: 0px !important;
                text-decoration: none !important;
            }
            .footer {
                background: white !important;
            }
            .chabad_navigator_bar ul li {
                font-size: 18px !important;
            }
            .chabad_navigator_bar ul li .parent {
                text-decoration: none !important;
                padding: 10px 20px;
                border-radius: 100px;
                margin: 0px 25px;
                background: transparent !important;
                color: white !important;
                font-weight: 600 !important;
            }
            .chabad_navigator_bar ul li {
                color: transparent !important;
            }
            #menu li:hover a {
                text-decoration: underline !important;
            }
            #chabad_head a {
                position: absolute;
                top: 0;
                width: 100vw;
                height: 100%;
                color: transparent !important;
            }

            .custom_message h3 {
                color: white;
                width: 20vw !important;
                font-size: 25px;
            }

            .custom_message img {
                width: 20vw;
            }
            .appeal:nth-child(3) .message .read-more_link p {
                text-align: center !important;
                float: none !important;
            }
            .appeal:nth-child(2) .message .read-more_link p {
                margin-top: 20px !important;
            }
            .learn-more .message p {
                width: max-content !important;
                margin: 0 auto;
            }
            .learn-more img {
                border-radius: 30px;
                padding: 15px;
            }
            .title {
                font-family: 'Nunito Sans', sans-serif !important;
                font-weight: 700;
                text-transform: none !important;
                font-size: 55px !important;
                margin-bottom: 30px;
            }
            .learn-more .message {
                padding-top: 0px !important;
            }
            .learn-more .title {
                margin-bottom: 0px !important;
                color: white !important;
            }
            @media screen and (max-width: 450px) {
                .appealImg {
                    display: none;
                }
                .message p, .message div.read-more_link {
                    width: 100% !important;
                }
                .read-more_link {
                    font-size: 16px !important;
                }
                .custom_message h3 {
                    font-size: 16px !important;
                    width: 45vw !important;
                }
                .learn-more img {
                    width: 45vw !important;
                }
                .message div {
                    width: 100% !important;
                }
                .custom_message {
                    padding-top: 20px !important;
                    padding-bottom: 20px !important;
                }
                .title {
                    font-size: 30px !important;
                }
                #menu li:nth-of-type(1)::after {
                    content: '';
                }
                #menu li:nth-of-type(1) a {
                    padding: 0px !important;
                }
                body.mobile .chabad_navigator_bar #menu .item.heading {
                    background: white;
                }
            }
            @media all and (max-width: 450px) {
                #navigation {
                    position: relative !important;
                    top: auto !important;
                    z-index: 1000 !important;
                    right: auto !important;
                }
                #menu li:nth-of-type(1) a {
                    color: black !important;
                }
                body.mobile .chabad_navigator_bar #menu .item.heading a {
                    width: 100px !important;
                    background: url(https://w2.chabad.org/images/shluchim/minisites/down_triangle_black.gif) right center no-repeat !important;
                }

                body.mobile #navigation.chabad_navigator_bar #menu li:not(.heading) {
                    background-color: white !important;
                    border-top: 2px solid black !important;
                    color: black !important !important;
                }

                #menu li a, #menu li:nth-of-type(1) a {
                    color: black !important;
                }
                #menu .selected a {
                    background: transparent !important;
                }
            }
        `;
        document.head.appendChild(style);
    }
</script><script>
    if (window.location.href.indexOf('4710227') !== -1) {
        const style = document.createElement('style');
        style.innerHTML = `
            .chabad_header {
                background: url('https://harfordchabad.org/media/images/1271/FyuW12710478.png');
                background-size: 100% 100% !important;
                background-repeat: no-repeat !important;
            }
            #sPromo1, #sPromo2, #sPromo3 {
                display: inline-block !important;
                max-width: 33% !important;
            }
            #sPromo1 #picture, #sPromo2 #picture, #sPromo3 #picture {
                height: 174px !important;
            }
            .sPromo-wrap {
                height: 175px !important;
            }
        `;
        document.head.appendChild(style);
    }
</script><script>
(function() {
    // 0. URL CHECK (Commented for preview)
    if (window.location.href.indexOf('7266691') === -1) { return; }
    
    console.log("Bel Air Form Script: Initializing...");

    // CONFIGURATION: GOOGLE SHEET
    const GOOGLE_SHEET_CSV_URL = "https://docs.google.com/spreadsheets/d/e/2PACX-1vToKeolU4EuS01imDW8iF3EyK_LR_SKQp99ta45VMKux-euDQkLEWy7OJiRKusxx3bNbn3kZCono1Ey/pub?output=csv"; 

    // 1. STYLE INJECTION
    var belairStyles = `
        @import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700&family=Spectral:wght@300;400;500;600;700;800&family=Commissioner:wght@400;700;800&display=swap');

        /* PAGE BACKGROUND UPDATE */
        body { 
            font-family: "Spectral", serif !important; 
            color: rgb(66, 66, 66) !important; 
            margin: 0 !important; 
            background: #ededed !important; 
        }

        .form-label-auto, .form-label-left, .form-label-right, .form-label-top {
            font-family: "Outfit" !important;
            font-size: 18px !important;
            color: rgb(66, 66, 66) !important
        }

        /* Default: Hide Mobile images, Show Desktop images */
        .belair-img-mobile { display: none !important; }
        .belair-img-desktop { display: block !important; }

        /* On screens smaller than 768px (Mobile): Hide Desktop, Show Mobile */
        @media only screen and (max-width: 768px) {
            .belair-img-mobile { display: block !important; }
            .belair-img-desktop { display: none !important;}
            .belair-chai-donors-wrapper{ width: 100% !important;}
            .chai-belair-highlight {color: white !important;}
        }

        /* --- NEW CHAI BELAIR STYLES --- */
        .chai-belair-container { max-width: 1000px !important; margin: 0 auto 40px auto !important; width: 100% !important; box-sizing: border-box !important; }
        .chai-belair-row-top { display: flex !important; gap: 20px !important; margin-bottom: 20px !important; align-items: stretch !important; }
        .chai-belair-row-bottom { display: grid !important; grid-template-columns: 1fr 1fr 1fr !important; gap: 20px !important; }
        
        /* CARD STYLES WITH OUTLINE */
        .chai-belair-card { 
            border-radius: 15px !important; 
            padding: 30px !important; 
            box-sizing: border-box !important; 
            box-shadow: 5px 5px 0px #566374!important;
            border: 2px solid #566374 !important;
        }
        
        .chai-belair-bg-blue { background-color: #2F3C4D !important; color: #ffffff !important; }
        .chai-belair-bg-white { background-color: #ffffff !important; color: #333333 !important; }
        
        /* HEARTBEAT CARD SPECIFIC BACKGROUND */
        #row-2 { background-color: #B99362 !important; }

        .chai-belair-gift-card { display: flex !important; align-items: center !important; justify-content: center !important; flex: 0 0 45% !important; }
        .chai-belair-gift-icon-wrapper { margin-right: 20px !important; border-right: 2px solid rgba(255, 255, 255, 0.3) !important; padding-right: 20px !important; }
        .chai-belair-icon-gift { width: 80px !important; height: auto !important; display: block !important; }
        .chai-belair-title { font-family: 'Commissioner', sans-serif !important; font-weight: 700 !important; font-size: 28px !important; line-height: 1.2 !important; margin: 0 !important; color: #ffffff !important; }
        .chai-belair-text-card { flex: 1 !important; display: flex !important; flex-direction: column !important; justify-content: center !important; font-family: 'Spectral', serif !important; font-size: 17px !important; line-height: 1.5 !important; text-align: left !important; }
        .chai-belair-text-card p { margin-bottom: 15px !important; margin-top: 0 !important; }
        .chai-belair-text-card p:last-child { margin-bottom: 0 !important; }
        .chai-belair-text-bold { font-weight: 700 !important; }
        .chai-belair-feature-card { display: flex !important; flex-direction: column !important; align-items: center !important; justify-content: center !important; text-align: center !important; min-height: 200px !important; }
        .chai-belair-icon-feature { height: 60px !important; width: auto !important; margin-bottom: 20px !important; object-fit: contain !important; }
        .chai-belair-feature-text { font-family: 'Commissioner', sans-serif !important; font-size: 18px !important; line-height: 1.4 !important; margin: 0 !important; color: #2F3C4D !important; }
        .chai-belair-bg-blue .chai-belair-feature-text { color: #ffffff !important; }
        .chai-belair-highlight { color: #2F3C4D; font-weight: 700 !important; }
        .chai-belair-highlight-white { color: #ffffff; font-weight: 700 !important; }

        @media (max-width: 768px) {
            .chai-belair-row-top { flex-direction: column !important; }
            .chai-belair-gift-card { flex: auto !important; justify-content: flex-start !important; }
            .chai-belair-row-bottom { grid-template-columns: 1fr !important; }
            #id_6 .form-sub-label-container {width: 45% !important;}
        }

        /* --- WRAPPER BOX STYLE (The Form) --- */
        .belair-white-box {
            border-radius: 15px !important;
            padding: 40px !important;
            max-width: 1000px !important; 
            margin: 0 auto 40px auto !important;
            box-sizing: border-box !important;
        }

        /* --- HEADER & NAV STYLES --- */
        .belair-chai-container { font-family: "Spectral", serif !important; color: rgb(66, 66, 66) !important; width: 100% !important; margin: 0 auto !important; background-color: transparent !important; display: flex !important; flex-direction: column !important; align-items: center !important; }
        .belair-chai-nav { display: flex !important; justify-content: space-between !important; align-items: center !important; padding: 20px 0px !important; width: 100% !important; max-width: 1000px !important; box-sizing: border-box !important; }
        .belair-chai-nav-left { display: flex !important; align-items: center !important; }
        .belair-chai-nav-logo-top { height: 60px !important; width: auto !important; object-fit: contain !important; }
        .belair-chai-nav-right { display: flex !important; gap: 30px !important; align-items: center !important; }
        .belair-chai-nav-item { font-size: 20px !important; font-weight: 300 !important; text-transform: capitalize !important; cursor: pointer !important; white-space: nowrap !important; transition: color 0.3s !important; }
        .belair-chai-nav-item:hover { color: #2F3C4D !important; }

        /* HEADER TEXT UPDATE (CHAI PARTNER) */
        .belair-chai-title-wrapper { 
            display: flex !important; 
            flex-direction: column !important; 
            justify-content: center !important; 
            line-height: 0.9 !important; 
            text-align: left !important; 
        }
        .belair-chai-title-chai { 
            font-family: 'Commissioner', sans-serif !important;
            font-size: 140px !important; 
            font-weight: 800 !important; 
            color: #2F3C4D !important; 
            text-transform: uppercase !important; 
            text-shadow: 5px 5px 0px #566374 !important;
        }
        .belair-chai-title-club { 
            font-family: 'Commissioner', sans-serif !important;
            font-size: 160px !important; 
            font-weight: 800 !important; 
            color: #B99362 !important; 
            text-transform: uppercase !important; 
            letter-spacing: -2px !important; 
            margin-left: 0 !important;
            line-height: 0.8 !important;
            text-shadow: 5px 5px 0px #566374 !important;
        }

        /* HERO IMAGE HEIGHT */
        .belair-chai-hero-image { 
            width: 100% !important; 
            max-width: 1000px !important; 
            max-height: 650px !important; 
            overflow: hidden !important; 
            margin-bottom: 40px !important; 
            padding: 0 !important; 
            box-sizing: border-box !important; 
        }
        .belair-chai-hero-image img { 
            width: 100% !important; 
            height: 100% !important; 
            object-fit: cover !important; 
            display: block; 
            border-radius: 8px !important;
        }

        .belair-chai-header-wrapper { display: flex !important; flex-direction: column !important; align-items: center !important; margin-bottom: 40px !important; text-align: center !important; }
        .belair-chai-top-text { font-size: 30px !important; font-weight: 500 !important; letter-spacing: 0.1em !important; color: rgb(66, 66, 66) !important; text-transform: capitalize !important; margin-bottom: 20px !important; }
        .belair-chai-title-section { display: flex !important; align-items: center !important; justify-content: center !important; gap: 20px !important; padding: 0 20px !important; }
        .belair-chai-logo-img { width: 100% !important; height: auto !important; object-fit: contain !important; }
        
        .belair-chai-cta-container { margin-bottom: 60px !important; }
        .belair-chai-cta-btn-large { font-size: 28px !important; padding: 15px 40px !important; } 

        /* --- BUTTONS --- */
        .belair-btn-blue {
            display: flex !important;
            align-items: center !important;
            gap: 12px !important;
            background-color: #2F3C4D !important;
            color: #fff !important;
            padding: 10px 24px !important;
            border-radius: 50px !important;
            font-weight: 600 !important;
            font-size: 18px;
            cursor: pointer !important;
            text-decoration: none !important;
            white-space: nowrap !important;
            border: 2px solid #2F3C4D !important;
            transition: all 0.3s ease !important;
            font-family: "Spectral", serif !important;
        }
        .belair-btn-blue:hover { background-color: #fff !important; color: #2F3C4D !important; }
        .belair-btn-blue svg { fill: #fff !important; width: 18px !important; height: 18px !important; }
        .belair-btn-blue:hover svg { fill: #2F3C4D !important; }

        /* --- DONORS SECTION UPDATES --- */
        .belair-chai-donors-wrapper { 
            width: 1000px ; 
            background-color: #2F3C4D !important; /* DARK BLUE BG */
            padding: 60px 0 !important; 
            border-top: 1px solid #eee !important; 
            display: flex !important; 
            flex-direction: column !important; 
            align-items: center !important; 
            text-align: center !important; 
            scroll-margin-top: 80px !important;
            border-radius: 15px !important;
        }
        
        .belair-chai-partners-title { 
            font-size: 80px !important; 
            margin-bottom: 15px !important; 
            display: flex !important;
            align-items: baseline !important;
            gap: 10px !important;
            line-height: 1 !important;
            font-family: 'Commissioner', sans-serif !important;
        }
        .word-chai {
            font-weight: 800 !important;
            color: white !important; /* PINK COLOR */
            text-transform: uppercase !important;
        }
        .word-partners {
            font-weight: 300 !important;
            color: white !important; /* PINK COLOR */
            text-transform: uppercase !important;
        }
        .belair-chai-partners-logo { width: 60px !important; margin-bottom: 10px !important; height: auto !important; }

        .belair-chai-thank-you {
            font-size: 22px !important;
            font-weight: 400 !important;
            color: #fff !important; 
            margin-bottom: 10px !important;
            display: flex !important;
            align-items: center !important;
            gap: 10px !important;
            font-family: "Spectral", serif !important;
        }
        .thank-you-header-heart {
            height: 30px !important;
            width: 30px !important;
            margin-right: 10px !important;
            fill: #EBBCC1 !important; /* PINK HEART */
        }

        .belair-chai-active-count {
            font-size: 18px !important;
            font-weight: 300 !important;
            color: white !important; /* LIGHT PINK */
            margin-bottom: 40px !important;
            font-family: Spectral !important;
        }

        /* DONOR GRID */
        .belair-chai-donors-grid {
            display: grid !important;
            grid-template-columns: repeat(3, 1fr) !important;
            gap: 20px !important;
            width: 100% !important;
            max-width: 900px !important;
            padding: 0 !important;
            box-sizing: border-box !important;
        }

        /* DONOR CARD STYLES */
        .belair-chai-donor-card {
            background-color: #f6f6f6 !important; /* Soft off-white to match image */
            border-radius: 4px !important; 
            padding: 20px !important;
            min-height: 120px !important;
            text-align: left !important;
            display: flex !important;
            flex-direction: column !important;
            justify-content: space-between !important;
            box-shadow: none !important;
            border: 1px solid #dcd0cb !important; /* Thinner, subtle border */
            font-family: 'Spectral' !important;
        }
        
        .belair-chai-card-top { margin-bottom: 15px !important; }
        
        .belair-chai-name-row {
            display: flex !important;
            align-items: center !important;
            justify-content: space-between !important;
            margin-bottom: 5px !important;
        }
        
        .belair-chai-name { 
            font-size: 20px !important; 
            font-weight: 700 !important; 
            color: rgb(57, 57, 57) !important; 
            line-height: 1.2 !important;
        }
        
        .belair-chai-card-divider {
            width: 100% !important;
            height: 1px !important;
            background-color: rgba(178, 95, 50, 0.2) !important;
            margin: 10px 0 !important;
        }
        
        .belair-chai-level { 
            font-size: 13px !important; 
            text-transform: uppercase !important; 
            color: rgb(100, 100, 100) !important; 
            letter-spacing: 0.5px !important;
        }
        
        .belair-chai-card-bottom { 
            font-size: 12px !important; 
            font-weight: 600 !important; 
            color: rgb(167, 167, 167) !important; 
            display: flex !important;
            align-items: center !important;
            gap: 5px !important;
        }
        
        .donor-card-heart svg {
            width: 14px !important;
            height: 14px !important;
        }

        /* VIEW ALL BUTTON HIDDEN */
        .belair-view-all-container {
            display: none !important;
        }
        .belair-view-all-btn {
            display: none !important;
        }
        
        /* --- GENERAL FORM OVERRIDES --- */
        .form-line { padding: 15px 0 !important; margin: 0 auto !important; max-width: 100% !important; box-sizing: border-box !important; display: block !important; }
        
        .form-label, .form-sub-label { 
            font-family: "Outfit", sans-serif !important; 
            font-size: 16px !important; 
            font-weight: 300 !important; 
            color: #777 !important; 
            margin-bottom: 8px !important; 
            display: block !important; 
            width: 100% !important; 
            text-align: left !important;
            float: none !important;
        }
        
        .form-address-table th { display: table-cell !important; color: #777 !important; font-weight: 600 !important; padding-bottom: 10px !important; text-align: left !important; }

        .form-textbox, .form-dropdown, .form-textarea { 
            width: 100% !important; 
            max-width: 100% !important; 
            padding: 12px 15px !important; 
            border: 1px solid #ddd !important; 
            border-radius: 6px !important; 
            font-family: "Outfit", sans-serif !important; 
            font-size: 16px !important; 
            box-sizing: border-box !important; 
            transition: border-color 0.3s !important; 
            background-color: #f9f9f9 !important; 
        }
        .form-textbox:focus, .form-dropdown:focus { 
            border-color: #2F3C4D !important; 
            outline: none !important; 
            background-color: #fff !important; 
        }

        /* --- TIER SECTION STYLES (id_4) --- */
        #cid_4 .form-single-column {
            display: grid !important;
            grid-template-columns: repeat(3, 1fr) !important;
            gap: 20px !important;
            width: 100% !important;
        }

        #label_4 {
            float: none !important;
            display: block !important;
            width: 100% !important;
            text-align: center !important;
            margin-bottom: 20px !important;
        }
        li#id_4 {
            display: flex !important;
            flex-direction: column !important;
            align-items: center !important;
            background-color: white !important;
            border-radius: 15px !important;
        }

        .tier-card {
            position: relative !important;
            border-radius: 12px !important;
            padding: 20px !important;
            display: flex !important;
            flex-direction: column !important;
            align-items: center !important;
            justify-content: center !important;
            min-height: 180px !important;
            cursor: pointer !important;
            transition: transform 0.2s !important;
            box-sizing: border-box !important;
            margin-bottom: 0 !important;
            width: 100% !important;
            border-width: 3px !important;
            border-style: solid !important;
        }

        /* [!!! FIX ADDED HERE !!!] Ensure spans inside the card share the cursor */
        .tier-card span {
            cursor: pointer !important;
            display: block;
            width: 100%;
        }

        .form-submit-button {box-shadow: unset !important;}
        .tier-card:hover { transform: translateY(-3px) !important; box-shadow: 0 5px 15px rgba(0,0,0,0.05) !important; }

        .tier-card-orange { 
            border: 2px solid #B99362 !important; 
            background-color: #FFF5F2 !important; 
        }
        .tier-card-blue { 
            border: 2px solid #2F3C4D !important; 
            background-color: #E6F1FA !important; 
        }
        
        .tier-card-orange .tier-price { color: #B99362 !important; }
        .tier-card-blue .tier-price { color: #2F3C4D !important; }

        .tier-card-orange:hover { 
            background-color: #FFE9EB !important; 
            border: 2px solid #B99362 !important; 
        }
        .tier-card-orange.tier-selected { 
            background-color: #FFE9EB !important; 
            border: 4px solid #B99362 !important; 
        }
        .tier-card-blue:hover { 
            background-color: #D6E8F8 !important; 
            border: 2px solid #2F3C4D !important; 
        }
        .tier-card-blue.tier-selected { 
            background-color: #D6E8F8 !important; 
            border: 4px solid #2F3C4D !important; 
        }

        .tier-card-other { grid-column: 1 / -1 !important; margin-top: 10px !important; }
        .tier-card-other .tier-card-content { flex-direction: row !important; gap: 15px !important; justify-content: center !important;  height: 5em !important;}
        .tier-card-other .tier-name { margin-bottom: 0 !important; white-space: nowrap !important; }
        .tier-other-wrapper { width: auto !important; flex-grow: 1 !important; max-width: 300px !important; }
        .tier-card input[type="text"], .tier-card input[type="number"] { width: 100% !important; }

        /* Custom Radio Buttons */
        .tier-card input[type="radio"] { 
            appearance: none !important;
            width: 24px !important;
            height: 24px !important;
            border-radius: 50% !important;
            border: 2px solid #ccc !important;
            background: #fff !important;
            cursor: pointer !important;
            position: absolute !important;
            top: 15px !important;
            right: 15px !important;
        }
        .tier-card-orange input[type="radio"]:checked {
            background-color: #B99362 !important;
            border-color: #B99362 !important;
            background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'%3E%3Cpath d='M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41z'/%3E%3C/svg%3E") !important;
        }
        .tier-card-blue input[type="radio"]:checked {
            background-color: #2F3C4D !important;
            border-color: #2F3C4D !important;
            background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'%3E%3Cpath d='M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41z'/%3E%3C/svg%3E") !important;
        }

        .tier-card-content { display: flex !important; flex-direction: column !important; align-items: center !important; width: 100% !important; text-align: center !important; }
        
        .tier-name { 
            font-size: 18px !important; 
            font-weight: 600 !important;
            margin-bottom: 10px !important; 
            color: #333 !important; 
            text-transform: uppercase !important; 
            letter-spacing: 0.5px !important; 
            font-family: "Spectral", serif !important; 
        }
        .tier-line { width: 80% !important; height: 1px !important; background-color: rgba(0,0,0,0.1) !important; margin: 10px 0 !important; }
        .tier-price { 
            font-size: 16px !important; 
            font-weight: 800 !important;
            color: #555 !important; 
            font-family: "Spectral", serif !important; 
        }
        
        .tier-main-title { font-size: 26px !important; font-weight: 800 !important; color: rgb(66, 66, 66) !important; margin-bottom: 5px !important; text-align: center !important; display: block !important; font-family: "Spectral", serif !important; }
        .tier-sub-title { font-size: 18px !important; font-weight: 400 !important; color: #666 !important; margin-bottom: 25px !important; text-align: center !important; display: block !important; font-family: "Spectral", serif !important; }
        .tier-other-wrapper { display: flex !important; align-items: center !important; justify-content: center !important; margin-top: 0 !important; }
        .tier-currency { font-size: 18px !important; font-weight: 600 !important; margin-right: 2px !important; color: #2F3C4D !important; }
        
        #cid_4 br, #cid_4 .clearfix { display: none !important; }

        /* [!!! FIX ADDED HERE !!!] "Ghost" CSS to let clicks fall through the disabled text box */
        .tier-card .form-radio-other-input:disabled {
            pointer-events: none !important;
            background-color: #f4f4f4 !important;
            cursor: pointer !important;
        }

        /* --- PAYMENT SECTION SPECIFIC STYLES --- */
        #header_5 {
            text-align: center !important;
            font-size: 32px !important;
            color: rgb(66, 66, 66) !important;
            font-family: "Spectral", serif !important;
            font-weight: 700 !important;
            margin: 10px 0 20px 0 !important;
            position: relative !important;
            padding-bottom: 15px !important;
            display: block !important;
        }
        
        #id_6 .form-sub-label-container { width: 49%; display: inline-block !important; }
        #id_6 .form-sub-label-container:first-child { margin-right: 1% !important; }
        #id_6 [data-type="control_fullname"] { display: flex !important; gap: 10px !important; }
        
        /* Make sure all labels display properly */
        #id_4 .form-label-top, #id_6 .form-label-top, #id_7 .form-label-top, #id_9 .form-label-top {
            float: none !important;
            display: block !important;
            text-align: left !important;
        }
        .form-input {
            margin-left: 0 !important;
            width: 100% !important;
        }
        
       
        
       

/* --- PAYMENT METHOD SECTION (#cid_17) --- */

        #label_12 { font-weight: 600 !important; color: #535353 !important; }

 /* TOTAL AMOUNT BOX / PAYMENT WRAPPER */
 #id_13 {
     padding: 20px !important;
     margin-top: 20px !important;
     width: 100% !important;
     display: flex !important;
     flex-direction: column !important;
     background-color: #F6F6F6 !important;
     border: 1px solid #D8D8D8 !important;
     border-radius: 8px !important;
     box-sizing: border-box !important;
 }

 .total-row-inner {
     display: flex !important;
     justify-content: space-between !important;
     width: 100% !important;
     align-items: center !important;
 }

 #label_13 {
     font-family: "Outfit", sans-serif !important;
     font-size: 16px !important;
     color: rgb(66, 66, 66) !important;
     margin: 0 !important;
 }

 #total_amount {
     font-size: 24px !important;
     font-weight: 700 !important;
     color: #2F3C4D !important;
     display: flex !important;
     align-items: baseline !important;
     font-family: "Outfit", sans-serif !important;
 }

 #total_amount:after {
     content: "/Month" !important;
     font-size: 16px !important;
     color: #777 !important;
     font-weight: 400 !important;
     margin-left: 5px !important;
     text-transform: capitalize !important;
 }

 #div_offset_gift_13 {
     display: block !important;
     width: 100% !important;
     margin-top: 5px !important;
     text-align: center !important;
 }

        /* 1. Remove box styles from Main Container */

        #cid_12 {

            background: transparent !important;

            border: none !important;

            border-radius: 0 !important;

            padding: 0 !important;

            margin-top: 10px !important;

            box-sizing: border-box !important;

        }



        /* 2. Styles for the Payment Methods Grid */

        #cid_12 > table > tbody > tr:nth-child(1) > td {

            display: grid !important;

            grid-template-columns: repeat(4, 1fr) !important;

            gap: 15px !important;

            width: 100% !important;

            margin-bottom: 20px !important;

        }

        .form-payment-methods .form-radio-item {

            display: flex !important;

            flex-direction: row-reverse !important;

            justify-content: space-between !important;

            align-items: center !important;

            background-color: #fff !important;

            border: 1px solid #D8D8D8 !important;

            border-radius: 15px !important;

            padding: 15px !important;

            cursor: pointer !important;

            min-width: 0 !important;

            width: 100% !important;

            box-sizing: border-box !important;

            float: none !important;

        }

        .form-payment-methods .form-radio-item.active-payment-card {

            background-color: #d3e9eb !important;

            border-color: #95c3db !important;

        }

        .form-payment-methods label {

            font-size: 1.8rem !important;
                font-family: 'Outfit';
            color: #535353 !important;

            cursor: pointer !important;

            white-space: nowrap !important;

        }

        .form-payment-methods input[type="radio"] {

            accent-color: #0000FF !important;

            transform: scale(1.1) !important;

            margin-left: 5px !important;

        }



        /* 3. Bel Air Style: Force Table Elements to Block for Layout Control */

        #cid_12 .form-address-table,

        #cid_12 .form-address-table tbody {

            display: block !important;

            width: 100% !important;

        }
.form-address-table {max-width: 100% !important;}
        

        /* FIX: Only apply flex layout to visible rows. 

           This prevents overriding the .hide class used by the CMS. */

        #cid_12 .form-address-table tr:not(.hide) {

            display: flex !important;

            flex-wrap: wrap !important;

            width: 100% !important;

            margin-bottom: 15px !important;

        }



        #cid_12 .form-address-table td {

            padding: 0 !important;

            width: 100% !important;

            display: block !important;

        }



        /* 3.5 ADD THE BOX STYLE TO THE SPECIFIC VISIBLE PAYMENT ROWS 

           We use :not(.hide) to ensure we don't accidentally style hidden elements 

           or interfere with the CMS toggling logic. */

        #cid_12 tr.credit_card:not(.hide),

        #cid_12 tr.paypal:not(.hide),

        #cid_12 tr.e_check:not(.hide),

        #cid_12 tr.other:not(.hide),

        #cid_12 tr.billing_address:not(.hide) {

             border-radius: 8px !important;

             padding: 0px !important;

             box-sizing: border-box !important;

             margin-top: 15px !important;

        }



        /* 4. Payment Input Styles (Outfit, Full Width) */

        #cid_12 .form-textbox, 

        #cid_12 .form-dropdown {

            width: 100% !important;

            max-width: 100% !important;

            padding: 12px 15px !important;

            border: 1px solid #ddd !important;

            border-radius: 6px !important;

            font-family: "Outfit", sans-serif !important;

            font-size: 16px !important;

            box-sizing: border-box !important;

            background-color: #f9f9f9 !important;

            transition: border-color 0.3s !important;

        }

        #cid_12 .form-textbox:focus, 

        #cid_12 .form-dropdown:focus {

            border-color: #3065B4 !important;

            background-color: #fff !important;

            outline: none !important;

        }

        

        /* 5. Headers inside Payment (Credit Card, Billing Address) */

        #cid_12 th {

            font-family: "Outfit", sans-serif !important;

            font-weight: 600 !important;

            color: #535353 !important;

            text-align: left !important;

            padding-bottom: 10px !important;

            display: block !important;

            border-bottom: 1px solid #eee !important;

            margin-bottom: 15px !important;

            margin-top: 5px !important;

            width: 100% !important;

        }



        /* 6. Layout Fixes for CC Fields */

        #cid_12 .cc-field-wrapper { width: 100% !important; }

        

        /* Ensure CVV is spaced correctly if in same row */

        #cid_12 .cc_ccv {

             width: 100% !important; 

             margin-top: 10px !important; 

        }



        /* Sub-labels (CC Number, Expiry, etc) */

        #cid_12 .form-sub-label {

            font-family: "Outfit", sans-serif !important;

            font-size: 14px !important;

            color: #777 !important;

            margin-top: 5px !important;

            display: block !important;

        }

        /* --- SUBMIT BUTTON --- */
        #id_2 { margin-top: 20px !important; padding-bottom: 20px !important; }
        #input_2 {
            width: 100% !important;
            background-color: #2F3C4D !important;
            color: #fff !important;
            font-family: "Spectral", serif !important;
            font-size: 22px !important;
            padding: 15px 25px !important;
            border-radius: 50px !important;
            display: flex !important;
            align-items: center !important;
            justify-content: center !important;
            gap: 15px !important;
            position: relative !important;
            cursor: pointer !important;
            border: 2px solid #2F3C4D !important;
            transition: all 0.3s ease !important;
        }
        #input_2:hover {
            background-color: #ffffff !important;
            color: #3166b5 !important;
            border-color: #3166b5 !important;
        }
        #input_2:hover .belair-submit-arrow svg {
            fill: #3166b5 !important;
            transition: fill 0.3s ease !important;
        }

        @media (max-width: 768px) {
            .belair-chai-nav { display: none !important; flex-direction: column !important; padding: 10px !important; }
            .belair-chai-nav-right { flex-direction: column !important; gap: 15px !important; margin-top: 15px !important; }
            .belair-white-box { padding: 20px !important; }
            
            #row-1, #row-3 { background-color: #2F3C4D !important;}
            .chai-belair-feature-text{ color: white !important;}
            #row-2{ background-color: #B99362 !important;}
            

            .belair-chai-partners-title { font-size: 45px !important;}
            .belair-chai-logo-img { width: 120px !important;}
            .belair-chai-title-club { font-size: 80px !important;}
            .belair-chai-title-chai { font-size: 70px !important;}
            
            .belair-chai-donors-grid { grid-template-columns: 1fr 1fr !important; gap: 10px !important; }
            .belair-chai-donors-grid { width: 95% !important;} 
            
            #cid_4 .form-single-column { grid-template-columns: 1fr 1fr !important; gap: 10px !important; }
            .tier-card-other { grid-column: 1 / -1 !important; }
#cid_12 > table > tbody > tr:nth-child(1) > td {grid-template-columns: repeat(2, 1fr) !important;}
        }

        /* --- SCROLL ANIMATION STYLES (NEW) --- */
        .belair-animate-hidden {
            opacity: 0;
            transform: translateY(30px);
            transition: opacity 0.8s ease-out, transform 0.8s ease-out;
            will-change: opacity, transform;
        }
        .belair-animate-visible {
            opacity: 1;
            transform: translateY(0);
        }
    `;
belairStyles = belairStyles.replace(/\u00A0/g, ' ');
    // Inject the styles
    var styleSheet = document.createElement("style");
    styleSheet.innerHTML = belairStyles;
    document.head.appendChild(styleSheet);


    // 2. LOGIC: INJECT SVGS INTO HTML
    // ----------------------------
    function injectSVGs() {
        const ARROW_SVG = `<svg xmlns="http://www.w3.org/2000/svg" height="24" viewBox="0 0 24 24" width="24" fill="#ffffff">
            <path d="M12 4l-1.41 1.41L16.17 11H4v2h12.17l-5.58 5.59L12 20l8-8z"/>
        </svg>`;
        
        const arrowTargets = document.querySelectorAll('.box-arrow-target');
        arrowTargets.forEach(el => { el.innerHTML = ARROW_SVG; });

        const submitBtn = document.getElementById('input_2');
        if(submitBtn && !submitBtn.querySelector('.belair-submit-arrow')) {
            const arrowDiv = document.createElement('div');
            arrowDiv.className = 'belair-submit-arrow'; 
            arrowDiv.style.marginLeft = "12px";
            arrowDiv.style.display = "flex";
            arrowDiv.style.alignItems = "center";
            arrowDiv.innerHTML = ARROW_SVG;
            const overrideStyle = document.createElement('style');
            overrideStyle.innerHTML = `#input_2::after { display: none !important; content: none !important; }`;
            document.head.appendChild(overrideStyle);
            submitBtn.appendChild(arrowDiv);
        }
        
        function scrollToTiers() {
            var formStart = document.getElementById('id_4'); // Mapped to Tier Radio Buttons ID
            if(formStart) formStart.scrollIntoView({behavior: 'smooth'});
            else {
                 var cid4 = document.getElementById('cid_4');
                 if(cid4) cid4.scrollIntoView({behavior: 'smooth'});
            }
        }

        var joinButtons = document.querySelectorAll('.nav-join-action');
        joinButtons.forEach(function(btn) {
            btn.addEventListener('click', function(e) {
                e.preventDefault();
                scrollToTiers();
            });
        });
    }

    // 3. LOGIC: FETCH AND RENDER DONORS
    // ---------------------------------
    function fetchAndRenderDonors() {
        let grid = document.getElementById('belair-chai-donors-grid');
        const countDisplay = document.getElementById('donor-count-display');
        let viewAllBtn = document.getElementById('btn-view-all-donors');
        
        // Ensure View All button container is hidden if it exists
        if (viewAllBtn) {
            viewAllBtn.style.display = 'none';
            if(viewAllBtn.parentNode && viewAllBtn.parentNode.classList.contains('belair-view-all-container')) {
                viewAllBtn.parentNode.style.display = 'none';
            }
        }

        if (!grid && countDisplay) {
            grid = document.createElement('div');
            grid.id = 'belair-chai-donors-grid';
            grid.className = 'belair-chai-donors-grid';
            // Insert it directly after the count display
            countDisplay.parentNode.insertBefore(grid, countDisplay.nextSibling);
        }
        
        if (!grid) return;

        const HEART_ORANGE = `<svg viewBox="0 0 24 24" style="fill:#B99362"><path d="M12 21.35l-1.45-1.32C5.4 15.36 2 12.28 2 8.5 2 5.42 4.42 3 7.5 3c1.74 0 3.41.81 4.5 2.09C13.09 3.81 14.76 3 16.5 3 19.58 3 22 5.42 22 8.5c0 3.78-3.4 6.86-8.55 11.54L12 21.35z"/></svg>`;
        const HEART_BLUE = `<svg viewBox="0 0 24 24" style="fill:#2F3C4D"><path d="M12 21.35l-1.45-1.32C5.4 15.36 2 12.28 2 8.5 2 5.42 4.42 3 7.5 3c1.74 0 3.41.81 4.5 2.09C13.09 3.81 14.76 3 16.5 3 19.58 3 22 5.42 22 8.5c0 3.78-3.4 6.86-8.55 11.54L12 21.35z"/></svg>`;

        function csvToArray(str, delimiter = ",") {
            const headers = str.slice(0, str.indexOf("\n")).split(delimiter).map(h => h.trim());
            const rows = str.slice(str.indexOf("\n") + 1).split("\n");
            return rows.map(function (row) {
                const values = row.split(delimiter);
                const el = headers.reduce(function (object, header, index) {
                    object[header] = values[index] ? values[index].trim() : "";
                    return object;
                }, {});
                return el;
            });
        }

        function renderCards(data) {
            var filteredData = data.filter(function(donor) {
                var rawLevel = donor['Level'] || donor['Category'] || "";
                var cleanLevel = rawLevel.replace(/^"|"$/g, '').trim().toLowerCase();
                return cleanLevel !== 'no category';
            });

            grid.innerHTML = "";
            countDisplay.innerText = `${filteredData.length} active partners`;

            // Draw all donors
            filteredData.forEach((donor, index) => {
                let heartIcon = (index % 2 === 0) ? HEART_ORANGE : HEART_BLUE;
                let name = donor['Name'] || donor['name'] || "Anonymous";
                let rawLevel = donor['Level'] || donor['Category'] || "Chai Partner";
                let level = rawLevel.replace(/^"|"$/g, '').trim(); 
                let date = donor['Since'] || donor['Date'] || "Nov 2025";

                let card = document.createElement('div');
                card.className = 'belair-chai-donor-card';
                
                // Build the HTML
                let cardHTML = `
                    <div class="belair-chai-card-top">
                        <div class="belair-chai-name-row">
                            <div class="belair-chai-name">${name}</div>
                        </div>
                        <div class="belair-chai-level">${level}</div>
                    </div>
                    <div class="belair-chai-card-divider"></div>
                    <div class="belair-chai-card-bottom">
                        <div class="donor-card-heart">${heartIcon}</div>
                        Partner Since ${date}
                    </div>
                `;
                
                // THIS FIXES THE SPACING: Strip non-breaking spaces before applying
                card.innerHTML = cardHTML.replace(/\u00A0/g, ''); 
                
                grid.appendChild(card);
            });
        }

        if (GOOGLE_SHEET_CSV_URL && GOOGLE_SHEET_CSV_URL.startsWith('http')) {
            fetch(GOOGLE_SHEET_CSV_URL)
                .then(response => response.text())
                .then(text => {
                    const data = csvToArray(text);
                    renderCards(data);
                })
                .catch(err => { console.error("Error fetching sheet:", err); });
        }
    }


    // 4. WRAP FORM
    function wrapFormContent() {
        var startElement = document.getElementById('id_4'); // Updated to Form Tiers ID
        var endElement = document.getElementById('id_2');   // Submit Button
        if (startElement && endElement) {
            var parent = startElement.parentNode;
            var wrapper = document.createElement('div');
            wrapper.className = 'belair-white-box';
            parent.insertBefore(wrapper, startElement);
            var current = startElement;
            var elementsToMove = [];
            while (current) {
                elementsToMove.push(current);
                if (current === endElement) break;
                current = current.nextElementSibling;
            }
            elementsToMove.forEach(function(el) { wrapper.appendChild(el); });
        }
    }

    // 5. RESTRUCTURE TIERS
    function restructureTierSection() {
        var headerLabelContainer = document.querySelector('#label_4'); // Updated mapped ID
        var headerLabel = headerLabelContainer ? headerLabelContainer.querySelector('label') : null;
        if (headerLabel) {
            var text = headerLabel.innerHTML; 
            var parts = text.split('/n');
            if (parts.length > 1) {
                headerLabel.innerHTML = `
                    <span class="tier-main-title">${parts[0].trim()}</span>
                    <span class="tier-sub-title">${parts[1].trim()}</span>
                `;
            }
        }
        var container = document.querySelector('#cid_4 .form-single-column'); // Updated mapped ID
        if (container) {
            var items = container.querySelectorAll('.form-radio-item');
            items.forEach(function(item, index) {
                item.classList.add('tier-card');
                
                /* [!!! FIX ADDED HERE !!!] BRUTE-FORCE LOGIC APPLIED TO CLICK EVENT */
                item.addEventListener('click', function(e) {
                    
                    // If they click inside an already active text/number input, let them type normally!
                    if (e.target.tagName === 'INPUT' && (e.target.type === 'text' || e.target.type === 'number') && !e.target.disabled) {
                        return; 
                    }

                    // 1. Remove selected state and lock ALL other inputs
                    items.forEach(i => {
                        i.classList.remove('tier-selected');
                        var otherInp = i.querySelector('.form-radio-other-input');
                        if (otherInp && i !== item) {
                            otherInp.setAttribute('disabled', 'disabled');
                            otherInp.disabled = true;
                        }
                    });

                    // 2. Add selected state to THIS item
                    item.classList.add('tier-selected');
                    
                    // 3. Check the radio natively
                    var radio = item.querySelector('input[type="radio"]');
                    if (radio && !radio.checked) {
                        radio.checked = true;
                        radio.dispatchEvent(new Event('change', { bubbles: true }));
                    } 
                    
                    // 4. Unlock the text box and focus it
                    var otherInput = item.querySelector('.form-radio-other-input');
                    if (otherInput) {
                        otherInput.removeAttribute('disabled');
                        otherInput.disabled = false;
                        otherInput.focus();
                    }
                });
                
                // Backup listener just in case they tab to it via keyboard
                var backupOtherInput = item.querySelector('.form-radio-other-input');
                if (backupOtherInput) {
                    backupOtherInput.addEventListener('focus', function() {
                        item.click(); 
                    });
                }
                /* [!!! END FIX !!!] */
                
                if (index % 2 === 0) item.classList.add('tier-card-orange');
                else item.classList.add('tier-card-blue');

                var isOther = item.querySelector('.form-radio-other'); 
                if (!isOther) {
                    var label = item.querySelector('label');
                    if (label) {
                        var fullText = label.innerText.trim(); 
                        var dollarIndex = fullText.lastIndexOf('$');
                        if (dollarIndex !== -1) {
                            var title = fullText.substring(0, dollarIndex).trim();
                            var price = fullText.substring(dollarIndex).trim();
                            label.innerHTML = `
                                <div class="tier-card-content">
                                    <div class="tier-name">${title}</div>
                                    <div class="tier-line"></div>
                                    <div class="tier-price">${price}</div>
                                </div>
                            `;
                        }
                    }
                }
            });
        }
    }

    // 6. ENHANCE PAYMENT
    function enhancePaymentSection() {
        var ccNumber = document.querySelector('[id*="cc_number"]');
        if (ccNumber) ccNumber.placeholder = "0000 0000 0000 0000";
        var ccCvv = document.querySelector('[id*="cc_ccv"]');
        if (ccCvv) ccCvv.placeholder = "CVV";
        
        // TOTAL AMOUNT RESTRUCTURE
        var totalAmountContainer = document.getElementById('id_13'); // Updated mapped ID
        if (totalAmountContainer) {
             var label = document.getElementById('label_13'); // Updated mapped ID
             var amount = document.getElementById('total_amount');
             // Double check it wasn't already restructured
             if (label && amount && label.parentNode !== amount.parentNode) {
                 var wrapper = document.createElement('div');
                 wrapper.className = 'total-row-inner';
                 wrapper.appendChild(label);
                 wrapper.appendChild(amount);
                 totalAmountContainer.insertBefore(wrapper, totalAmountContainer.firstChild);
             }
        }
        
        var expiryRow = document.querySelector('.credit_card:last-of-type'); 
        var cvvInput = document.getElementById('input_12_cc_ccv'); // Updated mapped ID
        if (expiryRow && cvvInput) {
            var cvvContainer = cvvInput.closest('td');
            if (cvvContainer && cvvContainer.parentNode !== expiryRow) {
                expiryRow.appendChild(cvvContainer);
            }
        }
    }

    // 7. HIDE MONTHLY
    function handleMonthlyRecurrence() {
        var monthlyCheckbox = document.getElementById('input_11'); // Updated ID for Monthly Recurrence checkbox
        var monthlyRow = document.getElementById('id_11');         // Updated ID for Monthly Recurrence container
        if (monthlyCheckbox) monthlyCheckbox.checked = true;
        if (monthlyRow) {
            monthlyRow.style.display = 'none';
            monthlyRow.style.visibility = 'hidden';
        }
    }

    // 8. ANIMATION LOGIC (INTERSECTION OBSERVER)
    function setupScrollAnimations() {
        const observerOptions = {
            root: null, 
            rootMargin: '0px',
            threshold: 0.1 
        };

        const observer = new IntersectionObserver((entries, observer) => {
            entries.forEach(entry => {
                if (entry.isIntersecting) {
                    entry.target.classList.add('belair-animate-visible');
                    observer.unobserve(entry.target); 
                }
            });
        }, observerOptions);

        // Updated array to target the correct ID's currently found in the HTML
        const targets = [
            '.belair-chai-nav',                 
            '.belair-chai-header-wrapper',      
            '.belair-chai-hero-image',          
            '.chai-belair-container',           
            '.belair-chai-donors-wrapper',      
            '#id_4',                            // Form: Tiers Section
            '#id_6',                            // Form: Full Name
            '#id_7',                            // Form: Display Name
            '#id_12',                           // Form: Payment Details Container
            '#id_2'                             // Form: Submit Button
        ];

        targets.forEach(selector => {
            const elements = document.querySelectorAll(selector);
            elements.forEach(el => {
                el.classList.add('belair-animate-hidden'); 
                observer.observe(el); 
            });
        });
    }

    function init() {
        if (window.belairFormInitialized) return;
        window.belairFormInitialized = true;

        injectSVGs();
        handleMonthlyRecurrence();
        fetchAndRenderDonors(); 
        wrapFormContent(); 
        restructureTierSection(); 
        enhancePaymentSection(); 
        
        // Trigger animations last
        setupScrollAnimations();
    }
    
    // Use an interval to wait for the dynamic form to load into the DOM
    let initAttempts = 0;
    let initInterval = setInterval(function() {
        initAttempts++;
        if (document.getElementById('id_4') && document.querySelector('.belair-chai-container')) {
            clearInterval(initInterval);
            init();
        } else if (initAttempts > 100) { // Timeout after ~10 seconds
            clearInterval(initInterval);
            console.warn("Bel Air Form Script: Form elements not found.");
        }
    }, 100);

})();
</script>
</body>
</html>