/* ==========================================================================
   HEIGHT PERCENTILE CALCULATOR - DESIGN SYSTEM & CORE STYLES
   ========================================================================== */

:root {
  /* Color Palette - Modern Medical/Health Tech Theme */
  --primary-color: #0f62fe;
  --primary-hover: #0353e9;
  --primary-light: #edf5ff;
  --primary-dark: #002d9c;
  
  --secondary-color: #0891b2;
  --secondary-hover: #0e7490;
  --secondary-light: #ecfeff;
  
  --accent-color: #f59e0b;
  --accent-light: #fef3c7;
  
  --text-main: #1e293b;
  --text-muted: #64748b;
  --text-light: #94a3b8;
  --text-white: #ffffff;
  
  --bg-main: #f8fafc;
  --bg-card: #ffffff;
  --bg-alt: #f1f5f9;
  
  --border-color: #e2e8f0;
  --border-focus: #3b82f6;
  
  --status-success: #10b981;
  --status-success-bg: #d1fae5;
  --status-warning: #f59e0b;
  --status-warning-bg: #fef3c7;
  --status-error: #ef4444;
  --status-error-bg: #fee2e2;

  /* Typography */
  --font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  --font-heading: 'Outfit', var(--font-family);

  /* Shadows */
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);

  /* Radius */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-full: 9999px;

  /* Layout */
  --max-width: 1200px;
  --header-height: 72px;
}

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

html {
  font-family: var(--font-family);
  font-size: 16px;
  line-height: 1.6;
  color: var(--text-main);
  background-color: var(--bg-main);
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

img, svg {
  max-width: 100%;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  color: var(--text-main);
  line-height: 1.25;
  font-weight: 700;
  letter-spacing: -0.02em;
}

h1 { font-size: 2.5rem; margin-bottom: 1rem; }
h2 { font-size: 1.875rem; margin-top: 2rem; margin-bottom: 1rem; }
h3 { font-size: 1.35rem; margin-top: 1.5rem; margin-bottom: 0.75rem; }
h4 { font-size: 1.15rem; margin-top: 1.25rem; margin-bottom: 0.5rem; }

p {
  margin-bottom: 1.25rem;
  color: var(--text-main);
}

a {
  color: var(--primary-color);
  text-decoration: none;
  transition: color 0.2s ease;
}

a:hover {
  color: var(--primary-hover);
  text-decoration: underline;
}

ul, ol {
  margin-bottom: 1.25rem;
  padding-left: 1.5rem;
}

li {
  margin-bottom: 0.35rem;
}

/* Container & Layout */
.container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.5rem;
}

.main-content {
  flex: 1;
  padding: 0 0 4rem;
}

.main-content > .container:first-child {
  padding-top: 2.5rem;
}

.layout-grid {
  display: grid;
  grid-template-columns: 1fr;
  width: 100%;
  max-width: 900px;
  margin: 0 auto;
  gap: 2.5rem;
  align-items: start;
  min-width: 0;
  box-sizing: border-box;
}

.content-full {
  grid-column: 1 / -1;
}

/* Header & Navigation */
.site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background-color: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-color);
  height: var(--header-height);
  display: flex;
  align-items: center;
  transition: background-color 0.3s ease, border-color 0.3s ease;
}

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

.header-right {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.brand-logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text-main);
  text-decoration: none !important;
  transition: transform 0.2s ease;
}

.brand-logo:hover {
  transform: translateY(-1px);
}

.brand-logo svg,
.brand-logo-img {
  width: 32px;
  height: 32px;
  border-radius: 6px;
  object-fit: contain;
  color: var(--primary-color);
}

.brand-logo span span {
  color: var(--primary-color);
}

.nav-menu {
  display: flex;
  align-items: center;
  gap: 1.75rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-link {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text-main);
  padding: 0.5rem 0.25rem;
  position: relative;
  transition: color 0.2s ease;
  text-decoration: none !important;
}

