/* ==========================================================================
   CALCHUB DESIGN SYSTEM — LIGHT THEME (HIGH-UTILITY & CLEAN ENGINEERING)
   Strictly Light Theme: Pure White, Slate Gray, Royal Indigo & Emerald Accents
   Zero CLS, Modern Typography, Responsive Breakpoints & Instant Paint
   ========================================================================== */

:root {
  --bg-page: #F8FAFC;
  --bg-surface: #FFFFFF;
  --bg-surface-alt: #F1F5F9;
  --bg-card: #FFFFFF;
  
  --border-light: #E2E8F0;
  --border-medium: #CBD5E1;
  --border-focus: #3B82F6;

  --text-main: #0F172A;
  --text-body: #334155;
  --text-muted: #64748B;
  --text-subtle: #94A3B8;

  --primary: #2563EB;
  --primary-hover: #1D4ED8;
  --primary-subtle: #EFF6FF;
  --primary-border: #BFDBFE;

  --accent-emerald: #059669;
  --accent-emerald-subtle: #ECFDF5;
  --accent-emerald-border: #A7F3D0;

  --accent-amber: #D97706;
  --accent-amber-subtle: #FFFBEB;
  --accent-amber-border: #FDE68A;

  --accent-rose: #E11D48;
  --accent-rose-subtle: #FFF1F2;
  --accent-rose-border: #FECDD3;

  --shadow-xs: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.08), 0 1px 2px -1px rgba(0, 0, 0, 0.08);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.07), 0 2px 4px -2px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -4px rgba(0, 0, 0, 0.04);
  --shadow-highlight: 0 0 0 3px rgba(37, 99, 235, 0.15);

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-xl: 20px;
  --radius-full: 9999px;

  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;

  --max-w-content: 1200px;
  --header-height: 80px;
}

/* Base Reset & Box Sizing */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  scroll-padding-top: 85px;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

body {
  background-color: var(--bg-page);
  color: var(--text-body);
  font-family: var(--font-sans);
  line-height: 1.65;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

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

h1 { font-size: clamp(2rem, 3.5vw, 2.75rem); margin-bottom: 0.75rem; }
h2 { font-size: clamp(1.4rem, 2.2vw, 1.85rem); margin: 2rem 0 1rem; }
h3 { font-size: 1.25rem; margin: 1.5rem 0 0.75rem; }
h4 { font-size: 1.1rem; margin: 1.25rem 0 0.5rem; }
p { margin-bottom: 1.15rem; font-size: 1rem; }

a {
  color: var(--primary);
  text-decoration: none;
  transition: color 0.15s ease, border-color 0.15s ease;
}
a:hover { color: var(--primary-hover); text-decoration: underline; }

/* Sticky Header - Elegant 2-Line Category Navigation */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-light);
  min-height: 72px;
  width: 100%;
  display: flex;
  align-items: center;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.05);
  padding: 0.38rem 0;
}

.header-inner {
  max-width: var(--max-w-content);
  width: 100%;
  margin: 0 auto;
  padding: 0 1.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.brand-logo {
  position: absolute;
  left: 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.65rem;
  font-weight: 800;
  font-size: 1.3rem;
  color: var(--text-main);
  text-decoration: none;
  letter-spacing: -0.03em;
  flex: 0 0 auto;
  z-index: 2;
}
.brand-logo:hover { text-decoration: none; }

.logo-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, #2563EB, #4F46E5);
  color: #FFFFFF;
  border-radius: var(--radius-md);
  font-size: 1.15rem;
  font-weight: 800;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.35);
}
.brand-logo span.accent {
  color: var(--primary);
}

.header-nav {
  display: flex;
  flex-direction: column;
  gap: 5px;
  align-items: center;
  justify-content: center;
  margin: 0 auto;
}

.nav-row {
  display: flex;
  align-items: center;
  gap: 6px;
  justify-content: center;
}

.nav-link {
  font-size: 0.82rem;
  font-weight: 600;
  color: #334155;
  padding: 0.24rem 0.62rem;
  border-radius: var(--radius-full);
  background: #F8FAFC;
  border: 1px solid #E2E8F0;
  transition: all 0.15s ease;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 0.32rem;
  text-decoration: none;
  line-height: 1.35;
}

.nav-link:hover {
  background: #EFF6FF;
  border-color: #BFDBFE;
  color: #2563EB;
  text-decoration: none;
  transform: translateY(-1px);
}

.nav-link.active {
  background: #2563EB;
  color: #FFFFFF;
  border-color: #2563EB;
  font-weight: 700;
  box-shadow: 0 2px 6px rgba(37, 99, 235, 0.28);
}

/* Category-specific Active Navigation Badges */
.nav-link[href="index.html"].active { background: #2563EB; border-color: #2563EB; color: #FFFFFF; box-shadow: 0 2px 6px rgba(37, 99, 235, 0.3); }
.nav-link[href="health.html"].active { background: #059669; border-color: #059669; color: #FFFFFF; box-shadow: 0 2px 6px rgba(5, 150, 105, 0.3); }
.nav-link[href="finance.html"].active { background: #2563EB; border-color: #2563EB; color: #FFFFFF; box-shadow: 0 2px 6px rgba(37, 99, 235, 0.3); }
.nav-link[href="math.html"].active { background: #7C3AED; border-color: #7C3AED; color: #FFFFFF; box-shadow: 0 2px 6px rgba(124, 58, 237, 0.3); }
.nav-link[href="engineering.html"].active { background: #D97706; border-color: #D97706; color: #FFFFFF; box-shadow: 0 2px 6px rgba(217, 119, 6, 0.3); }
.nav-link[href="solar-energy.html"].active { background: #EA580C; border-color: #EA580C; color: #FFFFFF; box-shadow: 0 2px 6px rgba(234, 88, 12, 0.3); }
.nav-link[href="mechanical.html"].active { background: #0891B2; border-color: #0891B2; color: #FFFFFF; box-shadow: 0 2px 6px rgba(8, 145, 178, 0.3); }
.nav-link[href="civil.html"].active { background: #B45309; border-color: #B45309; color: #FFFFFF; box-shadow: 0 2px 6px rgba(180, 83, 9, 0.3); }
.nav-link[href="chemical.html"].active { background: #0D9488; border-color: #0D9488; color: #FFFFFF; box-shadow: 0 2px 6px rgba(13, 148, 136, 0.3); }
.nav-link[href="fire-safety.html"].active { background: #DC2626; border-color: #DC2626; color: #FFFFFF; box-shadow: 0 2px 6px rgba(220, 38, 38, 0.3); }
.nav-link[href="programmer.html"].active { background: #4F46E5; border-color: #4F46E5; color: #FFFFFF; box-shadow: 0 2px 6px rgba(79, 70, 229, 0.3); }
.nav-link[href="datetime.html"].active { background: #0284C7; border-color: #0284C7; color: #FFFFFF; box-shadow: 0 2px 6px rgba(2, 132, 199, 0.3); }
.nav-link[href="converter.html"].active { background: #9333EA; border-color: #9333EA; color: #FFFFFF; box-shadow: 0 2px 6px rgba(147, 51, 234, 0.3); }

/* Category-specific Hover Links */
.nav-link[href="health.html"]:hover { background: #ECFDF5; border-color: #A7F3D0; color: #059669; }
.nav-link[href="finance.html"]:hover { background: #EFF6FF; border-color: #BFDBFE; color: #2563EB; }
.nav-link[href="math.html"]:hover { background: #F5F3FF; border-color: #DDD6FE; color: #7C3AED; }
.nav-link[href="engineering.html"]:hover { background: #FFFBEB; border-color: #FDE68A; color: #D97706; }
.nav-link[href="solar-energy.html"]:hover { background: #FFF7ED; border-color: #FFEDD5; color: #EA580C; }
.nav-link[href="mechanical.html"]:hover { background: #ECFEFF; border-color: #A5F3FC; color: #0891B2; }
.nav-link[href="civil.html"]:hover { background: #FEFCE8; border-color: #FEF08A; color: #B45309; }
.nav-link[href="chemical.html"]:hover { background: #F0FDFA; border-color: #99F6E4; color: #0D9488; }
.nav-link[href="fire-safety.html"]:hover { background: #FEF2F2; border-color: #FECACA; color: #DC2626; }
.nav-link[href="programmer.html"]:hover { background: #EEF2FF; border-color: #C7D2FE; color: #4F46E5; }
.nav-link[href="datetime.html"]:hover { background: #F0F9FF; border-color: #BAE6FD; color: #0284C7; }
.nav-link[href="converter.html"]:hover { background: #FAF5FF; border-color: #E9D5FF; color: #9333EA; }

.header-search input {
  width: 100%;
  padding: 0.45rem 0.75rem 0.45rem 2.2rem;
  font-size: 0.88rem;
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-full);
  background: var(--bg-surface-alt);
  color: var(--text-main);
  outline: none;
  transition: all 0.2s ease;
}
.header-search input:focus {
  background: #FFFFFF;
  border-color: var(--primary);
  box-shadow: var(--shadow-highlight);
}
.header-search .search-icon {
  position: absolute;
  left: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 0.85rem;
  pointer-events: none;
}
.search-results-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  background: #FFFFFF;
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  max-height: 380px;
  overflow-y: auto;
  display: none;
  z-index: 150;
}
.search-result-item {
  display: flex;
  flex-direction: column;
  padding: 0.6rem 0.85rem;
  border-bottom: 1px solid var(--border-light);
  color: var(--text-main);
  font-size: 0.9rem;
  text-decoration: none;
}
.search-result-item:last-child { border-bottom: none; }
.search-result-item:hover {
  background: var(--primary-subtle);
  text-decoration: none;
}
.search-result-category {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Breadcrumbs */
.breadcrumbs,
.category-breadcrumbs {
  max-width: var(--max-w-content);
  margin: 1rem auto 0;
  padding: 0 1.25rem;
  font-size: 0.85rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.4rem;
}
.category-breadcrumbs {
  padding: 0;
  margin: 0 0 1.25rem 0;
}
.breadcrumbs a,
.category-breadcrumbs a {
  color: var(--text-muted);
  text-decoration: none;
  font-weight: 500;
}
.breadcrumbs a:hover,
.category-breadcrumbs a:hover {
  color: var(--primary);
  text-decoration: underline;
}
.breadcrumbs span.sep { color: var(--text-subtle); }
.breadcrumbs span.current,
.category-breadcrumbs span {
  color: var(--text-main);
  font-weight: 600;
}

/* Main Layout Grid */
.main-wrapper {
  max-width: var(--max-w-content);
  width: 100%;
  margin: 1.5rem auto 3rem;
  padding: 0 1.25rem;
  flex: 1;
}

.main-wrapper {
  max-width: var(--max-w-content);
  width: 100%;
  margin: 1.5rem auto 3rem;
  padding: 0 1.25rem;
  display: block;
}

.tool-top-section,
.calculator-workspace-full,
.calculator-hero-wrapper {
  max-width: 1200px;
  width: 100%;
  margin: 1.25rem auto 2.5rem;
  display: block;
}

.calculator-hero,
.calc-page-header {
  margin-bottom: 1.75rem;
  background: linear-gradient(180deg, #FFFFFF 0%, #F8FAFC 100%);
  border-bottom: 1px solid #E2E8F0;
  padding: 2.25rem 1.25rem 1.75rem;
}
.calc-page-header-inner {
  max-width: 1120px;
  margin: 0 auto;
}
.calc-page-title {
  font-size: clamp(1.85rem, 3.5vw, 2.5rem);
  font-weight: 800;
  color: var(--text-main);
  letter-spacing: -0.02em;
  margin: 0.5rem 0;
}
.calculator-hero p.subtitle,
.calc-page-desc {
  font-size: 1.05rem;
  color: var(--text-muted);
  max-width: 820px;
  line-height: 1.6;
  margin: 0;
}
.layout-container {
  max-width: 1200px;
  margin: 0 auto;
}
.reference-table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0;
  font-size: 0.9rem;
}
.calculator-hero .category-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--primary);
  background: var(--primary-subtle);
  border: 1px solid var(--primary-border);
  padding: 0.25rem 0.65rem;
  border-radius: var(--radius-full);
  margin-bottom: 0.75rem;
}

/* Two-Column App Layout */
.calculator-workspace,
.calculator-grid {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 2rem;
  margin-bottom: 2.5rem;
  align-items: start;
}

.calculator-workspace:has(> .calculator-grid) {
  display: block !important;
  width: 100% !important;
}

/* Calculator Interactive Card */
.calc-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-sm);
  padding: 1.75rem;
  transition: box-shadow 0.2s ease, border-color 0.2s ease;
}
.calc-card:hover {
  border-color: var(--border-medium);
  box-shadow: var(--shadow-md);
}

.calc-card-header,
.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border-light);
}
.calc-card-header h2,
.card-header h2,
.calc-card-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-main);
  margin: 0;
}
.calc-title {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* Mode Switcher Tabs */
.unit-switcher {
  display: inline-flex;
  background: var(--bg-surface-alt);
  padding: 0.25rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-light);
  gap: 0.2rem;
}
.unit-btn {
  padding: 0.35rem 0.75rem;
  font-size: 0.82rem;
  font-weight: 600;
  border: none;
  background: transparent;
  color: var(--text-muted);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.15s ease;
}
.unit-btn.active {
  background: #FFFFFF;
  color: var(--primary);
  box-shadow: var(--shadow-xs);
}

/* Input Fields Grid */
.calc-form-grid,
.calc-fields-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.25rem;
  margin-bottom: 1.5rem;
}
.calc-field-full {
  grid-column: 1 / -1;
}

.input-group,
.calc-field-group,
.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}
.input-label,
.field-label,
.form-label {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-main);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.input-label .label-hint,
.field-label .label-hint {
  font-size: 0.75rem;
  font-weight: normal;
  color: var(--text-muted);
}
.input-unit {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-muted);
}

.input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}
.input-wrap input,
.input-wrap select,
.calc-input,
.calc-select,
.gpa-grade,
.gpa-credits,
.form-control {
  width: 100%;
  padding: 0.65rem 0.85rem;
  font-size: 0.98rem;
  font-family: inherit;
  font-weight: 500;
  color: var(--text-main);
  background: #FFFFFF;
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-md);
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
  box-sizing: border-box;
}
.input-wrap input:hover,
.input-wrap select:hover,
.calc-input:hover,
.calc-select:hover,
.gpa-grade:hover,
.gpa-credits:hover {
  border-color: #94A3B8;
}
.input-wrap input:focus,
.input-wrap select:focus,
.calc-input:focus,
.calc-select:focus,
.gpa-grade:focus,
.gpa-credits:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
  background: #FFFFFF;
}
.input-unit-badge {
  position: absolute;
  right: 0.75rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  pointer-events: none;
}
.has-unit input {
  padding-right: 2.75rem;
}

/* Range Sliders */
.range-slider-wrap {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-top: 0.25rem;
}
.range-slider-wrap input[type="range"] {
  flex: 1;
  accent-color: var(--primary);
  cursor: pointer;
}

/* Action Toolbar */
.calc-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  padding-top: 1rem;
  border-top: 1px solid var(--border-light);
}
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  font-size: 0.9rem;
  font-weight: 600;
  padding: 0.6rem 1.15rem;
  border-radius: var(--radius-md);
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.15s ease;
  white-space: nowrap;
}
.btn-primary {
  background: var(--primary);
  color: #FFFFFF;
}
.btn-primary:hover {
  background: var(--primary-hover);
  color: #FFFFFF;
  text-decoration: none;
  box-shadow: var(--shadow-sm);
}
.btn-secondary {
  background: var(--bg-surface-alt);
  color: var(--text-body);
  border-color: var(--border-medium);
}
.btn-secondary:hover {
  background: var(--border-light);
  color: var(--text-main);
  text-decoration: none;
}
.btn-subtle {
  background: transparent;
  color: var(--text-muted);
}
.btn-subtle:hover {
  color: var(--primary);
  background: var(--primary-subtle);
  text-decoration: none;
}

/* Results Panel Card */
.results-card {
  background: #FFFFFF;
  border: 1px solid var(--border-light);
  border-top: 4px solid var(--primary);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-md);
  padding: 1.75rem;
  position: sticky;
  top: calc(var(--header-height) + 1.5rem);
}

.results-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
}
.results-header h3 {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-main);
}
.results-title {
  font-size: 0.92rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}
.results-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.76rem;
  font-weight: 700;
  padding: 0.22rem 0.6rem;
  border-radius: var(--radius-full);
  background: #EFF6FF;
  color: var(--primary);
  border: 1px solid var(--primary-border);
  letter-spacing: 0.02em;
}
.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.78rem;
  font-weight: 700;
  padding: 0.2rem 0.6rem;
  border-radius: var(--radius-full);
}
.status-success {
  background: var(--accent-emerald-subtle);
  color: var(--accent-emerald);
  border: 1px solid var(--accent-emerald-border);
}
.status-warning {
  background: var(--accent-amber-subtle);
  color: var(--accent-amber);
  border: 1px solid var(--accent-amber-border);
}
.status-danger {
  background: var(--accent-rose-subtle);
  color: var(--accent-rose);
  border: 1px solid var(--accent-rose-border);
}
.status-info {
  background: #EFF6FF;
  color: #1D4ED8;
  border: 1px solid #BFDBFE;
}

.primary-result-box {
  background: linear-gradient(180deg, #F8FAFC 0%, #FFFFFF 100%);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  text-align: center;
  margin-bottom: 1.25rem;
}
.primary-result-label {
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 0.25rem;
}
.primary-result-value {
  font-size: 2.4rem;
  font-weight: 800;
  color: var(--text-main);
  letter-spacing: -0.03em;
  line-height: 1.1;
  font-family: var(--font-mono);
}
.primary-result-unit,
.primary-result-desc {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--primary);
  margin-top: 0.35rem;
}

.result-breakdown-grid,
.result-details-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}
.breakdown-item,
.result-item {
  background: var(--bg-surface-alt);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 0.75rem;
}
.breakdown-label,
.result-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 0.15rem;
}
.breakdown-val,
.breakdown-value,
.result-val {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-main);
  font-family: var(--font-mono);
  word-break: break-all;
}

