// legal.jsx — Every Man's Health · shared legal-page engine.
// One module renders all six legal pages; each HTML sets window.LEGAL_PAGE.
// Visual system inherited from shared.jsx (palette/type/useViewport). Calm,
// text-focused, responsive, no hero imagery, no sales copy.
//
// Entity note: the public legal pages display the brand name "Every Man's
// Health" only. Any underlying entity / registration language is reserved for
// internal, counsel-approved documents and does not appear in public copy.

const PX = (vp) => vp.pad;
const SY = (vp, n) => Math.round(n * (vp.isPhone ? 0.5 : vp.isMobile ? 0.6 : vp.isTablet ? 0.8 : 1));

// Public legal pages use the brand name only. Underlying entity / registration
// details are reserved for internal records, registration/consent and billing
// documents, and counsel-approved legal language — see the internal checklist.
const ENTITY = "Every Man's Health";
const LAST_UPDATED = 'May 29, 2026';
const LEGAL_LINKS = [
  ['Privacy Policy', 'EMH_07_Privacy_Policy.html'],
  ['Terms of Use', 'EMH_08_Terms_Of_Use.html'],
  ['HIPAA Notice', 'EMH_09_HIPAA_Notice.html'],
  ['Accessibility', 'EMH_10_Accessibility_Statement.html'],
  ['Website Disclaimer', 'EMH_11_Website_Disclaimer.html'],
  ['Electronic Communications', 'EMH_12_Electronic_Communications.html'],
];
const PORTAL = 'https://www.yourhealthfile.com/portal/login.jsp';

// Shared positioning paragraph reused across several pages.
const NOT_A_RELATIONSHIP = 'Use of this website, submission of a membership application, and any general communication with Every Man\u2019s Health do not create a physician-patient relationship. A clinical relationship is established only after an appropriate intake and an in-person physician evaluation, and at the discretion of the practice.';
const EMERGENCY = 'This website and its forms are not for medical emergencies. If you are experiencing a medical emergency, call 911 or go to your nearest emergency department. Do not use website forms, email, or non-urgent messaging for urgent or emergency concerns.';

