/* ==========================================================================
   aBMICalculator.com — Stylesheet & Design System
   Directly matching the ImageColorPicker.com chromatic stripe UI aesthetic
   ========================================================================== */

:root {
  /* Color Palette */
  --bg-main: #0c0e12;
  --bg-card: #131418;
  --bg-card-secondary: #1a1c22;
  --bg-input: #1f222a;
  --bg-input-hover: #262933;
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-active: rgba(255, 255, 255, 0.22);
  --border-highlight: #3b82f6;

  /* Typography */
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --font-main: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  /* Accent & Category Colors */
  --color-brand-blue: #2596be;
  --color-brand-blue-glow: rgba(37, 150, 190, 0.35);
  --color-brand-yellow: #f59e0b;
  --color-underweight: #38bdf8;
  --color-normal: #10b981;
  --color-overweight: #f59e0b;
  --color-obese: #ef4444;
  --color-severe: #dc2626;

  /* UI Tokens */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --radius-pill: 9999px;
  --shadow-card: 0 20px 40px -15px rgba(0, 0, 0, 0.6), 0 0 1px 1px rgba(255, 255, 255, 0.05);
  --shadow-glow: 0 0 30px rgba(37, 150, 190, 0.15);
  --transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

[data-theme="light"] {
  --bg-main: #f1f5f9;
  --bg-card: #ffffff;
  --bg-card-secondary: #f8fafc;
  --bg-input: #e2e8f0;
  --bg-input-hover: #cbd5e1;
  --border-subtle: rgba(0, 0, 0, 0.08);
  --border-active: rgba(0, 0, 0, 0.2);
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #94a3b8;
  --shadow-card: 0 15px 35px -10px rgba(0, 0, 0, 0.12), 0 0 1px 1px rgba(0, 0, 0, 0.05);
}

/* Base Resets */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: var(--font-main);
  background-color: var(--bg-main);
  color: var(--text-primary);
  line-height: 1.5;
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
}

/* ==========================================================================
   Chromatic Vertical Stripes Background (Exact Match to Image Reference)
   ========================================================================== */
.stripe-background {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: -1;
  display: flex;
  pointer-events: none;
  opacity: 0.85;
}

[data-theme="light"] .stripe-background {
  opacity: 0.25;
}

.stripe {
  flex: 1;
  height: 100%;
}

