/* ============================================
   WAIST TO HIP RATIO CALCULATOR - STYLESHEET
   Health/Wellness - Teal Theme
   ============================================ */

:root {
  --primary: #14b8a6;
  --primary-dark: #0d9488;
  --primary-light: #2dd4bf;
  --primary-bg: #f0fdfa;
  --secondary: #0f766e;
  --accent: #06b6d4;
  --success: #10b981;
  --success-bg: #d1fae5;
  --warning: #f59e0b;
  --warning-bg: #fef3c7;
  --error: #ef4444;
  --error-bg: #fee2e2;
  --gray-50: #f9fafb;
  --gray-100: #f3f4f6;
  --gray-200: #e5e7eb;
  --gray-300: #d1d5db;
  --gray-400: #9ca3af;
  --gray-500: #6b7280;
  --gray-600: #4b5563;
  --gray-700: #374151;
  --gray-800: #1f2937;
  --gray-900: #111827;
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: "SF Mono", Monaco, "Cascadia Code", "Roboto Mono", monospace;
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1);
  --radius-sm: 0.25rem;
  --radius-md: 0.5rem;
  --radius-lg: 0.75rem;
  --radius-xl: 1rem;
  --radius-full: 9999px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body { font-family: var(--font-sans); font-size: 16px; line-height: 1.6; color: var(--gray-800); background: var(--gray-50); min-height: 100vh; display: flex; flex-direction: column; }

h1, h2, h3, h4 { font-weight: 600; line-height: 1.3; color: var(--gray-900); }
h1 { font-size: 2.25rem; margin-bottom: 1rem; }
h2 { font-size: 1.5rem; margin-top: 2rem; margin-bottom: 1rem; }
h3 { font-size: 1.25rem; margin-top: 1.5rem; margin-bottom: 0.5rem; }
p { margin-bottom: 1rem; }
a { color: var(--primary-dark); text-decoration: none; transition: color 0.15s ease; }
a:hover { color: var(--primary); text-decoration: underline; }

.container { width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 1rem; }
.content-narrow { max-width: 800px; margin: 0 auto; }
main { flex: 1; padding: 2rem 0 3rem; }

/* Header */
.header { background: white; border-bottom: 1px solid var(--gray-200); position: sticky; top: 0; z-index: 100; }
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 64px; }
.logo { display: flex; align-items: center; gap: 0.5rem; font-weight: 700; font-size: 1.125rem; color: var(--gray-900); text-decoration: none; }
.logo:hover { text-decoration: none; color: var(--primary-dark); }
.logo-icon { width: 32px; height: 32px; color: var(--primary); }
.nav-desktop { display: flex; align-items: center; gap: 1.5rem; }
.nav-desktop a { font-size: 0.9375rem; font-weight: 500; color: var(--gray-600); padding: 0.5rem 0; border-bottom: 2px solid transparent; transition: all 0.15s ease; }
.nav-desktop a:hover, .nav-desktop a.active { color: var(--primary-dark); text-decoration: none; border-bottom-color: var(--primary); }
.nav-toggle { display: none; background: none; border: none; padding: 0.5rem; cursor: pointer; color: var(--gray-700); }
.nav-toggle svg { width: 24px; height: 24px; }
.nav-mobile { display: none; position: absolute; top: 100%; left: 0; right: 0; background: white; border-bottom: 1px solid var(--gray-200); padding: 1rem; box-shadow: var(--shadow-lg); }
.nav-mobile.active { display: block; }
.nav-mobile a { display: block; padding: 0.5rem 1rem; color: var(--gray-700); font-weight: 500; border-radius: var(--radius-md); }
.nav-mobile a:hover { background: var(--gray-100); text-decoration: none; }
@media (max-width: 768px) { .nav-desktop { display: none; } .nav-toggle { display: block; } }

.intro-text { font-size: 1.125rem; color: var(--gray-600); margin-bottom: 1.5rem; max-width: 700px; }

/* Calculator Card */
.calculator-card { background: white; border-radius: var(--radius-xl); box-shadow: var(--shadow-lg); padding: 0; margin-bottom: 1.5rem; overflow: hidden; max-width: 800px; margin-left: auto; margin-right: auto; }

/* Tabs */
.calc-tabs { display: flex; background: var(--gray-100); border-bottom: 1px solid var(--gray-200); overflow-x: auto; }
.calc-tab { flex: 1; min-width: 0; padding: 0.75rem 0.5rem; font-size: 0.75rem; font-weight: 500; color: var(--gray-600); background: transparent; border: none; cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 0.25rem; transition: all 0.15s ease; border-bottom: 3px solid transparent; }
.calc-tab:hover { color: var(--gray-800); background: var(--gray-50); }
.calc-tab.active { color: var(--primary-dark); background: white; border-bottom-color: var(--primary); }
.calc-tab svg { width: 18px; height: 18px; }
.calc-tab-label { white-space: nowrap; }

.calc-panel { display: none; padding: 1.25rem; }
.calc-panel.active { display: block; }