.nav-link:hover, .nav-link.active {
  color: var(--primary-color);
  text-decoration: none !important;
}

/* Header CTA Button */
.header-cta-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem 1.15rem;
  font-size: 0.9rem;
  font-weight: 700;
  color: #ffffff !important;
  background: linear-gradient(135deg, var(--primary-color, #2563eb) 0%, #1d4ed8 100%);
  border-radius: var(--radius-md, 8px);
  text-decoration: none !important;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.25);
  transition: all 0.2s ease;
  white-space: nowrap;
}

.header-cta-btn:hover {
  background: linear-gradient(135deg, #1d4ed8 0%, #1e40af 100%);
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.35);
  transform: translateY(-1px);
}

/* Mobile Toggle */
.mobile-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
  color: var(--text-main);
  border-radius: var(--radius-md, 6px);
  transition: background-color 0.2s ease;
}

.mobile-toggle:hover {
  background-color: var(--bg-surface-hover, #f1f5f9);
}

/* ==========================================================================
   HERO SECTION STYLES
   ========================================================================== */
.hero-section {
  padding: 3rem 0 3.5rem;
  margin-bottom: 2.5rem;
  border-bottom: 1px solid var(--border-color);
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(280px, 0.75fr);
  gap: 2.5rem;
  align-items: center;
}

.hero-content {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

/* Hero Breadcrumbs */
.hero-content .breadcrumb {
  margin-bottom: 0.85rem;
}

/* Eyebrow */
.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  padding: 0.35rem 0.85rem;
  background-color: var(--primary-light);
  color: var(--primary-color);
  font-family: var(--font-heading);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border-radius: var(--radius-full);
  border: 1px solid rgba(15, 98, 254, 0.15);
  margin-bottom: 1.25rem;
}

/* H1 Title */
.hero-content h1,
.hero-content h1#hero-title {
  font-family: var(--font-heading);
  font-size: clamp(1.9rem, 3.6vw, 2.75rem);
  font-weight: 800;
  line-height: 1.15;
  color: var(--text-main);
  letter-spacing: -0.025em;
  margin: 0 0 1.25rem 0;
}

/* Descriptions */
.hero-description {
  font-size: 1.05rem;
  line-height: 1.65;
  color: var(--text-main);
  max-width: 650px;
  margin-bottom: 0.75rem;
}

.hero-description-secondary {
  font-size: 1.05rem;
  line-height: 1.65;
  color: var(--text-main);
  margin-bottom: 1.5rem;
}

/* Topic Tags */
.hero-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.75rem;
}

.hero-tag {
  display: inline-block;
  padding: 0.35rem 0.8rem;
  background-color: #ffffff;
  color: var(--text-muted);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-full);
  font-size: 0.825rem;
  font-weight: 500;
  transition: all 0.2s ease;
}

.hero-tag:hover {
  border-color: var(--primary-color);
  color: var(--primary-color);
  background-color: var(--primary-light);
}

/* CTA Actions */
.hero-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.25rem;
  width: 100%;
}

.hero-actions .btn {
  padding: 0.75rem 1.5rem;
  font-size: 0.95rem;
  font-weight: 600;
  border-radius: var(--radius-md);
  transition: all 0.2s ease;
  cursor: pointer;
  text-decoration: none !important;
}

.hero-actions .btn-primary {
  background-color: var(--primary-color);
  color: #ffffff;
  border: 1px solid var(--primary-color);
  box-shadow: 0 2px 4px rgba(15, 98, 254, 0.2);
}

.hero-actions .btn-primary:hover {
  background-color: var(--primary-hover);
  border-color: var(--primary-hover);
  color: #ffffff;
  transform: translateY(-1px);
  box-shadow: 0 2px 6px rgba(15, 98, 254, 0.25);
}

.hero-actions .btn-secondary {
  background-color: #ffffff;
  color: var(--text-main);
  border: 1px solid var(--border-color);
}