// ── Page content ─────────────────────────────────────────────────────────
const PAGES = {
  privacy: {
    eyebrow: 'Legal · Privacy',
    title: 'Privacy Policy',
    intro: `This Privacy Policy explains how ${ENTITY} ("Every Man\u2019s Health," "we," "us," or "our") handles information collected through this website. It applies to this public marketing website only. Protected health information created or maintained within a treatment relationship is governed by our Notice of Privacy Practices (HIPAA Notice), not by this policy.`,
    sections: [
      { h: 'Information we collect', p: [
        'When you submit a membership inquiry or otherwise contact us through this website, we may collect the information you choose to provide — such as your name, age range, city and state, phone number, email address, preferred contact method, and a brief description of what you are hoping to address.',
        'The membership inquiry form is intended for general, non-sensitive information only. Please do not submit detailed medical history, medications, laboratory results, insurance details, Social Security numbers, or other sensitive information through the public form.',
      ], ul: [
        'Information you provide directly through forms or communications.',
        'Limited technical information your browser sends automatically (such as device, browser type, and general usage), where applicable.',
      ] },
      { h: 'How we use information', p: [
        'We use the information you provide to evaluate fit for membership, to respond to your inquiry, to arrange an introductory conversation, and to administer and improve this website.',
      ] },
      { h: 'How we share information', p: [
        'We do not sell your personal information. We may share information with service providers who support our website and operations, and as required by law.',
      ] },
      { h: 'Submitting a membership inquiry', p: [
        NOT_A_RELATIONSHIP,
        'Submitting an inquiry does not guarantee acceptance into the practice.',
      ] },
      { h: 'Data security', p: [
        'We take reasonable measures to protect information submitted through this website. No method of transmission over the internet is completely secure, and we cannot guarantee absolute security. Please see our Electronic Communications notice for guidance on appropriate channels.',
      ] },
      { h: 'Your choices', p: [
        'You may contact us to ask about the information you have submitted or to request that we update or delete it, subject to applicable law and our record-keeping obligations.',
      ] },
      { h: 'Changes to this policy', p: [
        'We may update this Privacy Policy from time to time. The "last updated" date below reflects the most recent revision.',
      ] },
    ],
  },

  terms: {
    eyebrow: 'Legal · Terms',
    title: 'Terms of Use',
    intro: `These Terms of Use govern your use of the ${ENTITY} website. By using this website, you agree to these terms. If you do not agree, please do not use the site.`,
    sections: [
      { h: 'Informational purpose only', p: [
        'The content on this website is provided for general informational and educational purposes only. It is not medical advice, and it is not a substitute for professional medical advice, diagnosis, treatment, or an established physician-patient relationship.',
        'Medical advice, diagnosis, and treatment are provided only through an appropriate clinical relationship with a licensed physician.',
      ] },
      { h: 'No physician-patient relationship', p: [ NOT_A_RELATIONSHIP ] },
      { h: 'Not for emergencies', p: [ EMERGENCY ] },
      { h: 'About the practice', p: [
        'Every Man\u2019s Health is a limited-panel regional Florida concierge men\u2019s health optimization practice. The model is physician-led, lab-guided, and data-informed, and is built around an initial in-person physician evaluation, coordinated laboratory testing, longitudinal monitoring, personalized planning, and telehealth-supported follow-up when clinically appropriate and where permitted.',
        'Laboratory testing is coordinated through trusted laboratory partners. Specialized pathology and molecular diagnostic capabilities may be supported through affiliated CAP/CLIA laboratory infrastructure when clinically indicated.',
        'Any prescription medications, compounded therapies, hormone-related therapies, metabolic therapies (including GLP-1, GIP, or glucagon-pathway therapies), and peptide-related therapies are considered only when clinically appropriate, legally available, and prescribed through a physician-guided process. Nothing on this website is an offer or guarantee of any specific therapy or outcome.',
      ] },
      { h: 'Technology and AI-assisted tools', p: [
        'Where technology or AI-assisted tools are referenced, they support the organization and review of information. They do not replace the judgment of a licensed physician, who is responsible for clinical interpretation and decisions.',
      ] },
      { h: 'Intellectual property', p: [
        'The content, design, and trademarks on this website are owned by or licensed to Every Man\u2019s Health and may not be used without permission.',
      ] },
      { h: 'Third-party links', p: [
        'This website may link to third-party sites, including the YourHealthFile patient portal. We are not responsible for the content or privacy practices of third-party sites.',
      ] },
      { h: 'Limitation of liability', p: [
        'To the fullest extent permitted by law, Every Man\u2019s Health is not liable for any damages arising from your use of, or inability to use, this website.',
      ] },
    ],
  },

  hipaa: {
    eyebrow: 'Legal · HIPAA',
    title: 'Notice of Privacy Practices',
    intro: `This Notice describes how medical information about you may be used and disclosed and how you can get access to this information. Please review it carefully. This Notice applies to protected health information ("PHI") created or maintained by ${ENTITY} in connection with treatment, payment, and health care operations.`,
    sections: [
      { h: 'Our commitment', p: [
        'We are required by law to maintain the privacy of your protected health information, to provide you with this Notice of our legal duties and privacy practices, and to follow the terms of the Notice currently in effect.',
      ] },
      { h: 'How we may use and disclose your health information', p: [
        'We may use and disclose your PHI for treatment, payment, and health care operations, as permitted by law.',
      ], ul: [
        'Treatment — to provide, coordinate, and manage your care, including with physicians, laboratory partners, and other clinicians involved in your care.',
        'Payment — to bill and obtain payment for services you receive, consistent with our direct-pay model.',
        'Health care operations — to support quality, administration, and operation of the practice.',
        'As required or permitted by law, and for public health and safety purposes where applicable.',
      ] },
      { h: 'Coordinated laboratory and specialized testing', p: [
        'Routine blood and biomarker testing is coordinated through trusted laboratory partners. Specialized pathology and molecular diagnostic testing may be supported through affiliated CAP/CLIA laboratory infrastructure when clinically indicated. PHI may be shared with these partners as necessary for your care and consistent with applicable law.',
      ] },
      { h: 'Your rights regarding your health information', p: [
        'Subject to applicable law, you have the right to:',
      ], ul: [
        'Inspect and request a copy of your health information.',
        'Request a correction or amendment to your health information.',
        'Request an accounting of certain disclosures.',
        'Request restrictions on certain uses and disclosures.',
        'Request confidential communications through a particular channel or location.',
        'Receive a paper copy of this Notice on request.',
      ] },
      { h: 'Secure communications', p: [
        'Once a treatment relationship is established, secure messaging through the YourHealthFile patient portal is the preferred channel for communications involving your health information. See our Electronic Communications notice.',
      ] },
      { h: 'Complaints', p: [
        'If you believe your privacy rights have been violated, you may file a complaint with us using the contact information below, or with the U.S. Department of Health and Human Services. You will not be penalized for filing a complaint.',
      ] },
      { h: 'Changes to this Notice', p: [
        'We may change this Notice and make the new Notice effective for all PHI we maintain. The current Notice will be posted and available on request.',
      ] },
    ],
  },

  accessibility: {
    eyebrow: 'Legal · Accessibility',
    title: 'Accessibility Statement',
    intro: `${ENTITY} is committed to making this website accessible to as many people as possible, including people with disabilities.`,
    sections: [
      { h: 'Our approach', p: [
        'We strive to follow widely recognized accessibility guidance and to improve the experience for all visitors. We design for readable text, clear structure, keyboard navigability, and responsive layouts across devices.',
      ] },
      { h: 'Ongoing effort', p: [
        'Accessibility is an ongoing effort. We continue to review and improve the website over time. We aim to conform to widely recognized accessibility standards.',
      ] },
      { h: 'Contact us about accessibility', p: [
        'If you have difficulty accessing any part of this website, or would like to report an accessibility issue or request information in an alternative format, please contact us. We welcome your feedback and will make reasonable efforts to assist.',
      ] },
    ],
  },

  disclaimer: {
    eyebrow: 'Legal · Disclaimer',
    title: 'Website Disclaimer',
    intro: `Please read this disclaimer carefully before using the ${ENTITY} website.`,
    sections: [
      { h: 'Not medical advice', p: [
        'All content on this website is provided for general informational and educational purposes only and is not intended as, and should not be relied upon as, medical advice. It is not a substitute for professional medical advice, diagnosis, treatment, emergency care, or an established physician-patient relationship.',
        'Always seek the advice of a qualified health provider with any questions you may have regarding a medical condition. Never disregard professional medical advice or delay seeking it because of something you have read on this website.',
      ] },
      { h: 'No physician-patient relationship', p: [ NOT_A_RELATIONSHIP ] },
      { h: 'Emergencies', p: [ EMERGENCY ] },
      { h: 'Therapies and outcomes', p: [
        'Any reference to laboratory testing, monitoring, prescription medications, compounded therapies, hormone-related therapies, metabolic therapies (including GLP-1, GIP, or glucagon-pathway therapies), or peptide-related therapies is general and educational. Such therapies are considered only when clinically appropriate, legally available, and prescribed through a physician-guided process. Individual results vary, and no specific outcome is promised or guaranteed.',
      ] },
      { h: 'Technology and AI-assisted tools', p: [
        'Technology and any AI-assisted tools referenced on this website support the organization and review of information and do not replace physician judgment. Clinical interpretation and decisions are made by licensed physicians.',
      ] },
      { h: 'External links', p: [
        'This website may contain links to third-party websites, including the YourHealthFile patient portal. Such links are provided for convenience; we do not control and are not responsible for third-party content or practices.',
      ] },
    ],
  },

  electronic: {
    eyebrow: 'Legal · Communications',
    title: 'Electronic Communications',
    intro: `This notice describes the electronic communication channels used by ${ENTITY} and the privacy considerations that apply to each.`,
    sections: [
      { h: 'Communication channels', p: [
        'Depending on your relationship with the practice, we may communicate through the following channels:',
      ], ul: [
        'YourHealthFile patient portal — secure messaging for established patients; the preferred channel for communications involving your health information.',
        'Telephone — (352) 861-2115, during office hours.',
        'Voicemail — for messages left outside office hours or when we are unavailable.',
        'Email — membership@everymanshealth.com, for general, non-sensitive inquiries.',
        'Website application form — for membership inquiries (general, non-sensitive information only).',
        'Text messaging — only if and where offered and with your consent; not for sensitive or urgent information.',
      ] },
      { h: 'Privacy risks of electronic communication', p: [
        'Email, text messaging, and website forms are not fully secure and may carry privacy risks. They may not be appropriate for sensitive, detailed, or urgent medical information. Please do not send highly sensitive medical information through these channels.',
        'Once a patient relationship exists, secure messaging through the YourHealthFile patient portal is the preferred method for communications involving your health information.',
      ] },
      { h: 'Not for emergencies', p: [ EMERGENCY ] },
      { h: 'Response times', p: [
        'Electronic messages are monitored during office hours (Monday–Thursday, 8:00 AM–3:30 PM) and are not monitored continuously. Do not rely on electronic communication for time-sensitive needs.',
      ] },
    ],
  },
};

