@scope (#original-content) {

/* ===== RESET & SCOPE ===== */
#bmi-page *, #bmi-page *::before, #bmi-page *::after { box-sizing: border-box; margin: 0; padding: 0; }
#bmi-page {
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: #ffffff;
  color: #111827;
  line-height: 1.8;
  max-width: 980px;
  margin: 0 auto;
  padding: 0 16px 56px;
}

/* ===== HEADER ===== */
#bmi-page .bmi-header {
  text-align: center;
  padding: 40px 20px 32px;
  border-bottom: 3px solid #2563eb;
  margin-bottom: 28px;
}
#bmi-page .bmi-header h1 {
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  font-weight: 900;
  color: #1e3a8a;
  letter-spacing: -0.5px;
  line-height: 1.2;
  margin-bottom: 12px;
}
#bmi-page .bmi-header p.subtitle {
  font-size: 1.1rem;
  color: #374151;
  font-weight: 600;
  max-width: 750px;
  margin: 0 auto 20px;
}
#bmi-page .badge-row { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }
#bmi-page .badge {
  background: #eff6ff;
  border: 1.5px solid #2563eb;
  color: #1d4ed8;
  font-size: 0.8rem;
  font-weight: 800;
  padding: 5px 14px;
  border-radius: 20px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* ===== TOC ===== */
#bmi-page .bmi-toc {
  background: #f8fafc;
  border-left: 4px solid #2563eb;
  border-radius: 0 8px 8px 0;
  padding: 20px 24px;
  margin-bottom: 32px;
}
#bmi-page .bmi-toc h2 { font-size: 0.95rem; font-weight: 800; text-transform: uppercase; letter-spacing: 1px; color: #1e3a8a; margin-bottom: 12px; }
#bmi-page .bmi-toc ol { padding-left: 20px; font-weight: 600; }
#bmi-page .bmi-toc li { margin-bottom: 6px; font-size: 0.95rem; }
#bmi-page .bmi-toc a { color: #2563eb; text-decoration: none; }
#bmi-page .bmi-toc a:hover { text-decoration: underline; color: #1d4ed8; }

/* ===== SECTION FORMATTING ===== */
#bmi-page .bmi-section {
  background: #fff;
  border: 1.5px solid #e5e7eb;
  border-radius: 12px;
  padding: 32px;
  margin-bottom: 32px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.03);
}
#bmi-page .bmi-section h2 {
  font-size: 1.6rem;
  font-weight: 900;
  color: #1e3a8a;
  border-bottom: 2.5px solid #2563eb;
  padding-bottom: 12px;
  margin-bottom: 20px;
}
#bmi-page .bmi-section h3 { font-size: 1.3rem; font-weight: 800; color: #1d4ed8; margin: 28px 0 14px; }
#bmi-page .bmi-section p { font-size: 1.05rem; font-weight: 500; color: #1f2937; margin-bottom: 18px; }
#bmi-page .bmi-section ul, #bmi-page .bmi-section ol { padding-left: 24px; margin-bottom: 18px; font-weight: 500; font-size: 1.05rem;}
#bmi-page .bmi-section li { margin-bottom: 10px; color: #1f2937;}

#bmi-page .info-box { background: #eff6ff; border-left: 4px solid #3b82f6; border-radius: 0 8px 8px 0; padding: 16px 20px; margin: 20px 0; font-weight: 600; color: #1e40af; }
#bmi-page .warn-box { background: #fffbeb; border-left: 4px solid #f59e0b; border-radius: 0 8px 8px 0; padding: 16px 20px; margin: 20px 0; font-weight: 600; color: #b45309; }
#bmi-page .danger-box { background: #fef2f2; border-left: 4px solid #ef4444; border-radius: 0 8px 8px 0; padding: 16px 20px; margin: 20px 0; font-weight: 600; color: #b91c1c; }

/* ===== MATH BLOCKS ===== */
#bmi-page .math-block {
  background: #f8fafc;
  border: 1.5px solid #e2e8f0;
  border-radius: 8px;
  padding: 18px 24px;
  margin: 20px 0;
  text-align: center;
  overflow-x: auto;
  font-size: 1.1rem;
  line-height: 1.8;
}
#bmi-page .math-block .label {
  display: block;
  font-size: 0.85rem;
  font-weight: 800;
  color: #6b7280;
  text-align: left;
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* ===== MATHJAX WORDPRESS GUARDS ===== */
#bmi-page mjx-container {
  display: inline-block !important;
  max-width: 100% !important;
  overflow-x: auto !important;
  overflow-y: hidden !important;
  vertical-align: middle !important;
  padding-bottom: 2px;
}
#bmi-page mjx-container[display="true"] { 
  display: block !important; 
  margin: 15px auto !important; 
  text-align: center !important; 
}
#bmi-page mjx-container svg { 
  max-width: none !important; 
  max-height: none !important; 
}

/* ===== TABLES ===== */
#bmi-page .bmi-table-wrap { overflow-x: auto; margin: 24px 0; border: 1.5px solid #e5e7eb; border-radius: 8px; }
#bmi-page .bmi-table { width: 100%; border-collapse: collapse; font-size: 1rem; }
#bmi-page .bmi-table th { background: #eff6ff; color: #1e3a8a; padding: 14px 18px; text-align: left; font-weight: 800; border-bottom: 2px solid #2563eb; }
#bmi-page .bmi-table td { padding: 12px 18px; border-bottom: 1px solid #e5e7eb; font-weight: 500; color: #1f2937; }
#bmi-page .bmi-table tr:nth-child(even) td { background: #f8fafc; }