/* Left Warm Crimson / Red Gradient Stripes */
.s1 { background: linear-gradient(180deg, #3d141e 0%, #581825 50%, #2a0e15 100%); }
.s2 { background: linear-gradient(180deg, #4c1723 0%, #681a2b 50%, #351019 100%); }
.s3 { background: linear-gradient(180deg, #581928 0%, #751e30 50%, #3e121d 100%); }
.s4 { background: linear-gradient(180deg, #631c2c 0%, #822235 50%, #461421 100%); }
.s5 { background: linear-gradient(180deg, #5c1c2a 0%, #762334 50%, #401520 100%); }
.s6 { background: linear-gradient(180deg, #4e1a26 0%, #63202e 50%, #36131c 100%); }
.s7 { background: linear-gradient(180deg, #3a1620 0%, #491a24 50%, #261016 100%); }
.s8 { background: linear-gradient(180deg, #25131b 0%, #2d1620 50%, #170d13 100%); }

/* Right Rich Emerald / Teal / Forest Green Gradient Stripes */
.s9  { background: linear-gradient(180deg, #102120 0%, #152c2a 50%, #0c1817 100%); }
.s10 { background: linear-gradient(180deg, #0e2d2b 0%, #143e3b 50%, #0a2120 100%); }
.s11 { background: linear-gradient(180deg, #0c3e3a 0%, #13554f 50%, #092e2b 100%); }
.s12 { background: linear-gradient(180deg, #0b4e49 0%, #116861 50%, #083b37 100%); }
.s13 { background: linear-gradient(180deg, #0d5f59 0%, #137e75 50%, #094743 100%); }
.s14 { background: linear-gradient(180deg, #0e6c65 0%, #158f85 50%, #0a514c 100%); }
.s15 { background: linear-gradient(180deg, #0e5b55 0%, #13776e 50%, #094440 100%); }
.s16 { background: linear-gradient(180deg, #0c433f 0%, #105953 50%, #08312e 100%); }

.stripe-vignette {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 25%, rgba(12, 14, 18, 0.45) 0%, rgba(12, 14, 18, 0.88) 75%, rgba(12, 14, 18, 0.98) 100%);
}

[data-theme="light"] .stripe-vignette {
  background: radial-gradient(circle at 50% 25%, rgba(241, 245, 249, 0.4) 0%, rgba(241, 245, 249, 0.85) 75%, rgba(241, 245, 249, 0.95) 100%);
}

/* ==========================================================================
   Header & Navigation
   ========================================================================== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  background: rgba(12, 14, 18, 0.65);
  border-bottom: 1px solid var(--border-subtle);
  transition: var(--transition);
}

[data-theme="light"] .site-header {
  background: rgba(255, 255, 255, 0.8);
}

.nav-container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0.85rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}

.brand-logo {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  font-weight: 800;
  font-size: 1.25rem;
  letter-spacing: -0.025em;
  color: var(--text-primary);
  text-decoration: none;
  transition: transform 0.2s ease;
}

.brand-logo:hover {
  transform: scale(1.02);
}

.logo-icon {
  width: 26px;
  height: 26px;
  flex-shrink: 0;
  color: #38bdf8;
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.brand-logo:hover .logo-icon {
  transform: rotate(45deg);
}

.logo-icon path {
  fill: currentColor;
}

[data-theme="light"] .logo-icon {
  color: #0f172a;
}

.brand-text {
  font-weight: 800;
  color: var(--text-primary);
}

.brand-tld {
  font-weight: 400;
  color: var(--text-secondary);
  opacity: 0.85;
}

.nav-center {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.nav-link {
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--text-secondary);
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  transition: var(--transition);
  padding: 0.4rem 0.6rem;
  border-radius: var(--radius-sm);
}

.nav-link:hover {
  color: var(--text-primary);
}

.nav-dropdown {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.dropdown-toggle {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.45rem 0.75rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
}

.dropdown-menu {
  position: absolute;
  top: calc(100% + 2px);
  left: 0;
  background: #181b22;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: var(--radius-md);
  padding: 0.5rem;
  min-width: 270px;
  box-shadow: 0 20px 45px rgba(0, 0, 0, 0.8), 0 0 1px 1px rgba(255, 255, 255, 0.1);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(6px);
  transition: opacity 0.18s cubic-bezier(0.16, 1, 0.3, 1), transform 0.18s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.18s;
  z-index: 99999;
}

/* Invisible hover bridge that prevents dropdown from closing when moving mouse */
.dropdown-menu::before {
  content: '';
  position: absolute;
  top: -16px;
  left: 0;
  width: 100%;
  height: 16px;
  background: transparent;
}

[data-theme="light"] .dropdown-menu {
  background: #ffffff;
  border: 1px solid #cbd5e1;
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.15), 0 0 1px 1px rgba(0, 0, 0, 0.05);
}

.nav-dropdown:hover .dropdown-menu,
.nav-dropdown:focus-within .dropdown-menu,
.nav-dropdown.active .dropdown-menu {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(0);
}

.dropdown-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 0.95rem;
  font-size: 0.9rem;
  font-weight: 600;
  color: #cbd5e1;
  border-radius: var(--radius-sm);
  transition: var(--transition);
  cursor: pointer;
  text-decoration: none;
}

[data-theme="light"] .dropdown-item {
  color: #334155;
}

.dropdown-item:hover, .dropdown-item:focus {
  color: #38bdf8;
  background: rgba(56, 189, 248, 0.14);
  transform: translateX(3px);
}

[data-theme="light"] .dropdown-item:hover, [data-theme="light"] .dropdown-item:focus {
  color: #0284c7;
  background: rgba(2, 132, 199, 0.1);
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.theme-toggle {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.theme-toggle:hover {
  background: rgba(37, 150, 190, 0.2);
  border-color: var(--accent-cyan);
  transform: rotate(15deg) scale(1.05);
}

.theme-toggle .sun-icon { 
  display: block; 
  width: 18px; 
  height: 18px; 
  color: #f59e0b;
}

.theme-toggle .moon-icon { 
  display: none; 
  width: 18px; 
  height: 18px; 
  color: #38bdf8;
}

[data-theme="light"] .theme-toggle .sun-icon { display: none; }
[data-theme="light"] .theme-toggle .moon-icon { display: block; }

.btn-login {
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
  font-size: 0.88rem;
  font-weight: 600;
  padding: 0.45rem 1.05rem;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border-subtle);
  transition: var(--transition);
}

[data-theme="light"] .btn-login {
  background: #ffffff;
  color: #0f172a;
  border-color: rgba(0, 0, 0, 0.12);
}

.btn-login:hover {
  background: rgba(255, 255, 255, 0.14);
}

.btn-signup {
  background: #000000;
  color: #ffffff;
  font-size: 0.88rem;
  font-weight: 600;
  padding: 0.45rem 1.15rem;
  border-radius: var(--radius-pill);
  border: 1px solid rgba(255, 255, 255, 0.2);
  transition: var(--transition);
}

[data-theme="light"] .btn-signup {
  background: #0f172a;
  border-color: transparent;
}

/* Article Live Search Bar */
.article-search-container input:focus {
  border-color: #38bdf8 !important;
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.25), 0 6px 25px rgba(0, 0, 0, 0.4) !important;
}

[data-theme="light"] .article-search-container input {
  background: #ffffff !important;
  border-color: #cbd5e1 !important;
  color: #0f172a !important;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.06) !important;
}

[data-theme="light"] .article-search-container input:focus {
  border-color: #0284c7 !important;
  box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.2), 0 4px 15px rgba(0, 0, 0, 0.1) !important;
}

#clearSearchBtn:hover {
  background: rgba(239, 68, 68, 0.2) !important;
  color: #ef4444 !important;
}

.btn-signup:hover {
  background: #18181b;
  border-color: rgba(255, 255, 255, 0.35);
  transform: translateY(-1px);
}

/* ==========================================================================
   Hero & Tool Switcher Bar
   ========================================================================== */
.main-wrapper {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem 1.5rem 5rem;
}

.hero-section {
  text-align: center;
  margin-bottom: 2.25rem;
}

.tool-tabs-bar {
  display: inline-flex;
  align-items: center;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  padding: 0.35rem;
  border-radius: var(--radius-pill);
  gap: 0.35rem;
  margin-bottom: 1.75rem;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.4);
  max-width: 100%;
  overflow-x: auto;
}

.tool-tab {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.55rem 1.15rem;
  border-radius: var(--radius-pill);
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-secondary);
  transition: var(--transition);
  white-space: nowrap;
  cursor: pointer;
  border: none;
  background: transparent;
}

.tool-tab:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.08);
}

.tool-tab.active {
  background: #ffffff;
  color: #0c0e12;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.25);
}

[data-theme="light"] .tool-tab.active {
  background: #0f172a;
  color: #ffffff;
}

.hero-title {
  font-size: clamp(2rem, 4vw, 3.25rem);
  font-weight: 800;
  letter-spacing: -0.035em;
  color: #ffffff;
  line-height: 1.18;
  margin-bottom: 0.85rem;
}

[data-theme="light"] .hero-title {
  color: #0f172a;
}

.hero-subtitle {
  font-size: clamp(0.96rem, 1.7vw, 1.1rem);
  color: #94a3b8;
  max-width: 680px;
  margin: 0 auto;
  line-height: 1.55;
}

/* ==========================================================================
   Tool Cards Container System
   ========================================================================== */
.tool-container {
  display: none;
  animation: fadeIn 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.tool-container.active {
  display: block !important;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.calculator-container {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  box-shadow: var(--shadow-card);
  position: relative;
  backdrop-filter: blur(12px);
  margin-bottom: 3.5rem;
  transition: var(--transition);
}

.calculator-container.is-fullscreen {
  position: fixed;
  inset: 1.5rem;
  z-index: 200;
  overflow-y: auto;
  max-width: 1300px;
  margin: auto;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.85);
}

.card-top-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
  padding-bottom: 0.85rem;
  border-bottom: 1px solid var(--border-subtle);
}

.card-badge {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.pulse-dot {
  width: 8px;
  height: 8px;
  background: var(--color-normal);
  border-radius: 50%;
  box-shadow: 0 0 10px var(--color-normal);
  animation: pulseAnimation 2s infinite;
}

@keyframes pulseAnimation {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.85); }
}

.btn-fullscreen {
  width: 32px;
  height: 32px;
  background: var(--bg-input);
  color: var(--text-secondary);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}

.btn-fullscreen:hover {
  background: var(--bg-input-hover);
  color: var(--text-primary);
  transform: scale(1.08);
}

/* Grid Layout */
.calc-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
}

@media (max-width: 880px) {
  .calc-grid {
    grid-template-columns: 1fr;
  }
}

.section-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
}

.label-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}

.label-subtitle {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-muted);
  background: var(--bg-card-secondary);
  padding: 0.2rem 0.55rem;
  border-radius: var(--radius-pill);
}

/* Unit Toggle */
.unit-toggle {
  display: flex;
  background: var(--bg-input);
  padding: 3px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border-subtle);
}

.unit-btn {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-secondary);
  padding: 0.35rem 0.8rem;
  border-radius: var(--radius-pill);
  transition: var(--transition);
}

.unit-btn.active {
  background: #ffffff;
  color: #0c0e12;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

[data-theme="light"] .unit-btn.active {
  background: #0f172a;
  color: #ffffff;
}

/* Input Cards */
.input-card {
  background: #161a22;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-md);
  padding: 1.1rem 1.25rem;
  margin-bottom: 1rem;
  transition: var(--transition);
}

.input-card:hover, .input-card:focus-within {
  border-color: rgba(56, 189, 248, 0.45);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

[data-theme="light"] .input-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
}

[data-theme="light"] .input-card:hover, [data-theme="light"] .input-card:focus-within {
  border-color: #38bdf8;
}

.input-card.hidden {
  display: none;
}

.form-row.two-cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.input-label {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  display: block;
}

.label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.6rem;
}

.input-val-badge {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 700;
  color: #38bdf8;
  background: rgba(56, 189, 248, 0.15);
  border: 1px solid rgba(56, 189, 248, 0.3);
  padding: 0.22rem 0.6rem;
  border-radius: var(--radius-sm);
}

[data-theme="light"] .input-val-badge {
  color: #0284c7;
  background: rgba(2, 132, 199, 0.1);
  border-color: rgba(2, 132, 199, 0.25);
}

.field-hint {
  font-size: 0.76rem;
  color: var(--text-muted);
  margin-top: 0.45rem;
  line-height: 1.4;
}

/* Gender Toggle Buttons */
.gender-toggle {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.gender-btn {
  flex: 1;
  background: #1e2430;
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--text-secondary);
  font-size: 0.88rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.6rem 0.5rem;
  border-radius: var(--radius-sm);
  transition: var(--transition);
}

[data-theme="light"] .gender-btn {
  background: #f1f5f9;
  border-color: #cbd5e1;
}

.gender-btn.active {
  background: #0284c7;
  color: #ffffff;
  border-color: #38bdf8;
  box-shadow: 0 0 14px rgba(56, 189, 248, 0.4);
}

/* High-Contrast Custom Sliders & Number Inputs */
.slider-group {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  margin-top: 0.5rem;
}

.custom-slider {
  flex: 1;
  -webkit-appearance: none;
  appearance: none;
  height: 8px;
  background: #334155;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: var(--radius-pill);
  outline: none;
  cursor: pointer;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.5);
}

[data-theme="light"] .custom-slider {
  background: #cbd5e1;
  border: 1px solid rgba(0, 0, 0, 0.12);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1);
}

.custom-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #38bdf8;
  border: 2.5px solid #ffffff;
  box-shadow: 0 0 12px rgba(56, 189, 248, 0.8), 0 2px 6px rgba(0, 0, 0, 0.5);
  cursor: pointer;
  transition: transform 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}

.custom-slider::-webkit-slider-thumb:hover {
  transform: scale(1.2);
  background: #0ea5e9;
  box-shadow: 0 0 18px rgba(14, 165, 233, 0.95), 0 3px 8px rgba(0, 0, 0, 0.6);
}

.custom-slider::-moz-range-thumb {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #38bdf8;
  border: 2.5px solid #ffffff;
  box-shadow: 0 0 12px rgba(56, 189, 248, 0.8), 0 2px 6px rgba(0, 0, 0, 0.5);
  cursor: pointer;
  transition: transform 0.15s ease, background 0.15s ease;
}

.custom-slider::-moz-range-thumb:hover {
  transform: scale(1.2);
  background: #0ea5e9;
}

.number-input-wrap {
  display: flex;
  align-items: center;
  background: #1e2430;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: var(--radius-sm);
  padding: 0.4rem 0.75rem;
  min-width: 100px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
  transition: var(--transition);
}

[data-theme="light"] .number-input-wrap {
  background: #ffffff;
  border: 1px solid #cbd5e1;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.number-input-wrap:focus-within {
  border-color: #38bdf8;
  box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.3);
}

.number-input-wrap input {
  font-family: var(--font-mono);
  font-size: 1rem;
  font-weight: 700;
  color: #ffffff;
  background: transparent;
  border: none;
  outline: none;
  width: 100%;
}

[data-theme="light"] .number-input-wrap input {
  color: #0f172a;
}

.unit-suffix {
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-left: 0.3rem;
}

.imperial-height-inputs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  margin-top: 0.5rem;
}

/* Date & Select Inputs */
.select-wrapper {
  position: relative;
  margin-top: 0.4rem;
}

.custom-select {
  width: 100%;
  appearance: none;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  font-size: 0.88rem;
  font-weight: 500;
  padding: 0.65rem 2.2rem 0.65rem 0.85rem;
  border-radius: var(--radius-sm);
  outline: none;
  cursor: pointer;
  transition: var(--transition);
}

.custom-select:focus {
  border-color: var(--border-active);
}

.select-arrow {
  position: absolute;
  right: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
  width: 16px;
  height: 16px;
}

.date-input-wrap {
  margin-top: 0.5rem;
}

.custom-date-input {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 0.92rem;
  font-weight: 600;
  padding: 0.65rem 0.85rem;
  border-radius: var(--radius-sm);
  outline: none;
  cursor: pointer;
}

.custom-date-input:focus {
  border-color: var(--border-active);
}

/* Goal Selection Grid */
.goal-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.6rem;
  margin-top: 0.5rem;
}

.goal-btn {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  padding: 0.65rem 0.75rem;
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  font-weight: 600;
  text-align: left;
  transition: var(--transition);
}

.goal-btn.active {
  background: #ea580c;
  color: #ffffff;
  border-color: #ea580c;
  box-shadow: 0 0 12px rgba(234, 88, 12, 0.4);
}

/* Method Toggle */
.method-toggle {
  display: flex;
  gap: 0.4rem;
  margin-top: 0.5rem;
}

.method-btn {
  flex: 1;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  padding: 0.55rem 0.45rem;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  font-weight: 600;
  text-align: center;
  transition: var(--transition);
}

.method-btn.active {
  background: #7c3aed;
  color: #ffffff;
  border-color: #7c3aed;
  box-shadow: 0 0 12px rgba(124, 58, 237, 0.4);
}

/* ==========================================================================
   Results & Swatches
   ========================================================================== */
.swatches-container {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

@media (max-width: 520px) {
  .swatches-container {
    grid-template-columns: 1fr;
  }
}

.swatch-large {
  background: var(--color-brand-blue);
  border-radius: var(--radius-md);
  padding: 1.4rem 1.25rem;
  min-height: 130px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  color: #ffffff;
  position: relative;
  box-shadow: 0 10px 25px -5px var(--color-brand-blue-glow);
  transition: background 0.3s ease, box-shadow 0.3s ease;
}

.swatch-secondary {
  background: #5bb3d6;
  border-radius: var(--radius-md);
  padding: 1.4rem 1.25rem;
  min-height: 130px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  color: #ffffff;
  box-shadow: 0 10px 25px -5px rgba(91, 179, 214, 0.3);
  transition: background 0.3s ease;
}

.swatch-label {
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  opacity: 0.9;
  display: block;
  margin-bottom: 0.25rem;
}

.swatch-score {
  font-size: 2.8rem;
  font-weight: 800;
  font-family: var(--font-mono);
  letter-spacing: -0.04em;
  line-height: 1;
  display: block;
  margin-bottom: 0.35rem;
}

.swatch-status {
  font-size: 0.88rem;
  font-weight: 700;
  background: rgba(0, 0, 0, 0.2);
  display: inline-block;
  padding: 0.2rem 0.65rem;
  border-radius: var(--radius-pill);
  backdrop-filter: blur(4px);
}

.swatch-subscore {
  font-size: 1.35rem;
  font-weight: 700;
  font-family: var(--font-mono);
  line-height: 1.2;
  display: block;
  margin-bottom: 0.25rem;
}

.swatch-subnote {
  font-size: 0.8rem;
  opacity: 0.85;
}

/* Spectrum Gauge Bar */
.gauge-card {
  background: var(--bg-card-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1rem 1.15rem;
  margin-bottom: 1.25rem;
}

.gauge-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 0.85rem;
}

.mono-badge {
  font-family: var(--font-mono);
  color: var(--text-primary);
  background: var(--bg-input);
  padding: 0.15rem 0.5rem;
  border-radius: var(--radius-sm);
}

.spectrum-bar {
  display: flex;
  height: 10px;
  border-radius: var(--radius-pill);
  overflow: visible;
  position: relative;
  margin-bottom: 0.85rem;
}

.spectrum-segment {
  height: 100%;
}

.spectrum-segment.underweight { width: 20%; background: var(--color-underweight); border-radius: 6px 0 0 6px; }
.spectrum-segment.normal { width: 35%; background: var(--color-normal); }
.spectrum-segment.overweight { width: 25%; background: var(--color-overweight); }
.spectrum-segment.obese { width: 20%; background: var(--color-obese); border-radius: 0 6px 6px 0; }

.spectrum-needle {
  position: absolute;
  top: -6px;
  transform: translateX(-50%);
  transition: left 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  flex-direction: column;
  align-items: center;
}

.needle-tip {
  width: 14px;
  height: 22px;
  background: #ffffff;
  border-radius: 3px;
  box-shadow: 0 0 8px rgba(0, 0, 0, 0.8), 0 0 12px #ffffff;
}

.spectrum-legend {
  display: flex;
  justify-content: space-between;
  font-size: 0.72rem;
  font-weight: 600;
}

.c-blue { color: var(--color-underweight); }
.c-green { color: var(--color-normal); }
.c-yellow { color: var(--color-overweight); }
.c-red { color: var(--color-obese); }

/* Macro Breakdown Bars */
.macro-breakdown-card {
  background: var(--bg-card-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1rem 1.15rem;
  margin-bottom: 1.25rem;
}

.macro-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 0.85rem;
}

.macro-bars-grid {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.macro-label-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-bottom: 0.25rem;
}

.macro-progress {
  height: 8px;
  background: var(--bg-input);
  border-radius: 4px;
  overflow: hidden;
}

.macro-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.3s ease;
}

.p-fill { background: #38bdf8; }
.c-fill { background: #10b981; }
.f-fill { background: #f59e0b; }

.macro-cals {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

/* Fertility Timeline Card */
.fertility-timeline-card {
  background: var(--bg-card-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1rem 1.15rem;
  margin-bottom: 1.25rem;
}

.timeline-title {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-secondary);
  margin-bottom: 0.75rem;
}

.milestone-rows {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.milestone-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: var(--bg-input);
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius-sm);
}

.milestone-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.dot-pink { background: #ec4899; box-shadow: 0 0 8px #ec4899; }
.dot-purple { background: #8b5cf6; box-shadow: 0 0 8px #8b5cf6; }
.dot-teal { background: #14b8a6; box-shadow: 0 0 8px #14b8a6; }

.milestone-info {
  display: flex;
  justify-content: space-between;
  width: 100%;
  align-items: center;
}

.milestone-name {
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.milestone-date {
  font-family: var(--font-mono);
  font-size: 0.84rem;
  font-weight: 700;
  color: var(--text-primary);
}

/* Trimester Progress Meter */
.trimester-meter-card {
  background: var(--bg-card-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1rem 1.15rem;
  margin-bottom: 1.25rem;
}

.trimester-header {
  display: flex;
  justify-content: space-between;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 0.65rem;
}

.trimester-track {
  height: 10px;
  background: var(--bg-input);
  border-radius: var(--radius-pill);
  overflow: hidden;
  margin-bottom: 0.6rem;
}

.trimester-bar {
  height: 100%;
  background: linear-gradient(90deg, #7c3aed 0%, #a855f7 100%);
  border-radius: var(--radius-pill);
  transition: width 0.4s ease;
}

.trimester-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.72rem;
  color: var(--text-muted);
}

.t-label.active {
  color: #a78bfa;
  font-weight: 700;
}

/* Code Box */
.code-box {
  background: #090a0d;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 0.5rem 0.85rem;
  margin-bottom: 1.25rem;
}

[data-theme="light"] .code-box {
  background: #f1f5f9;
}

.code-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.55rem 0.35rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

[data-theme="light"] .code-row {
  border-bottom: 1px solid rgba(0, 0, 0, 0.04);
}

.code-row:last-child {
  border-bottom: none;
}

.code-label {
  font-size: 0.76rem;
  font-weight: 700;
  color: var(--text-muted);
  letter-spacing: 0.05em;
}

.code-value {
  font-family: var(--font-mono);
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-primary);
}

.code-tag {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-secondary);
  background: var(--bg-card-secondary);
  padding: 0.15rem 0.45rem;
  border-radius: var(--radius-sm);
}

.code-tag.highlight {
  color: #10b981;
  background: rgba(16, 185, 129, 0.15);
}

.btn-copy {
  color: var(--text-secondary);
  padding: 0.25rem;
  border-radius: 4px;
  transition: var(--transition);
  display: flex;
  align-items: center;
}

.btn-copy:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.1);
}

/* Action Buttons */
.action-buttons-row {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 0.75rem;
}

.btn-primary {
  background: #ffffff;
  color: #0c0e12;
  font-size: 0.9rem;
  font-weight: 700;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  box-shadow: 0 4px 12px rgba(255, 255, 255, 0.15);
  transition: var(--transition);
}

[data-theme="light"] .btn-primary {
  background: #0f172a;
  color: #ffffff;
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(255, 255, 255, 0.25);
}

.btn-secondary {
  background: var(--bg-input);
  color: var(--text-secondary);
  font-size: 0.9rem;
  font-weight: 600;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  transition: var(--transition);
}

.btn-secondary:hover {
  background: var(--bg-input-hover);
  color: var(--text-primary);
}

/* ==========================================================================
   Section Components (Table, Blogs, FAQ, Formulas, History)
   ========================================================================== */
.info-section {
  margin-bottom: 4.5rem;
  scroll-margin-top: 5rem;
}

.section-header-box {
  margin-bottom: 1.75rem;
}

.section-header-box.history-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
}

.badge-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-brand-blue);
  background: rgba(37, 150, 190, 0.12);
  padding: 0.3rem 0.75rem;
  border-radius: var(--radius-pill);
  margin-bottom: 0.75rem;
}

.section-title {
  font-size: 1.6rem;
  font-weight: 800;
  letter-spacing: -0.025em;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 0.45rem;
}

.section-desc {
  font-size: 0.95rem;
  color: var(--text-secondary);
}

/* Blog Category Filter Buttons */
.blog-filters-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1.25rem;
}

.blog-filter-btn {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-secondary);
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  padding: 0.45rem 0.95rem;
  border-radius: var(--radius-pill);
  transition: var(--transition);
}

.blog-filter-btn:hover {
  color: var(--text-primary);
  border-color: rgba(255, 255, 255, 0.2);
}

.blog-filter-btn.active {
  background: var(--color-brand-blue);
  color: #ffffff;
  border-color: var(--color-brand-blue);
  box-shadow: 0 0 12px var(--color-brand-blue-glow);
}

/* Reference Tables */
.table-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  overflow-x: auto;
  box-shadow: var(--shadow-card);
}

.ref-table-card {
  display: none;
}

.ref-table-card.active {
  display: block;
  animation: fadeIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.bmi-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.92rem;
}

.bmi-table th {
  background: var(--bg-card-secondary);
  color: var(--text-secondary);
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.95rem 1.25rem;
  border-bottom: 1px solid var(--border-subtle);
}

.bmi-table td {
  padding: 0.95rem 1.25rem;
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  transition: var(--transition);
}

.bmi-table tbody tr:hover {
  background: rgba(255, 255, 255, 0.03);
}

.bmi-table tbody tr.active-user-row {
  background: rgba(37, 150, 190, 0.14) !important;
}

.bmi-table tbody tr.active-user-row td {
  color: var(--text-primary);
  font-weight: 600;
}

.tag-badge {
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.25rem 0.6rem;
  border-radius: var(--radius-pill);
  display: inline-block;
}

.bg-blue-dark { background: #1e3a8a; color: #93c5fd; }
.bg-blue { background: #0284c7; color: #e0f2fe; }
.bg-blue-light { background: #0369a1; color: #bae6fd; }
.bg-green { background: #065f46; color: #a7f3d0; }
.bg-yellow { background: #854d0e; color: #fef08a; }
.bg-orange { background: #9a3412; color: #fed7aa; }
.bg-red { background: #991b1b; color: #fecaca; }
.bg-red-dark { background: #7f1d1d; color: #fca5a5; }

/* Blogs Grid */
.blogs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 1.75rem;
}

.blog-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-card);
  transition: var(--transition);
  cursor: pointer;
  display: flex;
  flex-direction: column;
}

.blog-card.hidden {
  display: none !important;
}

.blog-card:hover {
  transform: translateY(-4px);
  border-color: rgba(255, 255, 255, 0.2);
  box-shadow: 0 20px 35px -10px rgba(0, 0, 0, 0.7);
}

.blog-image-wrap {
  position: relative;
  height: 170px;
  overflow: hidden;
}

.blog-color-banner {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.4s ease;
}

.blog-card:hover .blog-color-banner {
  transform: scale(1.04);
}

.banner-emerald { background: linear-gradient(135deg, #064e3b 0%, #0d9488 100%); }
.banner-cyan { background: linear-gradient(135deg, #164e63 0%, #0284c7 100%); }
.banner-orange { background: linear-gradient(135deg, #7c2d12 0%, #ea580c 100%); }
.banner-pink { background: linear-gradient(135deg, #831843 0%, #db2777 100%); }
.banner-purple { background: linear-gradient(135deg, #4c1d95 0%, #7c3aed 100%); }
.banner-teal { background: linear-gradient(135deg, #134e4a 0%, #0f766e 100%); }

.banner-icon {
  width: 56px;
  height: 56px;
  color: rgba(255, 255, 255, 0.85);
  filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.3));
}

.blog-category-tag {
  position: absolute;
  bottom: 0.85rem;
  left: 0.85rem;
  font-size: 0.74rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background: rgba(0, 0, 0, 0.65);
  color: #ffffff;
  padding: 0.25rem 0.65rem;
  border-radius: var(--radius-pill);
  backdrop-filter: blur(8px);
}

.blog-content {
  padding: 1.35rem;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.blog-meta {
  display: flex;
  align-items: center;
  gap: 1rem;
  font-size: 0.76rem;
  color: var(--text-muted);
  margin-bottom: 0.65rem;
}

.blog-meta span {
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

.blog-title {
  font-size: 1.12rem;
  font-weight: 700;
  line-height: 1.35;
  color: var(--text-primary);
  margin-bottom: 0.65rem;
}

.blog-excerpt {
  font-size: 0.88rem;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 1.25rem;
  flex: 1;
}

.blog-footer {
  padding-top: 0.85rem;
  border-top: 1px solid var(--border-subtle);
}

.read-more-link {
  font-size: 0.84rem;
  font-weight: 700;
  color: var(--color-brand-blue);
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  transition: var(--transition);
}

.blog-card:hover .read-more-link {
  transform: translateX(4px);
}

/* ==========================================================================
   FAQ Accordion Section (On-Page SEO)
   ========================================================================== */
.faq-accordion-list {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.ref-faq-card {
  display: none;
}

.ref-faq-card.active {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  animation: fadeIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.faq-item {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: var(--transition);
}

.faq-item.active {
  border-color: rgba(255, 255, 255, 0.2);
}

.faq-question {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.15rem 1.35rem;
  font-size: 0.98rem;
  font-weight: 700;
  color: var(--text-primary);
  text-align: left;
  transition: var(--transition);
}

.faq-question:hover {
  background: var(--bg-card-secondary);
}

.faq-icon {
  width: 18px;
  height: 18px;
  color: var(--text-muted);
  transition: transform 0.3s ease;
  flex-shrink: 0;
  margin-left: 1rem;
}

.faq-item.active .faq-icon {
  transform: rotate(180deg);
  color: var(--color-brand-blue);
}

.faq-answer {
  display: none;
  padding: 0 1.35rem 1.25rem;
  font-size: 0.92rem;
  line-height: 1.6;
  color: var(--text-secondary);
  border-top: 1px solid rgba(255, 255, 255, 0.04);
}

.faq-item.active .faq-answer {
  display: block;
}

.faq-answer code {
  font-family: var(--font-mono);
  background: rgba(37, 150, 190, 0.12);
  color: var(--color-brand-blue);
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
}

/* Formulas Grid */
.formulas-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
}

.ref-formula-card {
  display: none;
}

.ref-formula-card.active {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
  animation: fadeIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.formula-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  box-shadow: var(--shadow-card);
}

.formula-icon {
  width: 44px;
  height: 44px;
  background: var(--bg-input);
  color: var(--color-brand-blue);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1rem;
}

.formula-card h3 {
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 0.6rem;
}

.formula-code {
  font-family: var(--font-mono);
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--color-brand-blue);
  background: rgba(37, 150, 190, 0.1);
  padding: 0.6rem 0.8rem;
  border-radius: var(--radius-sm);
  margin-bottom: 0.6rem;
  line-height: 1.4;
}

.formula-desc {
  font-size: 0.84rem;
  color: var(--text-secondary);
}

/* History Section & Filter Tabs */
.history-filters-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.85rem;
}

.history-filter-btn {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-secondary);
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  padding: 0.3rem 0.75rem;
  border-radius: var(--radius-pill);
  transition: var(--transition);
}

.history-filter-btn:hover {
  color: var(--text-primary);
  border-color: rgba(255, 255, 255, 0.2);
}

.history-filter-btn.active {
  background: var(--color-brand-blue);
  color: #ffffff;
  border-color: var(--color-brand-blue);
  box-shadow: 0 0 10px var(--color-brand-blue-glow);
}

.btn-clear-history {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-muted);
  background: var(--bg-input);
  padding: 0.4rem 0.85rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  transition: var(--transition);
}

.btn-clear-history:hover {
  color: #ef4444;
  border-color: rgba(239, 68, 68, 0.3);
}

.history-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  box-shadow: var(--shadow-card);
  min-height: 120px;
}

.empty-history {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: var(--text-muted);
  padding: 2rem 1rem;
  gap: 0.75rem;
}

.history-items-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.history-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-card-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 0.75rem 1rem;
  transition: var(--transition);
}

.history-item:hover {
  border-color: rgba(255, 255, 255, 0.15);
}

.history-item-left {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.history-bmi-badge {
  font-family: var(--font-mono);
  font-size: 1.05rem;
  font-weight: 800;
  color: #ffffff;
  padding: 0.25rem 0.65rem;
  border-radius: var(--radius-sm);
  min-width: 60px;
  text-align: center;
}

.history-details {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.history-category {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-primary);
}

.history-stats {
  font-size: 0.78rem;
  color: var(--text-secondary);
}

.history-date {
  font-size: 0.74rem;
  color: var(--text-muted);
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--border-subtle);
  background: rgba(12, 14, 18, 0.9);
  padding: 4rem 1.5rem 2.5rem;
}

[data-theme="light"] .site-footer {
  background: #e2e8f0;
}

.footer-container {
  max-width: 1200px;
  margin: 0 auto 3rem;
  display: grid;
  grid-template-columns: 1.5fr 2fr;
  gap: 3rem;
}

@media (max-width: 768px) {
  .footer-container {
    grid-template-columns: 1fr;
  }
}

.footer-tagline {
  font-size: 0.88rem;
  color: var(--text-muted);
  margin-top: 0.85rem;
  max-width: 320px;
}

.footer-links {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}

@media (max-width: 520px) {
  .footer-links {
    grid-template-columns: 1fr 1fr;
  }
}

.footer-col h4 {
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-primary);
  margin-bottom: 0.85rem;
}

.footer-col a {
  display: block;
  font-size: 0.84rem;
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
  transition: var(--transition);
}

.footer-col a:hover {
  color: var(--text-primary);
}

.footer-bottom {
  max-width: 1200px;
  margin: 0 auto;
  border-top: 1px solid var(--border-subtle);
  padding-top: 1.5rem;
  font-size: 0.78rem;
  color: var(--text-muted);
  text-align: center;
  line-height: 1.6;
}

/* Modal & Toast */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  opacity: 0;
  visibility: hidden;
  transition: var(--transition);
}

.modal-backdrop.active {
  opacity: 1;
  visibility: visible;
}

.modal-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  max-width: 760px;
  width: 100%;
  max-height: 88vh;
  overflow-y: auto;
  padding: 2.25rem;
  position: relative;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.8);
  transform: scale(0.95);
  transition: var(--transition);
}

.modal-backdrop.active .modal-card {
  transform: scale(1);
}

.btn-close-modal {
  position: absolute;
  top: 1.25rem;
  right: 1.25rem;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--bg-input);
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}

.btn-close-modal:hover {
  background: var(--bg-input-hover);
  color: var(--text-primary);
}

.toast {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  background: #10b981;
  color: #ffffff;
  font-size: 0.88rem;
  font-weight: 600;
  padding: 0.75rem 1.25rem;
  border-radius: var(--radius-sm);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
  transform: translateY(100px);
  opacity: 0;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 1500;
}

.toast.show {
  transform: translateY(0);
  opacity: 1;
}

/* Icon Sizing Helper Classes */
.icon-xs { width: 14px; height: 14px; }
.icon-sm { width: 18px; height: 18px; }
.icon-md { width: 22px; height: 22px; }
.icon-lg { width: 36px; height: 36px; }

/* ==========================================================================
   Standalone SEO Article Page Styles
   ========================================================================== */
.article-wrapper {
  max-width: 860px;
  margin: 0 auto;
  padding: 2rem 1.5rem 5rem;
}

.breadcrumb-nav {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.84rem;
  color: var(--text-muted);
  margin-bottom: 2rem;
  flex-wrap: wrap;
}

.breadcrumb-nav a {
  color: var(--text-secondary);
  transition: var(--transition);
}

.breadcrumb-nav a:hover {
  color: var(--color-brand-blue);
}

.breadcrumb-separator {
  color: var(--text-muted);
  opacity: 0.6;
}

.article-header {
  margin-bottom: 2rem;
}

.article-title {
  font-size: clamp(2rem, 3.8vw, 3rem);
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: -0.03em;
  color: var(--text-primary);
  margin: 1rem 0 1.25rem;
}

.article-meta-bar {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  font-size: 0.86rem;
  color: var(--text-secondary);
  flex-wrap: wrap;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border-subtle);
}

.article-meta-item {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.article-banner-hero {
  border-radius: var(--radius-lg);
  height: 220px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 2.5rem;
  box-shadow: var(--shadow-card);
  position: relative;
  overflow: hidden;
}

.article-banner-hero i {
  width: 72px;
  height: 72px;
  color: rgba(255, 255, 255, 0.9);
  filter: drop-shadow(0 6px 16px rgba(0, 0, 0, 0.4));
}

.article-body {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 2.5rem;
  box-shadow: var(--shadow-card);
  margin-bottom: 2.5rem;
  font-size: 1.05rem;
  line-height: 1.8;
  color: var(--text-secondary);
}

@media (max-width: 640px) {
  .article-body {
    padding: 1.5rem;
    font-size: 0.98rem;
  }
}

.article-body h2 {
  font-size: 1.65rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  margin: 2.25rem 0 1rem;
  line-height: 1.3;
}

.article-body h2:first-child {
  margin-top: 0;
}

.article-body h3 {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 1.75rem 0 0.75rem;
  line-height: 1.35;
}

.article-body p {
  margin-bottom: 1.35rem;
}

.article-body ul, .article-body ol {
  margin: 0 0 1.5rem 1.5rem;
}

.article-body li {
  margin-bottom: 0.5rem;
}

.article-body strong {
  color: var(--text-primary);
}

.article-body blockquote {
  border-left: 4px solid var(--color-brand-blue);
  background: rgba(37, 150, 190, 0.08);
  padding: 1rem 1.25rem;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  margin: 1.5rem 0;
  font-style: italic;
  color: var(--text-primary);
}

.callout-box {
  background: var(--bg-card-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1.25rem 1.5rem;
  margin: 1.75rem 0;
}

.callout-box.tip {
  border-left: 4px solid #10b981;
}

.callout-box.info {
  border-left: 4px solid #38bdf8;
}

.callout-box.warning {
  border-left: 4px solid #f59e0b;
}

.callout-title {
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

/* Embedded Calculator CTA Card */
.calculator-cta-card {
  background: linear-gradient(135deg, rgba(37, 150, 190, 0.15) 0%, rgba(16, 185, 129, 0.1) 100%);
  border: 1px solid rgba(37, 150, 190, 0.3);
  border-radius: var(--radius-md);
  padding: 1.75rem;
  margin: 2.25rem 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.cta-text h4 {
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 0.35rem;
}

.cta-text p {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-bottom: 0;
}

.btn-cta {
  background: var(--color-brand-blue);
  color: #ffffff;
  font-weight: 700;
  font-size: 0.92rem;
  padding: 0.75rem 1.4rem;
  border-radius: var(--radius-pill);
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  box-shadow: 0 4px 15px var(--color-brand-blue-glow);
  transition: var(--transition);
  white-space: nowrap;
}

.btn-cta:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px var(--color-brand-blue-glow);
}

/* Medical Reviewer / Author Card */
.author-reviewer-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  margin-bottom: 2.5rem;
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.reviewer-avatar {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--color-brand-blue);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 1.25rem;
  flex-shrink: 0;
}

.reviewer-info h4 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.reviewer-info p {
  font-size: 0.84rem;
  color: var(--text-secondary);
  margin: 0.2rem 0 0;
}

.verified-badge {
  font-size: 0.72rem;
  background: rgba(16, 185, 129, 0.15);
  color: #10b981;
  padding: 0.15rem 0.5rem;
  border-radius: var(--radius-pill);
  font-weight: 700;
}

/* Share & Navigation Section */
.article-nav-section {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 3.5rem;
  flex-wrap: wrap;
  gap: 1rem;
  padding: 1.25rem 0;
  border-top: 1px solid var(--border-subtle);
  border-bottom: 1px solid var(--border-subtle);
}

.back-to-blogs-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  color: var(--text-primary);
  font-weight: 700;
  font-size: 0.9rem;
  transition: var(--transition);
}

.back-to-blogs-btn:hover {
  color: var(--color-brand-blue);
  transform: translateX(-4px);
}

.share-buttons-group {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.btn-share {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  padding: 0.45rem 0.85rem;
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  transition: var(--transition);
}

.btn-share:hover {
  color: var(--text-primary);
  border-color: rgba(255, 255, 255, 0.25);
}