.results-footer-actions {
  display: flex;
  gap: 0.65rem;
  margin-top: 1.25rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border-light);
}
.results-footer-actions button,
.results-footer-actions .btn {
  flex: 1;
  font-size: 0.85rem;
  padding: 0.55rem 0.75rem;
}

/* Progress / Visual Gauge Bar */
.visual-bar-wrap {
  margin: 1rem 0;
}
.visual-bar-track {
  width: 100%;
  height: 10px;
  background: #E2E8F0;
  border-radius: var(--radius-full);
  overflow: hidden;
  display: flex;
}
.visual-bar-fill {
  height: 100%;
  background: var(--primary);
  transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.visual-bar-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-subtle);
  margin-top: 0.3rem;
}

/* Export / Action Box */
.result-toolbar {
  display: flex;
  gap: 0.5rem;
  margin-top: 1rem;
}
.result-toolbar button {
  flex: 1;
}

/* Quick Reference Citation Section */
.geo-citation-box {
  background: #FFFFFF;
  border: 1px solid #BFDBFE;
  border-left: 4px solid var(--primary);
  border-radius: var(--radius-lg);
  padding: 1.25rem 1.5rem;
  margin: 2rem 0;
  box-shadow: var(--shadow-xs);
}
.geo-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--primary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.5rem;
}
.geo-citation-box p {
  font-size: 0.95rem;
  color: var(--text-body);
  margin-bottom: 0.6rem;
  line-height: 1.6;
}
.geo-citation-box p:last-child { margin-bottom: 0; }
.geo-citation-box ul {
  margin-left: 1.25rem;
  margin-bottom: 0.6rem;
  font-size: 0.92rem;
}
.geo-citation-box li {
  margin-bottom: 0.25rem;
}

/* Interactive Table of Contents (TOC) */
.toc-container {
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 1.25rem 1.5rem;
  margin: 2rem 0;
  box-shadow: var(--shadow-xs);
}
.toc-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}
.toc-list {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 0.4rem 1.5rem;
}
.toc-list li a {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-body);
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}
.toc-list li a::before {
  content: "→";
  color: var(--primary);
  font-weight: bold;
}
.toc-list li a:hover {
  color: var(--primary);
}

/* Comprehensive Educational Article */
.article-section {
  background: #FFFFFF;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-xl);
  padding: 2.5rem;
  margin-bottom: 2.5rem;
  box-shadow: var(--shadow-xs);
}
.article-section h2 {
  border-bottom: 1px solid var(--border-light);
  padding-bottom: 0.6rem;
}
.article-section p {
  color: var(--text-body);
}

.article-header {
  margin-bottom: 1.5rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--border-light);
}
.article-header h2 {
  margin: 0.5rem 0 0.25rem;
  font-size: 1.65rem;
  border-bottom: none;
  padding-bottom: 0;
}
.article-meta {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 0.5rem;
}

.article-summary-box {
  background: #F8FAFC;
  border: 1px solid var(--border-medium);
  border-left: 4px solid var(--primary);
  border-radius: var(--radius-md);
  padding: 1.15rem 1.35rem;
  margin: 1.5rem 0 2rem;
  font-size: 0.98rem;
  line-height: 1.65;
  color: var(--text-body);
}

/* Formula Highlight Box */
.formula-box,
.formula-block {
  background: var(--bg-surface-alt);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  margin: 1.25rem 0;
  text-align: center;
  overflow-x: auto;
}
.formula-title {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.5rem;
}
.formula-code {
  font-family: var(--font-mono);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--primary);
  letter-spacing: 0.02em;
}
.formula-legend {
  font-size: 0.84rem;
  color: var(--text-muted);
  margin-top: 0.6rem;
}

/* Data Tables */
.table-responsive,
.data-table-container {
  overflow-x: auto;
  margin: 1.5rem 0;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow-xs);
  background: #FFFFFF;
}
.data-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.92rem;
}
.data-table th {
  background: var(--bg-surface-alt);
  color: var(--text-main);
  font-weight: 700;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border-medium);
}
.data-table td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border-light);
  color: var(--text-body);
}
.data-table tr:last-child td {
  border-bottom: none;
}
.data-table tr:hover td {
  background: var(--primary-subtle);
}

/* FAQ Accordion & Item Lists */
.faq-wrap,
.faq-container {
  margin-top: 2.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border-light);
}
.faq-item {
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  margin-bottom: 0.75rem;
  overflow: hidden;
  background: #FFFFFF;
  box-shadow: var(--shadow-xs);
}
.faq-item summary {
  padding: 1rem 1.25rem;
  font-weight: 600;
  color: var(--text-main);
  cursor: pointer;
  user-select: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  list-style: none;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
  content: "+";
  font-size: 1.3rem;
  font-weight: 400;
  color: var(--text-muted);
  transition: transform 0.2s ease;
}
.faq-item[open] summary::after {
  content: "−";
}
.faq-item[open] summary {
  background: var(--bg-surface-alt);
  border-bottom: 1px solid var(--border-light);
}
.faq-content {
  padding: 1.25rem;
  color: var(--text-body);
  font-size: 0.94rem;
  line-height: 1.65;
}
.faq-item .faq-q {
  padding: 0.95rem 1.25rem;
  font-weight: 700;
  font-size: 0.98rem;
  color: var(--text-main);
  background: #F8FAFC;
  border-bottom: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.faq-item .faq-q::before {
  content: "Q.";
  color: var(--primary);
  font-weight: 800;
}
.faq-item .faq-a {
  padding: 1.15rem 1.25rem;
  color: var(--text-body);
  font-size: 0.95rem;
  line-height: 1.65;
  background: #FFFFFF;
}

.category-block-section {
  margin-bottom: 3.5rem;
  scroll-margin-top: 85px;
}

/* Post Layout with Sticky Sidebar */
.post-layout-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 2rem;
  align-items: start;
  margin-top: 1.5rem;
  margin-bottom: 2.5rem;
}

.post-main-content {
  min-width: 0;
}

.post-main-content .geo-citation-box,
.post-main-content .toc-container {
  margin-top: 0;
  margin-bottom: 1.5rem;
}

.post-sidebar {
  position: sticky;
  top: calc(var(--header-height) + 1.25rem);
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.sidebar-widget {
  background: #FFFFFF;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-xl);
  padding: 1.35rem;
  box-shadow: var(--shadow-sm);
}

.sidebar-widget-header {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 0.4rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border-light);
}

.sidebar-widget-header .widget-icon {
  font-size: 1.35rem;
}

.sidebar-widget-header .widget-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-main);
  margin: 0;
  letter-spacing: -0.01em;
}

.sidebar-widget-subtitle {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 0.85rem;
  line-height: 1.45;
}

.sidebar-tools-list,
.sidebar-links-list {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.sidebar-tool-item,
.sidebar-link-item {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.6rem 0.75rem;
  border-radius: var(--radius-md);
  background: #F8FAFC;
  border: 1px solid #F1F5F9;
  text-decoration: none;
  transition: all 0.15s ease;
}

.link-bullet {
  color: var(--text-muted);
  font-size: 0.8rem;
  margin-right: 0.35rem;
}

.sidebar-tool-item:hover,
.sidebar-link-item:hover {
  background: #EFF6FF;
  border-color: #BFDBFE;
  transform: translateX(3px);
  text-decoration: none;
}

.sidebar-tool-item .st-icon {
  font-size: 1.25rem;
  flex: 0 0 auto;
}

.sidebar-tool-item .st-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
  flex: 1;
}

.sidebar-tool-item .st-title {
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--text-main);
  line-height: 1.3;
}

.sidebar-tool-item .st-desc {
  font-size: 0.74rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.3;
}

.sidebar-tool-item.active,
.sidebar-link-item.active {
  background: #EFF6FF;
  border-color: #93C5FD;
  box-shadow: 0 1px 3px rgba(37, 99, 235, 0.12);
}

.sidebar-tool-item.active .st-title,
.sidebar-link-item.active {
  color: #2563EB;
  font-weight: 700;
}

.sidebar-tool-item.active .st-tag {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #2563EB;
}

.sidebar-widget-footer {
  margin-top: 0.85rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border-light);
  text-align: center;
}

.sidebar-cat-link,
.sidebar-category-link {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.84rem;
  font-weight: 700;
  color: var(--primary);
  text-decoration: none;
  transition: all 0.15s ease;
}

.sidebar-cat-link:hover,
.sidebar-category-link:hover {
  color: var(--primary-hover);
  text-decoration: underline;
  transform: translateX(2px);
}

/* Trust Widget */
.sidebar-trust-widget {
  background: linear-gradient(180deg, #F8FAFC 0%, #FFFFFF 100%);
  border: 1px solid var(--border-light);
}

.trust-badge-row {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
}

.trust-badge-row .trust-icon {
  font-size: 1.4rem;
}

.trust-badge-row .trust-title {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 0.2rem;
}

.trust-badge-row .trust-desc {
  font-size: 0.78rem;
  color: var(--text-muted);
  line-height: 1.45;
}

/* Silo / Related Calculators */
.silo-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 1.25rem;
  margin-top: 1.5rem;
}
.silo-card {
  background: #FFFFFF;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  text-decoration: none;
  color: inherit;
  transition: all 0.2s ease;
  display: flex;
  flex-direction: column;
}
.silo-card:hover {
  border-color: var(--primary);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  text-decoration: none;
}
.silo-card-icon {
  font-size: 1.6rem;
  margin-bottom: 0.6rem;
}
.silo-card-title {
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--text-main);
  margin-bottom: 0.35rem;
}
.silo-card-desc {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.5;
  flex: 1;
}