/* Form */
.form-grid { display: grid; gap: 1rem; }
.form-row { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0.75rem; }
@media (max-width: 600px) { .form-row { grid-template-columns: 1fr; } }
.form-group { display: flex; flex-direction: column; gap: 0.375rem; }
.form-label { font-size: 0.875rem; font-weight: 500; color: var(--gray-700); }
.form-hint { font-size: 0.75rem; color: var(--gray-500); }

.form-input { width: 100%; height: 44px; padding: 0 0.875rem; font-size: 0.9375rem; font-family: var(--font-sans); color: var(--gray-800); background: white; border: 1px solid var(--gray-300); border-radius: var(--radius-md); transition: all 0.15s ease; cursor: text; }
.form-input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-bg); }
.form-select { height: 44px; padding: 0 0.875rem; font-size: 0.9375rem; color: var(--gray-800); background: white; border: 1px solid var(--gray-300); border-radius: var(--radius-md); cursor: pointer; width: 100%; }
.form-select:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-bg); }

.input-group { display: flex; gap: 0.5rem; }
.input-group .form-input { flex: 1; }
.input-group .form-select { width: 90px; flex-shrink: 0; }

/* Unit Toggle */
.unit-toggle { display: flex; background: var(--gray-100); border-radius: var(--radius-full); padding: 3px; width: fit-content; margin-bottom: 0.875rem; }
.unit-toggle-btn { padding: 0.375rem 0.875rem; font-size: 0.8125rem; font-weight: 500; color: var(--gray-600); background: transparent; border: none; border-radius: var(--radius-full); cursor: pointer; transition: all 0.15s ease; }
.unit-toggle-btn.active { background: white; color: var(--primary-dark); box-shadow: var(--shadow-sm); }

/* Radio */
.radio-group { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.radio-option { display: flex; align-items: center; gap: 0.375rem; cursor: pointer; padding: 0.5rem 0.75rem; border: 1px solid var(--gray-300); border-radius: var(--radius-md); transition: all 0.15s ease; font-size: 0.875rem; }
.radio-option:hover { border-color: var(--primary-light); background: var(--primary-bg); }
.radio-option:has(input:checked) { border-color: var(--primary); background: var(--primary-bg); }
.radio-option input[type="radio"] { width: 16px; height: 16px; accent-color: var(--primary); cursor: pointer; }

/* Calculate Button */
.calculate-btn { width: 100%; height: 48px; margin-top: 1rem; font-size: 1rem; font-weight: 600; color: white; background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%); border: none; border-radius: var(--radius-md); cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 0.5rem; transition: all 0.15s ease; box-shadow: 0 4px 14px 0 rgba(20, 184, 166, 0.4); }
.calculate-btn:hover { transform: translateY(-2px); box-shadow: 0 6px 20px 0 rgba(20, 184, 166, 0.5); }
.calculate-btn svg { width: 20px; height: 20px; }

/* Results */
.results-section { display: none; margin-top: 1.5rem; padding-top: 1.5rem; border-top: 1px solid var(--gray-200); max-width: 800px; margin-left: auto; margin-right: auto; }
.results-section.visible { display: block; animation: fadeIn 0.3s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

/* Enhanced Results Styling */
.results-report { padding: 0 0.5rem; }
.results-report-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1rem; padding-bottom: 0.75rem; border-bottom: 1px solid var(--gray-200); }
.results-report-title { font-size: 1rem; font-weight: 600; color: var(--gray-800); margin: 0; }
.print-btn { display: inline-flex; align-items: center; gap: 0.375rem; padding: 0.5rem 0.875rem; font-size: 0.8125rem; font-weight: 500; color: var(--gray-600); background: var(--gray-100); border: 1px solid var(--gray-200); border-radius: var(--radius-md); cursor: pointer; transition: all 0.15s ease; }
.print-btn:hover { background: var(--gray-200); color: var(--gray-700); }
.print-btn svg { width: 16px; height: 16px; }