.hero-actions .btn-secondary:hover {
  background-color: var(--bg-alt);
  border-color: #cbd5e1;
  color: var(--text-main);
  transform: translateY(-1px);
}

.hero-actions .btn:focus-visible {
  outline: 3px solid var(--border-focus);
  outline-offset: 2px;
}

/* Trust Note */
.hero-trust-note {
  font-size: 0.825rem;
  color: var(--text-muted);
  margin-bottom: 0;
  line-height: 1.5;
}

/* Hero Right Column - Balanced 2px Shadow Preview Card */
.hero-visual {
  width: 100%;
  max-width: 380px;
  justify-self: end;
}

.hero-preview-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  padding: 1.35rem 1.25rem;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.04);
  display: flex;
  flex-direction: column;
  gap: 0.95rem;
  position: relative;
  overflow: hidden;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.hero-preview-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

/* Card Accent Bar */
.card-accent-bar {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--primary-color) 0%, var(--secondary-color) 100%);
}

.preview-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 0.65rem;
}

.preview-title {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-main);
  margin: 0 0 0.2rem 0;
  line-height: 1.2;
}

.preview-subtitle {
  font-size: 0.825rem;
  color: var(--text-muted);
  margin: 0;
}

.preview-dataset-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--primary-color);
  background-color: var(--primary-light);
  padding: 0.2rem 0.55rem;
  border-radius: var(--radius-full);
  border: 1px solid rgba(15, 98, 254, 0.15);
  white-space: nowrap;
}

.preview-dataset-badge svg {
  color: var(--primary-color);
}

/* Input Parameters Section */
.preview-inputs {
  background-color: var(--bg-main);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 0.75rem 0.85rem;
}

.preview-inputs-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
}

.preview-inputs-title {
  font-size: 0.725rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

.preview-badge {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background-color: #ffffff;
  color: var(--primary-color);
  padding: 0.1rem 0.45rem;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(15, 98, 254, 0.2);
}

.preview-input-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.5rem;
}

.preview-input-chip {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background-color: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 0.4rem 0.65rem;
}

.preview-input-chip.full-width {
  grid-column: 1 / -1;
}

.chip-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: var(--radius-sm);
  background-color: var(--primary-light);
  color: var(--primary-color);
  flex-shrink: 0;
}

.chip-content {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.chip-label {
  font-size: 0.7rem;
  color: var(--text-muted);
  font-weight: 500;
}

.chip-val {
  font-size: 0.825rem;
  color: var(--text-main);
  font-weight: 700;
  font-family: var(--font-heading);
  word-break: break-word;
}

.chip-subval {
  font-size: 0.725rem;
  font-weight: 400;
  color: var(--text-muted);
}

/* Result Visual Container */
.preview-result {
  background: linear-gradient(135deg, #f0f7ff 0%, #ffffff 100%);
  color: var(--text-main);
  border: 1px solid #bfdbfe;
  border-top: 3px solid var(--primary-color);
  border-radius: var(--radius-md);
  padding: 0.85rem 1rem 0.95rem;
  position: relative;
  text-align: center;
  box-shadow: 0 8px 24px -4px rgba(15, 98, 254, 0.08);
  overflow: hidden;
}

/* Curve graphic background */
.curve-graphic {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 45px;
  pointer-events: none;
  opacity: 0.85;
  z-index: 1;
}

.curve-graphic svg {
  width: 100%;
  height: 100%;
}

.preview-tag-example {
  display: inline-block;
  font-size: 0.625rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background: #e0f2fe;
  color: #0284c7;
  padding: 0.2rem 0.6rem;
  border-radius: var(--radius-sm);
  border: 1px solid #bae6fd;
  margin-bottom: 0.45rem;
  position: relative;
  z-index: 2;
  max-width: 100%;
  word-break: break-word;
}

.preview-stat {
  margin-top: 0;
  margin-bottom: 0.5rem;
  position: relative;
  z-index: 2;
}

.preview-num {
  font-family: var(--font-heading);
  font-size: clamp(2.1rem, 4.5vw, 2.75rem);
  font-weight: 800;
  color: var(--primary-color);
  line-height: 1.1;
  display: block;
  letter-spacing: -0.02em;
  word-break: break-word;
}

.preview-unit {
  font-size: 0.775rem;
  font-weight: 700;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  margin-top: 0.3rem;
  display: block;
}

.preview-insight-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.25rem 0.7rem;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 600;
  color: #1e293b;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  margin-bottom: 0.85rem;
  position: relative;
  z-index: 2;
  max-width: 100%;
  word-break: break-word;
  text-align: center;
}

.preview-scale {
  margin-top: 0.35rem;
  position: relative;
  z-index: 2;
}

.scale-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.7rem;
  color: #64748b;
  font-weight: 600;
  margin-bottom: 0.35rem;
}