/* BMI specific rows */
#bmi-page .row-underweight { background: #eff6ff !important; }
#bmi-page .row-normal { background: #f0fdf4 !important; }
#bmi-page .row-overweight { background: #fffbeb !important; }
#bmi-page .row-obese { background: #fef2f2 !important; }

/* ===== CALCULATOR WIDGET ===== */
#bmi-page .widget-container {
  background: #f8fafc;
  border: 1.5px solid #e5e7eb;
  border-radius: 12px;
  padding: 32px;
  margin-bottom: 24px;
}

#bmi-page .widget-tabs { display: flex; border-bottom: 2px solid #e2e8f0; margin-bottom: 24px; }
#bmi-page .widget-tab { flex: 1; text-align: center; padding: 12px; font-weight: 800; cursor: pointer; color: #64748b; font-size: 1.05rem; }
#bmi-page .widget-tab.active { color: #2563eb; border-bottom: 3px solid #2563eb; margin-bottom: -2px; }

#bmi-page .widget-row { display: flex; flex-wrap: wrap; gap: 24px; }
#bmi-page .widget-col { flex: 1; min-width: 250px; }

#bmi-page .input-group { margin-bottom: 20px; }
#bmi-page .input-label { display: block; font-weight: 800; font-size: 1rem; color: #1e293b; margin-bottom: 8px; }
#bmi-page .input-flex { display: flex; gap: 12px; }
#bmi-page .input-flex input { flex: 1; }

#bmi-page .input-field {
  width: 100%;
  padding: 12px 16px;
  border: 2px solid #cbd5e1;
  border-radius: 8px;
  font-size: 1.05rem;
  font-weight: 700;
  color: #0f172a;
  background: #fff;
  transition: all 0.2s;
}
#bmi-page .input-field:focus { border-color: #2563eb; outline: none; box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.2); }

#bmi-page .btn-group { display: flex; gap: 16px; margin-top: 28px; }
#bmi-page .bmi-btn {
  flex: 1;
  padding: 14px 24px;
  font-size: 1.05rem;
  font-weight: 800;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: transform 0.1s, background 0.2s;
}
#bmi-page .bmi-btn-primary { background: #2563eb; color: #fff; }
#bmi-page .bmi-btn-primary:hover { background: #1d4ed8; transform: translateY(-1px); }
#bmi-page .bmi-btn-danger { background: #e2e8f0; color: #475569; }
#bmi-page .bmi-btn-danger:hover { background: #cbd5e1; }

#bmi-page .results-box {
  margin-top: 32px;
  padding: 24px;
  border-radius: 12px;
  text-align: center;
  border: 2px solid #e2e8f0;
  background: #fff;
  display: none;
}
#bmi-page .res-title { font-size: 1.15rem; font-weight: 800; color: #475569; margin-bottom: 8px; text-transform: uppercase; letter-spacing: 0.5px;}
#bmi-page .res-score { font-size: 3.5rem; font-weight: 900; line-height: 1.1; margin-bottom: 4px; }
#bmi-page .res-category { font-size: 1.4rem; font-weight: 800; margin-bottom: 12px; }
#bmi-page .res-desc { font-size: 1.05rem; font-weight: 600; color: #334155; }

/* Status Colors */
#bmi-page .color-underweight { color: #3b82f6; } /* Blue */
#bmi-page .color-normal { color: #16a34a; } /* Green */
#bmi-page .color-overweight { color: #d97706; } /* Orange */
#bmi-page .color-obese { color: #dc2626; } /* Red */

#bmi-page .border-underweight { border-color: #3b82f6; }
#bmi-page .border-normal { border-color: #16a34a; }
#bmi-page .border-overweight { border-color: #d97706; }
#bmi-page .border-obese { border-color: #dc2626; }

#bmi-page .bmi-toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%) translateY(100px); background: #1e293b; color: #fff; padding: 14px 28px; border-radius: 8px; font-weight: 700; font-size: 1rem; opacity: 0; transition: all 0.3s ease; z-index: 9999; box-shadow: 0 4px 15px rgba(0,0,0,0.15); pointer-events: none; }
#bmi-page .bmi-toast.show { transform: translateX(-50%) translateY(0); opacity: 1; }

/* ===== FAQ ===== */
#bmi-page .faq-item { border: 1.5px solid #e5e7eb; border-radius: 8px; margin-bottom: 12px; overflow: hidden; }
#bmi-page .faq-q { background: #f8fafc; padding: 16px 24px; font-weight: 800; font-size: 1.05rem; color: #1e3a8a; cursor: pointer; display: flex; justify-content: space-between; align-items: center; user-select: none; }
#bmi-page .faq-q::after { content: '+'; font-size: 1.5rem; font-weight: 900; color: #2563eb; }
#bmi-page .faq-item.open .faq-q::after { content: '−'; }
#bmi-page .faq-a { display: none; padding: 20px 24px; font-size: 1.05rem; font-weight: 500; color: #374151; border-top: 1px solid #e5e7eb; background: #fff; }
#bmi-page .faq-item.open .faq-a { display: block; }

/* ===== FOOTER ===== */
#bmi-page .bmi-footer { text-align: center; padding: 32px 20px; border-top: 2px solid #e5e7eb; margin-top: 40px; font-size: 0.95rem; color: #6b7280; font-weight: 600; }
#bmi-page .bmi-footer a { color: #2563eb; text-decoration: none; font-weight: 800; }

@media (max-width: 650px) {
  #bmi-page .bmi-section { padding: 24px 16px; }
  #bmi-page .widget-row { flex-direction: column; gap: 16px; }
  #bmi-page .btn-group { flex-direction: column; }
}

}