/* Visual Bar Chart */
.visual-bar { margin: 1.25rem 0; }
.visual-bar-track { height: 12px; background: var(--gray-200); border-radius: var(--radius-full); position: relative; overflow: hidden; }
.visual-bar-fill { height: 100%; border-radius: var(--radius-full); transition: width 0.5s ease; }
.visual-bar-fill.low { background: linear-gradient(90deg, var(--success), #34d399); }
.visual-bar-fill.moderate { background: linear-gradient(90deg, var(--warning), #fbbf24); }
.visual-bar-fill.high { background: linear-gradient(90deg, var(--error), #f87171); }
.visual-bar-labels { display: flex; justify-content: space-between; margin-top: 0.375rem; font-size: 0.6875rem; color: var(--gray-500); }

/* Segmented Bar (for WHR gauge) */
.segmented-bar { height: 40px; display: flex; border-radius: var(--radius-md); overflow: hidden; position: relative; margin: 1rem 0; }
.segmented-bar-section { flex: 1; display: flex; align-items: center; justify-content: center; font-size: 0.6875rem; font-weight: 500; color: white; text-shadow: 0 1px 2px rgba(0,0,0,0.2); }
.segmented-bar-section.low { background: var(--success); }
.segmented-bar-section.moderate { background: var(--warning); }
.segmented-bar-section.high { background: var(--error); }
.segmented-bar-marker { position: absolute; top: -6px; bottom: -6px; width: 4px; background: var(--gray-900); border-radius: 2px; transform: translateX(-50%); box-shadow: 0 0 0 2px white; z-index: 10; }
.segmented-bar-value { position: absolute; top: -28px; transform: translateX(-50%); background: var(--gray-900); color: white; padding: 0.25rem 0.5rem; border-radius: var(--radius-sm); font-size: 0.75rem; font-weight: 600; white-space: nowrap; }
.segmented-bar-value::after { content: ''; position: absolute; bottom: -4px; left: 50%; transform: translateX(-50%); border-left: 4px solid transparent; border-right: 4px solid transparent; border-top: 4px solid var(--gray-900); }

/* Summary Table */
.summary-table { width: 100%; border-collapse: collapse; margin: 1rem 0; font-size: 0.875rem; }
.summary-table th, .summary-table td { padding: 0.625rem 0.75rem; text-align: left; border-bottom: 1px solid var(--gray-200); }
.summary-table th { font-weight: 500; color: var(--gray-600); background: var(--gray-50); font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.025em; }
.summary-table td { color: var(--gray-800); }
.summary-table td:last-child { color: var(--gray-500); font-size: 0.8125rem; }
.summary-table tr:last-child td { border-bottom: none; }
.summary-table .highlight { font-weight: 600; }

/* Input Summary */
.input-summary { background: var(--gray-50); border-radius: var(--radius-md); padding: 0.875rem 1rem; margin: 1rem 0; }
.input-summary-title { font-size: 0.6875rem; font-weight: 600; color: var(--gray-500); text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 0.5rem; }
.input-summary-grid { display: flex; flex-wrap: wrap; gap: 1rem; }
.input-summary-item { display: flex; gap: 0.375rem; font-size: 0.8125rem; }
.input-summary-item span:first-child { color: var(--gray-500); }
.input-summary-item span:last-child { font-weight: 500; color: var(--gray-800); }

/* Tips Grid */
.tips-section { margin-top: 1.5rem; padding-top: 1rem; border-top: 1px solid var(--gray-200); }
.tips-title { font-size: 0.9375rem; font-weight: 600; color: var(--gray-800); margin-bottom: 0.75rem; }
.tips-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0.75rem; }
@media (max-width: 600px) { .tips-grid { grid-template-columns: 1fr; } }
.tip-card { display: flex; gap: 0.625rem; padding: 0.75rem; background: var(--gray-50); border-radius: var(--radius-md); border: 1px solid var(--gray-100); }
.tip-icon { flex-shrink: 0; width: 28px; height: 28px; display: flex; align-items: center; justify-content: center; background: var(--primary-bg); border-radius: var(--radius-sm); color: var(--primary-dark); font-size: 0.875rem; }
.tip-content { flex: 1; min-width: 0; }
.tip-title { font-size: 0.8125rem; font-weight: 600; color: var(--gray-800); margin-bottom: 0.125rem; }
.tip-desc { font-size: 0.75rem; color: var(--gray-600); line-height: 1.4; }

/* What This Means Section */
.interpretation-section { margin-top: 1.25rem; padding: 1rem; background: white; border: 1px solid var(--gray-200); border-radius: var(--radius-md); }
.interpretation-title { font-size: 0.875rem; font-weight: 600; color: var(--gray-800); margin-bottom: 0.5rem; display: flex; align-items: center; gap: 0.375rem; }
.interpretation-text { font-size: 0.8125rem; color: var(--gray-600); line-height: 1.6; margin: 0; }
.interpretation-text strong { color: var(--gray-800); }

/* Formula Display */
.formula-display { margin-top: 1rem; padding: 0.75rem; background: var(--gray-100); border-radius: var(--radius-md); font-family: var(--font-mono); font-size: 0.8125rem; color: var(--gray-700); text-align: center; }

/* Status Indicator */
.status-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 0.375rem; }
.status-dot.low { background: var(--success); }
.status-dot.moderate { background: var(--warning); }
.status-dot.high { background: var(--error); }

/* Print Styles */
@media print {
  .header, .footer, .nav-toggle, .nav-mobile, .calculate-btn, .print-btn, .calc-tabs { display: none !important; }
  .calculator-card, .results-section { box-shadow: none; max-width: 100%; }
  .results-section { display: block !important; border: 1px solid #ddd; padding: 1rem; }
  body { background: white; }
}

.result-primary { text-align: center; padding: 1.5rem; margin-bottom: 1rem; background: linear-gradient(135deg, var(--primary-bg) 0%, #ccfbf1 100%); border-radius: var(--radius-lg); border: 2px solid var(--primary-light); }
.result-label { font-size: 0.875rem; font-weight: 500; color: var(--gray-500); text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 0.5rem; }
.result-value { font-size: 3rem; font-weight: 700; color: var(--primary-dark); line-height: 1.2; }
.result-sublabel { font-size: 1.125rem; color: var(--gray-700); margin-top: 0.5rem; font-weight: 500; }

/* Risk Categories */
.risk-low { color: var(--success); }
.risk-moderate { color: var(--warning); }
.risk-high { color: var(--error); }
.risk-badge { display: inline-block; padding: 0.375rem 1rem; border-radius: var(--radius-full); font-size: 0.875rem; font-weight: 600; }
.risk-badge.low { background: var(--success-bg); color: #059669; }
.risk-badge.moderate { background: var(--warning-bg); color: #d97706; }
.risk-badge.high { background: var(--error-bg); color: #dc2626; }

/* Gauge */
.gauge-container { margin: 1.5rem 0; }
.gauge-bar { height: 24px; background: linear-gradient(90deg, var(--success) 0%, var(--success) 33%, var(--warning) 33%, var(--warning) 66%, var(--error) 66%, var(--error) 100%); border-radius: var(--radius-full); position: relative; overflow: visible; }
.gauge-labels { display: flex; justify-content: space-between; margin-top: 0.5rem; font-size: 0.75rem; color: var(--gray-500); }
.gauge-marker { position: absolute; top: -8px; width: 4px; height: 40px; background: var(--gray-900); border-radius: 2px; transform: translateX(-50%); }
.gauge-value { position: absolute; top: -32px; transform: translateX(-50%); font-size: 0.875rem; font-weight: 600; color: var(--gray-900); white-space: nowrap; }

/* Results Grid */
.results-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0.75rem; margin-top: 1rem; }
.results-grid-3 { grid-template-columns: repeat(3, 1fr); }
.results-grid-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 600px) { .results-grid, .results-grid-3, .results-grid-4 { grid-template-columns: repeat(2, 1fr); } }
.result-item { padding: 1rem; background: var(--gray-50); border-radius: var(--radius-md); text-align: center; }
.result-item-label { font-size: 0.75rem; color: var(--gray-500); margin-bottom: 0.25rem; text-transform: uppercase; }
.result-item-value { font-size: 1.125rem; font-weight: 600; color: var(--gray-800); }

/* Body Shape */
.body-shape-result { text-align: center; padding: 2rem; }
.body-shape-icon { font-size: 4rem; margin-bottom: 1rem; }
.body-shape-name { font-size: 1.5rem; font-weight: 700; color: var(--primary-dark); margin-bottom: 0.5rem; }
.body-shape-desc { color: var(--gray-600); max-width: 400px; margin: 0 auto; }

/* Reference Table */
.reference-table { margin-top: 1.5rem; }
.reference-title { font-size: 0.9375rem; font-weight: 600; color: var(--gray-700); margin-bottom: 0.75rem; }

/* Content Section */
.content-section { background: white; border-radius: var(--radius-xl); box-shadow: var(--shadow-md); padding: 1.5rem; margin-bottom: 1.5rem; max-width: 800px; margin-left: auto; margin-right: auto; }
.content-section h2 { margin-top: 0; }
.content-section h2::after { content: ''; display: block; width: 60px; height: 3px; background: var(--primary); margin-top: 0.5rem; border-radius: var(--radius-full); }

/* Tables */
.table-responsive { overflow-x: auto; margin: 1.5rem 0; }
.data-table { width: 100%; border-collapse: collapse; font-size: 0.875rem; }
.data-table th, .data-table td { padding: 0.75rem 1rem; text-align: left; border-bottom: 1px solid var(--gray-200); }
.data-table th { font-weight: 600; color: var(--gray-700); background: var(--gray-50); }
.data-table td { color: var(--gray-600); }
.data-table tbody tr:hover { background: var(--gray-50); }

/* FAQ */
.faq-list { display: flex; flex-direction: column; gap: 0.75rem; max-width: 800px; margin-left: auto; margin-right: auto; }
.faq-item { border: 1px solid var(--gray-200); border-radius: var(--radius-lg); overflow: hidden; }
.faq-question { width: 100%; padding: 1rem; display: flex; align-items: center; justify-content: space-between; gap: 1rem; font-size: 0.9375rem; font-weight: 500; text-align: left; color: var(--gray-800); background: var(--gray-50); border: none; cursor: pointer; }
.faq-question:hover { background: var(--gray-100); }
.faq-question svg { width: 18px; height: 18px; color: var(--gray-400); transition: transform 0.15s ease; flex-shrink: 0; }
.faq-item.open .faq-question svg { transform: rotate(180deg); }
.faq-answer { display: none; padding: 1rem; background: white; }
.faq-item.open .faq-answer { display: block; }
.faq-answer p:last-child { margin-bottom: 0; }

/* Blog */
.blog-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1.5rem; margin-top: 2rem; max-width: 800px; margin-left: auto; margin-right: auto; }
.blog-card { background: white; border-radius: var(--radius-lg); box-shadow: var(--shadow-md); overflow: hidden; transition: all 0.15s ease; }
.blog-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.blog-card-content { padding: 1.25rem; }
.blog-card-meta { font-size: 0.75rem; color: var(--gray-500); margin-bottom: 0.5rem; }
.blog-card h3 { margin: 0 0 0.5rem; font-size: 1.0625rem; }
.blog-card h3 a { color: var(--gray-900); }
.blog-card h3 a:hover { color: var(--primary-dark); text-decoration: none; }
.blog-card p { font-size: 0.875rem; color: var(--gray-600); margin-bottom: 0; }

/* Footer */
.footer { background: var(--gray-900); color: var(--gray-400); padding: 2.5rem 0 1.5rem; margin-top: auto; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 2rem; margin-bottom: 2rem; }
@media (max-width: 768px) { .footer-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 480px) { .footer-grid { grid-template-columns: 1fr; } }
.footer-brand .logo { color: white; margin-bottom: 1rem; }
.footer-brand .logo-icon { color: var(--primary-light); }
.footer-brand p { font-size: 0.875rem; line-height: 1.6; }
.footer-nav h4 { color: white; font-size: 0.8125rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 1rem; }
.footer-nav ul { list-style: none; }
.footer-nav li { margin-bottom: 0.5rem; }
.footer-nav a { font-size: 0.875rem; color: var(--gray-400); }
.footer-nav a:hover { color: white; text-decoration: none; }
.footer-bottom { padding-top: 1.5rem; border-top: 1px solid var(--gray-800); font-size: 0.8125rem; }

/* Mobile Responsiveness Enhancements */
@media (max-width: 600px) {
  .calculator-card { border-radius: var(--radius-lg); margin: 0 -0.5rem 1.5rem; }
  .calc-panel { padding: 1rem; }
  .calc-tab { padding: 0.625rem 0.25rem; font-size: 0.6875rem; }
  .calc-tab svg { width: 16px; height: 16px; }
  .result-primary { padding: 1.25rem; }
  .result-value { font-size: 2.5rem; }
  .results-report-header { flex-direction: column; gap: 0.75rem; align-items: flex-start; }
  .summary-table { font-size: 0.8125rem; }
  .summary-table th, .summary-table td { padding: 0.5rem 0.625rem; }
  .tips-grid { grid-template-columns: 1fr; }
  .tip-card { padding: 0.625rem; }
  .input-summary-grid { flex-direction: column; gap: 0.375rem; }
  .segmented-bar { height: 32px; }
  .segmented-bar-section { font-size: 0.625rem; }
  .body-shape-result { padding: 1.5rem; }
  .body-shape-icon { font-size: 3rem; }
  .content-section { padding: 1.25rem; margin: 0 -0.5rem 1.5rem; border-radius: var(--radius-lg); }
  h1 { font-size: 1.75rem; }
  h2 { font-size: 1.25rem; }
}

/* Touch-friendly tap targets */
.form-input, .form-select, .calculate-btn, .faq-question, .unit-toggle-btn, .radio-option {
  min-height: 44px;
}

/* Dropdown z-index fix */
.form-select { position: relative; z-index: 10; }
.input-group .form-select { z-index: 11; }

/* Scrollable summary table on mobile */
.summary-table { display: block; overflow-x: auto; }

/* Body shape reference mobile */
@media (max-width: 600px) {
  .results-grid[style*="grid-template-columns:repeat(5,1fr)"] { grid-template-columns: repeat(3, 1fr) !important; }
}

/* ============================================
   ENHANCED CONTENT STYLES
   ============================================ */

/* Key Takeaways Box */
.key-takeaways { background: linear-gradient(135deg, var(--primary-bg) 0%, #ecfdf5 100%); border-left: 4px solid var(--primary); border-radius: var(--radius-md); padding: 1.25rem 1.5rem; margin: 1.5rem 0; }
.key-takeaways-title { font-size: 1rem; font-weight: 700; color: var(--primary-dark); margin-bottom: 0.75rem; display: flex; align-items: center; gap: 0.5rem; }
.key-takeaways ul { list-style: none; padding: 0; margin: 0; }
.key-takeaways li { position: relative; padding-left: 1.5rem; margin-bottom: 0.5rem; font-size: 0.9375rem; color: var(--gray-700); line-height: 1.5; }
.key-takeaways li:last-child { margin-bottom: 0; }
.key-takeaways li::before { content: '\2713'; position: absolute; left: 0; color: var(--primary); font-weight: 700; }

/* Table of Contents */
.toc { background: white; border: 1px solid var(--gray-200); border-radius: var(--radius-lg); padding: 1.25rem 1.5rem; margin: 1.5rem 0; }
.toc-title { font-size: 0.9375rem; font-weight: 700; color: var(--gray-800); margin-bottom: 0.75rem; }
.toc ol { padding-left: 1.25rem; margin: 0; }
.toc li { margin-bottom: 0.375rem; font-size: 0.875rem; }
.toc li a { color: var(--primary-dark); text-decoration: none; }
.toc li a:hover { text-decoration: underline; }

/* Related Guides Section */
.related-guides { margin-top: 2rem; padding-top: 1.5rem; border-top: 2px solid var(--gray-200); }
.related-guides-title { font-size: 1.125rem; font-weight: 700; color: var(--gray-900); margin-bottom: 1rem; }
.related-guides-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 1rem; }
.related-guide-card { display: block; padding: 1rem 1.25rem; background: var(--gray-50); border: 1px solid var(--gray-200); border-radius: var(--radius-md); text-decoration: none; transition: all 0.15s ease; }
.related-guide-card:hover { background: var(--primary-bg); border-color: var(--primary-light); transform: translateY(-2px); box-shadow: var(--shadow-md); text-decoration: none; }
.related-guide-card .card-label { font-size: 0.6875rem; font-weight: 600; color: var(--primary); text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 0.25rem; }
.related-guide-card .card-title { font-size: 0.9375rem; font-weight: 600; color: var(--gray-800); line-height: 1.4; }

/* Inline CSS Bar Charts */
.bar-chart { margin: 1.5rem 0; }
.bar-chart-title { font-size: 0.875rem; font-weight: 600; color: var(--gray-700); margin-bottom: 0.75rem; }
.bar-chart-row { display: flex; align-items: center; gap: 0.75rem; margin-bottom: 0.625rem; }
.bar-chart-label { flex-shrink: 0; width: 140px; font-size: 0.8125rem; color: var(--gray-700); text-align: right; }
.bar-chart-track { flex: 1; height: 24px; background: var(--gray-100); border-radius: var(--radius-sm); overflow: hidden; position: relative; }
.bar-chart-fill { height: 100%; border-radius: var(--radius-sm); display: flex; align-items: center; justify-content: flex-end; padding-right: 0.5rem; font-size: 0.6875rem; font-weight: 600; color: white; transition: width 0.5s ease; min-width: 2rem; }
.bar-chart-fill.green { background: linear-gradient(90deg, #10b981, #34d399); }
.bar-chart-fill.amber { background: linear-gradient(90deg, #f59e0b, #fbbf24); }
.bar-chart-fill.red { background: linear-gradient(90deg, #ef4444, #f87171); }
.bar-chart-fill.teal { background: linear-gradient(90deg, var(--primary), var(--primary-light)); }
.bar-chart-fill.blue { background: linear-gradient(90deg, #3b82f6, #60a5fa); }
@media (max-width: 600px) { .bar-chart-label { width: 100px; font-size: 0.75rem; } }

/* Callout / Info Boxes */
.callout { border-radius: var(--radius-md); padding: 1rem 1.25rem; margin: 1.25rem 0; border-left: 4px solid; }
.callout-info { background: #eff6ff; border-color: #3b82f6; }
.callout-warning { background: #fffbeb; border-color: #f59e0b; }
.callout-success { background: #ecfdf5; border-color: #10b981; }
.callout-danger { background: #fef2f2; border-color: #ef4444; }
.callout-title { font-size: 0.875rem; font-weight: 700; margin-bottom: 0.375rem; }
.callout-info .callout-title { color: #1d4ed8; }
.callout-warning .callout-title { color: #b45309; }
.callout-success .callout-title { color: #047857; }
.callout-danger .callout-title { color: #b91c1c; }
.callout p { font-size: 0.875rem; margin-bottom: 0.5rem; color: var(--gray-700); }
.callout p:last-child { margin-bottom: 0; }

/* Stat Highlight Cards */
.stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 1rem; margin: 1.5rem 0; }
.stat-card { text-align: center; padding: 1.25rem 1rem; background: white; border: 1px solid var(--gray-200); border-radius: var(--radius-md); }
.stat-number { font-size: 2rem; font-weight: 700; color: var(--primary-dark); line-height: 1.2; }
.stat-label { font-size: 0.8125rem; color: var(--gray-500); margin-top: 0.25rem; }

/* Comparison Table (enhanced) */
.comparison-table { width: 100%; border-collapse: collapse; margin: 1.5rem 0; font-size: 0.875rem; }
.comparison-table th { padding: 0.75rem 1rem; text-align: center; background: var(--gray-800); color: white; font-weight: 600; }
.comparison-table th:first-child { text-align: left; background: var(--gray-700); }
.comparison-table td { padding: 0.75rem 1rem; text-align: center; border-bottom: 1px solid var(--gray-200); }
.comparison-table td:first-child { text-align: left; font-weight: 500; color: var(--gray-800); }
.comparison-table tbody tr:hover { background: var(--gray-50); }
.comparison-table .check { color: var(--success); font-weight: 700; }
.comparison-table .cross { color: var(--error); font-weight: 700; }

/* Article Navigation */
.article-nav { display: flex; gap: 0.5rem; flex-wrap: wrap; margin-bottom: 1rem; font-size: 0.8125rem; }
.article-nav a { color: var(--gray-500); text-decoration: none; }
.article-nav a:hover { color: var(--primary-dark); }
.article-nav .separator { color: var(--gray-400); }
.article-nav .current { color: var(--gray-700); font-weight: 500; }

/* Inline Link Cards (for mid-article CTAs) */
.inline-cta { display: flex; align-items: center; gap: 1rem; padding: 1rem 1.25rem; background: linear-gradient(135deg, var(--primary-bg) 0%, #ecfdf5 100%); border: 1px solid var(--primary-light); border-radius: var(--radius-md); margin: 1.5rem 0; text-decoration: none; transition: all 0.15s ease; }
.inline-cta:hover { transform: translateY(-1px); box-shadow: var(--shadow-md); text-decoration: none; }
.inline-cta-icon { flex-shrink: 0; width: 40px; height: 40px; background: var(--primary); color: white; border-radius: var(--radius-md); display: flex; align-items: center; justify-content: center; font-size: 1.25rem; }
.inline-cta-content { flex: 1; }
.inline-cta-title { font-size: 0.9375rem; font-weight: 600; color: var(--gray-900); }
.inline-cta-desc { font-size: 0.8125rem; color: var(--gray-600); }

/* Horizontal Rule Styling */
.section-divider { border: none; border-top: 2px solid var(--gray-200); margin: 2rem 0; }

/* Enhanced List Styling for articles */
.content-section ul { margin-bottom: 1rem; }
.content-section ul li { margin-bottom: 0.375rem; }

/* ============================================
   PHASE 1: NEW CSS VISUAL COMPONENTS
   ============================================ */

/* Risk Spectrum — horizontal gradient bar with labeled markers */
.risk-spectrum { position: relative; margin: 2rem 0 3rem; }
.risk-spectrum-bar { height: 28px; border-radius: var(--radius-full); background: linear-gradient(90deg, #10b981 0%, #34d399 20%, #fbbf24 45%, #f59e0b 60%, #ef4444 80%, #dc2626 100%); position: relative; }
.risk-spectrum-marker { position: absolute; top: -8px; width: 3px; height: 44px; background: var(--gray-900); border-radius: 2px; transform: translateX(-50%); z-index: 2; }
.risk-spectrum-marker::after { content: attr(data-label); position: absolute; top: 48px; left: 50%; transform: translateX(-50%); font-size: 0.6875rem; font-weight: 600; color: var(--gray-700); white-space: nowrap; }
.risk-spectrum-marker::before { content: attr(data-value); position: absolute; top: -22px; left: 50%; transform: translateX(-50%); font-size: 0.75rem; font-weight: 700; color: var(--gray-900); white-space: nowrap; }
.risk-spectrum-labels { display: flex; justify-content: space-between; margin-top: 0.5rem; font-size: 0.75rem; color: var(--gray-500); padding: 0 0.25rem; }
.risk-spectrum-zone { position: absolute; top: 0; height: 100%; display: flex; align-items: center; justify-content: center; font-size: 0.6875rem; font-weight: 600; color: white; text-shadow: 0 1px 2px rgba(0,0,0,0.2); pointer-events: none; }

/* Donut Chart — CSS-only using conic-gradient */
.donut-chart { position: relative; width: 200px; height: 200px; border-radius: 50%; margin: 1.5rem auto; }
.donut-chart-hole { position: absolute; top: 25%; left: 25%; width: 50%; height: 50%; border-radius: 50%; background: white; display: flex; align-items: center; justify-content: center; font-size: 0.875rem; font-weight: 600; color: var(--gray-700); text-align: center; z-index: 2; }
.donut-chart-legend { display: flex; flex-wrap: wrap; justify-content: center; gap: 1rem; margin-top: 1rem; }
.donut-chart-legend-item { display: flex; align-items: center; gap: 0.375rem; font-size: 0.8125rem; color: var(--gray-700); }
.donut-chart-legend-swatch { width: 12px; height: 12px; border-radius: 3px; flex-shrink: 0; }

/* VS Comparison Cards — side-by-side with VS badge */
.vs-container { display: grid; grid-template-columns: 1fr auto 1fr; gap: 0; align-items: stretch; margin: 1.5rem 0; }
.vs-card { padding: 1.25rem; background: white; border: 1px solid var(--gray-200); border-radius: var(--radius-lg); }
.vs-card:first-child { border-right: none; border-top-right-radius: 0; border-bottom-right-radius: 0; }
.vs-card:last-child { border-left: none; border-top-left-radius: 0; border-bottom-left-radius: 0; }
.vs-card h4 { font-size: 1.125rem; color: var(--primary-dark); margin-bottom: 0.75rem; }
.vs-card ul { list-style: none; padding: 0; margin: 0; }
.vs-card ul li { padding: 0.375rem 0; font-size: 0.8125rem; color: var(--gray-600); border-bottom: 1px solid var(--gray-100); }
.vs-card ul li:last-child { border-bottom: none; }
.vs-badge { display: flex; align-items: center; justify-content: center; width: 44px; background: var(--gray-100); border-top: 1px solid var(--gray-200); border-bottom: 1px solid var(--gray-200); font-size: 0.875rem; font-weight: 800; color: var(--gray-500); letter-spacing: 0.05em; }
@media (max-width: 600px) {
  .vs-container { grid-template-columns: 1fr; }
  .vs-card:first-child { border-right: 1px solid var(--gray-200); border-radius: var(--radius-lg) var(--radius-lg) 0 0; border-bottom: none; }
  .vs-card:last-child { border-left: 1px solid var(--gray-200); border-radius: 0 0 var(--radius-lg) var(--radius-lg); border-top: none; }
  .vs-badge { width: 100%; height: 36px; border: 1px solid var(--gray-200); border-top: none; border-bottom: none; }
}

/* Step Indicator — numbered circles connected by lines */
.step-indicator { display: flex; align-items: flex-start; gap: 0; margin: 2rem 0; overflow-x: auto; padding-bottom: 0.5rem; }
.step-indicator-item { flex: 1; min-width: 120px; display: flex; flex-direction: column; align-items: center; position: relative; text-align: center; }
.step-indicator-item:not(:last-child)::after { content: ''; position: absolute; top: 20px; left: calc(50% + 20px); right: calc(-50% + 20px); height: 3px; background: var(--primary-light); z-index: 0; }
.step-indicator-circle { width: 40px; height: 40px; border-radius: 50%; background: var(--primary); color: white; display: flex; align-items: center; justify-content: center; font-size: 1rem; font-weight: 700; z-index: 1; flex-shrink: 0; box-shadow: 0 2px 8px rgba(20, 184, 166, 0.3); }
.step-indicator-label { margin-top: 0.625rem; font-size: 0.8125rem; font-weight: 600; color: var(--gray-800); line-height: 1.3; }
.step-indicator-desc { margin-top: 0.25rem; font-size: 0.75rem; color: var(--gray-500); line-height: 1.4; max-width: 140px; }
@media (max-width: 600px) {
  .step-indicator { flex-direction: column; align-items: flex-start; gap: 0; }
  .step-indicator-item { flex-direction: row; gap: 0.75rem; min-width: 0; text-align: left; align-items: flex-start; padding-left: 0; }
  .step-indicator-item:not(:last-child)::after { top: 40px; left: 19px; right: auto; width: 3px; height: calc(100% - 20px); }
  .step-indicator-item { padding-bottom: 1.25rem; }
  .step-indicator-desc { max-width: none; }
}

/* Sources / References List */
.sources-list { background: var(--gray-50); border: 1px solid var(--gray-200); border-radius: var(--radius-lg); padding: 1.25rem 1.5rem; margin: 2rem 0; }
.sources-list-title { font-size: 1rem; font-weight: 700; color: var(--gray-800); margin-bottom: 0.75rem; display: flex; align-items: center; gap: 0.5rem; }
.sources-list ol { padding-left: 1.25rem; margin: 0; counter-reset: source-counter; list-style: none; }
.sources-list li { position: relative; padding-left: 0.25rem; margin-bottom: 0.625rem; font-size: 0.8125rem; color: var(--gray-600); line-height: 1.5; counter-increment: source-counter; }
.sources-list li::before { content: counter(source-counter) "."; position: absolute; left: -1.25rem; font-weight: 600; color: var(--gray-500); }
.sources-list li a { color: var(--primary-dark); word-break: break-word; }
.sources-list li a:hover { text-decoration: underline; }

/* Stacked Bar Chart — horizontal stacked segments */
.stacked-bar { margin: 1.5rem 0; }
.stacked-bar-title { font-size: 0.875rem; font-weight: 600; color: var(--gray-700); margin-bottom: 0.75rem; }
.stacked-bar-row { display: flex; align-items: center; gap: 0.75rem; margin-bottom: 0.75rem; }
.stacked-bar-label { flex-shrink: 0; width: 100px; font-size: 0.8125rem; color: var(--gray-700); text-align: right; font-weight: 500; }
.stacked-bar-track { flex: 1; height: 28px; display: flex; border-radius: var(--radius-sm); overflow: hidden; }
.stacked-bar-segment { height: 100%; display: flex; align-items: center; justify-content: center; font-size: 0.625rem; font-weight: 600; color: white; text-shadow: 0 1px 1px rgba(0,0,0,0.15); min-width: 24px; transition: width 0.5s ease; }
.stacked-bar-legend { display: flex; flex-wrap: wrap; gap: 1rem; margin-top: 0.75rem; }
.stacked-bar-legend-item { display: flex; align-items: center; gap: 0.375rem; font-size: 0.75rem; color: var(--gray-600); }
.stacked-bar-legend-swatch { width: 12px; height: 12px; border-radius: 3px; flex-shrink: 0; }
@media (max-width: 600px) { .stacked-bar-label { width: 80px; font-size: 0.75rem; } }

/* Timeline / Life-Stage Table */
.timeline-table { width: 100%; border-collapse: collapse; margin: 1.5rem 0; font-size: 0.8125rem; }
.timeline-table th { padding: 0.75rem 0.875rem; background: var(--primary-dark); color: white; font-weight: 600; text-align: left; font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.03em; }
.timeline-table th:first-child { border-radius: var(--radius-md) 0 0 0; }
.timeline-table th:last-child { border-radius: 0 var(--radius-md) 0 0; }
.timeline-table td { padding: 0.75rem 0.875rem; border-bottom: 1px solid var(--gray-200); color: var(--gray-700); vertical-align: top; }
.timeline-table tbody tr:hover { background: var(--primary-bg); }
.timeline-table tbody tr:last-child td:first-child { border-radius: 0 0 0 var(--radius-md); }
.timeline-table tbody tr:last-child td:last-child { border-radius: 0 0 var(--radius-md) 0; }
.timeline-table .stage-badge { display: inline-block; padding: 0.25rem 0.5rem; border-radius: var(--radius-sm); font-size: 0.6875rem; font-weight: 600; }
.timeline-table .stage-badge.green { background: var(--success-bg); color: #059669; }
.timeline-table .stage-badge.amber { background: var(--warning-bg); color: #d97706; }
.timeline-table .stage-badge.red { background: var(--error-bg); color: #dc2626; }
.timeline-table .stage-badge.blue { background: #dbeafe; color: #1d4ed8; }