.scale-track {
  height: 7px;
  background: #e2e8f0;
  border-radius: var(--radius-full);
  position: relative;
  overflow: visible;
}

.scale-fill {
  height: 100%;
  background: linear-gradient(90deg, #38bdf8, #0f62fe);
  border-radius: var(--radius-full);
}

.scale-marker {
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 14px;
  height: 14px;
  background-color: #ffffff;
  border: 3px solid var(--primary-color);
  border-radius: 50%;
  box-shadow: 0 0 6px rgba(15, 98, 254, 0.5);
}

.scale-marker .marker-pulse {
  position: absolute;
  top: -3px;
  left: -3px;
  right: -3px;
  bottom: -3px;
  border-radius: 50%;
  background: rgba(56, 189, 248, 0.4);
  animation: pulseMarker 2s infinite;
}

@keyframes pulseMarker {
  0% { transform: scale(1); opacity: 0.8; }
  50% { transform: scale(1.4); opacity: 0; }
  100% { transform: scale(1); opacity: 0; }
}

.preview-footer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  font-size: 0.775rem;
  color: var(--text-muted);
  font-weight: 500;
  padding-top: 0;
}

.preview-footer svg {
  color: var(--secondary-color);
}

/* Footer */
.site-footer {
  background: linear-gradient(180deg, #0f172a 0%, #090d16 100%);
  color: #cbd5e1;
  padding: 4rem 0 2rem;
  margin-top: auto;
  border-top: 1px solid rgba(59, 130, 246, 0.25);
  position: relative;
}

.footer-disclaimer-notice {
  background: rgba(30, 41, 59, 0.7);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 1.15rem 1.35rem;
  border-radius: var(--radius-md);
  margin-bottom: 3rem;
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

.disclaimer-icon {
  color: #38bdf8;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding-top: 2px;
}

.disclaimer-text {
  font-size: 0.875rem;
  line-height: 1.6;
  color: #cbd5e1;
}

.disclaimer-text strong {
  color: #ffffff;
  font-weight: 600;
}

.disclaimer-link {
  color: #38bdf8;
  font-weight: 500;
  text-decoration: underline;
  text-underline-offset: 3px;
  white-space: nowrap;
  transition: color 0.2s ease;
}

.disclaimer-link:hover {
  color: #60a5fa;
  text-decoration: underline;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.8fr repeat(3, 1fr);
  gap: 3rem;
  margin-bottom: 3.5rem;
}

.footer-brand {
  display: flex;
  flex-direction: column;
  gap: 1.15rem;
}

.footer-brand .brand-logo {
  color: #ffffff;
  font-size: 1.35rem;
}

.footer-brand .brand-logo svg {
  color: #38bdf8;
}

.footer-brand .brand-logo span span {
  color: #38bdf8;
}

.footer-brand-desc {
  font-size: 0.9rem;
  line-height: 1.6;
  color: #94a3b8;
  margin: 0;
}

.footer-trust-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.25rem;
}

.trust-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #e2e8f0;
  font-size: 0.75rem;
  font-weight: 500;
  padding: 0.3rem 0.65rem;
  border-radius: 20px;
}

