<?xml version="1.0" encoding="UTF-8"?>
<rss 
  version="2.0"
  xmlns:dc="http://purl.org/dc/elements/1.1/"
  xmlns:content="http://purl.org/rss/1.0/modules/content/"
  xmlns:atom="http://www.w3.org/2005/Atom"
  xmlns:media="http://search.yahoo.com/mrss/"
  xmlns:wfw="http://wellformedweb.org/CommentAPI/"
  xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
  xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
  xmlns:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd"
  xmlns:rawvoice="http://www.rawvoice.com/rawvoiceRssModule/"
  xmlns:googleplay="http://www.google.com/schemas/play-podcasts/1.0">

  <channel>
    <atom:link href="https://ayse-akyuz.com/rss/" rel="self" type="application/rss+xml" />
    <title>Your dietician for a healthy and happy life</title>
    <link>https://ayse-akyuz.com</link>
    <description>Trusted strategies, meal plans, and recovery tips designed for athletes at every level</description>
    <language>en</language>
    <copyright>Your dietician for a healthy and happy life Copyright 2026</copyright>
    <lastBuildDate>Wed, 15 Apr 2026 00:36:26 +0000</lastBuildDate>
    <itunes:author>Your dietician for a healthy and happy life</itunes:author>
    <itunes:summary>Trusted strategies, meal plans, and recovery tips designed for athletes at every level</itunes:summary>
    <itunes:owner>
      <itunes:name>Your Name</itunes:name>
      <itunes:email>youremail@example.com</itunes:email>
    </itunes:owner>
    <itunes:explicit>no</itunes:explicit>
    <itunes:image href="https://storage.ghost.io/c/19/20/192012e9-8380-4771-b514-3cb716bfccdf/content/images/2025/08/favicon-60x60.png" />
    <itunes:category text="Technology"></itunes:category>

        <item>
          <title>Protein‑Packed Healthy Pancakes</title>
          <link>https://ayse-akyuz.com/protein-packed-healthy-pancakes/</link>
          <description></description>
          <pubDate>Mon, 25 Aug 2025 18:33:28 +0000</pubDate>
          <guid isPermaLink="false"><![CDATA[ 68aca7e32c7136000105e5ec ]]></guid>
          <category><![CDATA[ Recipes ]]></category>
          <content:encoded><![CDATA[ <p><strong>Serves:</strong> 2<br><strong>Time:</strong> 15 minutes<br><strong>Great for:</strong> Post‑workout breakfast or snack</p><h2 id="ingredients">Ingredients</h2><ul><li>1 ripe banana</li><li>2 large eggs</li><li>½ cup rolled oats (or oat flour)</li><li>½ cup low‑fat Greek yogurt</li><li>½ tsp baking powder</li><li>½ tsp cinnamon (optional)</li><li>Pinch of salt</li><li>1 tsp olive or coconut oil (for the pan)</li></ul><p><strong>Optional add‑ins:</strong> 1 scoop vanilla protein powder; blueberries or chopped apple; a few dark‑chocolate chips</p><h2 id="steps">Steps</h2><h3 id="1-blend-the-batter">1) Blend the batter</h3><p>Banana, eggs, oats, yogurt and spices in a blender for pancake batter.”<br><em>Blend until smooth. Add 1–2 tbsp milk/water if too thick.</em></p><figure class="kg-card kg-image-card"><img src="https://storage.ghost.io/c/19/20/192012e9-8380-4771-b514-3cb716bfccdf/content/images/2025/08/ChatGPT-Image-Aug-25--2025--08_17_46-PM-1-1-1.png" class="kg-image" alt="" loading="lazy" width="480" height="511"></figure><h3 id="2-heat-the-pan">2) Heat the pan</h3><p>Lightly oiled non‑stick pan heating over medium heat. Make sure it is just a thin film of oil on the pan</p><h3 id="3-pour-the-batter-onto-the-pan">3) Pour the batter onto the pan</h3><p><em>Cook 2–3 minutes until bubbles appear on top then flip the pancakes and cook for 1-2 more minutes until golden</em> </p><h3 id="4-stack-serve">4) Stack &amp; serve</h3><p>Stack the pancakes and top with Greek yogurt and fresh berries<br>Optional:<em> add a drizzle of honey or spoon of nut butter.</em></p> ]]></content:encoded>
          <enclosure url="" length="0" type="audio/mpeg" />
          <itunes:title>Protein‑Packed Healthy Pancakes</itunes:title>
          <itunes:author>Ayse Akyuz</itunes:author>
          <itunes:subtitle></itunes:subtitle>
          <itunes:summary><![CDATA[ <p><strong>Serves:</strong> 2<br><strong>Time:</strong> 15 minutes<br><strong>Great for:</strong> Post‑workout breakfast or snack</p><h2 id="ingredients">Ingredients</h2><ul><li>1 ripe banana</li><li>2 large eggs</li><li>½ cup rolled oats (or oat flour)</li><li>½ cup low‑fat Greek yogurt</li><li>½ tsp baking powder</li><li>½ tsp cinnamon (optional)</li><li>Pinch of salt</li><li>1 tsp olive or coconut oil (for the pan)</li></ul><p><strong>Optional add‑ins:</strong> 1 scoop vanilla protein powder; blueberries or chopped apple; a few dark‑chocolate chips</p><h2 id="steps">Steps</h2><h3 id="1-blend-the-batter">1) Blend the batter</h3><p>Banana, eggs, oats, yogurt and spices in a blender for pancake batter.”<br><em>Blend until smooth. Add 1–2 tbsp milk/water if too thick.</em></p><figure class="kg-card kg-image-card"><img src="https://storage.ghost.io/c/19/20/192012e9-8380-4771-b514-3cb716bfccdf/content/images/2025/08/ChatGPT-Image-Aug-25--2025--08_17_46-PM-1-1-1.png" class="kg-image" alt="" loading="lazy" width="480" height="511"></figure><h3 id="2-heat-the-pan">2) Heat the pan</h3><p>Lightly oiled non‑stick pan heating over medium heat. Make sure it is just a thin film of oil on the pan</p><h3 id="3-pour-the-batter-onto-the-pan">3) Pour the batter onto the pan</h3><p><em>Cook 2–3 minutes until bubbles appear on top then flip the pancakes and cook for 1-2 more minutes until golden</em> </p><h3 id="4-stack-serve">4) Stack &amp; serve</h3><p>Stack the pancakes and top with Greek yogurt and fresh berries<br>Optional:<em> add a drizzle of honey or spoon of nut butter.</em></p> ]]></itunes:summary>
            <itunes:image href="https://storage.ghost.io/c/19/20/192012e9-8380-4771-b514-3cb716bfccdf/content/images/2025/08/ChatGPT-Image-Aug-25--2025--08_31_48-PM-2-1-1-1.png" />
          <itunes:explicit>no</itunes:explicit>
        </item>
        <item>
          <title>Basal metabolic rate (BMR) calculator</title>
          <link>https://ayse-akyuz.com/basal-metabolic-rate-bmr-calculator/</link>
          <description></description>
          <pubDate>Mon, 25 Aug 2025 10:28:25 +0000</pubDate>
          <guid isPermaLink="false"><![CDATA[ 68ac39fe27c4c60001707432 ]]></guid>
          <category><![CDATA[ Calculators ]]></category>
          <content:encoded><![CDATA[ 
<!--kg-card-begin: html-->
<div class="bmr-wrap" id="bmr-calculator" translate="no">
  <style>
    .bmr-wrap{--bg:#fff;--fg:#111827;--muted:#6b7280;--line:#e5e7eb;--accent:#2563eb;--ring:#93c5fd;
      max-width:720px;margin:2rem auto;padding:1.25rem 1.5rem;background:var(--bg);color:var(--fg);
      border:1px solid var(--line);border-radius:16px;font:16px/1.5 system-ui,-apple-system,Segoe UI,Roboto,Inter,Arial}
    .bmr-wrap h3{margin:0 0 .75rem;font-size:1.25rem}
    .bmr-grid{display:grid;grid-template-columns:1fr 1fr;gap:12px}
    .bmr-row{display:flex;gap:10px;align-items:center;flex-wrap:wrap;margin:.25rem 0 .5rem}
    label{font-weight:600;font-size:.95rem}
    input[type="number"],select{width:100%;padding:.6rem .7rem;border:1px solid #d1d5db;border-radius:10px;background:#fff}
    input:focus,select:focus{outline:none;border-color:var(--accent);box-shadow:0 0 0 3px var(--ring)}
    .muted{color:var(--muted);font-size:.9rem}
    .bmr-actions{display:flex;gap:10px;align-items:center;margin-top:.5rem;flex-wrap:wrap}
    .btn{appearance:none;border:0;border-radius:999px;background:var(--accent);color:#fff;padding:.65rem 1rem;font-weight:700;cursor:pointer}
    .btn:focus{outline:none;box-shadow:0 0 0 3px var(--ring)}
    .out{margin-top:1rem;border-top:1px dashed var(--line);padding-top:1rem}
    .val{font-size:1.75rem;font-weight:800}
    .note{margin-top:.25rem;font-size:.9rem}
    .seg{display:flex;gap:12px;flex-wrap:wrap}
    .seg label{font-weight:600}
    .seg input[type="radio"]{transform:translateY(1px)}
    @media (max-width:560px){.bmr-grid{grid-template-columns:1fr}}
  </style>

 
  <div class="bmr-row seg" role="radiogroup" aria-label="Units">
    <label><input type="radio" name="units" value="metric" checked> Metric (kg, cm)</label>
    <label><input type="radio" name="units" value="imperial"> Imperial (lb, ft/in)</label>
  </div>

  <div class="bmr-grid">
    <div>
      <label for="sex">Sex (for equation)</label>
      <select id="sex" aria-label="Sex for equation">
        <option value="female">Female</option>
        <option value="male">Male</option>
      </select>
    </div>
    <div>
      <label for="age">Age</label>
      <input id="age" type="number" min="14" max="99" inputmode="numeric" placeholder="Years">
    </div>

    <div id="metric-weight">
      <label for="kg">Weight</label>
      <input id="kg" type="number" min="20" max="300" step="0.1" placeholder="kg">
    </div>
    <div id="metric-height">
      <label for="cm">Height</label>
      <input id="cm" type="number" min="120" max="230" step="0.1" placeholder="cm">
    </div>

    <div id="imperial-weight" style="display:none">
      <label for="lb">Weight</label>
      <input id="lb" type="number" min="50" max="660" step="0.1" placeholder="lb">
    </div>
    <div id="imperial-height" style="display:none">
      <label>Height</label>
      <div class="bmr-row" style="gap:8px">
        <input id="ft" type="number" min="3" max="7" placeholder="ft" style="flex:1">
        <input id="inch" type="number" min="0" max="11" step="0.1" placeholder="in" style="flex:1">
      </div>
    </div>
  </div>

  <div class="bmr-row" style="margin-top:.5rem">
    <label for="formula">Formula</label>
    <select id="formula" aria-label="Formula">
      <option value="msj" selected>Mifflin–St Jeor (default)</option>
      <option value="hb">Harris–Benedict (revised)</option>
    </select>
  </div>

  <div class="bmr-actions">
    <button class="btn" id="calcBMR">Calculate BMR</button>
    <span class="muted">BMR = calories your body burns at rest (kcal/day).</span>
  </div>

  <div class="out" aria-live="polite" id="bmr-output" hidden>
    <div class="val" id="bmr-kcal">0 kcal/day</div>
    <div class="muted" id="bmr-kj">0 kJ/day</div>
    <div class="note" id="bmr-note">—</div>
  </div>

  <script>
    (function(){
      const byId = id => document.getElementById(id);
      const sexEl = byId('sex'), ageEl = byId('age'), kgEl = byId('kg'), cmEl = byId('cm'),
            lbEl = byId('lb'), ftEl = byId('ft'), inchEl = byId('inch'),
            unitsRadios = document.querySelectorAll('input[name="units"]'),
            metricW = byId('metric-weight'), metricH = byId('metric-height'),
            impW = byId('imperial-weight'), impH = byId('imperial-height'),
            formulaEl = byId('formula'), btn = byId('calcBMR'),
            out = byId('bmr-output'), kcalEl = byId('bmr-kcal'), kjEl = byId('bmr-kj'), noteEl = byId('bmr-note');

      function toMetric(){
        const isMetric = document.querySelector('input[name="units"]:checked').value === 'metric';
        metricW.style.display = metricH.style.display = isMetric ? '' : 'none';
        impW.style.display = impH.style.display = isMetric ? 'none' : '';
      }

      unitsRadios.forEach(r => r.addEventListener('change', toMetric));
      toMetric();

      function sanitize(v){ return isFinite(v) && v>0 ? v : NaN; }

      function getInputs(){
        const sex = sexEl.value;
        const age = sanitize(parseFloat(ageEl.value));
        let kg, cm;

        const isMetric = document.querySelector('input[name="units"]:checked').value === 'metric';
        if(isMetric){
          kg = sanitize(parseFloat(kgEl.value));
          cm = sanitize(parseFloat(cmEl.value));
        } else {
          const lb = sanitize(parseFloat(lbEl.value));
          const ft = sanitize(parseFloat(ftEl.value));
          const inch = sanitize(parseFloat(inchEl.value));
          if(!isNaN(lb)) kg = lb * 0.45359237;
          if(!isNaN(ft) || !isNaN(inch)){
            const totalIn = (isNaN(ft)?0:ft)*12 + (isNaN(inch)?0:inch);
            cm = totalIn * 2.54;
          }
        }
        return {sex, age, kg, cm};
      }

      function bmrMSJ({sex, age, kg, cm}){
        // Mifflin–St Jeor
        if(sex === 'male') return 10*kg + 6.25*cm - 5*age + 5;
        return 10*kg + 6.25*cm - 5*age - 161;
      }
      function bmrHB({sex, age, kg, cm}){
        // Harris–Benedict (revised)
        if(sex === 'male') return 88.362 + 13.397*kg + 4.799*cm - 5.677*age;
        return 447.593 + 9.247*kg + 3.098*cm - 4.330*age;
      }

      function format(n){ return Math.round(n).toLocaleString(); }

      btn.addEventListener('click', function(){
        const i = getInputs();
        if([i.age, i.kg, i.cm].some(v => isNaN(v))){
          out.hidden = false;
          kcalEl.textContent = '—';
          kjEl.textContent = '';
          noteEl.textContent = 'Please enter valid age, weight, and height.';
          return;
        }
        const bmr = (formulaEl.value === 'hb' ? bmrHB(i) : bmrMSJ(i));
        const kj = bmr * 4.184;

        out.hidden = false;
        kcalEl.textContent = `${format(bmr)} kcal/day`;
        kjEl.textContent = `${format(kj)} kJ/day`;

        noteEl.textContent =
          'Tip: To estimate maintenance calories (TDEE), multiply BMR by an activity factor (e.g., 1.2 sedentary → 1.9 very active).';
      });
    })();
  </script>

  <p class="muted" style="margin-top:.75rem">
    Note: BMR is an estimate. Individual needs vary by body composition, hormones, and training status.
  </p>
</div>
<!--kg-card-end: html-->
 ]]></content:encoded>
          <enclosure url="" length="0" type="audio/mpeg" />
          <itunes:title>Basal metabolic rate (BMR) calculator</itunes:title>
          <itunes:author>Ayse Akyuz</itunes:author>
          <itunes:subtitle></itunes:subtitle>
          <itunes:summary><![CDATA[ 
<!--kg-card-begin: html-->
<div class="bmr-wrap" id="bmr-calculator" translate="no">
  <style>
    .bmr-wrap{--bg:#fff;--fg:#111827;--muted:#6b7280;--line:#e5e7eb;--accent:#2563eb;--ring:#93c5fd;
      max-width:720px;margin:2rem auto;padding:1.25rem 1.5rem;background:var(--bg);color:var(--fg);
      border:1px solid var(--line);border-radius:16px;font:16px/1.5 system-ui,-apple-system,Segoe UI,Roboto,Inter,Arial}
    .bmr-wrap h3{margin:0 0 .75rem;font-size:1.25rem}
    .bmr-grid{display:grid;grid-template-columns:1fr 1fr;gap:12px}
    .bmr-row{display:flex;gap:10px;align-items:center;flex-wrap:wrap;margin:.25rem 0 .5rem}
    label{font-weight:600;font-size:.95rem}
    input[type="number"],select{width:100%;padding:.6rem .7rem;border:1px solid #d1d5db;border-radius:10px;background:#fff}
    input:focus,select:focus{outline:none;border-color:var(--accent);box-shadow:0 0 0 3px var(--ring)}
    .muted{color:var(--muted);font-size:.9rem}
    .bmr-actions{display:flex;gap:10px;align-items:center;margin-top:.5rem;flex-wrap:wrap}
    .btn{appearance:none;border:0;border-radius:999px;background:var(--accent);color:#fff;padding:.65rem 1rem;font-weight:700;cursor:pointer}
    .btn:focus{outline:none;box-shadow:0 0 0 3px var(--ring)}
    .out{margin-top:1rem;border-top:1px dashed var(--line);padding-top:1rem}
    .val{font-size:1.75rem;font-weight:800}
    .note{margin-top:.25rem;font-size:.9rem}
    .seg{display:flex;gap:12px;flex-wrap:wrap}
    .seg label{font-weight:600}
    .seg input[type="radio"]{transform:translateY(1px)}
    @media (max-width:560px){.bmr-grid{grid-template-columns:1fr}}
  </style>

 
  <div class="bmr-row seg" role="radiogroup" aria-label="Units">
    <label><input type="radio" name="units" value="metric" checked> Metric (kg, cm)</label>
    <label><input type="radio" name="units" value="imperial"> Imperial (lb, ft/in)</label>
  </div>

  <div class="bmr-grid">
    <div>
      <label for="sex">Sex (for equation)</label>
      <select id="sex" aria-label="Sex for equation">
        <option value="female">Female</option>
        <option value="male">Male</option>
      </select>
    </div>
    <div>
      <label for="age">Age</label>
      <input id="age" type="number" min="14" max="99" inputmode="numeric" placeholder="Years">
    </div>

    <div id="metric-weight">
      <label for="kg">Weight</label>
      <input id="kg" type="number" min="20" max="300" step="0.1" placeholder="kg">
    </div>
    <div id="metric-height">
      <label for="cm">Height</label>
      <input id="cm" type="number" min="120" max="230" step="0.1" placeholder="cm">
    </div>

    <div id="imperial-weight" style="display:none">
      <label for="lb">Weight</label>
      <input id="lb" type="number" min="50" max="660" step="0.1" placeholder="lb">
    </div>
    <div id="imperial-height" style="display:none">
      <label>Height</label>
      <div class="bmr-row" style="gap:8px">
        <input id="ft" type="number" min="3" max="7" placeholder="ft" style="flex:1">
        <input id="inch" type="number" min="0" max="11" step="0.1" placeholder="in" style="flex:1">
      </div>
    </div>
  </div>

  <div class="bmr-row" style="margin-top:.5rem">
    <label for="formula">Formula</label>
    <select id="formula" aria-label="Formula">
      <option value="msj" selected>Mifflin–St Jeor (default)</option>
      <option value="hb">Harris–Benedict (revised)</option>
    </select>
  </div>

  <div class="bmr-actions">
    <button class="btn" id="calcBMR">Calculate BMR</button>
    <span class="muted">BMR = calories your body burns at rest (kcal/day).</span>
  </div>

  <div class="out" aria-live="polite" id="bmr-output" hidden>
    <div class="val" id="bmr-kcal">0 kcal/day</div>
    <div class="muted" id="bmr-kj">0 kJ/day</div>
    <div class="note" id="bmr-note">—</div>
  </div>

  <script>
    (function(){
      const byId = id => document.getElementById(id);
      const sexEl = byId('sex'), ageEl = byId('age'), kgEl = byId('kg'), cmEl = byId('cm'),
            lbEl = byId('lb'), ftEl = byId('ft'), inchEl = byId('inch'),
            unitsRadios = document.querySelectorAll('input[name="units"]'),
            metricW = byId('metric-weight'), metricH = byId('metric-height'),
            impW = byId('imperial-weight'), impH = byId('imperial-height'),
            formulaEl = byId('formula'), btn = byId('calcBMR'),
            out = byId('bmr-output'), kcalEl = byId('bmr-kcal'), kjEl = byId('bmr-kj'), noteEl = byId('bmr-note');

      function toMetric(){
        const isMetric = document.querySelector('input[name="units"]:checked').value === 'metric';
        metricW.style.display = metricH.style.display = isMetric ? '' : 'none';
        impW.style.display = impH.style.display = isMetric ? 'none' : '';
      }

      unitsRadios.forEach(r => r.addEventListener('change', toMetric));
      toMetric();

      function sanitize(v){ return isFinite(v) && v>0 ? v : NaN; }

      function getInputs(){
        const sex = sexEl.value;
        const age = sanitize(parseFloat(ageEl.value));
        let kg, cm;

        const isMetric = document.querySelector('input[name="units"]:checked').value === 'metric';
        if(isMetric){
          kg = sanitize(parseFloat(kgEl.value));
          cm = sanitize(parseFloat(cmEl.value));
        } else {
          const lb = sanitize(parseFloat(lbEl.value));
          const ft = sanitize(parseFloat(ftEl.value));
          const inch = sanitize(parseFloat(inchEl.value));
          if(!isNaN(lb)) kg = lb * 0.45359237;
          if(!isNaN(ft) || !isNaN(inch)){
            const totalIn = (isNaN(ft)?0:ft)*12 + (isNaN(inch)?0:inch);
            cm = totalIn * 2.54;
          }
        }
        return {sex, age, kg, cm};
      }

      function bmrMSJ({sex, age, kg, cm}){
        // Mifflin–St Jeor
        if(sex === 'male') return 10*kg + 6.25*cm - 5*age + 5;
        return 10*kg + 6.25*cm - 5*age - 161;
      }
      function bmrHB({sex, age, kg, cm}){
        // Harris–Benedict (revised)
        if(sex === 'male') return 88.362 + 13.397*kg + 4.799*cm - 5.677*age;
        return 447.593 + 9.247*kg + 3.098*cm - 4.330*age;
      }

      function format(n){ return Math.round(n).toLocaleString(); }

      btn.addEventListener('click', function(){
        const i = getInputs();
        if([i.age, i.kg, i.cm].some(v => isNaN(v))){
          out.hidden = false;
          kcalEl.textContent = '—';
          kjEl.textContent = '';
          noteEl.textContent = 'Please enter valid age, weight, and height.';
          return;
        }
        const bmr = (formulaEl.value === 'hb' ? bmrHB(i) : bmrMSJ(i));
        const kj = bmr * 4.184;

        out.hidden = false;
        kcalEl.textContent = `${format(bmr)} kcal/day`;
        kjEl.textContent = `${format(kj)} kJ/day`;

        noteEl.textContent =
          'Tip: To estimate maintenance calories (TDEE), multiply BMR by an activity factor (e.g., 1.2 sedentary → 1.9 very active).';
      });
    })();
  </script>

  <p class="muted" style="margin-top:.75rem">
    Note: BMR is an estimate. Individual needs vary by body composition, hormones, and training status.
  </p>
</div>
<!--kg-card-end: html-->
 ]]></itunes:summary>
            <itunes:image href="https://storage.ghost.io/c/19/20/192012e9-8380-4771-b514-3cb716bfccdf/content/images/2025/08/ChatGPT-Image-Aug-25--2025--12_31_48-PM.png" />
          <itunes:explicit>no</itunes:explicit>
        </item>
        <item>
          <title>BMI Calculator</title>
          <link>https://ayse-akyuz.com/untitled/</link>
          <description></description>
          <pubDate>Tue, 19 Aug 2025 09:08:19 +0000</pubDate>
          <guid isPermaLink="false"><![CDATA[ 68a43ec85798030001b55216 ]]></guid>
          <category><![CDATA[ Calculators ]]></category>
          <content:encoded><![CDATA[ 
<!--kg-card-begin: html-->


<div id="bmi-calc" class="bmi-wrap" lang="en" translate="no">
  <style>
    /* Scoped styles (won't leak) */
    #bmi-calc {
      --bg: #ffffff;
      --fg: #111827;
      --muted: #6b7280;
      --ring: #e5e7eb;
      --accent: #2563eb;
      --ok: #059669;
      --warn: #d97706;
      --bad: #dc2626;
      --shadow: 0 10px 20px rgba(0,0,0,0.06), 0 6px 6px rgba(0,0,0,0.08);
      color: var(--fg);
      max-width: 720px;
      margin: 1.5rem auto;
      font-family: system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji", "Segoe UI Emoji";
    }
    #bmi-calc .card {
      background: var(--bg);
      border: 1px solid var(--ring);
      border-radius: 16px;
      box-shadow: var(--shadow);
      overflow: hidden;
    }
    #bmi-calc .header {
      padding: 1.25rem 1.25rem 0.75rem;
      border-bottom: 1px solid var(--ring);
    }
    #bmi-calc .title {
      margin: 0;
      font-size: 1.25rem;
      line-height: 1.2;
      font-weight: 700;
    }
    #bmi-calc .sub {
      margin: 0.25rem 0 0;
      color: var(--muted);
      font-size: 0.9375rem;
    }
    #bmi-calc .body {
      padding: 1.25rem;
    }
    #bmi-calc .grid {
      display: grid;
      grid-template-columns: 1fr;
      gap: 0.9rem;
    }
    @media (min-width: 640px) {
      #bmi-calc .grid-2 { grid-template-columns: 1fr 1fr; }
      #bmi-calc .grid-3 { grid-template-columns: 1fr 1fr 1fr; }
    }
    #bmi-calc label {
      display: block;
      font-size: 0.9rem;
      font-weight: 600;
      margin: 0 0 0.35rem;
    }
    #bmi-calc .field {
      display: flex;
      flex-direction: column;
    }
    #bmi-calc input[type="number"], #bmi-calc select {
      appearance: none;
      width: 100%;
      padding: 0.65rem 0.75rem;
      border: 1px solid var(--ring);
      border-radius: 10px;
      font-size: 1rem;
      outline: none;
      transition: border-color .15s ease, box-shadow .15s ease;
      background: #fff;
    }
    #bmi-calc input[type="number"]:focus, #bmi-calc select:focus {
      border-color: var(--accent);
      box-shadow: 0 0 0 3px rgba(37, 99, 235, .15);
    }
    #bmi-calc .hint {
      font-size: 0.8rem;
      color: var(--muted);
      margin-top: 0.25rem;
    }
    #bmi-calc .error {
      font-size: 0.82rem;
      color: var(--bad);
      margin-top: 0.3rem;
      display: none;
    }
    #bmi-calc .unit-toggle {
      display: inline-flex;
      gap: 0.5rem;
      background: #f9fafb;
      border: 1px solid var(--ring);
      border-radius: 999px;
      padding: 0.25rem;
      align-items: center;
    }
    #bmi-calc .seg {
      position: relative;
      display: inline-flex;
      align-items: center;
      gap: 0.5rem;
      padding: 0.4rem 0.8rem;
      border-radius: 999px;
      font-weight: 600;
      cursor: pointer;
      user-select: none;
      white-space: nowrap;
    }
    #bmi-calc .seg input { display: none; }
    #bmi-calc .seg.active {
      background: var(--bg);
      border: 1px solid var(--ring);
      box-shadow: var(--shadow);
    }
    #bmi-calc .btns {
      display: flex; gap: 0.6rem; flex-wrap: wrap; align-items: center;
      margin-top: 0.2rem;
    }
    #bmi-calc button {
      appearance: none;
      border: 1px solid var(--ring);
      background: var(--fg);
      color: white;
      padding: 0.7rem 1rem;
      border-radius: 12px;
      font-weight: 700;
      cursor: pointer;
      transition: transform .04s ease, filter .15s ease, background .15s ease;
    }
    #bmi-calc button:hover { filter: brightness(1.05); }
    #bmi-calc button:active { transform: translateY(1px); }
    #bmi-calc .ghost {
      background: #f9fafb; color: var(--fg);
    }
    #bmi-calc .result {
      margin-top: 1rem;
      border: 1px dashed var(--ring);
      border-radius: 12px;
      padding: 1rem;
    }
    #bmi-calc .row { display: flex; gap: 0.75rem; align-items: baseline; flex-wrap: wrap; }
    #bmi-calc .bmi-value {
      font-size: 2rem;
      font-weight: 800;
      letter-spacing: -0.5px;
    }
    #bmi-calc .badge {
      font-size: 0.85rem;
      padding: 0.25rem 0.6rem;
      border-radius: 999px;
      font-weight: 700;
      border: 1px solid var(--ring);
    }
    #bmi-calc .badge.ok { background: #ecfdf5; color: var(--ok); }
    #bmi-calc .badge.warn { background: #fffbeb; color: var(--warn); }
    #bmi-calc .badge.bad { background: #fef2f2; color: var(--bad); }
    #bmi-calc .range {
      margin-top: 0.35rem;
      font-size: 0.95rem;
      color: var(--muted);
    }
    #bmi-calc .context {
      margin-top: 0.35rem;
      font-size: 0.95rem;
    }
    #bmi-calc .context small { color: var(--muted); }
    #bmi-calc .disclaimer {
      margin-top: 0.75rem;
      font-size: 0.82rem;
      color: var(--muted);
    }
    #bmi-calc .hidden { display: none !important; }
    #bmi-calc .divider {
      height: 1px; background: var(--ring); margin: 0.5rem 0 0.75rem;
    }
  </style>

  <div class="card">
    <div class="header">
      
      <p class="sub">Body Mass Index with metric & imperial units, plus sex & somatotype context.</p>
    </div>

    <div class="body">
      <form id="bmi-form" novalidate>
        <div class="btns" role="radiogroup" aria-label="Units">
          <div class="unit-toggle">
            <label class="seg active" id="seg-metric">
              <input type="radio" name="unit" value="metric" checked aria-labelledby="seg-metric">
              Metric (kg, cm)
            </label>
            <label class="seg" id="seg-imperial">
              <input type="radio" name="unit" value="imperial" aria-labelledby="seg-imperial">
              Imperial (lb, ft+in)
            </label>
          </div>
        </div>

        <!-- Context selectors -->
        <div class="grid grid-2" style="margin-top: 0.9rem;">
          <div class="field">
            <label for="sex">Sex (for context)</label>
            <select id="sex" name="sex" autocomplete="off">
              <option value="unspecified" selected>Prefer not to say</option>
              <option value="female">Female</option>
              <option value="male">Male</option>
              <option value="intersex">Intersex / Other</option>
            </select>
            <p class="hint">BMI formula & cutoffs are the same; this only adjusts guidance text.</p>
          </div>
          <div class="field">
            <label for="somato">Somatotype (optional)</label>
            <select id="somato" name="somato" autocomplete="off">
              <option value="unspecified" selected>Not sure / Prefer not to say</option>
              <option value="ecto">Ectomorph (leaner frame)</option>
              <option value="meso">Mesomorph (more muscular)</option>
              <option value="endo">Endomorph (easier fat gain)</option>
            </select>
            <p class="hint">A broad frame-type heuristic; not medical.</p>
          </div>
        </div>

        <!-- Metric fields -->
        <div id="metric-fields" class="grid grid-2" style="margin-top: 0.6rem;">
          <div class="field">
            <label for="weight-kg">Weight (kg)</label>
            <input id="weight-kg" name="weight-kg" type="number" inputmode="decimal" min="1" step="0.1" placeholder="e.g., 70" autocomplete="off">
            <div class="error" id="err-kg">Please enter a valid weight in kilograms.</div>
          </div>
          <div class="field">
            <label for="height-cm">Height (cm)</label>
            <input id="height-cm" name="height-cm" type="number" inputmode="decimal" min="30" step="0.1" placeholder="e.g., 175" autocomplete="off">
            <div class="error" id="err-cm">Please enter a valid height in centimeters.</div>
          </div>
          <p class="hint" style="grid-column: 1 / -1;">Tip: 1.75 m = 175 cm</p>
        </div>

        <!-- Imperial fields -->
        <div id="imperial-fields" class="grid grid-3 hidden" style="margin-top: 0.6rem;">
          <div class="field">
            <label for="weight-lb">Weight (lb)</label>
            <input id="weight-lb" name="weight-lb" type="number" inputmode="decimal" min="1" step="0.1" placeholder="e.g., 154" autocomplete="off">
            <div class="error" id="err-lb">Please enter a valid weight in pounds.</div>
          </div>
          <div class="field">
            <label for="height-ft">Height (ft)</label>
            <input id="height-ft" name="height-ft" type="number" inputmode="numeric" min="1" step="1" placeholder="e.g., 5" autocomplete="off">
            <div class="error" id="err-ft">Please enter feet (whole number).</div>
          </div>
          <div class="field">
            <label for="height-in">Height (in)</label>
            <input id="height-in" name="height-in" type="number" inputmode="decimal" min="0" step="0.1" placeholder="e.g., 9" autocomplete="off">
            <div class="error" id="err-in">Please enter inches (0–11.9).</div>
          </div>
          <p class="hint" style="grid-column: 1 / -1;">Tip: 5 ft 9 in = 69 in total</p>
        </div>

        <div class="btns" style="margin-top: 0.6rem;">
          <button type="submit" id="calc-btn" aria-label="Calculate BMI">Calculate BMI</button>
          <button type="button" class="ghost" id="reset-btn" aria-label="Reset form">Reset</button>
        </div>

        <div class="result" id="result" aria-live="polite" aria-atomic="true" style="display:none;">
          <div class="row">
            <div class="bmi-value" id="bmi-number">—</div>
            <span class="badge" id="bmi-badge">—</span>
          </div>
          <div class="range" id="range-text"></div>
          <div class="context" id="context-text"></div>
          <div class="divider"></div>
          <div class="disclaimer">
            BMI is a screening tool and does not directly assess body fat, muscle mass, or health. For personalized advice, consult a qualified professional.
          </div>
        </div>
      </form>
    </div>
  </div>

  <script>
    (function () {
      const root = document.getElementById('bmi-calc');
      if (!root) return;
      const $ = sel => root.querySelector(sel);

      const segMetric = $('#seg-metric');
      const segImperial = $('#seg-imperial');
      const metricFields = $('#metric-fields');
      const imperialFields = $('#imperial-fields');

      const kg = $('#weight-kg');
      const cm = $('#height-cm');
      const lb = $('#weight-lb');
      const ft = $('#height-ft');
      const inch = $('#height-in');

      const errKg = $('#err-kg');
      const errCm = $('#err-cm');
      const errLb = $('#err-lb');
      const errFt = $('#err-ft');
      const errIn = $('#err-in');

      const sexSel = $('#sex');
      const somatoSel = $('#somato');

      const form = $('#bmi-form');
      const resultBox = $('#result');
      const bmiNumber = $('#bmi-number');
      const badge = $('#bmi-badge');
      const rangeText = $('#range-text');
      const contextText = $('#context-text');

      function setUnit(unit) {
        const isMetric = unit === 'metric';
        metricFields.classList.toggle('hidden', !isMetric);
        imperialFields.classList.toggle('hidden', isMetric);
        segMetric.classList.toggle('active', isMetric);
        segImperial.classList.toggle('active', !isMetric);
        clearErrors();
        if (resultBox.style.display !== 'none') showResult(false);
      }

      // Toggle via label click
      segMetric.addEventListener('click', () => {
        segMetric.querySelector('input').checked = true;
        setUnit('metric');
      });
      segImperial.addEventListener('click', () => {
        segImperial.querySelector('input').checked = true;
        setUnit('imperial');
      });

      function showError(el, msgEl, cond) {
        if (cond) {
          el.setAttribute('aria-invalid', 'true');
          msgEl.style.display = 'block';
        } else {
          el.removeAttribute('aria-invalid');
          msgEl.style.display = 'none';
        }
      }
      function clearErrors() {
        [kg, cm, lb, ft, inch].forEach(i => i && i.removeAttribute('aria-invalid'));
        [errKg, errCm, errLb, errFt, errIn].forEach(e => e && (e.style.display = 'none'));
      }

      function toNum(v) {
        const n = parseFloat(String(v).replace(',', '.'));
        return Number.isFinite(n) ? n : NaN;
      }

      function classify(bmi) {
        if (bmi < 18.5) return { label: 'Underweight', tone: 'warn' };
        if (bmi < 25)   return { label: 'Normal', tone: 'ok' };
        if (bmi < 30)   return { label: 'Overweight', tone: 'warn' };
        return { label: 'Obesity', tone: 'bad' };
      }

      function fmt1(x) { return (Math.round(x * 10) / 10).toFixed(1); }

      function showResult(show) {
        resultBox.style.display = show ? 'block' : 'none';
      }

      function calcMetric() {
        const w = toNum(kg.value);
        const hcm = toNum(cm.value);
        const wBad = !(w > 0 && w < 650);
        const hBad = !(hcm > 30 && hcm < 300);

        showError(kg, errKg, wBad);
        showError(cm, errCm, hBad);
        if (wBad || hBad) return null;

        const hm = hcm / 100;
        const bmi = w / (hm * hm);
        const low = 18.5 * hm * hm;
        const high = 24.9 * hm * hm;

        return { bmi, range: `${fmt1(low)}–${fmt1(high)} kg` };
      }

      function calcImperial() {
        const w = toNum(lb.value);
        const feet = toNum(ft.value);
        const inches = toNum(inch.value);

        const wBad = !(w > 0 && w < 1400);
        const ftBad = !(feet >= 1 && feet < 9 && Number.isFinite(feet));
        const inBad = !(inches >= 0 && inches < 12.0 && Number.isFinite(inches));

        showError(lb, errLb, wBad);
        showError(ft, errFt, ftBad);
        showError(inch, errIn, inBad);
        if (wBad || ftBad || inBad) return null;

        const totalIn = feet * 12 + inches;
        if (!(totalIn > 12 && totalIn < 120)) {
          showError(ft, errFt, true);
          showError(inch, errIn, true);
          return null;
        }

        const bmi = 703 * (w / (totalIn * totalIn));
        const low = (18.5 * totalIn * totalIn) / 703;
        const high = (24.9 * totalIn * totalIn) / 703;

        return { bmi, range: `${fmt1(low)}–${fmt1(high)} lb` };
      }

      function buildContextText(sex, somato) {
        const notes = [];
        // Sex-based context (does not change BMI cutoffs)
        if (sex === 'female') {
          notes.push('BMI cutoffs are the same for women and men. As an extra context marker, a waist circumference above ~88 cm (35 in) is often associated with higher metabolic risk.');
        } else if (sex === 'male') {
          notes.push('BMI cutoffs are the same for women and men. As an extra context marker, a waist circumference above ~102 cm (40 in) is often associated with higher metabolic risk.');
        } else if (sex === 'intersex') {
          notes.push('BMI cutoffs are the same across sexes. Consider also tracking waist circumference alongside BMI.');
        } else {
          notes.push('BMI cutoffs are universal. Consider also tracking waist circumference, strength, and cardio fitness.');
        }

        // Somatotype (heuristic only)
        if (somato === 'ecto') {
          notes.push('<small>Somatotype:</small> Ectomorph tendency (leaner frame). Focus on adequate protein and progressive resistance training if gaining muscle is a goal.');
        } else if (somato === 'meso') {
          notes.push('<small>Somatotype:</small> Mesomorphic tendency (more muscular). BMI may overestimate body fat if muscle mass is high; body composition measures can add context.');
        } else if (somato === 'endo') {
          notes.push('<small>Somatotype:</small> Endomorphic tendency (easier fat gain). Consistency with nutrition, step count, and resistance training can help manage weight.');
        }

        return notes.join(' ');
      }

      function render(res) {
        const { bmi, range } = res;
        const c = classify(bmi);
        const sex = sexSel.value;
        const somato = somatoSel.value;

        bmiNumber.textContent = fmt1(bmi);
        badge.textContent = c.label;
        badge.className = 'badge ' + (c.tone === 'ok' ? 'ok' : (c.tone === 'warn' ? 'warn' : 'bad'));
        rangeText.textContent = `Healthy weight range for your height (BMI 18.5–24.9): ${range}.`;
        contextText.innerHTML = buildContextText(sex, somato);

        showResult(true);
      }

      form.addEventListener('submit', function (e) {
        e.preventDefault();
        clearErrors();
        const unit = root.querySelector('input[name="unit"]:checked')?.value || 'metric';
        const res = unit === 'metric' ? calcMetric() : calcImperial();
        if (res) render(res);
      });

      $('#reset-btn').addEventListener('click', function () {
        form.reset();
        clearErrors();
        setUnit('metric');
        showResult(false);
        [kg, cm, lb, ft, inch].forEach(inp => { if (inp) inp.value = ''; });
        sexSel.value = 'unspecified';
        somatoSel.value = 'unspecified';
      });

      // Calculate on Enter in any numeric input
      [kg, cm, lb, ft, inch].forEach(inp => {
        inp && inp.addEventListener('keydown', (ev) => {
          if (ev.key === 'Enter') {
            ev.preventDefault();
            form.requestSubmit();
          }
        });
      });
    })();
  </script>