/* Category Overview & Hub Cards */
.category-overview-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.25rem;
  margin-top: 1.75rem;
  margin-bottom: 3rem;
  align-items: stretch;
}
@media (max-width: 1100px) {
  .category-overview-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1.25rem;
  }
}
@media (max-width: 640px) {
  .category-overview-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
}
.category-overview-card {
  background: #FFFFFF;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-xl);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  text-decoration: none;
  color: inherit;
  height: 100%;
  box-sizing: border-box;
}
.category-overview-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--card-accent, #2563EB);
  opacity: 0;
  transition: opacity 0.2s ease;
}
.category-overview-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 16px 30px -6px rgba(15, 23, 42, 0.1);
  border-color: var(--border-medium);
  text-decoration: none;
}
.category-overview-card:hover::before {
  opacity: 1;
}
.category-overview-card.cat-health { --card-accent: #059669; }
.category-overview-card.cat-finance { --card-accent: #2563EB; }
.category-overview-card.cat-math { --card-accent: #7C3AED; }
.category-overview-card.cat-engineering { --card-accent: #D97706; }
.category-overview-card.cat-solar { --card-accent: #EA580C; }
.category-overview-card.cat-mechanical { --card-accent: #0891B2; }
.category-overview-card.cat-civil { --card-accent: #B45309; }
.category-overview-card.cat-chemical { --card-accent: #0D9488; }
.category-overview-card.cat-physics { --card-accent: #4F46E5; }
.category-overview-card.cat-fire { --card-accent: #DC2626; }
.category-overview-card.cat-datetime { --card-accent: #0284C7; }
.category-overview-card.cat-converter { --card-accent: #9333EA; }

.cat-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
  height: 52px;
}
.cat-icon-box {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  background: var(--bg-surface-alt);
  border: 1px solid var(--border-light);
  flex-shrink: 0;
}
.cat-count-badge {
  font-size: 0.78rem;
  font-weight: 700;
  padding: 0.3rem 0.7rem;
  border-radius: var(--radius-full);
  background: var(--primary-subtle);
  color: var(--primary);
  border: 1px solid var(--primary-border);
  white-space: nowrap;
}
.cat-card-title {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text-main);
  margin-bottom: 0.5rem;
  min-height: 3.1rem;
  display: flex;
  align-items: flex-start;
  line-height: 1.35;
}
.cat-card-desc {
  font-size: 0.84rem;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 1.25rem;
  min-height: 2.55rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.cat-tool-preview-list {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  margin-bottom: 1.5rem;
}
.cat-tool-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.45rem 0.75rem;
  border-radius: var(--radius-md);
  background: #F8FAFC;
  border: 1px solid #F1F5F9;
  color: var(--text-body);
  font-size: 0.82rem;
  font-weight: 500;
  text-decoration: none;
  transition: all 0.15s ease;
  height: 48px;
  min-height: 48px;
  max-height: 48px;
  box-sizing: border-box;
}
.cat-tool-item > span:first-child {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.25;
  padding-right: 0.35rem;
  flex: 1;
}
.cat-tool-item:hover {
  background: #FFFFFF;
  border-color: var(--card-accent, var(--primary-border));
  color: var(--card-accent, var(--primary));
  text-decoration: none;
  transform: translateX(3px);
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}
.cat-tool-item .arr {
  color: var(--text-subtle);
  font-size: 0.85rem;
  flex-shrink: 0;
  transition: transform 0.15s ease;
}
.cat-tool-item:hover .arr {
  color: var(--card-accent, var(--primary));
  transform: translateX(2px);
}
.cat-explore-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-md);
  background: #F1F5F9;
  color: var(--text-main);
  font-weight: 700;
  font-size: 0.88rem;
  text-decoration: none;
  border: 1px solid var(--border-light);
  transition: all 0.2s ease;
  margin-top: auto;
  height: 44px;
  min-height: 44px;
  box-sizing: border-box;
}
.cat-explore-btn:hover {
  background: var(--card-accent, var(--primary));
  color: #FFFFFF;
  border-color: var(--card-accent, var(--primary));
  text-decoration: none;
}

/* ==========================================================================
   CATEGORY COLOR THEME SYSTEM (12 DISTINCT DISCIPLINES)
   Scoped variables and styling applied via body.cat-theme-*
   ========================================================================== */

/* 1. Health & Fitness - Emerald Green */
.cat-theme-health {
  --cat-accent: #059669;
  --cat-hover: #047857;
  --cat-subtle: #ECFDF5;
  --cat-border: #A7F3D0;
}
/* 2. Finance & Investment - Royal Blue */
.cat-theme-finance {
  --cat-accent: #2563EB;
  --cat-hover: #1D4ED8;
  --cat-subtle: #EFF6FF;
  --cat-border: #BFDBFE;
}
/* 3. Mathematics & Utilities - Deep Violet */
.cat-theme-math {
  --cat-accent: #7C3AED;
  --cat-hover: #6D28D9;
  --cat-subtle: #F5F3FF;
  --cat-border: #DDD6FE;
}
/* 4. Electrical Engineering - Warm Amber */
.cat-theme-engineering {
  --cat-accent: #D97706;
  --cat-hover: #B45309;
  --cat-subtle: #FFFBEB;
  --cat-border: #FDE68A;
}
/* 5. Solar & Renewable Energy - Solar Flame Orange */
.cat-theme-solar {
  --cat-accent: #EA580C;
  --cat-hover: #C2410C;
  --cat-subtle: #FFF7ED;
  --cat-border: #FFEDD5;
}
/* 6. Mechanical & HVAC - Cool Steel Cyan */
.cat-theme-mechanical {
  --cat-accent: #0891B2;
  --cat-hover: #0E7490;
  --cat-subtle: #ECFEFF;
  --cat-border: #A5F3FC;
}
/* 7. Civil & Construction - Warm Ochre Bronze */
.cat-theme-civil {
  --cat-accent: #B45309;
  --cat-hover: #92400E;
  --cat-subtle: #FEFCE8;
  --cat-border: #FEF08A;
}
/* 8. Chemical & Water - Teal / Aquamarine */
.cat-theme-chemical {
  --cat-accent: #0D9488;
  --cat-hover: #0F766E;
  --cat-subtle: #F0FDFA;
  --cat-border: #99F6E4;
}
/* 9. Fire & Life Safety - Crimson Fire Red */
.cat-theme-fire,
.cat-theme-fire-safety {
  --cat-accent: #DC2626;
  --cat-hover: #B91C1C;
  --cat-subtle: #FEF2F2;
  --cat-border: #FECACA;
}
/* 10. Programmer & Networking - Tech Indigo */
.cat-theme-programmer {
  --cat-accent: #4F46E5;
  --cat-hover: #4338CA;
  --cat-subtle: #EEF2FF;
  --cat-border: #C7D2FE;
}
/* 11. Date & Time Utilities - Sky Azure */
.cat-theme-datetime {
  --cat-accent: #0284C7;
  --cat-hover: #0369A1;
  --cat-subtle: #F0F9FF;
  --cat-border: #BAE6FD;
}
/* 12. Universal Converters - Fuchsia Purple */
.cat-theme-converter {
  --cat-accent: #9333EA;
  --cat-hover: #7E22CE;
  --cat-subtle: #FAF5FF;
  --cat-border: #E9D5FF;
}

/* Category Scoped Calculator Accents */
body[class*="cat-theme-"] .calculator-hero .category-tag,
body[class*="cat-theme-"] .category-tag {
  color: var(--cat-accent) !important;
  background: var(--cat-subtle) !important;
  border-color: var(--cat-border) !important;
}

body[class*="cat-theme-"] .results-card {
  border-top: 4px solid var(--cat-accent) !important;
}

body[class*="cat-theme-"] .btn-primary,
body[class*="cat-theme-"] .btn-calculate {
  background: var(--cat-accent);
  border-color: var(--cat-accent);
}
body[class*="cat-theme-"] .btn-primary:hover,
body[class*="cat-theme-"] .btn-calculate:hover {
  background: var(--cat-hover);
  border-color: var(--cat-hover);
}

body[class*="cat-theme-"] .range-slider-wrap input[type="range"] {
  accent-color: var(--cat-accent);
}

body[class*="cat-theme-"] .primary-result-value {
  color: var(--cat-accent);
}

body[class*="cat-theme-"] .sidebar-tool-item.active {
  background: var(--cat-subtle) !important;
  border-color: var(--cat-border) !important;
  color: var(--cat-accent) !important;
  font-weight: 700;
}
body[class*="cat-theme-"] .sidebar-tool-item:hover {
  background: var(--cat-subtle);
  border-color: var(--cat-border);
  color: var(--cat-accent);
}

body[class*="cat-theme-"] .silo-card {
  border-top: 3px solid var(--cat-accent) !important;
}

body[class*="cat-theme-"] .silo-card:hover {
  border-color: var(--cat-border);
  box-shadow: 0 8px 20px -4px rgba(15, 23, 42, 0.08);
}

body[class*="cat-theme-"] .unit-btn.active {
  background: var(--cat-accent);
  color: #FFFFFF;
}

body[class*="cat-theme-"] .calc-card:focus-within {
  border-color: var(--cat-border);
}

body[class*="cat-theme-"] .sidebar-widget-header .widget-title {
  border-left: 3px solid var(--cat-accent);
  padding-left: 0.5rem;
}

/* Category Filter Tabs */
.category-filter-nav {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  justify-content: center;
  margin: 1.5rem auto 2.5rem;
  padding: 0.35rem;
  background: #FFFFFF;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-full);
  max-width: fit-content;
  box-shadow: var(--shadow-xs);
}
.filter-pill {
  padding: 0.5rem 1.15rem;
  border-radius: var(--radius-full);
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.88rem;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-family: inherit;
}
.filter-pill:hover {
  color: var(--primary);
}
.filter-pill.active {
  background: var(--primary);
  color: #FFFFFF;
  box-shadow: 0 2px 6px rgba(37, 99, 235, 0.3);
}

/* Quick Calculator & Popular Tools Hero Row */
.hero-calc-row {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 1.5rem;
  max-width: 1040px;
  margin: 2.25rem auto 0.5rem;
  text-align: left;
}
@media (max-width: 860px) {
  .hero-calc-row {
    grid-template-columns: 1fr;
  }
}
.hero-card-panel {
  background: #FFFFFF;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-xl);
  padding: 1.25rem;
  box-shadow: var(--shadow-sm);
}
.hero-panel-title {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.quick-calc-screen {
  background: #F8FAFC;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 0.75rem 1rem;
  text-align: right;
  margin-bottom: 0.75rem;
  min-height: 70px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}
.quick-calc-expr {
  font-size: 0.8rem;
  color: var(--text-muted);
  min-height: 16px;
  word-break: break-all;
}
.quick-calc-val {
  font-size: 1.65rem;
  font-weight: 800;
  color: var(--primary);
  line-height: 1.2;
  word-break: break-all;
}
.quick-calc-keys {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
}
.q-key {
  padding: 0.65rem 0;
  font-size: 1rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-light);
  background: #FFFFFF;
  color: var(--text-main);
  cursor: pointer;
  transition: all 0.1s ease;
  text-align: center;
  user-select: none;
}
.q-key:hover {
  background: var(--bg-surface-alt);
  border-color: var(--border-medium);
}
.q-key:active {
  transform: scale(0.97);
}
.q-key.op {
  color: var(--primary);
  background: var(--primary-subtle);
  border-color: var(--primary-border);
}
.q-key.eq {
  background: var(--primary);
  color: #FFFFFF;
  border-color: var(--primary);
  grid-column: span 2;
  font-weight: 700;
}
.q-key.fn {
  color: var(--accent-rose);
  background: var(--accent-rose-subtle);
  border-color: var(--accent-rose-border);
}

/* Popular Tools Grid in Hero */
.hero-popular-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 0.65rem;
}
.hero-tool-chip {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 0.75rem 0.85rem;
  background: #F8FAFC;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  text-decoration: none;
  color: var(--text-main);
  transition: all 0.15s ease;
}
.hero-tool-chip:hover {
  background: #FFFFFF;
  border-color: var(--primary);
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
  text-decoration: none;
}
.hero-tool-chip .t-icon { font-size: 1.25rem; }
.hero-tool-chip .t-name { font-weight: 700; font-size: 0.85rem; color: var(--text-main); }
.hero-tool-chip .t-cat { font-size: 0.72rem; color: var(--text-muted); }

/* Category Landing Page Hero & Cards */
.cat-hub-hero {
  background: linear-gradient(180deg, #FFFFFF 0%, #F8FAFC 100%);
  border-bottom: 1px solid var(--border-light);
  padding: 3.5rem 1.25rem 3rem;
}
.cat-hub-hero-inner {
  max-width: 900px;
  margin: 0 auto;
}
.formula-badge-pill {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.76rem;
  background: #F1F5F9;
  border: 1px solid var(--border-light);
  color: var(--text-body);
  padding: 0.25rem 0.55rem;
  border-radius: var(--radius-sm);
  margin-top: 0.5rem;
}

/* Silo Card Enhancements */
.silo-card {
  position: relative;
  overflow: hidden;
}
.silo-card-badge {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  background: #F1F5F9;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
  width: fit-content;
}

/* Site Footer */
.site-footer {
  background: #FFFFFF;
  border-top: 1px solid var(--border-light, #E2E8F0);
  padding: 3.5rem 1.25rem 2rem;
  margin-top: auto;
}
.footer-inner,
.footer-container {
  max-width: var(--max-w-content, 1200px);
  margin: 0 auto;
  width: 100%;
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.5fr repeat(3, 1fr);
  gap: 2.5rem;
  margin-bottom: 2.5rem;
}
.footer-brand {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.75rem;
}
.footer-brand .brand-logo {
  position: static !important;
  display: inline-flex !important;
  left: auto !important;
  top: auto !important;
  margin-bottom: 0.25rem;
}
.footer-brand p {
  color: var(--text-muted, #64748B);
  font-size: 0.9rem;
  line-height: 1.6;
  margin: 0;
  max-width: 320px;
}
.footer-col h4,
.footer-col-title {
  font-size: 0.88rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-heading, #0F172A);
  margin-top: 0;
  margin-bottom: 1rem;
}
.footer-links,
.footer-col ul {
  list-style: none;
  padding: 0;
  margin: 0;
}
.footer-links li,
.footer-col ul li {
  margin-bottom: 0.5rem;
}
.footer-links a,
.footer-col ul a {
  font-size: 0.88rem;
  color: var(--text-muted, #64748B);
  text-decoration: none;
  transition: color 0.15s ease;
}
.footer-links a:hover,
.footer-col ul a:hover {
  color: var(--primary, #2563EB);
  text-decoration: underline;
}
.footer-bottom {
  padding-top: 1.5rem;
  border-top: 1px solid var(--border-light, #E2E8F0);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  font-size: 0.82rem;
  color: var(--text-muted, #64748B);
}
.footer-bottom p {
  margin: 0;
}
.footer-bottom-links,
.footer-bottom div {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}
.footer-bottom-links a,
.footer-bottom div a {
  color: var(--text-muted, #64748B);
  text-decoration: none;
  transition: color 0.15s ease;
}
.footer-bottom-links a:hover,
.footer-bottom div a:hover {
  color: var(--primary, #2563EB);
  text-decoration: underline;
}

/* Toast Notification */
.toast-notice {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: #0F172A;
  color: #FFFFFF;
  padding: 0.75rem 1.25rem;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  font-size: 0.9rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  z-index: 1000;
  opacity: 0;
  transform: translateY(10px);
  pointer-events: none;
  transition: all 0.25s ease;
}
.toast-notice.show {
  opacity: 1;
  transform: translateY(0);
}

/* Responsive Media Queries */
@media (max-width: 1040px) {
  .site-header { padding: 0.5rem 0; min-height: auto; }
  .header-inner {
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
  }
  .brand-logo {
    position: static;
  }
  .header-nav {
    align-items: center;
    width: 100%;
  }
  .nav-row {
    justify-content: center;
    flex-wrap: wrap;
    gap: 4px;
  }
}

@media (max-width: 960px) {
  .calculator-workspace {
    grid-template-columns: 1fr;
  }
  .results-card {
    position: static;
  }
  .post-layout-grid {
    grid-template-columns: 1fr;
  }
  .post-sidebar {
    position: static;
  }
  .footer-grid {
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
  }
}

@media (max-width: 680px) {
  .site-header { padding: 0.4rem 0; }
  .header-inner { gap: 0.4rem; padding: 0 0.5rem; }
  .brand-logo { font-size: 1.15rem; }
  .logo-badge { width: 30px; height: 30px; font-size: 1rem; }
  .header-nav { width: 100%; }
  .nav-row {
    width: 100%;
    overflow-x: auto;
    white-space: nowrap;
    scrollbar-width: none;
    justify-content: flex-start;
    padding: 0.15rem 0;
    -webkit-overflow-scrolling: touch;
    flex-wrap: nowrap;
  }
  .nav-row::-webkit-scrollbar { display: none; }
  .nav-link { font-size: 0.74rem; padding: 0.18rem 0.42rem; }
  .calc-form-grid { grid-template-columns: 1fr; }
  .result-breakdown-grid { grid-template-columns: 1fr; }
  .article-section { padding: 1.5rem; }
  .footer-grid { grid-template-columns: 1fr; }
  .primary-result-value { font-size: 2rem; }
}

/* ==========================================================================
   HOMEPAGE DIRECTORY, SPOTLIGHT & TRUST MATRIX STYLES
   ========================================================================== */

.home-section {
  margin-bottom: 3.5rem;
}

.home-section-header {
  text-align: center;
  margin-bottom: 2rem;
}
.home-section-header h2 {
  font-size: clamp(1.6rem, 2.8vw, 2.2rem);
  color: var(--text-main);
  margin-bottom: 0.5rem;
  letter-spacing: -0.02em;
}
.home-section-header p {
  font-size: 1.05rem;
  color: var(--text-muted);
  max-width: 780px;
  margin: 0 auto;
  line-height: 1.6;
}

/* Trust Capabilities Grid */
.trust-features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.5rem;
  margin-top: 1.75rem;
}
.trust-feature-card {
  background: #FFFFFF;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-xl);
  padding: 1.5rem;
  box-shadow: var(--shadow-xs);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.trust-feature-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
  border-color: var(--border-medium);
}
.trust-feature-icon {
  font-size: 2rem;
  margin-bottom: 0.75rem;
}
.trust-feature-card h3 {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 0.4rem;
}
.trust-feature-card p {
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.55;
  margin: 0;
}

/* Complete Directory Grid */
.directory-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
  gap: 1.5rem;
}
.directory-card {
  background: #FFFFFF;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-xl);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-xs);
  position: relative;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}
.directory-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: var(--border-medium);
}
.directory-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
  padding-bottom: 0.65rem;
  border-bottom: 1px solid var(--border-light);
}
.directory-card-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-main);
  margin: 0;
}
.directory-card-title a {
  color: var(--text-main);
  text-decoration: none;
}
.directory-card-title a:hover {
  color: var(--primary);
  text-decoration: underline;
}
.directory-card-badge {
  font-size: 0.74rem;
  font-weight: 700;
  padding: 0.2rem 0.55rem;
  border-radius: var(--radius-full);
}
.directory-card-desc {
  font-size: 0.9rem;
  color: var(--text-body);
  line-height: 1.6;
  margin-bottom: 1rem;
}
.directory-card-desc a {
  color: var(--primary);
  font-weight: 600;
  text-decoration: underline;
}
.directory-card-desc a:hover {
  color: var(--primary-hover);
}
.directory-links-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin-top: auto;
  padding-top: 0.75rem;
  border-top: 1px dashed var(--border-light);
}
.directory-link-item a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--text-body);
  padding: 0.35rem 0.6rem;
  border-radius: var(--radius-sm);
  background: #F8FAFC;
  transition: all 0.15s ease;
  text-decoration: none;
}
.directory-link-item a:hover {
  background: var(--primary-subtle);
  color: var(--primary);
  text-decoration: none;
  transform: translateX(3px);
}
.directory-link-item .tool-meta {
  font-size: 0.72rem;
  font-weight: normal;
  color: var(--text-muted);
}

/* Spotlight Frequently-Used Tools Grid */
.spotlight-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 1.5rem;
}
.spotlight-card {
  background: #FFFFFF;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-xl);
  padding: 1.75rem;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.spotlight-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: var(--border-medium);
}
.spotlight-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}
.spotlight-tag {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.25rem 0.6rem;
  border-radius: var(--radius-full);
}
.spotlight-card h3 {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text-main);
  margin-bottom: 0.4rem;
}
.spotlight-card h3 a {
  color: var(--text-main);
  text-decoration: none;
}
.spotlight-card h3 a:hover {
  color: var(--primary);
  text-decoration: underline;
}
.spotlight-card p {
  font-size: 0.92rem;
  color: var(--text-body);
  line-height: 1.6;
  margin-bottom: 1rem;
  flex: 1;
}
.spotlight-formula {
  background: #F8FAFC;
  border: 1px solid #E2E8F0;
  border-radius: var(--radius-md);
  padding: 0.6rem 0.85rem;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  font-weight: 700;
  color: #0F172A;
  margin-bottom: 1.25rem;
  text-align: center;
}
.spotlight-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  font-size: 0.88rem;
  font-weight: 700;
  padding: 0.6rem 1rem;
  border-radius: var(--radius-md);
  background: var(--bg-surface-alt);
  color: var(--text-main);
  border: 1px solid var(--border-light);
  text-decoration: none;
  transition: all 0.15s ease;
  margin-top: auto;
}
.spotlight-btn:hover {
  background: var(--primary);
  color: #FFFFFF;
  border-color: var(--primary);
  text-decoration: none;
}

/* In-Article Contextual Semantic Links */
.article-section a {
  color: var(--cat-accent, var(--primary));
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: opacity 0.15s ease;
}
.article-section a:hover {
  opacity: 0.8;
}

/* Standards Verification Box (E-E-A-T Authority Badge) */
.standards-verification-box {
  background: #F8FAFC;
  border: 1px solid var(--border-medium);
  border-left: 4px solid var(--cat-accent, var(--primary));
  border-radius: var(--radius-lg);
  padding: 1.25rem 1.5rem;
  margin: 1.75rem 0;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.standards-verification-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.standards-badge-title {
  font-weight: 700;
  font-size: 1rem;
  color: var(--text-main);
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}
.standards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin-top: 0.5rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border-light);
  font-size: 0.88rem;
}
.standards-item strong {
  display: block;
  color: var(--text-main);
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 0.2rem;
}

/* Worked Engineering Case Study / Practical Example Card */
.worked-example-card {
  background: #FFFFFF;
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  margin: 1.75rem 0;
  box-shadow: var(--shadow-sm);
}
.worked-example-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border-light);
}
.worked-example-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-main);
  margin: 0;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.worked-example-badge {
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.25rem 0.6rem;
  border-radius: var(--radius-full);
  background: var(--cat-subtle, #EFF6FF);
  color: var(--cat-accent, #2563EB);
  border: 1px solid var(--cat-border, #BFDBFE);
}
.step-calculation-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin: 1.25rem 0;
}
.calc-step-item {
  background: var(--bg-surface-alt);
  border-left: 3px solid var(--cat-accent, var(--primary));
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  padding: 0.9rem 1.15rem;
}
.calc-step-title {
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--text-main);
  margin-bottom: 0.35rem;
}
.calc-step-formula {
  font-family: var(--font-mono);
  font-size: 0.92rem;
  color: var(--text-body);
  background: #FFFFFF;
  padding: 0.4rem 0.75rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-light);
  display: inline-block;
  margin: 0.35rem 0;
}
.calc-final-result {
  background: #ECFDF5;
  border: 1px solid #A7F3D0;
  color: #065F46;
  border-radius: var(--radius-md);
  padding: 1rem 1.25rem;
  margin-top: 1rem;
  font-weight: 600;
}