.trust-badge svg {
  color: #38bdf8;
}

.footer-heading {
  color: #ffffff;
  font-family: var(--font-heading);
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 1.25rem;
  letter-spacing: 0.02em;
  position: relative;
  display: inline-block;
}

.footer-heading::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: -6px;
  width: 24px;
  height: 2px;
  background: #38bdf8;
  border-radius: 2px;
}

.footer-links {
  list-style: none;
  padding: 0;
  margin: 0;
}

.footer-links li {
  margin-bottom: 0.75rem;
}

.footer-links a {
  color: #cbd5e1;
  font-size: 0.925rem;
  text-decoration: none;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
}

.footer-links a:hover {
  color: #38bdf8;
  transform: translateX(4px);
}

.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding-top: 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}

.footer-bottom-info {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.footer-bottom .copyright {
  color: #cbd5e1;
  font-size: 0.875rem;
  font-weight: 500;
  margin: 0;
}

.footer-bottom .copyright a {
  color: inherit;
  text-decoration: underline;
  text-decoration-color: rgba(203, 213, 225, 0.4);
  transition: color 0.2s ease, text-decoration-color 0.2s ease;
}

.footer-bottom .copyright a:hover {
  color: #ffffff;
  text-decoration-color: #ffffff;
}

.footer-data-credit {
  color: #94a3b8;
  font-size: 0.8rem;
  margin: 0;
}

.back-to-top {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(30, 41, 59, 0.8);
  color: #cbd5e1;
  border: 1px solid rgba(255, 255, 255, 0.15);
  padding: 0.55rem 1rem;
  border-radius: var(--radius-sm);
  font-size: 0.825rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.back-to-top:hover {
  background: #38bdf8;
  color: #0f172a;
  border-color: #38bdf8;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(56, 189, 248, 0.25);
}

/* Breadcrumbs */
.breadcrumb {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
  list-style: none;
  padding: 0;
}

.breadcrumb-item a {
  color: var(--text-muted);
}

.breadcrumb-item a:hover {
  color: var(--primary-color);
}

.breadcrumb-separator {
  color: var(--text-light);
}

.breadcrumb-item.active {
  color: var(--text-main);
  font-weight: 600;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-weight: 600;
  font-size: 1rem;
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none !important;
  line-height: 1.4;
}

.btn-primary {
  background-color: var(--primary-color);
  color: var(--text-white);
  box-shadow: 0 2px 4px rgba(15, 98, 254, 0.25);
}

.btn-primary:hover {
  background-color: var(--primary-hover);
  color: var(--text-white);
  box-shadow: 0 4px 8px rgba(15, 98, 254, 0.35);
}

.btn-secondary {
  background-color: var(--bg-alt);
  color: var(--text-main);
  border-color: var(--border-color);
}

.btn-secondary:hover {
  background-color: var(--border-color);
  color: var(--text-main);
}

.btn-outline {
  background-color: transparent;
  color: var(--primary-color);
  border-color: var(--primary-color);
}

.btn-outline:hover {
  background-color: var(--primary-light);
}

/* Badges & Trust Elements */
.trust-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background-color: var(--primary-light);
  color: var(--primary-dark);
  padding: 0.4rem 0.85rem;
  border-radius: var(--radius-full);
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 1rem;
}

.trust-panel {
  background-color: var(--bg-alt);
  border: 1px solid var(--border-color);
  padding: 1rem 1.25rem;
  border-radius: var(--radius-md);
  margin: 1.5rem 0;
  font-size: 0.9rem;
}

.trust-panel h4 {
  margin-top: 0;
  margin-bottom: 0.3rem;
  color: var(--primary-dark);
}

/* Cards & Containers */
.card,
.educational-content section {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  padding: 2rem;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.04);
  margin-bottom: 2rem;
}

/* Educational Content Typography & Readability */
.educational-content {
  display: flex;
  flex-direction: column;
}