// ── Layout ─────────────────────────────────────────────────────────────
function LegalNav({ p, T, S, vp }) {
  const [hover, setHover] = React.useState(null);
  const [open, setOpen] = React.useState(false);
  const items = [
    { label: 'The Practice', href: 'EMH_05_The_Practice.html' },
    { label: 'Care Model',   href: 'EMH_03_Care_Model.html' },
    { label: 'Membership',   href: 'EMH_04_Membership.html' },
    { label: 'Insights',     href: 'EMH_13_Insights.html' },
  ];
  const applyBtn = (
    <a href="EMH_06_Apply_For_Membership.html" style={{ fontFamily: T.body, fontSize: 13.5, fontWeight: 500, padding: '10px 18px', background: p.ink, color: p.cream, border: 'none', borderRadius: 2, cursor: 'pointer', whiteSpace: 'nowrap', textDecoration: 'none', display: 'inline-block' }}>Apply for membership</a>
  );
  if (vp.isMobile) {
    return (
      <div style={{ position: 'sticky', top: 0, zIndex: 20, background: `${p.cream}f5`, backdropFilter: 'blur(10px)', borderBottom: `1px solid ${p.ink}1a` }}>
        <div style={{ display: 'flex', alignItems: 'center', justifyContent: 'space-between', padding: `14px ${PX(vp)}px`, gap: 14 }}>
          <a href="EMH_02_Florida_Concierge_Homepage_Current.html" style={{ display: 'flex', alignItems: 'center', gap: 10, textDecoration: 'none', color: 'inherit', minWidth: 0 }}>
            <EMHMark color={p.ink} size={24} />
            <div style={{ fontFamily: T.display, fontWeight: 500, fontSize: 15.5, letterSpacing: '-0.012em', whiteSpace: 'nowrap', overflow: 'hidden', textOverflow: 'ellipsis' }}>Every Man's Health</div>
          </a>
          <div style={{ display: 'flex', alignItems: 'center', gap: 10, flexShrink: 0 }}>
            <button onClick={() => setOpen((o) => !o)} aria-expanded={open} aria-label="Menu"
              style={{ fontFamily: T.body, fontSize: 13, fontWeight: 500, padding: '9px 12px', background: 'transparent', color: p.ink, border: `1px solid ${p.ink}33`, borderRadius: 2, cursor: 'pointer', display: 'inline-flex', alignItems: 'center', gap: 6 }}>
              Menu<span style={{ display: 'inline-block', transform: open ? 'rotate(180deg)' : 'none', transition: 'transform .18s', fontSize: 9 }}>▾</span>
            </button>
            {!vp.isPhone && applyBtn}
          </div>
        </div>
        {open && (
          <div style={{ borderTop: `1px solid ${p.ink}14`, padding: `8px ${PX(vp)}px 16px`, display: 'flex', flexDirection: 'column' }}>
            {items.map(({ label, href }) => (
              <a key={label} href={href} onClick={() => setOpen(false)} style={{ fontSize: 15, color: p.ink, textDecoration: 'none', padding: '13px 0', borderBottom: `1px solid ${p.ink}10` }}>{label}</a>
            ))}
            <a href={PORTAL} target="_blank" rel="noopener noreferrer" style={{ fontSize: 15, color: p.inkSoft, textDecoration: 'none', padding: '13px 0' }}>Patient Portal</a>
            <div style={{ marginTop: 10 }}>{applyBtn}</div>
          </div>
        )}
      </div>
    );
  }
  return (
    <div style={{ position: 'sticky', top: 0, zIndex: 10, background: `${p.cream}f0`, backdropFilter: 'blur(10px)', borderBottom: `1px solid ${p.ink}1a` }}>
      <div style={{ ...S.container, display: 'flex', alignItems: 'center', padding: `20px ${PX(vp)}px`, gap: vp.isTablet ? 24 : 40 }}>
        <a href="EMH_02_Florida_Concierge_Homepage_Current.html" style={{ display: 'flex', alignItems: 'center', gap: 12, textDecoration: 'none', color: 'inherit' }}>
          <EMHMark color={p.ink} size={26} />
          <div style={{ fontFamily: T.display, fontWeight: 500, fontSize: 17, letterSpacing: '-0.012em', whiteSpace: 'nowrap' }}>Every Man's Health</div>
        </a>
        <div style={{ flex: 1, display: 'flex', justifyContent: 'center', gap: vp.isTablet ? 22 : 32 }}>
          {items.map(({ label, href }) => (
            <a key={label} href={href} onMouseEnter={() => setHover(label)} onMouseLeave={() => setHover(null)}
               style={{ fontSize: 13.5, color: hover === label ? p.ink : p.inkSoft, textDecoration: 'none', transition: 'color .12s', position: 'relative', padding: '4px 0', whiteSpace: 'nowrap' }}>
              {label}
              {hover === label && <span style={{ position: 'absolute', left: 0, right: 0, bottom: -2, height: 1, background: p.accent }} />}
            </a>
          ))}
        </div>
        <div style={{ display: 'flex', alignItems: 'center', gap: 18 }}>
          {!vp.isTablet && <a href={PORTAL} target="_blank" rel="noopener noreferrer" style={{ fontSize: 13.5, color: p.inkSoft, textDecoration: 'none', whiteSpace: 'nowrap' }}>Patient Portal</a>}
          {applyBtn}
        </div>
      </div>
    </div>
  );
}