/* Print Optimization */
@media print {
  .site-header, .site-footer, .calc-actions, .geo-citation-box, .toc-container, .silo-card-grid {
    display: none !important;
  }
  body, .main-wrapper, .calc-card, .results-card, .article-section {
    background: #FFFFFF !important;
    box-shadow: none !important;
    border: none !important;
    padding: 0 !important;
    margin: 0 !important;
    width: 100% !important;
  }
  .primary-result-box {
    border: 2px solid #0F172A !important;
  }
}

/* Directory Tool Cards */
.directory-tool-card {
  background: #FFFFFF;
  border: 1px solid #E2E8F0;
  border-radius: 10px;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: transform 0.2s, box-shadow 0.2s;
}
.directory-tool-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
  border-color: #CBD5E1;
}

/* Sidebar and Secondary Tools Layout */
.sidebar {
  width: 300px;
  flex-shrink: 0;
}
.sidebar-card {
  background: #F8FAFC;
  border: 1px solid #E2E8F0;
  border-radius: 12px;
  padding: 1.25rem;
  margin-bottom: 1.5rem;
}

/* Educational Content Articles */
.educational-content {
  margin-top: 3rem;
  line-height: 1.7;
  color: #334155;
}
.educational-content h2 {
  color: #0F172A;
  font-size: 1.5rem;
  margin-top: 2rem;
  margin-bottom: 0.75rem;
}
.educational-content h3 {
  color: #1E293B;
  font-size: 1.2rem;
  margin-top: 1.5rem;
  margin-bottom: 0.5rem;
}

/* Custom Table Layout */
.table-custom {
  width: 100%;
  border-collapse: collapse;
  border: 1px solid #E2E8F0;
}
.table-custom th,
.table-custom td {
  padding: 0.75rem;
}