.educational-content section h2 {
  font-size: 1.55rem;
  font-weight: 700;
  color: var(--text-main);
  margin-top: 0;
  margin-bottom: 1rem;
  line-height: 1.35;
  letter-spacing: -0.015em;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--primary-light);
}

.educational-content section h3 {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text-main);
  margin-top: 1.5rem;
  margin-bottom: 0.65rem;
}

.educational-content section p {
  font-size: 1.025rem;
  line-height: 1.7;
  color: var(--text-main);
  margin-bottom: 1.15rem;
}

.educational-content section p:last-child {
  margin-bottom: 0;
}

.educational-content section ul,
.educational-content section ol {
  margin-bottom: 1.25rem;
  padding-left: 1.4rem;
  line-height: 1.65;
}

.educational-content section li {
  margin-bottom: 0.45rem;
  font-size: 1rem;
  color: var(--text-main);
}

.card-title {
  margin-top: 0;
  margin-bottom: 1rem;
}

/* Data Tables */
.table-responsive {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 1.5rem 0;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
}

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

.data-table th, .data-table td {
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--border-color);
}

.data-table th {
  background-color: var(--bg-alt);
  font-weight: 700;
  color: var(--text-main);
  white-space: nowrap;
}

.data-table tbody tr:nth-child(even) {
  background-color: var(--bg-main);
}

.data-table tbody tr:hover {
  background-color: var(--primary-light);
}

.highlight-row {
  background-color: var(--accent-light) !important;
  font-weight: 600;
}

/* Sidebar Widgets */
.sidebar-widget {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  margin-bottom: 1.75rem;
}

.sidebar-widget h3 {
  font-size: 1.15rem;
  margin-top: 0;
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--primary-light);
}

.sidebar-links {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 0.75rem 1.5rem;
}

.sidebar-links li {
  margin-bottom: 0;
}

.sidebar-links a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--text-main);
  font-weight: 500;
  font-size: 0.95rem;
  padding: 0.5rem 0.75rem;
  background-color: var(--bg-alt);
  border-radius: var(--radius-sm);
  transition: all 0.2s ease;
}

.sidebar-links a:hover {
  color: var(--primary-color);
  background-color: var(--primary-light);
  text-decoration: none;
}

/* Callouts / FAQ */
.faq-accordion {
  margin: 2rem 0;
}

.faq-item {
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  background-color: var(--bg-card);
  margin-bottom: 1rem;
  overflow: hidden;
}

.faq-question {
  width: 100%;
  text-align: left;
  padding: 1.25rem 1.5rem;
  background: none;
  border: none;
  font-family: var(--font-heading);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-main);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.faq-question::after {
  content: '+';
  font-size: 1.5rem;
  color: var(--primary-color);
  transition: transform 0.2s ease;
}

.faq-item.active .faq-question::after {
  content: '−';
}

.faq-answer {
  padding: 0 1.5rem 1.25rem;
  display: none;
  color: var(--text-main);
  border-top: 1px solid var(--border-color);
  padding-top: 1rem;
}

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

/* ==========================================================================
   TABLE OF CONTENTS & ADVANCED COMPONENTS
   ========================================================================== */

.toc-card {
  background: var(--primary-light);
  border: 1px solid rgba(15, 98, 254, 0.2);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  margin: 2rem 0;
  box-shadow: var(--shadow-sm);
}

.toc-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
  border-bottom: 2px solid rgba(15, 98, 254, 0.15);
  padding-bottom: 0.75rem;
}

.toc-header h3 {
  margin: 0;
  font-size: 1.25rem;
  color: var(--primary-dark);
}

.toc-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.6rem 1.5rem;
  list-style: none;
  padding: 0;
  margin: 0;
}

.toc-grid li {
  margin: 0;
}

.toc-grid a {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.925rem;
  font-weight: 500;
  color: var(--text-main);
  padding: 0.35rem 0.5rem;
  border-radius: var(--radius-sm);
  transition: all 0.2s ease;
}