function LegalFooter({ p, T, S, vp }) {
  const cols = [
    ['Practice',  ['The Practice', 'Care model', 'Membership', 'Insights']],
    ['Care',      ['Preventive', 'Hormone health', 'Metabolic', 'Sexual', 'Cognitive', 'Longevity']],
    ['Resources', ['Care model', 'Membership', 'Apply', 'FAQ']],
    ['Company',   ['The Practice', 'Careers', 'Press', 'Apply']],
  ];
  const gridCols = vp.isPhone ? '1fr 1fr' : vp.isMobile ? 'repeat(3, 1fr)' : '1.4fr repeat(4, 1fr)';
  return (
    <footer style={{ background: p.cream, padding: `${SY(vp, 72)}px ${PX(vp)}px 36px`, maxWidth: 1440, margin: '0 auto' }}>
      <div style={{ display: 'grid', gridTemplateColumns: gridCols, gap: vp.isMobile ? 32 : 48, marginBottom: vp.isMobile ? 40 : 60 }}>
        <div style={{ gridColumn: vp.isMobile ? '1 / -1' : 'auto' }}>
          <div style={{ display: 'flex', alignItems: 'center', gap: 12, marginBottom: 18 }}>
            <EMHMark color={p.ink} size={26} />
            <span style={{ fontFamily: T.display, fontSize: 17, fontWeight: 500 }}>Every Man's Health</span>
          </div>
          <p style={{ fontSize: 13.5, lineHeight: 1.6, color: p.inkSoft, maxWidth: 280, margin: 0 }}>
            A Florida concierge men's health practice. Physician-led, lab-guided, data-informed — by application.
          </p>
          <div style={{ marginTop: 18, fontSize: 12.5, lineHeight: 1.7, color: p.inkSoft }}>
            9401 SW Highway 200, STE 502<br />Ocala, FL 34481-9650<br />
            <span style={{ color: p.muted }}>Tel</span> (352) 861-2115 &nbsp;·&nbsp; <span style={{ color: p.muted }}>Fax</span> (352) 854-5726<br />
            <span style={{ color: p.muted }}>Mon–Thu</span> 8:00 AM – 3:30 PM<br />
            <a href="mailto:membership@everymanshealth.com" style={{ color: 'inherit', textDecoration: 'none' }}>membership@everymanshealth.com</a>
          </div>
        </div>
        {cols.map(([title, items]) => (
          <div key={title}>
            <div style={{ ...S.mono, fontSize: 10, color: p.muted, marginBottom: 14 }}>{title}</div>
            <ul style={{ listStyle: 'none', padding: 0, margin: 0, display: 'flex', flexDirection: 'column', gap: 8 }}>
              {items.map((i) => <li key={i} style={{ fontSize: 13.5, color: p.inkSoft }}>{i}</li>)}
            </ul>
          </div>
        ))}
      </div>
      <div style={{ borderTop: `1px solid ${p.ink}1a`, paddingTop: 24, display: 'flex', justifyContent: 'space-between', alignItems: 'flex-start', gap: 32, flexDirection: vp.isMobile ? 'column' : 'row' }}>
        <p style={{ fontSize: 11.5, lineHeight: 1.55, color: p.muted, margin: 0, maxWidth: 760 }}>
          Information presented on this site is for educational purposes and does not constitute medical advice. Routine blood and biomarker testing is coordinated through trusted laboratory partners; specialized pathology and molecular diagnostic testing may be supported through affiliated CAP/CLIA laboratory infrastructure when clinically indicated. Technology, including AI-assisted organization of laboratory and health data, supports physician review; clinical interpretation and treatment decisions are made by licensed physicians on a case-by-case basis. Compounded medications, when used, are dispensed by 503A pharmacies in compliance with applicable regulations. Practice based in Florida; telehealth follow-up available where licensed.
        </p>
        <div style={{ ...S.mono, fontSize: 10, color: p.muted, textAlign: vp.isMobile ? 'left' : 'right' }}>
          © 2026 Every Man's Health. All rights reserved.<br />
          {LEGAL_LINKS.slice(0, 3).map(([l, h], i) => <React.Fragment key={h}>{i > 0 && ' · '}<a href={h} style={{ color: 'inherit', textDecoration: 'none' }}>{l}</a></React.Fragment>)}<br />
          {LEGAL_LINKS.slice(3).map(([l, h], i) => <React.Fragment key={h}>{i > 0 && ' · '}<a href={h} style={{ color: 'inherit', textDecoration: 'none' }}>{l}</a></React.Fragment>)}
        </div>
      </div>
    </footer>
  );
}