/* FAQ Accordion & Universal Item Styling */
.faq-accordion,
.faq-wrap,
.faq-container,
.faq-section {
  margin-top: 1.5rem;
  margin-bottom: 2.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.faq-accordion .faq-item,
.faq-section .faq-item,
.faq-wrap .faq-item,
.faq-container .faq-item {
  background: #FFFFFF;
  border: 1px solid var(--border-light, #E2E8F0);
  border-radius: var(--radius-md, 10px);
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
  transition: all 0.2s ease;
  margin-bottom: 0 !important;
}

.faq-accordion .faq-item:hover,
.faq-section .faq-item:hover,
.faq-wrap .faq-item:hover,
.faq-container .faq-item:hover {
  border-color: #CBD5E1;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
}

.faq-accordion .faq-item > h3,
.faq-accordion .faq-item > h4,
.faq-section .faq-item > h3,
.faq-section .faq-item > h4,
.faq-item > h3:not(.widget-title) {
  margin: 0;
  padding: 1rem 1.25rem;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-heading, #0F172A);
  background: var(--bg-surface-alt, #F8FAFC);
  border-bottom: 1px solid var(--border-light, #E2E8F0);
  display: flex;
  align-items: center;
  gap: 0.65rem;
  line-height: 1.45;
}

.faq-accordion .faq-item > h3::before,
.faq-accordion .faq-item > h4::before,
.faq-section .faq-item > h3::before,
.faq-section .faq-item > h4::before,
.faq-item > h3:not(.widget-title)::before {
  content: "Q.";
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.82rem;
  font-weight: 800;
  color: #FFFFFF;
  background: var(--primary, #2563EB);
  width: 26px;
  height: 26px;
  border-radius: 6px;
  flex-shrink: 0;
}

.faq-accordion .faq-item > p,
.faq-section .faq-item > p,
.faq-item > p:not(.calc-desc) {
  margin: 0;
  padding: 1.15rem 1.25rem;
  font-size: 0.95rem;
  line-height: 1.65;
  color: var(--text-body, #334155);
  background: #FFFFFF;
}

/* Calculator Layout & Tool Components */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0.75rem 1.25rem 2.5rem;
}
.header-container {
  width: 100% !important;
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1.5rem;
  padding: 0.75rem 1.25rem;
}
.site-logo, .header-container .logo {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
  font-weight: 800;
  font-size: 1.35rem;
  color: var(--text-heading, #0F172A);
  margin-right: auto;
}
.logo-icon {
  font-size: 1.5rem;
  color: var(--brand-primary, #2563EB);
}
.logo-text {
  font-weight: 800;
}
.site-nav, .header-container .nav-links {
  display: flex;
  gap: 1.25rem;
  align-items: center;
  flex-wrap: wrap;
}
.site-nav a {
  text-decoration: none;
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text-body, #475569);
  transition: color 0.15s ease;
}
.site-nav a.active,
.site-nav a:hover {
  color: var(--brand-primary, #2563EB);
}
.breadcrumb-nav {
  font-size: 0.85rem;
  color: #64748B;
  margin: 1.5rem 0 1rem;
}
.breadcrumb-nav a {
  color: #64748B;
  text-decoration: none;
}
.breadcrumb-nav a:hover {
  color: var(--brand-primary, #2563EB);
}
.calculator-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
  margin-bottom: 3.5rem;
}
@media (min-width: 1024px) {
  .calculator-layout {
    grid-template-columns: minmax(0, 1fr) 340px;
    align-items: start;
  }
}
.calc-main {
  width: 100%;
}
.calc-header {
  margin-bottom: 1.75rem;
}
.calc-badge {
  display: inline-block;
  background: #EFF6FF;
  color: #1D4ED8;
  font-size: 0.8rem;
  font-weight: 700;
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
  border: 1px solid #BFDBFE;
  margin-bottom: 0.75rem;
}
.calc-tagline {
  font-size: 1.05rem;
  color: #475569;
  line-height: 1.6;
  max-width: 800px;
}
.tool-card {
  background: #FFFFFF;
  border: 1px solid #E2E8F0;
  border-radius: 12px;
  padding: 1.75rem;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}
.calc-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.25rem;
}
.form-hint {
  display: block;
  font-size: 0.75rem;
  color: #64748B;
  margin-top: 0.35rem;
}
.input-with-unit {
  position: relative;
  display: flex;
  align-items: center;
}
.input-with-unit .form-control {
  padding-right: 3.5rem;
}
.unit-badge {
  position: absolute;
  right: 0.75rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: #64748B;
  pointer-events: none;
}
.results-panel {
  background: #F8FAFC;
  border: 1px solid #E2E8F0;
  border-radius: 10px;
  padding: 1.5rem;
}
.results-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
}
.result-tile {
  background: #FFFFFF;
  border: 1px solid #E2E8F0;
  border-radius: 8px;
  padding: 1rem;
}
.result-value {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--brand-primary, #2563EB);
  margin: 0.25rem 0;
}
.result-subtext {
  font-size: 0.75rem;
  color: #64748B;
}
.formula-math {
  overflow-x: auto;
  padding: 0.5rem 0;
}
.step-calculation {
  background: #F8FAFC;
  border-left: 3px solid var(--brand-primary, #2563EB);
  padding: 0.75rem 1rem;
  margin: 0.75rem 0;
  border-radius: 0 6px 6px 0;
}
.footer-desc {
  font-size: 0.88rem;
  color: #94A3B8;
  line-height: 1.6;
  max-width: 320px;
}
.btn-block {
  display: block;
  width: 100%;
}
.results-container {
  background: var(--bg-surface, #ffffff);
  border: 1px solid var(--border-light, #e2e8f0);
  border-radius: var(--radius-lg, 12px);
  padding: 1.5rem;
  margin-top: 1.5rem;
}
.article-body {
  line-height: 1.7;
  color: var(--text-body, #334155);
}
.calc-sidebar {
  width: 100%;
}
.hint {
  display: block;
  font-size: 0.8rem;
  color: var(--text-muted, #64748B);
  margin-top: 0.35rem;
  line-height: 1.4;
}
.form-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.25rem;
  margin-bottom: 1.25rem;
}
.form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.5rem;
}
.result-tile.highlight {
  background: var(--primary-subtle, #EFF6FF);
  border-color: var(--primary-border, #BFDBFE);
}
.result-tile.highlight .result-value {
  color: var(--primary, #1D4ED8);
}
.sidebar-links {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.sidebar-links li a {
  color: var(--text-main, #1E293B);
  text-decoration: none;
  font-size: 0.9rem;
  display: block;
  padding: 0.4rem 0.5rem;
  border-radius: 6px;
  transition: all 0.15s ease;
}
.sidebar-links li a:hover {
  background: var(--bg-surface-alt, #F1F5F9);
  color: var(--primary, #2563EB);
}
.footer-content {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 2rem;
  padding: 3rem 1rem 2rem;
}
.text-center {
  text-align: center;
}
.result-unit {
  font-size: 0.78rem;
  color: var(--text-muted, #64748B);
  font-weight: 500;
  margin-top: 0.2rem;
}
.calculator-main {
  flex: 1;
  min-width: 0;
}
.calculator-card {
  background: var(--bg-surface, #FFFFFF);
  border: 1px solid var(--border-light, #E2E8F0);
  border-radius: var(--radius-lg, 16px);
  padding: 1.75rem;
  box-shadow: var(--shadow-sm, 0 1px 3px rgba(0,0,0,0.05));
  margin-bottom: 2rem;
}
.results-box {
  background: var(--bg-surface-alt, #F8FAFC);
  border: 1px solid var(--border-light, #E2E8F0);
  border-radius: var(--radius-md, 12px);
  padding: 1.5rem;
}
.result-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}
.grid-2-col {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1rem;
}
.result-card {
  background: var(--bg-surface, #FFFFFF);
  border: 1px solid var(--border-light, #E2E8F0);
  border-radius: var(--radius-md, 8px);
  padding: 1rem 1.25rem;
  display: flex;
  flex-direction: column;
}
.field-hint {
  display: block;
  font-size: 0.75rem;
  color: var(--text-muted, #64748B);
  margin-top: 0.25rem;
}
.tool-title {
  font-size: 2rem;
  font-weight: 800;
  color: var(--text-main, #0F172A);
  margin-bottom: 0.5rem;
  letter-spacing: -0.02em;
}
.tool-subtitle {
  font-size: 1.05rem;
  color: var(--text-muted, #64748B);
  margin-bottom: 1.75rem;
  font-weight: 400;
}
.calc-form {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}
.result-details {
  margin-top: 1rem;
  padding: 1rem;
  background: var(--card-bg, #FFFFFF);
  border-radius: 6px;
  border: 1px solid var(--border-light, #E2E8F0);
}
.footer-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
}
.footer-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-main, #0F172A);
  margin-bottom: 0.75rem;
}
.footer-logo {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
}
.footer-about {
  font-size: 0.88rem;
  color: var(--text-muted, #64748B);
  line-height: 1.6;
}
.radio-group {
  display: flex;
  gap: 1.5rem;
  align-items: center;
}
.result-box {
  background: var(--surface, #FFFFFF);
  border: 1px solid var(--border-light, #E2E8F0);
  border-radius: var(--radius-md, 8px);
  padding: 1.25rem;
  margin-bottom: 1rem;
}
.result-box.primary-result {
  background: linear-gradient(135deg, #EFF6FF 0%, #DBEAFE 100%);
  border: 1px solid #BFDBFE;
}




/* Mathematical Blocks & SUVAT Layout Utilities */
.math-block {
  overflow-x: auto;
  padding: 0.75rem 1rem;
  margin: 1rem 0;
  background: var(--surface-alt, #F8FAFC);
  border: 1px solid var(--border-light, #E2E8F0);
  border-radius: var(--radius-md, 8px);
  text-align: center;
}

.sub-label {
  display: block;
  font-size: 0.8rem;
  color: var(--text-muted, #64748B);
  font-weight: 500;
  margin-bottom: 0.25rem;
}

.sub-value {
  display: block;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-main, #0F172A);
  font-variant-numeric: tabular-nums;
}

.unit-select {
  border-left: none;
  border-radius: 0 var(--radius-md, 8px) var(--radius-md, 8px) 0;
  background: var(--surface-alt, #F8FAFC);
  border: 1px solid var(--border-medium, #CBD5E1);
  padding: 0.5rem 0.75rem;
  font-size: 0.9rem;
  color: var(--text-main, #0F172A);
  cursor: pointer;
}

.col-half {
  flex: 1 1 calc(50% - 0.75rem);
  min-width: 240px;
}

.col-third {
  flex: 1 1 calc(33.333% - 0.75rem);
  min-width: 200px;
}

.col-full {
  flex: 1 1 100%;
}

.logo {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--brand-primary, #2563EB);
  text-decoration: none;
  letter-spacing: -0.02em;
}

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

.nav-links a {
  color: var(--text-muted, #64748B);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.95rem;
  transition: color 0.15s ease;
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--brand-primary, #2563EB);
  font-weight: 600;
}

.page-container {
  max-width: var(--container-max, 1200px);
  margin: 0 auto;
  padding: 2rem 1.5rem 4rem;
}

.content-wrapper {
  display: flex;
  gap: 2.5rem;
  align-items: flex-start;
}

.calculator-container {
  flex: 1 1 0%;
  min-width: 0;
}

.lead-text {
  font-size: 1.1rem;
  color: var(--text-muted, #64748B);
  line-height: 1.6;
  margin-bottom: 2rem;
}

.btn-group {
  display: flex;
  gap: 0.75rem;
  margin-top: 1.5rem;
  flex-wrap: wrap;
}

.result-sub {
  font-size: 0.88rem;
  color: var(--text-muted, #64748B);
  margin-top: 0.35rem;
}

.radio-row {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: center;
}

.category-hero {
  text-align: center;
  margin-bottom: 3rem;
}

.result-hero {
  background: linear-gradient(180deg, #F8FAFC 0%, #FFFFFF 100%);
  border: 1px solid var(--border-light, #E2E8F0);
  border-radius: var(--radius-lg, 12px);
  padding: 1.25rem;
  text-align: center;
  margin-bottom: 1.25rem;
}

.hero-label {
  display: block;
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--text-muted, #64748B);
  margin-bottom: 0.35rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.hero-value {
  display: block;
  font-size: 2.2rem;
  font-weight: 800;
  color: var(--primary, #2563EB);
  letter-spacing: -0.03em;
  line-height: 1.15;
  font-family: var(--font-mono, monospace);
}

/* Batch 21 Component and Utility Aliases */
.bg-slate-50 { background-color: #F8FAFC; }
.text-slate-900 { color: #0F172A; }
.header { width: 100%; border-bottom: 1px solid var(--border-light, #E2E8F0); background: #FFFFFF; }
.header-logo { display: flex; align-items: center; gap: 0.5rem; }
.logo-link { display: inline-flex; align-items: center; gap: 0.5rem; text-decoration: none; font-weight: 800; font-size: 1.25rem; color: var(--text-main, #0F172A); }
.main-content { min-height: calc(100vh - 200px); padding: 2rem 1rem; }
.calculator-header { margin-bottom: 2rem; }
.badge-tag { display: inline-block; padding: 0.25rem 0.75rem; border-radius: 9999px; font-size: 0.75rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; background: #EEF2FF; color: #4F46E5; margin-bottom: 0.75rem; }
.calculator-title { font-size: 2.2rem; font-weight: 800; color: var(--text-main, #0F172A); line-height: 1.2; margin-bottom: 0.75rem; }
.calculator-description { font-size: 1.05rem; color: var(--text-muted, #64748B); line-height: 1.6; max-width: 800px; }
.calc-card-body { padding: 1.5rem; }
.form-input { width: 100%; padding: 0.65rem 0.85rem; border: 1px solid var(--border-medium, #CBD5E1); border-radius: var(--radius-md, 8px); font-size: 0.95rem; font-family: inherit; background: #FFFFFF; color: var(--text-main, #0F172A); }
.form-select { width: 100%; padding: 0.65rem 0.85rem; border: 1px solid var(--border-medium, #CBD5E1); border-radius: var(--radius-md, 8px); font-size: 0.95rem; font-family: inherit; background: #FFFFFF; color: var(--text-main, #0F172A); }
.stat-box { background: #F8FAFC; border: 1px solid var(--border-light, #E2E8F0); border-radius: var(--radius-md, 8px); padding: 1rem; margin-top: 1.25rem; }
.example-header { display: flex; align-items: center; gap: 0.75rem; margin-bottom: 1rem; flex-wrap: wrap; }
.example-badge { display: inline-block; padding: 0.2rem 0.6rem; border-radius: var(--radius-sm, 4px); font-size: 0.75rem; font-weight: 700; background: #E0E7FF; color: #3730A3; }
.example-title { font-size: 1.2rem; font-weight: 700; margin: 0; color: var(--text-main, #0F172A); }
.example-step { display: flex; gap: 1rem; margin-bottom: 1.25rem; align-items: flex-start; }
.step-num { width: 28px; height: 28px; border-radius: 50%; background: var(--primary, #2563EB); color: #FFFFFF; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 0.85rem; flex-shrink: 0; }
.step-content { flex: 1; font-size: 0.95rem; line-height: 1.6; color: var(--text-body, #334155); }
.footer { border-top: 1px solid var(--border-light, #E2E8F0); background: #FFFFFF; padding: 3rem 1rem 2rem; margin-top: 4rem; }
.footer-tagline { font-size: 0.85rem; color: var(--text-muted, #64748B); margin-top: 0.5rem; }

/* Batch 22 Component and Utility Aliases */
.my-4 { margin-top: 1.5rem; margin-bottom: 1.5rem; }
.mt-4 { margin-top: 1.5rem; }
.footer-heading { font-size: 0.95rem; font-weight: 700; color: #0F172A; margin-bottom: 0.75rem; }
.footer-nav { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 0.5rem; }
.slider-container { display: flex; align-items: center; gap: 1rem; width: 100%; }
.form-slider { width: 100%; accent-color: var(--brand-primary, #2563EB); cursor: pointer; }
.table-container { overflow-x: auto; margin-top: 1.25rem; margin-bottom: 1.25rem; border-radius: var(--radius-md, 8px); }
.main-container { max-width: 1200px; margin: 0 auto; padding: 1.5rem 1rem; }
.breadcrumb-list { list-style: none; display: flex; gap: 0.5rem; padding: 0; margin: 0 0 1.25rem 0; font-size: 0.875rem; color: #64748B; align-items: center; }
.breadcrumb-list li a { color: var(--primary, #2563EB); text-decoration: none; }
.breadcrumb-list li.active { color: var(--text-main, #0F172A); font-weight: 600; }
.breadcrumb-list li:not(:last-child)::after { content: "/"; margin-left: 0.5rem; color: #94A3B8; }
.page-layout { display: grid; grid-template-columns: 1fr 340px; gap: 2rem; align-items: start; }
@media (max-width: 900px) { .page-layout { grid-template-columns: 1fr; } }
.calculator-subtitle { font-size: 1rem; color: var(--text-muted, #64748B); margin-top: 0.25rem; margin-bottom: 1.5rem; line-height: 1.5; }
.calculator-form { display: flex; flex-direction: column; gap: 1.25rem; }
.slider-display { font-weight: 700; font-size: 0.95rem; color: var(--primary, #2563EB); min-width: 85px; }
.calculate-btn { background: var(--primary, #2563EB); color: #FFFFFF; font-weight: 700; padding: 0.75rem 1.5rem; border: none; border-radius: var(--radius-md, 8px); cursor: pointer; transition: background 0.2s ease; width: 100%; font-size: 1rem; }
.calculate-btn:hover { background: #1D4ED8; }
.results-heading { font-size: 1.25rem; font-weight: 700; margin-bottom: 1rem; color: var(--text-main, #0F172A); }
.highlight-card { background: #EFF6FF !important; border: 1px solid #BFDBFE !important; }
.summary-box { background: #F8FAFC; border: 1px solid var(--border-light, #E2E8F0); border-radius: var(--radius-md, 8px); padding: 1.25rem; }
.summary-title { font-size: 1rem; font-weight: 700; color: var(--text-main, #0F172A); margin-bottom: 0.5rem; }
.summary-text { font-size: 0.95rem; color: var(--text-body, #334155); line-height: 1.5; margin: 0; }
.weight-unit { font-weight: 700; }
.font-bold { font-weight: 700; }
.text-primary { color: var(--primary, #2563EB); }
.status-below { display: inline-block; padding: 0.25rem 0.5rem; border-radius: 4px; font-size: 0.85rem; font-weight: 700; background: #FEF3C7; color: #B45309; }
.status-above { display: inline-block; padding: 0.25rem 0.5rem; border-radius: 4px; font-size: 0.85rem; font-weight: 700; background: #FEE2E2; color: #B91C1C; }
.status-normal { display: inline-block; padding: 0.25rem 0.5rem; border-radius: 4px; font-size: 0.85rem; font-weight: 700; background: #DCFCE7; color: #15803D; }
.unit-label { font-size: 0.875rem; color: var(--text-muted, #64748B); font-weight: 500; }
.badge { display: inline-block; padding: 0.25rem 0.5rem; border-radius: 4px; font-size: 0.8rem; font-weight: 600; }
.results-display { margin-bottom: 1.5rem; }
.result-hero-box { background: var(--surface-variant, #F8FAFC); padding: 1.5rem; border-radius: 12px; border: 1px solid var(--border-light, #E2E8F0); text-align: center; }
.footer-summary { font-size: 0.9rem; color: var(--text-muted, #64748B); line-height: 1.5; margin-top: 0.5rem; }
.footer-bottom-inner { display: flex; justify-content: space-between; align-items: center; max-width: 1200px; margin: 0 auto; padding: 1rem 0; font-size: 0.85rem; color: var(--text-muted, #64748B); }

/* Converter Page Specialized Components */
.converter-page { background-color: var(--bg-body, #F8FAFC); }
.page-wrapper { max-width: 1200px; margin: 0 auto; padding: 1.5rem 1rem; }
.converter-layout { display: grid; grid-template-columns: 1fr 320px; gap: 2rem; align-items: start; }
@media (max-width: 960px) { .converter-layout { grid-template-columns: 1fr; } }
.converter-main { display: flex; flex-direction: column; gap: 1.5rem; }
.tagline { font-size: 1.05rem; color: var(--text-muted, #64748B); margin-top: 0.25rem; line-height: 1.5; }
.card-surface { background: #FFFFFF; border: 1px solid var(--border-light, #E2E8F0); border-radius: var(--radius-lg, 12px); padding: 1.75rem; box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05); }
.converter-box { display: flex; flex-direction: column; gap: 1.25rem; }
.converter-inputs-grid { display: grid; grid-template-columns: 1fr auto 1fr; gap: 1rem; align-items: center; }
@media (max-width: 640px) { .converter-inputs-grid { grid-template-columns: 1fr; } }
.input-col { display: flex; flex-direction: column; gap: 0.5rem; }
.sub-label { margin-top: 0.5rem; }
.converter-num-input { width: 100%; padding: 0.75rem 1rem; font-size: 1.15rem; font-weight: 600; border: 1px solid var(--border-medium, #CBD5E1); border-radius: var(--radius-md, 8px); background: #FFFFFF; color: var(--text-main, #0F172A); }
.converter-num-input.output-val { background: #F8FAFC; color: var(--primary, #2563EB); }
.converter-select { width: 100%; padding: 0.65rem 0.85rem; font-size: 0.95rem; font-weight: 500; border: 1px solid var(--border-medium, #CBD5E1); border-radius: var(--radius-md, 8px); background: #FFFFFF; color: var(--text-main, #0F172A); cursor: pointer; }
.swap-col { display: flex; align-items: center; justify-content: center; padding-top: 1.5rem; }
.swap-button { width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--border-medium, #CBD5E1); background: #F1F5F9; color: var(--text-main, #0F172A); font-size: 1.25rem; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: all 0.2s ease; }
.swap-button:hover { background: var(--primary, #2563EB); color: #FFFFFF; border-color: var(--primary, #2563EB); }
.converter-quick-presets { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; margin-top: 0.5rem; }
.preset-label { font-size: 0.85rem; font-weight: 600; color: var(--text-muted, #64748B); }
.preset-chip { padding: 0.35rem 0.75rem; border-radius: 9999px; border: 1px solid var(--border-light, #E2E8F0); background: #F8FAFC; color: var(--text-body, #334155); font-size: 0.825rem; font-weight: 500; cursor: pointer; transition: all 0.2s ease; }
.preset-chip:hover { background: #EFF6FF; border-color: #BFDBFE; color: var(--primary, #2563EB); }
.conversion-summary-panel { background: #F8FAFC; border: 1px solid var(--border-light, #E2E8F0); border-radius: var(--radius-md, 8px); padding: 1rem 1.25rem; margin-top: 0.75rem; }
.summary-line { font-size: 1.05rem; font-weight: 700; color: var(--text-main, #0F172A); margin-bottom: 0.75rem; }
.summary-label { color: var(--text-muted, #64748B); font-weight: 500; margin-right: 0.5rem; font-size: 0.9rem; }
.summary-formula { color: var(--primary, #2563EB); }
.summary-submetrics { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 1rem; border-top: 1px solid var(--border-light, #E2E8F0); padding-top: 0.75rem; }
.submetric-item { display: flex; flex-direction: column; gap: 0.25rem; }
.submetric-name { font-size: 0.8rem; color: var(--text-muted, #64748B); font-weight: 500; }
.submetric-val { font-size: 0.95rem; font-weight: 700; color: var(--text-main, #0F172A); }
.formula-card { background: #F8FAFC; border-left: 4px solid var(--primary, #2563EB); padding: 1.25rem; border-radius: 0 var(--radius-md, 8px) var(--radius-md, 8px) 0; margin: 1.25rem 0; }
.faq-section { margin-top: 2rem; }
.converter-sidebar { display: flex; flex-direction: column; gap: 1.5rem; }
.sidebar-tip { font-size: 0.9rem; line-height: 1.6; color: var(--text-body, #334155); }
.table-footnote { font-size: 0.825rem; color: var(--text-muted, #64748B); margin-top: 0.5rem; }

/* Missing Classes from Batch 27 Audit */
.faq-question { font-size: 1.15rem; font-weight: 700; color: var(--text-main, #0F172A); margin-bottom: 0.5rem; }
.faq-answer { font-size: 0.95rem; line-height: 1.6; color: var(--text-body, #334155); margin-bottom: 1.25rem; }
.sidebar-title { font-size: 1.1rem; font-weight: 700; color: var(--text-main, #0F172A); margin-bottom: 0.75rem; }
.content-column { display: flex; flex-direction: column; gap: 2rem; }
.tool-header { margin-bottom: 1.5rem; }
.conversion-steps { margin-top: 1.5rem; }
.example-body { padding: 1.25rem; font-size: 0.95rem; line-height: 1.6; color: var(--text-body, #334155); }
.sidebar-column { display: flex; flex-direction: column; gap: 1.5rem; }
.sidebar-nav { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 0.5rem; }
.sidebar-nav li a { color: var(--primary, #2563EB); text-decoration: none; font-weight: 500; font-size: 0.9rem; }
.sidebar-nav li a:hover { text-decoration: underline; }

/* Batch 29 CSS Class Enhancements */
.res-label { font-size: 0.85rem; font-weight: 600; color: var(--text-muted, #64748B); }
.res-val { font-size: 1.05rem; font-weight: 700; color: var(--text-main, #0F172A); }
.help-text { font-size: 0.8rem; color: var(--text-muted, #64748B); margin-top: 0.25rem; display: block; }
.input-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 1rem; margin-bottom: 1rem; }
.content-layout { display: grid; grid-template-columns: 1fr 300px; gap: 2rem; }
.main-column { display: flex; flex-direction: column; gap: 2rem; min-width: 0; }
.calc-icon { font-size: 1.75rem; display: inline-flex; align-items: center; justify-content: center; margin-right: 0.5rem; }
.calc-description { font-size: 0.95rem; color: var(--text-muted, #64748B); line-height: 1.6; margin-bottom: 1.5rem; }
.result-highlight { font-size: 1.5rem; font-weight: 800; color: var(--primary, #2563EB); background: #EFF6FF; border: 1px solid #BFDBFE; border-radius: var(--radius-md, 8px); padding: 1rem 1.25rem; text-align: center; margin-bottom: 1.25rem; }
@media (max-width: 900px) {
  .content-layout { grid-template-columns: 1fr; }
}

/* Batch 30 CSS Class Enhancements */
.method-panel { margin-bottom: 1.25rem; }
.nav-container { display: flex; align-items: center; justify-content: space-between; max-width: 1200px; margin: 0 auto; padding: 0 1rem; }
.calculator-body { padding: 1rem 0; }
.result-title { font-size: 1.25rem; font-weight: 700; color: var(--text-main, #0F172A); margin-bottom: 1rem; }

/* Batch 31 CSS Class Enhancements */
.prob-panel { margin-bottom: 1.25rem; }
.dim-3d-group { margin-bottom: 1rem; }

/* Batch 32 CSS Class Enhancements */
.solid-panel { margin-bottom: 1.25rem; }
.shape-panel { margin-bottom: 1.25rem; }
.step-solution { background: var(--bg-secondary, #f8f9fa); border-left: 3px solid var(--primary, #2563eb); padding: 1rem 1.25rem; margin-top: 1rem; border-radius: 0 6px 6px 0; }
.info-card { background: var(--card-bg, #ffffff); border: 1px solid var(--border-color, #e2e8f0); border-radius: var(--radius-md, 8px); padding: 1.25rem; margin-bottom: 1.5rem; }
.related-calculators { margin-top: 2rem; padding: 1.5rem; background: var(--bg-secondary, #f8f9fa); border-radius: 8px; border: 1px solid var(--border-color, #e2e8f0); }

/* Batch 33 CSS Class Enhancements */
.metric-card { background: var(--bg-surface, #ffffff); border: 1px solid var(--border-light, #e2e8f0); border-radius: var(--radius-sm, 6px); padding: 0.85rem; }
.page-header { margin-bottom: 1.75rem; }
.page-title { font-size: clamp(1.85rem, 3vw, 2.5rem); font-weight: 800; color: var(--text-main, #0f172a); margin-bottom: 0.5rem; }
.page-desc { font-size: 1.05rem; color: var(--text-muted, #64748b); line-height: 1.5; }
.result-hero-card { background: var(--bg-surface, #ffffff); border: 1px solid var(--border-light, #e2e8f0); border-radius: var(--radius-md, 8px); padding: 1.25rem; text-align: center; margin-bottom: 1rem; }
.summary-metrics-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 0.75rem; }

/* Batch 34 CSS Class Enhancements */
.pc-el-symbol { font-weight: 600; text-transform: uppercase; }
.pc-el-count { font-weight: 600; }
.pc-el-mw { font-family: var(--font-mono, monospace); }
.pc-remove-btn { cursor: pointer; transition: background 0.15s ease; }

/* Batch 35 CSS Class Enhancements */
.content-area { min-width: 0; }
.breadcrumb {
  font-size: 0.85rem;
  color: var(--text-muted, #64748b);
  margin-top: 1.25rem;
  margin-bottom: 1.25rem;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.4rem;
}
.breadcrumb a { color: var(--primary, #2563eb); text-decoration: none; }
.breadcrumb a:hover { text-decoration: underline; }
.calc-desc { font-size: 0.95rem; color: var(--text-muted, #64748b); margin-top: 0.35rem; }
.calc-input-group { margin-bottom: 1rem; display: flex; flex-direction: column; gap: 0.35rem; }
.input-with-select { display: flex; gap: 0.5rem; align-items: center; }
.input-with-select input { flex: 1; min-width: 0; }
.input-with-select select { width: auto; min-width: 80px; }
.calc-btn { display: inline-flex; align-items: center; justify-content: center; width: 100%; padding: 0.85rem 1.5rem; font-weight: 700; font-size: 1rem; color: #ffffff; background: var(--primary, #2563eb); border: none; border-radius: var(--radius-md, 8px); cursor: pointer; transition: background 0.15s ease, transform 0.1s ease; margin-top: 0.75rem; margin-bottom: 1.5rem; }
.calc-btn:hover { background: var(--primary-dark, #1d4ed8); transform: translateY(-1px); }
.calc-results-card { background: #f8fafc; border: 1px solid var(--border-light, #e2e8f0); border-radius: var(--radius-md, 8px); padding: 1.25rem; margin-top: 1rem; }
.result-row { display: flex; justify-content: space-between; align-items: center; padding: 0.5rem 0; border-bottom: 1px solid #f1f5f9; }
.result-row:last-child { border-bottom: none; }
.highlight-result { font-weight: 700; color: var(--primary, #2563eb); font-size: 1.1rem; background: #eff6ff; padding: 0.75rem; border-radius: var(--radius-sm, 6px); }
.pr-val-input { width: 100%; }
.pr-unit-select { min-width: 70px; }
.pr-remove-btn { background: #fee2e2; color: #dc2626; border: 1px solid #fecaca; border-radius: 4px; padding: 0.35rem 0.65rem; cursor: pointer; font-size: 0.85rem; }
.pr-remove-btn:hover { background: #fca5a5; }


/* Added for component cards grid */
.calculator-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin: 1.5rem 0;
}
.card-title {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text-color, #1e293b);
    margin-bottom: 0.5rem;
}
.card-description {
    font-size: 0.95rem;
    color: var(--text-muted, #64748b);
    line-height: 1.5;
}

/* CalcHub dynamic form layout classes */
.calc-row {
    display: flex;
    flex-wrap: wrap;
    gap: 1.25rem;
    margin-bottom: 1.25rem;
}
.calc-field {
    flex: 1 1 calc(50% - 1.25rem);
    min-width: 250px;
    display: flex;
    flex-direction: column;
}
.calc-field label {
    font-weight: 600;
    margin-bottom: 0.4rem;
    color: var(--text-color, #1e293b);
    font-size: 0.95rem;
}
.calc-field input, .calc-field select {
    padding: 0.65rem 0.85rem;
    border: 1px solid var(--border-color, #cbd5e1);
    border-radius: 8px;
    font-size: 1rem;
    background: #ffffff;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.calc-field input:focus, .calc-field select:focus {
    outline: none;
    border-color: var(--brand-primary, #2563eb);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}
.calc-field .field-hint {
    font-size: 0.8rem;
    color: var(--text-muted, #64748b);
    margin-top: 0.3rem;
}
.calc-results {
    background: var(--bg-surface, #f8fafc);
    border: 1px solid var(--border-light, #e2e8f0);
    border-radius: 12px;
    padding: 1.5rem;
    margin-top: 1.5rem;
}
.calc-results h3 {
    margin-top: 0;
    margin-bottom: 1rem;
    font-size: 1.2rem;
    color: var(--text-color, #0f172a);
}


/* Batch 39 Chrono & Form Component Utilities */
.calc-inputs {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.input-field {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border-color, #cbd5e1);
    border-radius: var(--radius-md, 8px);
    font-size: 1rem;
    background: #ffffff;
    color: var(--text-main, #0f172a);
    box-sizing: border-box;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.input-field:focus {
    outline: none;
    border-color: var(--brand-primary, #2563eb);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.input-hint {
    display: block;
    font-size: 0.8rem;
    color: var(--text-muted, #64748b);
    margin-top: 0.35rem;
    line-height: 1.4;
}

.result-value-sm {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-main, #0f172a);
    margin-top: 0.3rem;
}

.result-grid-mini {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 0.75rem;
}

.btn-outline {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.4rem 0.85rem;
    border: 1px solid var(--border-color, #cbd5e1);
    border-radius: var(--radius-sm, 6px);
    background: #ffffff;
    color: var(--text-main, #0f172a);
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-outline:hover {
    border-color: var(--brand-primary, #2563eb);
    color: var(--brand-primary, #2563eb);
    background: var(--bg-accent, #eff6ff);
}

.calc-body {
    padding: 0.5rem 0;
}

/* Specialized Performance & Metabolic Calculator Card Styles */
.unit-toggle-group {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1.25rem;
    flex-wrap: wrap;
}

.unit-toggle-label {
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--text-muted, #64748b);
}

.toggle-buttons {
    display: inline-flex;
    background: #f1f5f9;
    padding: 3px;
    border-radius: var(--radius-md, 8px);
    gap: 4px;
}

.result-highlight-card {
    background: linear-gradient(135deg, #eff6ff 0%, #f8fafc 100%);
    border: 1px solid #bfdbfe;
    border-radius: var(--radius-lg, 12px);
    padding: 1.5rem;
    text-align: center;
    margin-bottom: 1.5rem;
}

.highlight-label {
    display: block;
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--text-muted, #64748b);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 0.35rem;
}

.highlight-val {
    display: block;
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--brand-primary, #2563eb);
    line-height: 1.1;
    font-family: var(--font-mono, monospace);
    margin-bottom: 0.35rem;
}

.highlight-sub {
    display: block;
    font-size: 0.92rem;
    font-weight: 500;
    color: var(--text-body, #334155);
}

.results-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.stat-card {
    background: #ffffff;
    border: 1px solid var(--border-light, #e2e8f0);
    border-radius: var(--radius-md, 8px);
    padding: 1rem 1.15rem;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.stat-title {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-muted, #64748b);
}

.stat-value {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-main, #0f172a);
    font-family: var(--font-mono, monospace);
}

.stat-desc {
    font-size: 0.78rem;
    color: var(--text-muted, #64748b);
    line-height: 1.4;
}

/* Contextual Related Computational Tools Section */
.related-tools-section {
  margin-top: 2.75rem;
  padding-top: 1.75rem;
  border-top: 1px solid var(--border-light, #e2e8f0);
}

.related-tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1rem;
}

.related-tool-card {
  display: flex;
  flex-direction: column;
  padding: 1.1rem;
  background: var(--bg-surface-alt, #f8fafc);
  border: 1px solid var(--border-light, #e2e8f0);
  border-radius: var(--radius-md, 8px);
  text-decoration: none;
  color: inherit;
  transition: all 0.2s ease;
}

.related-tool-card:hover {
  border-color: var(--primary, #2563eb);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.08);
  transform: translateY(-2px);
  text-decoration: none;
}

/* ==========================================================================
   WORKED EXAMPLE CASE STUDY & PARAMETER SYSTEM
   ========================================================================== */
.step-param-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin: 0.75rem 0;
  padding: 0.75rem 1rem;
  background: var(--bg-surface-alt, #F1F5F9);
  border: 1px solid var(--border-light, #E2E8F0);
  border-radius: var(--radius-md, 10px);
}

.step-param-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.88rem;
  color: var(--text-body, #334155);
  background: #FFFFFF;
  border: 1px solid var(--border-light, #E2E8F0);
  border-radius: var(--radius-sm, 6px);
  padding: 0.35rem 0.75rem;
  line-height: 1.45;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
  transition: border-color 0.15s ease;
}

.step-param-pill:hover {
  border-color: var(--primary-border, #BFDBFE);
}

.step-param-pill strong {
  color: var(--text-main, #0F172A);
  font-weight: 700;
}

/* Worked Example Card Polish */
.worked-example-card {
  background: #FFFFFF;
  border: 1px solid var(--border-light, #E2E8F0);
  border-radius: var(--radius-lg, 14px);
  padding: 1.75rem;
  margin: 2rem 0;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -2px rgba(0, 0, 0, 0.03);
  transition: box-shadow 0.2s ease, border-color 0.2s ease;
}

.worked-example-card:hover {
  border-color: var(--border-medium, #CBD5E1);
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.06), 0 4px 6px -4px rgba(0, 0, 0, 0.03);
}

.worked-example-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
  padding-bottom: 0.85rem;
  border-bottom: 1px solid var(--border-light, #E2E8F0);
}

.worked-example-title {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text-main, #0F172A);
  margin: 0;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  line-height: 1.35;
}

.worked-example-badge {
  font-size: 0.78rem;
  font-weight: 700;
  padding: 0.3rem 0.75rem;
  border-radius: var(--radius-full, 9999px);
  background: var(--primary-subtle, #EFF6FF);
  color: var(--primary, #2563EB);
  border: 1px solid var(--primary-border, #BFDBFE);
  white-space: nowrap;
  letter-spacing: 0.02em;
}

.step-calculation-list {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.calc-step-item {
  background: var(--bg-surface-alt, #F8FAFC);
  border: 1px solid var(--border-light, #E2E8F0);
  border-left: 4px solid var(--cat-accent, var(--primary, #2563EB));
  border-radius: 0 var(--radius-md, 10px) var(--radius-md, 10px) 0;
  padding: 1.1rem 1.35rem;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.calc-step-item:hover {
  background: #FFFFFF;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.calc-step-title {
  font-weight: 700;
  font-size: 1rem;
  color: var(--text-main, #0F172A);
  margin-bottom: 0.5rem;
  line-height: 1.4;
}

.calc-final-result {
  margin-top: 1.5rem;
  padding: 1rem 1.35rem;
  background: var(--primary-subtle, #EFF6FF);
  border: 1px solid var(--primary-border, #BFDBFE);
  border-left: 4px solid var(--primary, #2563EB);
  border-radius: var(--radius-md, 10px);
  font-weight: 600;
  font-size: 0.98rem;
  color: var(--text-main, #0F172A);
  line-height: 1.55;
}

/* Mathematical Formula & KaTeX Polish */
.formula-box,
.formula-block,
.math-block {
  background: var(--bg-surface-alt, #F8FAFC);
  border: 1px solid var(--border-light, #E2E8F0);
  border-radius: var(--radius-md, 10px);
  padding: 1.1rem 1.25rem;
  margin: 1rem 0;
  text-align: center;
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.katex-display {
  max-width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  padding: 0.5rem 0;
  margin: 0.5rem 0 !important;
}

.katex {
  font-size: 1.08em;
  text-rendering: optimizeLegibility;
}

/* Global Responsive Table System (Zero Viewport Blowout) */
table {
  max-width: 100%;
}

.table-responsive,
.data-table-container,
.table-container {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 1.5rem 0;
  border: 1px solid var(--border-light, #E2E8F0);
  border-radius: var(--radius-md, 10px);
  background: #FFFFFF;
  box-shadow: var(--shadow-xs);
}

.data-table,
.reference-table,
.table-custom {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.92rem;
}

.data-table th,
.reference-table th,
.table-custom th {
  background: var(--bg-surface-alt, #F8FAFC);
  color: var(--text-main, #0F172A);
  font-weight: 700;
  padding: 0.85rem 1.15rem;
  border-bottom: 2px solid var(--border-medium, #CBD5E1);
  white-space: nowrap;
}

.data-table td,
.reference-table td,
.table-custom td {
  padding: 0.85rem 1.15rem;
  border-bottom: 1px solid var(--border-light, #E2E8F0);
  color: var(--text-body, #334155);
}

.data-table tr:hover td,
.reference-table tr:hover td,
.table-custom tr:hover td {
  background: var(--primary-subtle, #EFF6FF);
}

/* ==========================================================================
   CONSOLIDATED MULTI-DEVICE RESPONSIVE BREAKPOINTS
   (Laptops, Tablets & Mobile Handhelds)
   ========================================================================== */

/* 1. Large Screen & Small Laptops (<= 1024px) */
@media (max-width: 1024px) {
  .site-header {
    padding: 0.5rem 0;
  }
  .header-inner {
    flex-direction: column;
    align-items: center;
    gap: 0.6rem;
    padding: 0 1rem;
  }
  .brand-logo {
    position: static;
  }
  .header-nav {
    width: 100%;
  }
  .nav-row {
    justify-content: center;
    flex-wrap: wrap;
    gap: 5px;
  }
  .calculator-workspace,
  .page-layout,
  .converter-layout,
  .post-layout-grid,
  .main-wrapper:has(> .post-sidebar),
  .main-wrapper:has(.content-area):has(.post-sidebar),
  .main-wrapper:has(> .calculator-workspace):has(> .post-sidebar),
  .main-wrapper.has-sidebar,
  .container > .main-wrapper:has(.post-sidebar),
  .container > .calc-grid:has(> .post-sidebar),
  .calc-grid:has(> .calc-main):has(> .post-sidebar) {
    grid-template-columns: 1fr;
  }
  .results-card,
  .post-sidebar,
  .sidebar-column,
  .converter-sidebar {
    position: static;
    width: 100%;
  }
  .layout-container[style*="display:flex"],
  .layout-container {
    flex-direction: column !important;
  }
}

/* 2. Tablets & Landscape Phones (<= 768px) */
@media (max-width: 768px) {
  html, body {
    overflow-x: hidden;
  }
  h1 {
    font-size: 1.85rem;
  }
  h2 {
    font-size: 1.45rem;
  }
  .site-header {
    min-height: auto;
    padding: 0.4rem 0;
  }
  .nav-row {
    overflow-x: auto;
    white-space: nowrap;
    scrollbar-width: none;
    -ms-overflow-style: none;
    justify-content: flex-start;
    padding: 0.2rem 0;
    -webkit-overflow-scrolling: touch;
    flex-wrap: nowrap;
    width: 100%;
  }
  .nav-row::-webkit-scrollbar {
    display: none;
  }
  .calc-card,
  .calculator-card,
  .results-card,
  .article-section {
    padding: 1.25rem;
  }
  .calc-form-grid,
  .calc-grid,
  .converter-inputs-grid,
  .footer-grid {
    grid-template-columns: 1fr;
    gap: 1.25rem;
  }
  .result-breakdown-grid,
  .silo-card-grid,
  .related-tools-grid {
    grid-template-columns: 1fr;
  }
  table,
  .data-table,
  .reference-table,
  .table-custom {
    display: block;
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  .worked-example-card {
    padding: 1.25rem;
    margin: 1.5rem 0;
  }
  .worked-example-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }
  .calc-step-item {
    padding: 0.85rem 1rem;
  }
  .calc-actions {
    flex-direction: column;
  }
  .calculate-btn,
  .calc-btn {
    width: 100%;
  }
}

/* 3. Mobile Phones & Narrow Screens (<= 480px) */
@media (max-width: 480px) {
  h1 {
    font-size: 1.6rem;
  }
  h2 {
    font-size: 1.3rem;
  }
  .brand-logo {
    font-size: 1.15rem;
  }
  .logo-badge {
    width: 32px;
    height: 32px;
    font-size: 1rem;
  }
  .nav-link {
    font-size: 0.76rem;
    padding: 0.2rem 0.5rem;
  }
  .calc-card,
  .calculator-card,
  .results-card,
  .article-section,
  .worked-example-card {
    padding: 1rem;
    border-radius: var(--radius-md, 10px);
  }
  /* Prevent iOS Safari auto-zoom on inputs */
  input[type="text"],
  input[type="number"],
  input[type="date"],
  select,
  textarea {
    font-size: 16px !important;
  }
  .step-param-grid {
    flex-direction: column;
    gap: 0.4rem;
    padding: 0.6rem;
  }
  .step-param-pill {
    width: 100%;
    justify-content: space-between;
    font-size: 0.82rem;
  }
  .primary-result-value {
    font-size: 1.85rem;
  }
  .formula-box,
  .formula-block,
  .math-block {
    padding: 0.85rem;
    font-size: 0.95rem;
  }
}

/* ==========================================================================
   ENHANCED SIDEBAR COMPONENT (TOP 5 DYNAMIC ROTATING SYSTEM)
   ========================================================================== */
.post-sidebar,
.sidebar-column,
.converter-sidebar {
  position: sticky;
  top: calc(var(--header-height, 72px) + 1.25rem);
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  width: 340px;
  max-width: 100%;
  flex-shrink: 0;
}

.sidebar-widget {
  background: #FFFFFF;
  border: 1px solid var(--border-light, #E2E8F0);
  border-radius: var(--radius-xl, 16px);
  padding: 1.35rem;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.05);
  transition: box-shadow 0.2s ease, border-color 0.2s ease;
}

.sidebar-widget:hover {
  border-color: var(--border-medium, #CBD5E1);
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.08);
}

.sidebar-widget-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border-light, #E2E8F0);
}

.widget-header-title-wrap {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-width: 0;
}

.widget-icon {
  font-size: 1.35rem;
  flex-shrink: 0;
}

.widget-title {
  font-size: 1.02rem;
  font-weight: 700;
  color: var(--text-main, #0F172A);
  margin: 0;
  letter-spacing: -0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-shuffle-btn {
  display: none !important;
}

.sidebar-pool-data {
  display: none !important;
}

.sidebar-widget-subtitle {
  font-size: 0.8rem;
  color: var(--text-muted, #64748B);
  margin-bottom: 0.85rem;
  line-height: 1.45;
}

.sidebar-tools-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  list-style: none;
  padding: 0;
  margin: 0;
}

.sidebar-tool-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.65rem 0.85rem;
  border-radius: var(--radius-md, 10px);
  background: #F8FAFC;
  border: 1px solid #F1F5F9;
  text-decoration: none;
  color: inherit;
  transition: all 0.2s ease;
}

.sidebar-tool-item:hover {
  background: #EFF6FF;
  border-color: #BFDBFE;
  transform: translateX(3px);
  text-decoration: none;
  box-shadow: 0 2px 6px rgba(37, 99, 235, 0.06);
}

.sidebar-tool-item .st-icon {
  font-size: 1.25rem;
  flex: 0 0 auto;
}

.sidebar-tool-item .st-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
  flex: 1;
}

.sidebar-tool-item .st-title {
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--text-main, #0F172A);
  line-height: 1.3;
}

.sidebar-tool-item:hover .st-title {
  color: var(--primary, #2563EB);
}

.sidebar-tool-item .st-desc {
  font-size: 0.74rem;
  color: var(--text-muted, #64748B);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.35;
  margin-top: 0.1rem;
}

.sidebar-tool-item .st-arrow {
  font-size: 1rem;
  color: var(--text-subtle, #94A3B8);
  margin-left: auto;
  transition: transform 0.15s ease, color 0.15s ease;
  flex-shrink: 0;
}

.sidebar-tool-item:hover .st-arrow {
  color: var(--primary, #2563EB);
  transform: translateX(2px);
}

.sidebar-widget-footer {
  margin-top: 1rem;
  padding-top: 0.85rem;
  border-top: 1px solid var(--border-light, #E2E8F0);
  text-align: center;
}

.sidebar-category-link {
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--primary, #2563EB);
  text-decoration: none;
  transition: color 0.15s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.sidebar-category-link:hover {
  color: var(--primary-hover, #1D4ED8);
  text-decoration: underline;
}





/* ==========================================================================
   UNIFIED 2-COLUMN SIDE-BY-SIDE SPLIT FOR ALL CALCULATOR & TOOL CARDS
   (Matching Business Days Calculator & Spring Rate Calculator)
   ========================================================================== */
@media (min-width: 900px) {
  .calculator-card:has(> form):has(> .results-box),
  .calculator-card:has(> form):has(> .results-container),
  .calculator-card:has(> form):has(> [id*="Result" i]),
  .tool-card:has(> form):has(> .results-box),
  .tool-card:has(> form):has(> .results-container),
  .tool-card:has(> form):has(> [id*="Result" i]),
  .tool-card:has(> form):has(> [class*="result" i]),
  .calc-card:has(> .calc-inputs):has(> .calc-results),
  .calc-card:has(> .calc-inputs):has(> .results-panel),
  .calculator-card:has(> .calc-inputs):has(> .calc-results),
  .calculator-form:has(> .calc-inputs):has(> .calc-results),
  .calc-body:has(> .calc-inputs):has(> .calc-results),
  .calc-body:has(> .calc-form):has(> .calc-results),
  .calc-body:has(> .calc-form):has(> [id*="result" i]),
  .calc-body:has(> .calc-form):has(> [class*="result" i]),
  .calculator-card:has(> .calc-form):has(> .calc-results),
  .calculator-card:has(> .calc-form):has(> [id*="result" i]),
  .calc-card:has(> .calc-form):has(> .calc-results) {
    display: grid !important;
    grid-template-columns: 1.15fr 0.85fr !important;
    gap: 2rem !important;
    align-items: start !important;
  }

  /* 1. All headers, titles, descriptions, badges & tabs MUST span full card width (columns 1 to -1) */
  .calculator-card > .calculator-header,
  .calculator-card > .calc-header,
  .calculator-card > .tool-header,
  .calculator-card > .card-header,
  .calculator-card > .calc-card-header,
  .calculator-card > .calculator-title,
  .calculator-card > .calc-title,
  .calculator-card > .calculator-subtitle,
  .calculator-card > .calc-subtitle,
  .calculator-card > .calc-description,
  .calculator-card > .calc-desc,
  .calculator-card > .tool-desc,
  .calculator-card > p.calc-description,
  .calculator-card > p.calc-desc,
  .calculator-card > p.calculator-subtitle,
  .calculator-card > p,
  .calculator-card > h1,
  .calculator-card > h2,
  .calculator-card > h3,
  .calculator-card > header,
  .calculator-card > nav,
  .calculator-card > .calc-badge,
  .calculator-card > .badge-tag,
  .tool-card > .calculator-header,
  .tool-card > .calc-header,
  .tool-card > .tool-header,
  .tool-card > .card-header,
  .tool-card > .calc-card-header,
  .tool-card > .calculator-title,
  .tool-card > .calc-title,
  .tool-card > .calculator-subtitle,
  .tool-card > .calc-description,
  .tool-card > .calc-desc,
  .tool-card > .tool-desc,
  .tool-card > p,
  .tool-card > h1,
  .tool-card > h2,
  .tool-card > header,
  .calc-card > .calculator-header,
  .calc-card > .calc-header,
  .calc-card > .tool-header,
  .calc-card > .card-header,
  .calc-card > .calc-card-header,
  .calc-card > .calculator-title,
  .calc-card > .calc-title,
  .calc-card > .calculator-subtitle,
  .calc-card > .calc-description,
  .calc-card > .calc-desc,
  .calc-card > p,
  .calc-card > h1,
  .calc-card > h2,
  .calc-card > header,
  .calc-body > .calculator-header,
  .calc-body > .calc-header,
  .calc-body > .tool-header,
  .calc-body > .card-header,
  .calc-body > .calc-card-header,
  .calc-body > p,
  .calc-body > h1,
  .calc-body > h2,
  .calc-body > header {
    grid-column: 1 / -1 !important;
    width: 100% !important;
  }

  /* 2. Inputs / Form Container (Column 1 - Left) */
  .calculator-card:has(> form) > form,
  .calculator-card > form,
  .calculator-card > .calc-form,
  .calculator-card > .calc-inputs,
  .tool-card:has(> form) > form,
  .tool-card > form,
  .tool-card > .calc-form,
  .tool-card > .calc-inputs,
  .calc-card > form,
  .calc-card > .calc-form,
  .calc-card > .calc-inputs,
  .calculator-form > .calc-inputs,
  .calc-body > form,
  .calc-body > .calc-form,
  .calc-body > .calc-inputs {
    grid-column: 1 !important;
    margin-bottom: 0 !important;
    width: 100% !important;
  }

  /* 3. Results Container (Column 2 - Right, Sticky) */
  .calculator-card > .results-box,
  .calculator-card > .results-container,
  .calculator-card > .calc-results,
  .calculator-card > .results-panel,
  .calculator-card > [id*="Result" i],
  .calculator-card > [class*="result" i],
  .tool-card > .results-box,
  .tool-card > .results-container,
  .tool-card > .calc-results,
  .tool-card > .results-panel,
  .tool-card > [id*="Result" i],
  .tool-card > [class*="result" i],
  .calc-card > .results-box,
  .calc-card > .results-container,
  .calc-card > .calc-results,
  .calc-card > .results-panel,
  .calc-card > [id*="Result" i],
  .calc-card > [class*="result" i],
  .calculator-form > .calc-results,
  .calc-body > .results-box,
  .calc-body > .results-container,
  .calc-body > .calc-results,
  .calc-body > .results-panel,
  .calc-body > [id*="result" i],
  .calc-body > [class*="result" i] {
    grid-column: 2 !important;
    margin-top: 0 !important;
    display: block !important;
    position: sticky !important;
    top: 90px !important;
    width: 100% !important;
  }

  /* 4. Bottom notes, disclaimers, and steps span full width */
  .calculator-card > .conversion-steps,
  .calculator-card > .notes-card,
  .calculator-card > .disclaimer,
  .calculator-card > .calc-footer,
  .calculator-card > footer,
  .tool-card > .conversion-steps,
  .tool-card > .notes-card,
  .tool-card > .disclaimer,
  .tool-card > footer,
  .calc-card > .conversion-steps,
  .calc-card > .notes-card,
  .calc-card > .disclaimer,
  .calc-card > footer {
    grid-column: 1 / -1 !important;
    width: 100% !important;
  }
}

/* ==========================================================================
   GLOBAL FORM & RESULT CARD REFINEMENT
   (Guarantees Beautiful Modern UI on All Tools Across CalcHub)
   ========================================================================== */

/* 1. Form Inputs, Selects & Textareas */
input[type="text"],
input[type="number"],
input[type="date"],
input[type="email"],
select,
textarea,
.form-control,
.input-field,
.calc-input {
  width: 100%;
  padding: 0.72rem 0.95rem;
  border: 1px solid var(--border-medium, #CBD5E1);
  border-radius: var(--radius-md, 8px);
  font-size: 0.98rem;
  font-family: inherit;
  background-color: #FFFFFF;
  color: var(--text-main, #0F172A);
  line-height: 1.5;
  box-sizing: border-box;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

input[type="text"]:focus,
input[type="number"]:focus,
input[type="date"]:focus,
input[type="email"]:focus,
select:focus,
textarea:focus,
.form-control:focus,
.input-field:focus,
.calc-input:focus {
  outline: none;
  border-color: var(--primary, #2563EB);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

/* 2. Labels & Hints */
label,
.form-label,
.input-label {
  display: block;
  font-weight: 600;
  font-size: 0.92rem;
  color: var(--text-main, #0F172A);
  margin-bottom: 0.4rem;
  line-height: 1.4;
}

.hint,
.input-hint,
.form-hint {
  display: block;
  font-size: 0.8rem;
  color: var(--text-muted, #64748B);
  margin-top: 0.35rem;
  line-height: 1.4;
}

.form-group,
.input-group {
  margin-bottom: 1rem;
  display: flex;
  flex-direction: column;
}

.form-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.15rem;
  margin-bottom: 0.5rem;
}

/* 3. Results Container & Typography */
.results-box,
.results-container {
  background: #F8FAFC !important;
  border: 1px solid var(--border-light, #E2E8F0) !important;
  border-radius: var(--radius-lg, 14px) !important;
  padding: 1.5rem !important;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04) !important;
}

.results-box h3,
.results-container h3,
.results-box h2,
.results-container h2 {
  margin-top: 0;
  margin-bottom: 1.15rem;
  font-size: 1.12rem;
  font-weight: 700;
  color: var(--text-main, #0F172A);
  letter-spacing: -0.01em;
  padding-bottom: 0.65rem;
  border-bottom: 1px solid var(--border-light, #E2E8F0);
}

/* 4. Result Tiles (Flex Column Stack, Big Values) */
.result-grid,
.results-grid {
  display: grid !important;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)) !important;
  gap: 0.85rem !important;
}

.result-tile,
.result-item,
.result-card:not(.primary-result),
.breakdown-item,
.submetric-item,
.stat-card {
  background: #FFFFFF !important;
  border: 1px solid var(--border-light, #E2E8F0) !important;
  border-radius: var(--radius-md, 10px) !important;
  padding: 1rem 1.15rem !important;
  display: flex !important;
  flex-direction: column !important;
  justify-content: center !important;
  transition: transform 0.15s ease, box-shadow 0.15s ease !important;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04) !important;
}

.result-tile:hover,
.result-item:hover,
.result-card:not(.primary-result):hover,
.breakdown-item:hover {
  border-color: var(--border-medium, #CBD5E1) !important;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.06) !important;
}

.result-tile .result-label,
.result-item .result-label,
.result-card .result-label,
.result-item .sub-label,
.result-item .res-label,
.breakdown-item .breakdown-label,
.submetric-item .submetric-name,
.stat-card .stat-title,
.res-label {
  font-size: 0.82rem !important;
  font-weight: 600 !important;
  color: var(--text-muted, #64748B) !important;
  margin-bottom: 0.35rem !important;
  line-height: 1.35 !important;
  display: block !important;
  width: 100% !important;
}

.res-label .katex,
.result-label .katex {
  white-space: nowrap !important;
  display: inline-block !important;
}

.result-tile .result-value,
.result-item .result-value,
.result-card .result-value,
.result-card .result-value-sm,
.result-item .sub-value,
.result-item .result-val,
.result-item .res-val,
.breakdown-item .breakdown-val,
.breakdown-item .breakdown-value,
.submetric-item .submetric-val,
.stat-card .stat-value,
.res-val {
  font-size: 1.55rem !important;
  font-weight: 800 !important;
  color: var(--primary, #2563EB) !important;
  line-height: 1.25 !important;
  margin: 0.15rem 0 !important;
  display: block !important;
  width: 100% !important;
  word-break: break-word !important;
}

.result-tile .result-unit,
.result-item .result-unit,
.result-card .result-sub,
.result-tile .result-hint,
.result-item .result-hint {
  font-size: 0.78rem !important;
  color: var(--text-muted, #64748B) !important;
  margin-top: 0.25rem !important;
  line-height: 1.3 !important;
  display: block !important;
  width: 100% !important;
}

.result-tile.highlight {
  background: var(--primary-subtle, #EFF6FF) !important;
  border-color: var(--primary-border, #BFDBFE) !important;
}

.result-tile.highlight .result-value {
  color: var(--primary, #2563EB) !important;
  font-size: 1.95rem !important;
}

/* 5. Buttons Styling */
.form-actions,
.btn-group {
  display: flex;
  gap: 0.75rem;
  margin-top: 1.25rem;
  align-items: center;
  flex-wrap: wrap;
}

.btn,
.btn-primary,
.btn-secondary,
.btn-outline,
.calculate-btn,
.calc-btn,
button.btn-primary,
button.btn-secondary {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 0.72rem 1.4rem !important;
  font-weight: 600 !important;
  font-size: 0.95rem !important;
  border-radius: var(--radius-md, 8px) !important;
  cursor: pointer !important;
  border: 1px solid transparent !important;
  transition: all 0.15s ease !important;
  line-height: 1.4 !important;
  text-decoration: none !important;
  box-sizing: border-box !important;
}

.btn-primary,
.calculate-btn,
.calc-btn,
button.btn-primary {
  background: var(--primary, #2563EB) !important;
  color: #FFFFFF !important;
  border-color: var(--primary, #2563EB) !important;
}

.btn-primary:hover,
.calculate-btn:hover,
.calc-btn:hover,
button.btn-primary:hover {
  background: var(--primary-hover, #1D4ED8) !important;
  border-color: var(--primary-hover, #1D4ED8) !important;
  color: #FFFFFF !important;
  transform: translateY(-1px) !important;
}

.btn-secondary,
button.btn-secondary {
  background: #F1F5F9 !important;
  color: #334155 !important;
  border: 1px solid #CBD5E1 !important;
}

.btn-secondary:hover,
button.btn-secondary:hover {
  background: #E2E8F0 !important;
  color: #0F172A !important;
}

.btn-outline {
  background: #FFFFFF !important;
  color: var(--primary, #2563EB) !important;
  border: 1px solid var(--primary-border, #BFDBFE) !important;
}

.btn-outline:hover {
  background: var(--primary-subtle, #EFF6FF) !important;
  color: var(--primary-hover, #1D4ED8) !important;
  border-color: var(--primary, #2563EB) !important;
}