.toc-grid a:hover {
  background-color: #ffffff;
  color: var(--primary-color);
  text-decoration: none;
  transform: translateX(4px);
}

.toc-grid a::before {
  content: '→';
  color: var(--primary-color);
  font-weight: bold;
}

/* Math Formula Box */
.formula-box {
  background: linear-gradient(90deg, rgba(2, 132, 199, 0.05) 0%, var(--bg-card) 100%);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  margin: 1.5rem 0;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.03);
  font-family: inherit;
}

.formula-box .formula-title {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--text-main);
  margin-bottom: 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.formula-box .formula-code {
  background: var(--bg-alt);
  border: 1px solid var(--border-color);
  padding: 0.85rem 1.25rem;
  border-radius: var(--radius-sm);
  font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, Courier, monospace;
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--primary-dark);
  margin: 0.5rem 0;
  overflow-x: auto;
}

/* Tool Hub Cards Grid */
.tool-cards-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  margin: 2rem 0;
}

.tool-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.tool-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  border-color: var(--primary-color);
}

.tool-card h3 {
  font-size: 1.15rem;
  margin-top: 0;
  margin-bottom: 0.5rem;
}

.tool-card p {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 1.25rem;
  flex: 1;
}

/* Example Calculation Box */
.example-calc-box {
  background: linear-gradient(90deg, rgba(2, 132, 199, 0.05) 0%, var(--bg-alt) 100%);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  margin: 1.75rem 0;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.03);
}

.example-calc-box .example-badge {
  display: inline-block;
  background: rgba(2, 132, 199, 0.1);
  color: var(--primary-color);
  border: 1px solid rgba(2, 132, 199, 0.2);
  font-weight: 700;
  font-size: 0.8rem;
  padding: 0.3rem 0.85rem;
  border-radius: var(--radius-full);
  margin-bottom: 1.25rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.example-step {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 1rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border-color);
}

.example-step:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

.example-step-num {
  background: var(--primary-color);
  color: #ffffff;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.875rem;
  flex-shrink: 0;
  box-shadow: 0 2px 4px rgba(2, 132, 199, 0.25);
}

/* Page Footer CTA Banner */
.cta-banner {
  background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary-color) 100%);
  color: #ffffff;
  border-radius: var(--radius-xl);
  padding: 3rem 2rem;
  text-align: center;
  margin: 3.5rem 0 2rem;
  box-shadow: var(--shadow-xl);
}

.cta-banner h2 {
  color: #ffffff;
  margin-top: 0;
  margin-bottom: 0.75rem;
  font-size: 2.25rem;
}

.cta-banner p {
  color: #e2e8f0;
  font-size: 1.1rem;
  max-width: 650px;
  margin: 0 auto 1.75rem;
}

.cta-banner .btn-cta {
  background-color: #ffffff;
  color: var(--primary-dark);
  font-size: 1.1rem;
  font-weight: 700;
  padding: 0.875rem 2.25rem;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.cta-banner .btn-cta:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
  color: var(--primary-color);
}

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

  .tool-cards-grid {
    grid-template-columns: 1fr;
  }

  .cta-banner {
    padding: 2rem 1.25rem;
  }

  .cta-banner h2 {
    font-size: 1.65rem;
  }
}

/* Responsive Chart & Infographic Visual Containers */
.chart-visual-container {
  margin: 1.75rem 0;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
  transition: transform 0.25 ease, box-shadow 0.25s ease;
}

.chart-visual-container:hover {
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
}

.responsive-chart-img {
  width: 100%;
  height: auto;
  display: block;
  object-fit: cover;
}

.chart-visual-container figcaption {
  padding: 0.75rem 1.25rem;
  font-size: 0.875rem;
  color: var(--text-muted);
  background-color: var(--bg-alt);
  border-top: 1px solid var(--border-color);
  text-align: center;
  font-weight: 500;
}