function LegalPage() {
  const [t, setTweak] = useTweaks(window.TWEAK_DEFAULTS);
  const vp = useViewport();
  const p = PALETTES[t.palette];
  const T = TYPES[t.typePair];
  const page = PAGES[window.LEGAL_PAGE] || PAGES.privacy;

  const S = {
    base:      { background: p.cream, color: p.ink, fontFamily: T.body, fontSize: 15.5, lineHeight: 1.55, letterSpacing: '-0.005em' },
    display:   { fontFamily: T.display, fontWeight: T.displayWeight, letterSpacing: T.displayTracking, color: p.ink },
    mono:      { fontFamily: T.mono, letterSpacing: '0.14em', textTransform: 'uppercase' },
    container: { padding: `0 ${PX(vp)}px`, position: 'relative', maxWidth: 1440, margin: '0 auto' },
  };
  const readW = 740; // comfortable legal reading measure

  return (
    <div style={S.base}>
      <LegalNav p={p} T={T} S={S} vp={vp} />

      {/* Title block */}
      <section style={{ ...S.container, padding: `${SY(vp, 80)}px ${PX(vp)}px ${SY(vp, 40)}px`, borderBottom: `1px solid ${p.ink}14` }}>
        <div style={{ maxWidth: readW }}>
          <div style={{ ...S.mono, fontSize: 11, color: p.accent, marginBottom: 20 }}>{page.eyebrow}</div>
          <h1 style={{ ...S.display, fontSize: vp.isPhone ? 34 : 48, lineHeight: 1.06, margin: 0, marginBottom: 22, textWrap: 'balance' }}>{page.title}</h1>
          <p style={{ fontSize: 16.5, lineHeight: 1.65, color: p.inkSoft, margin: 0 }}>{page.intro}</p>
          <div style={{ ...S.mono, fontSize: 10, color: p.muted, marginTop: 24 }}>Last updated · {LAST_UPDATED}</div>
        </div>
      </section>

      {/* Body */}
      <section style={{ ...S.container, padding: `${SY(vp, 56)}px ${PX(vp)}px ${SY(vp, 80)}px` }}>
        <div style={{ maxWidth: readW, display: 'flex', flexDirection: 'column', gap: 40 }}>
          {page.sections.map((sec, i) => (
            <div key={i}>
              <h2 style={{ ...S.display, fontSize: vp.isPhone ? 21 : 24, lineHeight: 1.2, margin: 0, marginBottom: 16 }}>{sec.h}</h2>
              {(sec.p || []).map((para, j) => (
                <p key={j} style={{ fontSize: 15.5, lineHeight: 1.7, color: p.inkSoft, margin: 0, marginBottom: 14 }}>{para}</p>
              ))}
              {sec.ul && (
                <ul style={{ listStyle: 'none', padding: 0, margin: '4px 0 0', display: 'flex', flexDirection: 'column', gap: 12 }}>
                  {sec.ul.map((item, k) => (
                    <li key={k} style={{ paddingLeft: 22, position: 'relative', fontSize: 15.5, lineHeight: 1.6, color: p.inkSoft }}>
                      <span style={{ position: 'absolute', left: 0, top: 12, width: 12, height: 1, background: p.accent }} />
                      {item}
                    </li>
                  ))}
                </ul>
              )}
            </div>
          ))}

          {/* Contact block — consistent across legal pages */}
          <div style={{ marginTop: 8, paddingTop: 32, borderTop: `1px solid ${p.ink}1a` }}>
            <div style={{ ...S.mono, fontSize: 10.5, color: p.accent, marginBottom: 16 }}>Contact</div>
            <p style={{ fontSize: 15, lineHeight: 1.7, color: p.ink, margin: 0 }}>
              {ENTITY}<br />
              9401 SW Highway 200, STE 502<br />
              Ocala, FL 34481-9650<br />
              <span style={{ color: p.muted }}>Tel</span> (352) 861-2115 &nbsp;·&nbsp; <span style={{ color: p.muted }}>Fax</span> (352) 854-5726<br />
              <a href="mailto:membership@everymanshealth.com" style={{ color: p.ink, textDecoration: 'none', borderBottom: `1px solid ${p.accent}66` }}>membership@everymanshealth.com</a><br />
              <span style={{ color: p.muted }}>Office hours</span> Monday–Thursday, 8:00 AM–3:30 PM
            </p>
            <p style={{ fontSize: 13, lineHeight: 1.65, color: p.muted, margin: '18px 0 0', maxWidth: readW }}>
              This page is provided for general informational purposes and does not constitute legal or medical advice.
            </p>
          </div>
        </div>
      </section>

      <LegalFooter p={p} T={T} S={S} vp={vp} />

      <TweaksPanel title="Tweaks">
        <TweakSection label="Palette">
          <TweakColor label="Theme" value={t.palette}
            options={[['#0E1E3A', '#F2EBDD', '#B8965B'], ['#0A1628', '#ECE6D9', '#3FB6C2'], ['#142244', '#EFE4D0', '#7A8F6E']]}
            onChange={(v) => {
              const map = { '["#0e1e3a","#f2ebdd","#b8965b"]': 'marine', '["#0a1628","#ece6d9","#3fb6c2"]': 'graphite', '["#142244","#efe4d0","#7a8f6e"]': 'atlantic' };
              setTweak('palette', map[JSON.stringify(v).toLowerCase()] || 'marine');
            }} />
        </TweakSection>
        <TweakSection label="Typography">
          <TweakRadio label="Pairing" value={t.typePair}
            options={[{ value: 'editorial', label: 'Editorial' }, { value: 'clinical', label: 'Clinical' }, { value: 'technical', label: 'Technical' }]}
            onChange={(v) => setTweak('typePair', v)} />
        </TweakSection>
      </TweaksPanel>
    </div>
  );
}

function __mountLegal() {
  if (window.PALETTES && window.TYPES && window.useTweaks && window.TweaksPanel && window.EMHMark) {
    try {
      ReactDOM.createRoot(document.getElementById('root')).render(<LegalPage />);
    } catch (e) {
      document.getElementById('root').innerHTML = '<pre style="padding:24px;color:#900;white-space:pre-wrap;font:12px ui-monospace">' + (e && e.stack || e) + '</pre>';
      throw e;
    }
  } else {
    setTimeout(__mountLegal, 30);
  }
}
__mountLegal();