</div>

<!--kg-card-end: html-->
 ]]></content:encoded>
          <enclosure url="" length="0" type="audio/mpeg" />
          <itunes:title>BMI Calculator</itunes:title>
          <itunes:author>Ayse Akyuz</itunes:author>
          <itunes:subtitle></itunes:subtitle>
          <itunes:summary><![CDATA[ 
<!--kg-card-begin: html-->


<div id="bmi-calc" class="bmi-wrap" lang="en" translate="no">
  <style>
    /* Scoped styles (won't leak) */
    #bmi-calc {
      --bg: #ffffff;
      --fg: #111827;
      --muted: #6b7280;
      --ring: #e5e7eb;
      --accent: #2563eb;
      --ok: #059669;
      --warn: #d97706;
      --bad: #dc2626;
      --shadow: 0 10px 20px rgba(0,0,0,0.06), 0 6px 6px rgba(0,0,0,0.08);
      color: var(--fg);
      max-width: 720px;
      margin: 1.5rem auto;
      font-family: system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji", "Segoe UI Emoji";
    }
    #bmi-calc .card {
      background: var(--bg);
      border: 1px solid var(--ring);
      border-radius: 16px;
      box-shadow: var(--shadow);
      overflow: hidden;
    }
    #bmi-calc .header {
      padding: 1.25rem 1.25rem 0.75rem;
      border-bottom: 1px solid var(--ring);
    }
    #bmi-calc .title {
      margin: 0;
      font-size: 1.25rem;
      line-height: 1.2;
      font-weight: 700;
    }
    #bmi-calc .sub {
      margin: 0.25rem 0 0;
      color: var(--muted);
      font-size: 0.9375rem;
    }
    #bmi-calc .body {
      padding: 1.25rem;
    }
    #bmi-calc .grid {
      display: grid;
      grid-template-columns: 1fr;
      gap: 0.9rem;
    }
    @media (min-width: 640px) {
      #bmi-calc .grid-2 { grid-template-columns: 1fr 1fr; }
      #bmi-calc .grid-3 { grid-template-columns: 1fr 1fr 1fr; }
    }
    #bmi-calc label {
      display: block;
      font-size: 0.9rem;
      font-weight: 600;
      margin: 0 0 0.35rem;
    }
    #bmi-calc .field {
      display: flex;
      flex-direction: column;
    }
    #bmi-calc input[type="number"], #bmi-calc select {
      appearance: none;
      width: 100%;
      padding: 0.65rem 0.75rem;
      border: 1px solid var(--ring);
      border-radius: 10px;
      font-size: 1rem;
      outline: none;
      transition: border-color .15s ease, box-shadow .15s ease;
      background: #fff;
    }
    #bmi-calc input[type="number"]:focus, #bmi-calc select:focus {
      border-color: var(--accent);
      box-shadow: 0 0 0 3px rgba(37, 99, 235, .15);
    }
    #bmi-calc .hint {
      font-size: 0.8rem;
      color: var(--muted);
      margin-top: 0.25rem;
    }
    #bmi-calc .error {
      font-size: 0.82rem;
      color: var(--bad);
      margin-top: 0.3rem;
      display: none;
    }
    #bmi-calc .unit-toggle {
      display: inline-flex;
      gap: 0.5rem;
      background: #f9fafb;
      border: 1px solid var(--ring);
      border-radius: 999px;
      padding: 0.25rem;
      align-items: center;
    }
    #bmi-calc .seg {
      position: relative;
      display: inline-flex;
      align-items: center;
      gap: 0.5rem;
      padding: 0.4rem 0.8rem;
      border-radius: 999px;
      font-weight: 600;
      cursor: pointer;
      user-select: none;
      white-space: nowrap;
    }
    #bmi-calc .seg input { display: none; }
    #bmi-calc .seg.active {
      background: var(--bg);
      border: 1px solid var(--ring);
      box-shadow: var(--shadow);
    }
    #bmi-calc .btns {
      display: flex; gap: 0.6rem; flex-wrap: wrap; align-items: center;
      margin-top: 0.2rem;
    }
    #bmi-calc button {
      appearance: none;
      border: 1px solid var(--ring);
      background: var(--fg);
      color: white;
      padding: 0.7rem 1rem;
      border-radius: 12px;
      font-weight: 700;
      cursor: pointer;
      transition: transform .04s ease, filter .15s ease, background .15s ease;
    }
    #bmi-calc button:hover { filter: brightness(1.05); }
    #bmi-calc button:active { transform: translateY(1px); }
    #bmi-calc .ghost {
      background: #f9fafb; color: var(--fg);
    }
    #bmi-calc .result {
      margin-top: 1rem;
      border: 1px dashed var(--ring);
      border-radius: 12px;
      padding: 1rem;
    }
    #bmi-calc .row { display: flex; gap: 0.75rem; align-items: baseline; flex-wrap: wrap; }
    #bmi-calc .bmi-value {
      font-size: 2rem;
      font-weight: 800;
      letter-spacing: -0.5px;
    }
    #bmi-calc .badge {
      font-size: 0.85rem;
      padding: 0.25rem 0.6rem;
      border-radius: 999px;
      font-weight: 700;
      border: 1px solid var(--ring);
    }
    #bmi-calc .badge.ok { background: #ecfdf5; color: var(--ok); }
    #bmi-calc .badge.warn { background: #fffbeb; color: var(--warn); }
    #bmi-calc .badge.bad { background: #fef2f2; color: var(--bad); }
    #bmi-calc .range {
      margin-top: 0.35rem;
      font-size: 0.95rem;
      color: var(--muted);
    }
    #bmi-calc .context {
      margin-top: 0.35rem;
      font-size: 0.95rem;
    }
    #bmi-calc .context small { color: var(--muted); }
    #bmi-calc .disclaimer {
      margin-top: 0.75rem;
      font-size: 0.82rem;
      color: var(--muted);
    }
    #bmi-calc .hidden { display: none !important; }
    #bmi-calc .divider {
      height: 1px; background: var(--ring); margin: 0.5rem 0 0.75rem;
    }
  </style>

  <div class="card">
    <div class="header">
      
      <p class="sub">Body Mass Index with metric & imperial units, plus sex & somatotype context.</p>
    </div>

    <div class="body">
      <form id="bmi-form" novalidate>
        <div class="btns" role="radiogroup" aria-label="Units">
          <div class="unit-toggle">
            <label class="seg active" id="seg-metric">
              <input type="radio" name="unit" value="metric" checked aria-labelledby="seg-metric">
              Metric (kg, cm)
            </label>
            <label class="seg" id="seg-imperial">
              <input type="radio" name="unit" value="imperial" aria-labelledby="seg-imperial">
              Imperial (lb, ft+in)
            </label>
          </div>
        </div>

        <!-- Context selectors -->
        <div class="grid grid-2" style="margin-top: 0.9rem;">
          <div class="field">
            <label for="sex">Sex (for context)</label>
            <select id="sex" name="sex" autocomplete="off">
              <option value="unspecified" selected>Prefer not to say</option>
              <option value="female">Female</option>
              <option value="male">Male</option>
              <option value="intersex">Intersex / Other</option>
            </select>
            <p class="hint">BMI formula & cutoffs are the same; this only adjusts guidance text.</p>
          </div>
          <div class="field">
            <label for="somato">Somatotype (optional)</label>
            <select id="somato" name="somato" autocomplete="off">
              <option value="unspecified" selected>Not sure / Prefer not to say</option>
              <option value="ecto">Ectomorph (leaner frame)</option>
              <option value="meso">Mesomorph (more muscular)</option>
              <option value="endo">Endomorph (easier fat gain)</option>
            </select>
            <p class="hint">A broad frame-type heuristic; not medical.</p>
          </div>
        </div>

        <!-- Metric fields -->
        <div id="metric-fields" class="grid grid-2" style="margin-top: 0.6rem;">
          <div class="field">
            <label for="weight-kg">Weight (kg)</label>
            <input id="weight-kg" name="weight-kg" type="number" inputmode="decimal" min="1" step="0.1" placeholder="e.g., 70" autocomplete="off">
            <div class="error" id="err-kg">Please enter a valid weight in kilograms.</div>
          </div>
          <div class="field">
            <label for="height-cm">Height (cm)</label>
            <input id="height-cm" name="height-cm" type="number" inputmode="decimal" min="30" step="0.1" placeholder="e.g., 175" autocomplete="off">
            <div class="error" id="err-cm">Please enter a valid height in centimeters.</div>
          </div>
          <p class="hint" style="grid-column: 1 / -1;">Tip: 1.75 m = 175 cm</p>
        </div>

        <!-- Imperial fields -->
        <div id="imperial-fields" class="grid grid-3 hidden" style="margin-top: 0.6rem;">
          <div class="field">
            <label for="weight-lb">Weight (lb)</label>
            <input id="weight-lb" name="weight-lb" type="number" inputmode="decimal" min="1" step="0.1" placeholder="e.g., 154" autocomplete="off">
            <div class="error" id="err-lb">Please enter a valid weight in pounds.</div>
          </div>
          <div class="field">
            <label for="height-ft">Height (ft)</label>
            <input id="height-ft" name="height-ft" type="number" inputmode="numeric" min="1" step="1" placeholder="e.g., 5" autocomplete="off">
            <div class="error" id="err-ft">Please enter feet (whole number).</div>
          </div>
          <div class="field">
            <label for="height-in">Height (in)</label>
            <input id="height-in" name="height-in" type="number" inputmode="decimal" min="0" step="0.1" placeholder="e.g., 9" autocomplete="off">
            <div class="error" id="err-in">Please enter inches (0–11.9).</div>
          </div>
          <p class="hint" style="grid-column: 1 / -1;">Tip: 5 ft 9 in = 69 in total</p>
        </div>

        <div class="btns" style="margin-top: 0.6rem;">
          <button type="submit" id="calc-btn" aria-label="Calculate BMI">Calculate BMI</button>
          <button type="button" class="ghost" id="reset-btn" aria-label="Reset form">Reset</button>
        </div>

        <div class="result" id="result" aria-live="polite" aria-atomic="true" style="display:none;">
          <div class="row">
            <div class="bmi-value" id="bmi-number">—</div>
            <span class="badge" id="bmi-badge">—</span>
          </div>
          <div class="range" id="range-text"></div>
          <div class="context" id="context-text"></div>
          <div class="divider"></div>
          <div class="disclaimer">
            BMI is a screening tool and does not directly assess body fat, muscle mass, or health. For personalized advice, consult a qualified professional.
          </div>
        </div>
      </form>
    </div>
  </div>

  <script>
    (function () {
      const root = document.getElementById('bmi-calc');
      if (!root) return;
      const $ = sel => root.querySelector(sel);

      const segMetric = $('#seg-metric');
      const segImperial = $('#seg-imperial');
      const metricFields = $('#metric-fields');
      const imperialFields = $('#imperial-fields');

      const kg = $('#weight-kg');
      const cm = $('#height-cm');
      const lb = $('#weight-lb');
      const ft = $('#height-ft');
      const inch = $('#height-in');

      const errKg = $('#err-kg');
      const errCm = $('#err-cm');
      const errLb = $('#err-lb');
      const errFt = $('#err-ft');
      const errIn = $('#err-in');

      const sexSel = $('#sex');
      const somatoSel = $('#somato');

      const form = $('#bmi-form');
      const resultBox = $('#result');
      const bmiNumber = $('#bmi-number');
      const badge = $('#bmi-badge');
      const rangeText = $('#range-text');
      const contextText = $('#context-text');

      function setUnit(unit) {
        const isMetric = unit === 'metric';
        metricFields.classList.toggle('hidden', !isMetric);
        imperialFields.classList.toggle('hidden', isMetric);
        segMetric.classList.toggle('active', isMetric);
        segImperial.classList.toggle('active', !isMetric);
        clearErrors();
        if (resultBox.style.display !== 'none') showResult(false);
      }

      // Toggle via label click
      segMetric.addEventListener('click', () => {
        segMetric.querySelector('input').checked = true;
        setUnit('metric');
      });
      segImperial.addEventListener('click', () => {
        segImperial.querySelector('input').checked = true;
        setUnit('imperial');
      });

      function showError(el, msgEl, cond) {
        if (cond) {
          el.setAttribute('aria-invalid', 'true');
          msgEl.style.display = 'block';
        } else {
          el.removeAttribute('aria-invalid');
          msgEl.style.display = 'none';
        }
      }
      function clearErrors() {
        [kg, cm, lb, ft, inch].forEach(i => i && i.removeAttribute('aria-invalid'));
        [errKg, errCm, errLb, errFt, errIn].forEach(e => e && (e.style.display = 'none'));
      }

      function toNum(v) {
        const n = parseFloat(String(v).replace(',', '.'));
        return Number.isFinite(n) ? n : NaN;
      }

      function classify(bmi) {
        if (bmi < 18.5) return { label: 'Underweight', tone: 'warn' };
        if (bmi < 25)   return { label: 'Normal', tone: 'ok' };
        if (bmi < 30)   return { label: 'Overweight', tone: 'warn' };
        return { label: 'Obesity', tone: 'bad' };
      }

      function fmt1(x) { return (Math.round(x * 10) / 10).toFixed(1); }

      function showResult(show) {
        resultBox.style.display = show ? 'block' : 'none';
      }

      function calcMetric() {
        const w = toNum(kg.value);
        const hcm = toNum(cm.value);
        const wBad = !(w > 0 && w < 650);
        const hBad = !(hcm > 30 && hcm < 300);

        showError(kg, errKg, wBad);
        showError(cm, errCm, hBad);
        if (wBad || hBad) return null;

        const hm = hcm / 100;
        const bmi = w / (hm * hm);
        const low = 18.5 * hm * hm;
        const high = 24.9 * hm * hm;

        return { bmi, range: `${fmt1(low)}–${fmt1(high)} kg` };
      }

      function calcImperial() {
        const w = toNum(lb.value);
        const feet = toNum(ft.value);
        const inches = toNum(inch.value);

        const wBad = !(w > 0 && w < 1400);
        const ftBad = !(feet >= 1 && feet < 9 && Number.isFinite(feet));
        const inBad = !(inches >= 0 && inches < 12.0 && Number.isFinite(inches));

        showError(lb, errLb, wBad);
        showError(ft, errFt, ftBad);
        showError(inch, errIn, inBad);
        if (wBad || ftBad || inBad) return null;

        const totalIn = feet * 12 + inches;
        if (!(totalIn > 12 && totalIn < 120)) {
          showError(ft, errFt, true);
          showError(inch, errIn, true);
          return null;
        }

        const bmi = 703 * (w / (totalIn * totalIn));
        const low = (18.5 * totalIn * totalIn) / 703;
        const high = (24.9 * totalIn * totalIn) / 703;

        return { bmi, range: `${fmt1(low)}–${fmt1(high)} lb` };
      }

      function buildContextText(sex, somato) {
        const notes = [];
        // Sex-based context (does not change BMI cutoffs)
        if (sex === 'female') {
          notes.push('BMI cutoffs are the same for women and men. As an extra context marker, a waist circumference above ~88 cm (35 in) is often associated with higher metabolic risk.');
        } else if (sex === 'male') {
          notes.push('BMI cutoffs are the same for women and men. As an extra context marker, a waist circumference above ~102 cm (40 in) is often associated with higher metabolic risk.');
        } else if (sex === 'intersex') {
          notes.push('BMI cutoffs are the same across sexes. Consider also tracking waist circumference alongside BMI.');
        } else {
          notes.push('BMI cutoffs are universal. Consider also tracking waist circumference, strength, and cardio fitness.');
        }

        // Somatotype (heuristic only)
        if (somato === 'ecto') {
          notes.push('<small>Somatotype:</small> Ectomorph tendency (leaner frame). Focus on adequate protein and progressive resistance training if gaining muscle is a goal.');
        } else if (somato === 'meso') {
          notes.push('<small>Somatotype:</small> Mesomorphic tendency (more muscular). BMI may overestimate body fat if muscle mass is high; body composition measures can add context.');
        } else if (somato === 'endo') {
          notes.push('<small>Somatotype:</small> Endomorphic tendency (easier fat gain). Consistency with nutrition, step count, and resistance training can help manage weight.');
        }

        return notes.join(' ');
      }

      function render(res) {
        const { bmi, range } = res;
        const c = classify(bmi);
        const sex = sexSel.value;
        const somato = somatoSel.value;

        bmiNumber.textContent = fmt1(bmi);
        badge.textContent = c.label;
        badge.className = 'badge ' + (c.tone === 'ok' ? 'ok' : (c.tone === 'warn' ? 'warn' : 'bad'));
        rangeText.textContent = `Healthy weight range for your height (BMI 18.5–24.9): ${range}.`;
        contextText.innerHTML = buildContextText(sex, somato);

        showResult(true);
      }

      form.addEventListener('submit', function (e) {
        e.preventDefault();
        clearErrors();
        const unit = root.querySelector('input[name="unit"]:checked')?.value || 'metric';
        const res = unit === 'metric' ? calcMetric() : calcImperial();
        if (res) render(res);
      });

      $('#reset-btn').addEventListener('click', function () {
        form.reset();
        clearErrors();
        setUnit('metric');
        showResult(false);
        [kg, cm, lb, ft, inch].forEach(inp => { if (inp) inp.value = ''; });
        sexSel.value = 'unspecified';
        somatoSel.value = 'unspecified';
      });

      // Calculate on Enter in any numeric input
      [kg, cm, lb, ft, inch].forEach(inp => {
        inp && inp.addEventListener('keydown', (ev) => {
          if (ev.key === 'Enter') {
            ev.preventDefault();
            form.requestSubmit();
          }
        });
      });
    })();
  </script>
</div>

<!--kg-card-end: html-->
 ]]></itunes:summary>
            <itunes:image href="https://storage.ghost.io/c/19/20/192012e9-8380-4771-b514-3cb716bfccdf/content/images/2025/08/ChatGPT-Image-Aug-22--2025--04_26_16-PM-1.png" />
          <itunes:explicit>no</itunes:explicit>
        </item>
  </channel>

</rss>