/* ═══════════════════════════════════════════════════════════════
   CalcNovaHub — shared.css  v2
   Nova palette · Polished light mode · Mobile-first · Sub-1s load
   ═══════════════════════════════════════════════════════════════ */

/* ── Reset ─────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 16px; }
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font-family: inherit; font-size: inherit; }

/* ── Nova Palette — Light Mode (default) ────────────────────── */
:root {
  /* Page & surface backgrounds */
  --bg-base:        #EEF2FF;   /* ← soft periwinkle tint (was pure #F8FAFC) */
  --bg-surface:     #FFFFFF;   /* cards pop white on the tinted page */
  --bg-elevated:    #F3F6FF;   /* inputs, code blocks */
  --bg-hover:       #E8EDFF;

  /* Nova brand */
  --nova-blue:      #2563EB;
  --nova-cyan:      #0891B2;
  --nova-grad:      linear-gradient(135deg, #2563EB 0%, #0891B2 100%);
  --nova-grad-soft: linear-gradient(135deg, #EEF2FF 0%, #E0EAFF 100%);
  --nova-grad-text: linear-gradient(135deg, #2563EB 0%, #0891B2 100%);

  /* Functional */
  --result-green:   #059669;
  --result-green-bg:#ECFDF5;
  --warning:        #D97706;
  --warning-bg:     #FFFBEB;
  --danger:         #DC2626;
  --danger-bg:      #FEF2F2;

  /* Text */
  --text-primary:   #0F172A;
  --text-secondary: #334155;
  --text-muted:     #64748B;
  --text-inverse:   #F8FAFC;

  /* Borders */
  --border:         rgba(37,99,235,0.10);   /* blue-tinted border */
  --border-hover:   rgba(37,99,235,0.22);
  --border-focus:   #2563EB;
  --border-success: rgba(5,150,105,0.3);

  /* Typography */
  --font-sans:  'Inter', system-ui, -apple-system, sans-serif;
  --font-mono:  'JetBrains Mono', 'Fira Code', monospace;

  /* Spacing */
  --radius-sm:  6px;
  --radius-md:  10px;
  --radius-lg:  14px;
  --radius-xl:  20px;

  /* Shadows — blue-tinted for depth */
  --shadow-sm:  0 1px 4px rgba(37,99,235,0.08);
  --shadow-md:  0 4px 18px rgba(37,99,235,0.10);
  --shadow-lg:  0 8px 32px rgba(37,99,235,0.13);
}

/* ── Base Body ──────────────────────────────────────────────── */
body {
  background: var(--bg-base);
  color: var(--text-primary);
  font-family: var(--font-sans);
  line-height: 1.65;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* subtle dot-grid texture on the page background */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -1;
  background-image: radial-gradient(circle, rgba(37,99,235,0.07) 1px, transparent 1px);
  background-size: 28px 28px;
  pointer-events: none;
}

h1, h2, h3, h4 {
  font-weight: 600;
  line-height: 1.25;
  color: var(--text-primary);
}

p { color: #334155; line-height: 1.75; }

code {
  font-family: var(--font-mono);
  font-size: 0.875em;
  background: var(--bg-elevated);
  border: 0.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 2px 6px;
  color: var(--nova-cyan);
}

/* ── Light Mode Overrides (explicit class) ───────────────────── */
body.light-mode {
  background: var(--bg-base);
  color: var(--text-primary);
}
body.light-mode .top-nav       { background: rgba(255,255,255,0.92); border-bottom: 0.5px solid var(--border); }
body.light-mode .field-input,
body.light-mode .field-select  { background: #FFFFFF; color: #0F172A; }
body.light-mode .calc-card     { background: #FFFFFF; }
body.light-mode .sidebar       { background: #FFFFFF; }
body.light-mode .nav-search    { background: #F3F6FF; color: #0F172A; }
body.light-mode p              { color: #334155; }
body.light-mode .hero-subtitle { color: #334155; }
body.light-mode .footer        { background: linear-gradient(180deg,#E8EDFF 0%,#EEF2FF 100%); border-top: 0.5px solid var(--border); }
body.light-mode .formula-block { background: #EFF6FF; border-left-color: #3B82F6; color: #1D4ED8; }
body.light-mode .example-block { background: #FFFBEB; }
body.light-mode .mistake-block { background: #FEF2F2; }
body.light-mode .result-panel  { background: #ECFDF5; }
body.light-mode .aside-card    { background: #FFFFFF; }
body.light-mode .affiliate-box { background: #F3F6FF; }
body.light-mode .category-card { background: #FFFFFF; }
body.light-mode .popular-card  { background: #FFFFFF; }
body.light-mode .related-card  { background: #FFFFFF; }
body.light-mode .hero-search   { background: #FFFFFF; color: #0F172A; }
body.light-mode .ad-slot       { background: #F3F6FF; }

/* calc-card-header — gradient tint so it's clearly separate from the body */
body.light-mode .calc-card-header {
  background: linear-gradient(135deg, #EEF2FF 0%, #E8F0FE 60%, #F0F9FF 100%);
  border-bottom: 0.5px solid var(--border);
}

/* ── Theme Toggle ────────────────────────────────────────────── */
.theme-toggle {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 999;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--nova-grad);
  border: none;
  color: white;
  font-size: 20px;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(37,99,235,0.35);
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}
.theme-toggle:hover { transform: scale(1.1); box-shadow: 0 6px 20px rgba(37,99,235,0.5); }

/* ── Top Navigation ─────────────────────────────────────────── */
.top-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255,255,255,0.92);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 0.5px solid var(--border);
  height: 60px;
  display: flex;
  align-items: center;
  box-shadow: 0 1px 6px rgba(37,99,235,0.07);
}

.nav-inner {
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 1.5rem;
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 1.1rem;
  font-weight: 700;
  flex-shrink: 0;
}

.nav-logo-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: var(--nova-grad);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
}

.nav-logo-text {
  background: var(--nova-grad-text);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.nav-search-wrap {
  flex: 1;
  max-width: 400px;
  position: relative;
}

.nav-search {
  width: 100%;
  background: #F3F6FF;
  border: 0.5px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  padding: 8px 14px 8px 36px;
  font-size: 0.875rem;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.nav-search:focus { outline: none; border-color: var(--border-focus); box-shadow: 0 0 0 3px rgba(37,99,235,0.10); }
.nav-search::placeholder { color: var(--text-muted); }

.nav-search-icon {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 16px;
  pointer-events: none;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  margin-left: auto;
}

.nav-link {
  font-size: 0.8rem;
  color: #94A3B8;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  transition: all 0.15s;
  white-space: nowrap;
}
.nav-link:hover, .nav-link.active { color: var(--nova-blue); background: rgba(37,99,235,0.08); }

/* ── Page Layout ────────────────────────────────────────────── */
.page-wrap {
  max-width: 1280px;
  margin: 0 auto;
  padding: 2rem 1.5rem 5rem;
}

.layout-with-sidebar {
  display: grid;
  grid-template-columns: 240px 1fr 240px;
  gap: 2rem;
  align-items: start;
  max-width: 1280px;
  margin: 0 auto;
  width: 100%;
  padding: 0 1rem;
  max-width: 1280px;        ← add this   ← DELETE THIS LINE
  margin: 0 auto;           ← add this   ← DELETE THIS LINE
  width: 100%;              ← add this   ← DELETE THIS LINE
  padding: 0 1rem;          ← add this   ← DELETE THIS LINE
}

/* Col 1 = left spacer | Col 2 = content | Col 3 = right sidebar */
.layout-with-sidebar > div,
.layout-with-sidebar > main  { grid-column: 2 !important; }
.layout-with-sidebar > aside { grid-column: 3 !important; grid-row: 1 !important; }

@media (max-width: 1100px) {
  .layout-with-sidebar { grid-template-columns: 1fr 240px; }
  .layout-with-sidebar > div,
  .layout-with-sidebar > main  { grid-column: 1 !important; }
  .layout-with-sidebar > aside { grid-column: 2 !important; grid-row: 1 !important; }
}

@media (max-width: 900px) {
  .layout-with-sidebar { grid-template-columns: 1fr; }
  .layout-with-sidebar > div,
  .layout-with-sidebar > main  { grid-column: 1 !important; }
  .layout-with-sidebar > aside { grid-column: 1 !important; grid-row: auto !important; }
  .sidebar { display: none; }
}

/* ── Sidebar ────────────────────────────────────────────────── */
.sidebar {
  position: sticky;
  top: 76px;
  background: var(--bg-surface);
  border: 0.5px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1rem 0;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.sidebar-section { margin-bottom: 0.25rem; }

.sidebar-heading {
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-muted);
  padding: 0.5rem 1rem 0.3rem;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 1rem;
  font-size: 0.82rem;
  color: var(--text-secondary);
  transition: all 0.12s;
  border-left: 2px solid transparent;
}
.sidebar-link:hover { color: var(--nova-blue); background: rgba(37,99,235,0.05); }
.sidebar-link.active { color: var(--nova-blue); border-left-color: var(--nova-blue); background: rgba(37,99,235,0.07); }

/* ── Ad Slots ───────────────────────────────────────────────── */
.ad-slot {
  display: none !important;
  background: var(--bg-surface);
  border: 0.5px dashed var(--border-hover);
  border-radius: var(--radius-md);
  margin: 1rem 0;
}
.ad-slot-leaderboard { height: 90px; }
.ad-slot-rectangle   { height: 250px; }
.ad-slot-native      { height: 120px; }

/* ── Cards ──────────────────────────────────────────────────── */
.card {
  background: var(--bg-surface);
  border: 0.5px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  transition: border-color 0.15s, box-shadow 0.15s;
  box-shadow: var(--shadow-sm);
}
.card:hover { border-color: var(--border-hover); box-shadow: var(--shadow-md); }
.card-featured { border: 1.5px solid var(--nova-blue); }

/* ── Calculator Card ────────────────────────────────────────── */
.calc-card {
  background: var(--bg-surface);
  border: 0.5px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-bottom: 1.5rem;
  box-shadow: var(--shadow-md);
}

/* The gradient header is the biggest visual upgrade */
.calc-card-header {
  background: linear-gradient(135deg, #EEF2FF 0%, #E8F0FE 60%, #F0F9FF 100%);
  border-bottom: 0.5px solid var(--border);
  padding: 1rem 1.25rem;
  display: flex;
  align-items: center;
  gap: 10px;
}

.calc-card-icon {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: var(--nova-grad);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(37,99,235,0.25);
}

.calc-card-title    { font-size: 1rem; font-weight: 600; }
.calc-card-subtitle { font-size: 0.78rem; color: var(--text-muted); margin-top: 1px; }
.calc-card-body     { padding: 1.25rem; }

/* ── Form Elements ──────────────────────────────────────────── */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 1rem; }
.field:last-child { margin-bottom: 0; }

.field-label {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-secondary);
}

.field-input,
.field-select {
  width: 100%;
  background: var(--bg-elevated);
  border: 0.5px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  padding: 10px 14px;
  font-size: 0.9375rem;
  transition: border-color 0.15s, box-shadow 0.15s;
  -webkit-appearance: none;
  appearance: none;
}

.field-input:focus,
.field-select:focus {
  outline: none;
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(37,99,235,0.10);
}

.field-input::placeholder { color: var(--text-muted); }
.field-select {
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%2394A3B8' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 36px;
}
.field-select option { background: var(--bg-surface); color: var(--text-primary); }

.field-prefix-wrap { position: relative; }
.field-prefix {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 0.9rem;
  pointer-events: none;
}
.field-prefix + .field-input { padding-left: 26px; }

/* Input grids */
.input-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.input-grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 1rem; }
@media (max-width: 600px) { .input-grid-2, .input-grid-3 { grid-template-columns: 1fr; } }

/* Toggle */
.toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 0.5px solid var(--border);
}
.toggle-row:last-child { border-bottom: none; }
.toggle-label  { font-size: 0.85rem; color: var(--text-primary); }
.toggle-sub    { font-size: 0.72rem; color: var(--text-muted); }

.toggle { position: relative; width: 42px; height: 24px; flex-shrink: 0; cursor: pointer; }
.toggle input { opacity: 0; width: 0; height: 0; position: absolute; }
.toggle-track { position: absolute; inset: 0; background: var(--bg-elevated); border: 0.5px solid var(--border); border-radius: 999px; transition: all 0.2s; }
.toggle input:checked + .toggle-track { background: var(--nova-blue); border-color: var(--nova-blue); }
.toggle-thumb { position: absolute; width: 18px; height: 18px; background: white; border-radius: 50%; top: 3px; left: 3px; transition: left 0.2s; pointer-events: none; }
.toggle input:checked ~ .toggle-thumb { left: 21px; }

/* ── Buttons ────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: none;
  border-radius: var(--radius-md);
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
  text-decoration: none;
  white-space: nowrap;
}
.btn:active { transform: scale(0.98); }

.btn-primary {
  background: var(--nova-grad);
  color: white;
  padding: 12px 24px;
  font-size: 0.9375rem;
  width: 100%;
  box-shadow: 0 4px 14px rgba(37,99,235,0.28);
}
.btn-primary:hover { box-shadow: 0 6px 22px rgba(37,99,235,0.42); filter: brightness(1.07); }

.btn-secondary {
  background: var(--bg-surface);
  border: 0.5px solid var(--border);
  color: var(--text-primary);
  padding: 10px 20px;
  font-size: 0.875rem;
}
.btn-secondary:hover { border-color: var(--border-hover); background: var(--bg-elevated); }

.btn-affiliate {
  background: linear-gradient(135deg, #10B981, #059669);
  color: white;
  padding: 12px 24px;
  font-size: 0.9rem;
  width: 100%;
  box-shadow: 0 4px 14px rgba(16,185,129,0.25);
}
.btn-affiliate:hover { box-shadow: 0 6px 20px rgba(16,185,129,0.4); filter: brightness(1.08); }

/* ── Results Panel ──────────────────────────────────────────── */
.result-panel {
  background: linear-gradient(135deg, #ECFDF5 0%, #F0FDF4 100%);
  border: 0.5px solid var(--border-success);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  margin-top: 1rem;
  display: none;
  animation: slideUp 0.35s ease both;
}
.result-panel.show { display: block; }

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

.result-main {
  text-align: center;
  padding: 1rem 0 1.25rem;
  border-bottom: 0.5px solid var(--border-success);
  margin-bottom: 1rem;
}

.result-label    { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.1em; color: var(--result-green); opacity: 0.75; margin-bottom: 6px; }
.result-value    { font-size: 2.25rem; font-weight: 700; color: var(--result-green); line-height: 1.1; }
.result-sublabel { font-size: 0.8rem; color: var(--result-green); opacity: 0.7; margin-top: 6px; }

.result-breakdown { display: flex; flex-direction: column; gap: 0; }

.result-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 0;
  border-bottom: 0.5px solid rgba(16,185,129,0.12);
  gap: 1rem;
}
.result-row:last-child  { border-bottom: none; }
.result-row-label       { font-size: 0.82rem; color: var(--text-secondary); }
.result-row-note        { font-size: 0.72rem; color: var(--text-muted); }
.result-row-value       { font-size: 0.9rem; font-weight: 600; color: var(--text-primary); white-space: nowrap; }
.result-row-value.negative { color: var(--danger); }

/* ── Affiliate CTA Box ──────────────────────────────────────── */
.affiliate-box {
  background: linear-gradient(135deg, #F3F6FF 0%, #EEF2FF 100%);
  border: 0.5px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  margin-top: 1rem;
}
.affiliate-box-title { font-size: 1rem; font-weight: 600; margin-bottom: 0.4rem; }
.affiliate-box-desc  { font-size: 0.85rem; color: var(--text-secondary); margin-bottom: 1rem; line-height: 1.6; }
.affiliate-result-context {
  font-size: 0.82rem; color: var(--nova-cyan); margin-bottom: 0.75rem;
  padding: 6px 10px; background: rgba(8,145,178,0.08);
  border-radius: var(--radius-sm); border-left: 2px solid var(--nova-cyan);
}

/* ── SEO Content Sections ───────────────────────────────────── */
.seo-section { margin-top: 3rem; border-top: 0.5px solid var(--border); padding-top: 2.5rem; }
.seo-section h2 { font-size: 1.5rem; margin-bottom: 0.75rem; }
.seo-section h3 { font-size: 1.05rem; font-weight: 600; color: var(--nova-blue); margin: 2rem 0 0.5rem; }
.seo-section p  { font-size: 0.9rem; color: var(--text-secondary); line-height: 1.8; margin-bottom: 0.75rem; }
.seo-section ul { padding-left: 1.25rem; margin-bottom: 0.75rem; }
.seo-section li { font-size: 0.9rem; color: var(--text-secondary); line-height: 1.75; margin-bottom: 0.35rem; }
.seo-section li strong { color: var(--text-primary); font-weight: 600; }

/* Formula block */
.formula-block {
  background: #EFF6FF;
  border: 0.5px solid rgba(37,99,235,0.18);
  border-left: 3px solid var(--nova-blue);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  padding: 1rem 1.25rem;
  margin: 1rem 0;
  font-family: var(--font-mono);
  font-size: 1rem;
  color: #1D4ED8;
  overflow-x: auto;
}

/* Step example */
.example-block {
  background: #FFFBEB;
  border: 0.5px solid rgba(245,158,11,0.2);
  border-radius: var(--radius-md);
  padding: 1.1rem 1.25rem;
  margin: 1rem 0;
}
.example-block-title { font-size: 0.72rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.1em; color: var(--warning); margin-bottom: 0.75rem; }
.example-step { display: flex; gap: 12px; margin-bottom: 8px; font-size: 0.875rem; }
.example-step-num { width: 22px; height: 22px; border-radius: 50%; background: rgba(245,158,11,0.15); color: var(--warning); font-size: 0.72rem; font-weight: 700; display: flex; align-items: center; justify-content: center; flex-shrink: 0; margin-top: 1px; }
.example-step-text { color: var(--text-secondary); line-height: 1.6; }
.example-step-text strong { color: var(--text-primary); }

/* Mistake block */
.mistake-block {
  background: rgba(239,68,68,0.05);
  border: 0.5px solid rgba(239,68,68,0.15);
  border-radius: var(--radius-md);
  padding: 1rem 1.25rem;
  margin: 1rem 0;
}
.mistake-item { display: flex; gap: 10px; margin-bottom: 10px; font-size: 0.875rem; }
.mistake-item:last-child { margin-bottom: 0; }
.mistake-icon { color: var(--danger); flex-shrink: 0; font-size: 16px; margin-top: 2px; }
.mistake-text { color: var(--text-secondary); line-height: 1.6; }
.mistake-text strong { color: var(--text-primary); }

/* FAQ */
.faq-list { margin-top: 1rem; }
.faq-item { border-bottom: 0.5px solid var(--border); padding: 1rem 0; }
.faq-item:last-child { border-bottom: none; }
.faq-q { font-size: 0.9375rem; font-weight: 600; color: var(--text-primary); margin-bottom: 0.4rem; cursor: pointer; display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.faq-a { font-size: 0.875rem; color: var(--text-secondary); line-height: 1.75; }

/* ── Related Calculators ────────────────────────────────────── */
.related-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px,1fr)); gap: 0.75rem; margin-top: 1rem; }

.related-card {
  background: var(--bg-surface);
  border: 0.5px solid var(--border);
  border-radius: var(--radius-md);
  padding: 0.875rem 1rem;
  display: flex;
  align-items: center;
  gap: 10px;
  transition: all 0.15s;
  font-size: 0.85rem;
  color: var(--text-secondary);
  box-shadow: var(--shadow-sm);
}
.related-card:hover { border-color: var(--nova-blue); color: var(--nova-blue); transform: translateY(-2px); box-shadow: var(--shadow-md); }
.related-card-icon  { font-size: 18px; flex-shrink: 0; }
.related-card-arrow { margin-left: auto; color: var(--text-muted); font-size: 14px; }

/* ── Homepage ───────────────────────────────────────────────── */
.hero {
  text-align: center;
  padding: 4rem 1rem 3.5rem;
  position: relative;
  /* soft radial glow behind the title */
  background: radial-gradient(ellipse 80% 60% at 50% 0%, rgba(37,99,235,0.08) 0%, transparent 70%);
  border-radius: var(--radius-xl);
  margin-bottom: 1rem;
}

.hero-eyebrow { font-size: 0.75rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.12em; color: var(--nova-blue); margin-bottom: 1rem; }

.hero-title {
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 800;
  line-height: 1.1;
  margin-bottom: 1rem;
  background: var(--nova-grad-text);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-subtitle { font-size: 1.1rem; color: var(--text-secondary); max-width: 520px; margin: 0 auto 2.5rem; }

.hero-stats { display: flex; justify-content: center; gap: 3rem; flex-wrap: wrap; margin-bottom: 2rem; }
.hero-stat-val { font-size: 1.75rem; font-weight: 700; color: var(--nova-blue); }
.hero-stat-lbl { font-size: 0.78rem; color: var(--text-muted); margin-top: 2px; }

/* Search bar on homepage */
.hero-search-wrap { max-width: 520px; margin: 0 auto; position: relative; }
.hero-search {
  width: 100%;
  background: var(--bg-surface);
  border: 0.5px solid var(--border-hover);
  border-radius: var(--radius-xl);
  color: var(--text-primary);
  padding: 14px 20px 14px 48px;
  font-size: 1rem;
  transition: all 0.15s;
  box-shadow: var(--shadow-md);
}
.hero-search:focus { outline: none; border-color: var(--nova-blue); box-shadow: 0 0 0 4px rgba(37,99,235,0.12), var(--shadow-md); }
.hero-search::placeholder { color: var(--text-muted); }
.hero-search-icon { position: absolute; left: 16px; top: 50%; transform: translateY(-50%); color: var(--nova-blue); font-size: 20px; pointer-events: none; }

/* Category section labels */
.section-eyebrow { font-size: 0.7rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.12em; color: var(--nova-blue); margin-bottom: 0.5rem; }
.section-title-text { font-size: 1.35rem; font-weight: 700; margin-bottom: 1.5rem; }

/* Category cards — now with a left color stripe on hover */
.category-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px,1fr)); gap: 1rem; margin-bottom: 3rem; }

.category-card {
  background: var(--bg-surface);
  border: 0.5px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  transition: all 0.18s;
  display: block;
  box-shadow: var(--shadow-sm);
  border-left: 3px solid transparent;
}
.category-card:hover {
  border-color: var(--border-hover);
  border-left-color: var(--nova-blue);
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}

.category-card-header { display: flex; align-items: center; gap: 10px; margin-bottom: 0.75rem; }
.category-card-icon   { width: 40px; height: 40px; border-radius: 10px; background: var(--nova-grad); display: flex; align-items: center; justify-content: center; font-size: 20px; flex-shrink: 0; box-shadow: 0 2px 8px rgba(37,99,235,0.22); }
.category-card-name   { font-size: 1rem; font-weight: 600; color: var(--text-primary); }
.category-card-count  { font-size: 0.75rem; color: var(--text-muted); }
.category-card-desc   { font-size: 0.82rem; color: var(--text-secondary); line-height: 1.6; margin-bottom: 0.75rem; }
.category-card-tags   { display: flex; flex-wrap: wrap; gap: 5px; }
.category-tag         { font-size: 0.7rem; background: #EEF2FF; color: var(--nova-blue); padding: 2px 8px; border-radius: 999px; font-weight: 500; }

/* Popular grid */
.popular-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px,1fr)); gap: 0.75rem; margin-bottom: 3rem; max-width: 960px; margin-left: auto; margin-right: auto; }

.popular-card {
  background: var(--bg-surface);
  border: 0.5px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1rem;
  display: flex;
  align-items: center;
  gap: 10px;
  transition: all 0.15s;
  box-shadow: var(--shadow-sm);
}
.popular-card:hover { border-color: var(--nova-blue); transform: translateY(-2px); box-shadow: var(--shadow-md); }
.popular-card-icon  { font-size: 22px; flex-shrink: 0; }
.popular-card-name  { font-size: 0.875rem; font-weight: 600; color: var(--text-primary); }
.popular-card-cat   { font-size: 0.72rem; color: var(--nova-blue); margin-top: 1px; font-weight: 500; }
.popular-card-arrow { margin-left: auto; color: var(--text-muted); font-size: 16px; }

/* ── Badges & Pills ─────────────────────────────────────────── */
.badge        { font-size: 0.7rem; font-weight: 600; padding: 3px 10px; border-radius: 999px; }
.badge-blue   { background: rgba(37,99,235,0.10);  color: var(--nova-blue); }
.badge-cyan   { background: rgba(8,145,178,0.10);  color: var(--nova-cyan); }
.badge-green  { background: rgba(5,150,105,0.10);  color: var(--result-green); }
.badge-amber  { background: rgba(245,158,11,0.10); color: var(--warning); }
.badge-red    { background: rgba(239,68,68,0.10);  color: var(--danger); }

/* ── Breadcrumb ─────────────────────────────────────────────── */
.breadcrumb { display: flex; align-items: center; gap: 6px; font-size: 0.82rem; color: var(--text-muted); margin-bottom: 1.5rem; flex-wrap: wrap; }
.breadcrumb a { color: var(--nova-blue); opacity: 0.75; transition: opacity 0.12s; }
.breadcrumb a:hover { opacity: 1; }
.breadcrumb-sep { color: var(--text-muted); }

/* ── Calc page header ───────────────────────────────────────── */
.calc-page-header { margin-bottom: 1.75rem; max-width: 960px; margin-left: auto; margin-right: auto; }
.calc-page-title  { font-size: clamp(1.5rem, 3vw, 2rem); font-weight: 700; margin-bottom: 0.5rem; }
.calc-page-desc   { font-size: 0.9rem; color: var(--text-secondary); line-height: 1.7; max-width: 600px; }

/* ── Calc aside ─────────────────────────────────────────────── */
.calc-aside  { display: flex; flex-direction: column; gap: 1rem; }
.aside-card  { background: var(--bg-surface); border: 0.5px solid var(--border); border-radius: var(--radius-lg); padding: 1rem; box-shadow: var(--shadow-sm); }
.aside-title { font-size: 0.7rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.1em; color: var(--text-muted); margin-bottom: 0.75rem; }
.aside-link  { display: flex; align-items: center; justify-content: space-between; padding: 6px 0; font-size: 0.82rem; color: var(--text-secondary); border-bottom: 0.5px solid var(--border); transition: color 0.12s; }
.aside-link:last-child { border-bottom: none; }
.aside-link:hover { color: var(--nova-blue); }

/* ── History ────────────────────────────────────────────────── */
.history-list { display: flex; flex-direction: column; gap: 6px; margin-top: 0.75rem; }
.history-item { background: var(--bg-elevated); border-radius: var(--radius-sm); padding: 6px 10px; font-size: 0.78rem; color: var(--text-secondary); display: flex; justify-content: space-between; cursor: pointer; }
.history-item:hover { color: var(--text-primary); }
.history-result { color: var(--result-green); font-weight: 600; }

/* ── Footer ─────────────────────────────────────────────────── */
.footer {
  border-top: 0.5px solid var(--border);
  padding: 3rem 1.5rem 2rem;
  margin-top: 4rem;
  background: linear-gradient(180deg, #E8EDFF 0%, #EEF2FF 100%);
}

.footer-inner { max-width: 1280px; margin: 0 auto; }

.footer-top { display: grid; grid-template-columns: 1.5fr 1fr 1fr 1fr; gap: 2rem; margin-bottom: 2rem; }
@media (max-width: 768px) { .footer-top { grid-template-columns: 1fr 1fr; } }

.footer-brand-name {
  font-size: 1.1rem; font-weight: 700;
  background: var(--nova-grad-text);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
  margin-bottom: 0.5rem;
}
.footer-brand-desc { font-size: 0.8rem; color: var(--text-muted); line-height: 1.7; max-width: 220px; }

.footer-link { display: block; font-size: 0.82rem; color: var(--text-secondary); padding: 3px 0; transition: color 0.12s; }
.footer-link:hover { color: var(--nova-blue); }

.footer-col-title { font-size: 0.75rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.1em; color: var(--text-muted); margin-bottom: 0.75rem; }

.footer-bottom { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 1rem; padding-top: 1.5rem; border-top: 0.5px solid var(--border); }
.footer-copy { font-size: 0.75rem; color: var(--text-muted); }
.footer-disc { font-size: 0.72rem; color: var(--text-muted); max-width: 500px; line-height: 1.5; }

/* ── Utilities ──────────────────────────────────────────────── */
.text-nova   { background: var(--nova-grad-text); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
.text-green  { color: var(--result-green); }
.text-muted  { color: var(--text-muted); }
.text-center { text-align: center; }
.mt-1 { margin-top: 0.5rem; } .mt-2 { margin-top: 1rem; } .mt-3 { margin-top: 1.5rem; }
.mb-1 { margin-bottom: 0.5rem; } .mb-2 { margin-bottom: 1rem; } .mb-3 { margin-bottom: 1.5rem; }

/* ── Responsive ─────────────────────────────────────────────── */
@media (max-width: 768px) {
  .page-wrap { padding: 1.5rem 1rem 4rem; }
  .hero { padding: 2.5rem 1rem 2rem; }
  .hero-stats { gap: 1.5rem; }
  .nav-search-wrap { display: none; }
  .footer-top { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 480px) {
  .calc-card-body { padding: 1rem; }
  .btn-primary { font-size: 0.875rem; padding: 11px 20px; }
}

/* ── Search results dropdown ────────────────────────────────── */
.search-results {
  position: absolute;
  top: calc(100% + 6px);
  left: 0; right: 0;
  background: var(--bg-surface);
  border: 0.5px solid var(--border-hover);
  border-radius: var(--radius-md);
  overflow: hidden;
  z-index: 200;
  box-shadow: var(--shadow-lg);
  display: none;
}
.search-results.show { display: block; }
.search-result-item { display: flex; align-items: center; gap: 10px; padding: 10px 14px; font-size: 0.875rem; color: var(--text-secondary); transition: all 0.12s; cursor: pointer; }
.search-result-item:hover { background: #EEF2FF; color: var(--nova-blue); }
.search-result-item:not(:last-child) { border-bottom: 0.5px solid var(--border); }
.search-result-cat { font-size: 0.7rem; color: var(--nova-blue); margin-left: auto; font-weight: 500; background: rgba(37,99,235,0.08); padding: 2px 7px; border-radius: 999px; }

/* ── Copy button ────────────────────────────────────────────── */
.copy-btn { background: none; border: 0.5px solid var(--border); border-radius: var(--radius-sm); color: var(--text-muted); padding: 3px 8px; font-size: 0.72rem; cursor: pointer; transition: all 0.15s; }
.copy-btn:hover { border-color: var(--nova-blue); color: var(--nova-blue); }

/* ── Dark mode (toggled via JS) ─────────────────────────────── */
body:not(.light-mode) {
  --bg-base:        #0F172A;
  --bg-surface:     #1E293B;
  --bg-elevated:    #1A2540;
  --bg-hover:       #243049;
  --text-primary:   #F0F6FF;
  --text-secondary: #94A3B8;
  --text-muted:     #64748B;
  --border:         rgba(255,255,255,0.06);
  --border-hover:   rgba(255,255,255,0.12);
  --shadow-sm:      0 1px 4px rgba(0,0,0,0.3);
  --shadow-md:      0 4px 18px rgba(0,0,0,0.35);
  --shadow-lg:      0 8px 32px rgba(0,0,0,0.4);
  --nova-grad-text: linear-gradient(135deg, #60A5FA 0%, #22D3EE 100%);
}
body:not(.light-mode) { background: var(--bg-base); color: var(--text-primary); }
body:not(.light-mode)::before { background-image: radial-gradient(circle, rgba(96,165,250,0.04) 1px, transparent 1px); }
body:not(.light-mode) .calc-card-header { background: linear-gradient(135deg, #1a2540 0%, #1e2d4a 100%); }
body:not(.light-mode) .top-nav          { background: rgba(15,23,42,0.92); }
body:not(.light-mode) .footer           { background: linear-gradient(180deg, #0D1829 0%, #0F172A 100%); }
body:not(.light-mode) .hero             { background: radial-gradient(ellipse 80% 60% at 50% 0%, rgba(37,99,235,0.12) 0%, transparent 70%); }
body:not(.light-mode) .field-input,
body:not(.light-mode) .field-select     { background: #1A2540; color: #F0F6FF; }
body:not(.light-mode) .nav-search       { background: #1A2540; color: #F0F6FF; }
body:not(.light-mode) .category-tag     { background: rgba(37,99,235,0.15); color: #60A5FA; }
body:not(.light-mode) p                 { color: #94A3B8; }
body:not(.light-mode) .formula-block    { background: rgba(37,99,235,0.12); border-left-color: #60A5FA; color: #93C5FD; }
body:not(.light-mode) .search-result-item:hover { background: #1A2540; color: #60A5FA; }
body:not(.light-mode) .search-results   { background: #1E293B; }

/* ═══════════════════════════════════════════════════════════════
   DARK MODE FIXES — v2.1
   Fixes: white cards, dull nav text, dull footer, mobile menu
   ═══════════════════════════════════════════════════════════════ */

/* ── Nav top links — class-based so dark mode can override ─── */
.nav-top-link {
  font-size: 0.875rem;
  font-weight: 500;
  padding: 6px 14px;
  border-radius: 6px;
  text-decoration: none;
  transition: all 0.15s;
  white-space: nowrap;
  color: var(--text-secondary);
}
.nav-top-link:hover {
  color: var(--nova-blue);
  background: rgba(37,99,235,0.08);
}

/* ── Mobile: hide nav links, they overflow ────────────────────── */
@media (max-width: 900px) {
  .nav-links { display: none !important; }
}

/* ── Dark mode: bright readable text everywhere ──────────────── */
body:not(.light-mode) .nav-top-link          { color: #94A3B8; }
body:not(.light-mode) .nav-top-link:hover    { color: #60A5FA; background: rgba(96,165,250,0.10); }

/* Cards must use dark surfaces — belt-and-suspenders overrides */
body:not(.light-mode) .card,
body:not(.light-mode) .calc-card,
body:not(.light-mode) .aside-card,
body:not(.light-mode) .category-card,
body:not(.light-mode) .popular-card,
body:not(.light-mode) .related-card,
body:not(.light-mode) .sidebar,
body:not(.light-mode) .hero-search,
body:not(.light-mode) .btn-secondary,
body:not(.light-mode) .search-results        { background: var(--bg-surface); }

body:not(.light-mode) .field-input,
body:not(.light-mode) .field-select          { background: var(--bg-elevated); color: #F0F6FF; }
body:not(.light-mode) .field-select option   { background: #1A2540; }

/* Footer text: fully bright in dark mode */
body:not(.light-mode) .footer-brand-desc     { color: #94A3B8; }
body:not(.light-mode) .footer-link           { color: #94A3B8; }
body:not(.light-mode) .footer-col-title      { color: #64748B; }
body:not(.light-mode) .footer-copy,
body:not(.light-mode) .footer-disc           { color: #64748B; }
body:not(.light-mode) .footer-link:hover     { color: #60A5FA; }

/* Category card names bright in dark mode */
body:not(.light-mode) .category-card-name   { color: #F0F6FF; }
body:not(.light-mode) .category-card-desc   { color: #94A3B8; }
body:not(.light-mode) .category-card-count  { color: #64748B; }
body:not(.light-mode) .popular-card-name    { color: #F0F6FF; }
body:not(.light-mode) .popular-card-cat     { color: #60A5FA; }
body:not(.light-mode) .related-card         { color: #94A3B8; }
body:not(.light-mode) .related-card:hover   { color: #60A5FA; border-color: #3B82F6; }

/* Breadcrumb in dark */
body:not(.light-mode) .breadcrumb           { color: #64748B; }
body:not(.light-mode) .breadcrumb a         { color: #60A5FA; opacity: 0.8; }
body:not(.light-mode) .breadcrumb-sep       { color: #334155; }

/* Sidebar in dark */
body:not(.light-mode) .sidebar-link         { color: #94A3B8; }
body:not(.light-mode) .sidebar-link:hover   { color: #F0F6FF; background: rgba(255,255,255,0.05); }
body:not(.light-mode) .sidebar-link.active  { color: #60A5FA; background: rgba(96,165,250,0.08); border-left-color: #3B82F6; }
body:not(.light-mode) .sidebar-heading      { color: #475569; }

/* Result panel stays green — it's already correct */

/* Calc card header dark */
body:not(.light-mode) .calc-card-header     { background: linear-gradient(135deg,#1a2540 0%,#1e2d4a 100%); }
body:not(.light-mode) .calc-card-title      { color: #F0F6FF; }
body:not(.light-mode) .calc-card-subtitle   { color: #64748B; }

/* Category tags dark */
body:not(.light-mode) .category-tag         { background: rgba(96,165,250,0.12); color: #60A5FA; }

/* Search dropdown dark */
body:not(.light-mode) .search-result-item   { color: #94A3B8; }
body:not(.light-mode) .search-result-item:hover { background: #1A2540; color: #F0F6FF; }
body:not(.light-mode) .search-result-cat    { color: #60A5FA; background: rgba(96,165,250,0.10); }

/* Hero stat numbers bright */
body:not(.light-mode) .hero-stat-val        { color: #60A5FA; }
body:not(.light-mode) .hero-stat-lbl        { color: #64748B; }

/* Page heading + desc in dark */
body:not(.light-mode) .calc-page-title      { color: #F0F6FF; }
body:not(.light-mode) .calc-page-desc       { color: #94A3B8; }
body:not(.light-mode) .section-title-text   { color: #F0F6FF; }

/* BTN secondary dark */
body:not(.light-mode) .btn-secondary        { color: #94A3B8; border-color: rgba(255,255,255,0.08); }
body:not(.light-mode) .btn-secondary:hover  { background: #243049; color: #F0F6FF; }

/* Formula + FAQ dark */
body:not(.light-mode) .formula-block        { background: rgba(37,99,235,0.12); border-left-color: #60A5FA; color: #93C5FD; }
body:not(.light-mode) .faq-q               { color: #F0F6FF; }
body:not(.light-mode) .faq-a               { color: #94A3B8; }
body:not(.light-mode) .faq-item            { border-color: rgba(255,255,255,0.06); }
body:not(.light-mode) .seo-section         { border-top-color: rgba(255,255,255,0.06); }
body:not(.light-mode) .seo-section h2      { color: #F0F6FF; }
body:not(.light-mode) .seo-section h3      { color: #60A5FA; }
body:not(.light-mode) .seo-section p,
body:not(.light-mode) .seo-section li      { color: #94A3B8; }

/* ═══════════════════════════════════════════════════════════════
   DARK MODE FIXES — v2.1
   Fixes: white cards, dull nav text, dull footer, mobile menu
   ═══════════════════════════════════════════════════════════════ */

/* ── Nav top links: class-based so dark mode can override ─── */
.nav-top-link {
  font-size: 0.875rem;
  font-weight: 500;
  padding: 6px 14px;
  border-radius: 6px;
  text-decoration: none;
  transition: all 0.15s;
  white-space: nowrap;
  color: var(--text-secondary);
}
.nav-top-link:hover {
  color: var(--nova-blue);
  background: rgba(37,99,235,0.08);
}

/* ── Mobile: hide overflowing nav links ──────────────────── */
@media (max-width: 900px) {
  .nav-links { display: none !important; }
}

/* ── Dark mode: bright nav text ─────────────────────────── */
body:not(.light-mode) .nav-top-link       { color: #94A3B8; }
body:not(.light-mode) .nav-top-link:hover { color: #60A5FA; background: rgba(96,165,250,0.10); }

/* ── Dark mode: card surfaces ───────────────────────────── */
body:not(.light-mode) .card,
body:not(.light-mode) .calc-card,
body:not(.light-mode) .aside-card,
body:not(.light-mode) .category-card,
body:not(.light-mode) .popular-card,
body:not(.light-mode) .related-card,
body:not(.light-mode) .sidebar,
body:not(.light-mode) .hero-search,
body:not(.light-mode) .search-results     { background: var(--bg-surface) !important; }

body:not(.light-mode) .btn-secondary      { background: var(--bg-elevated) !important; color: #94A3B8; border-color: rgba(255,255,255,0.08); }
body:not(.light-mode) .btn-secondary:hover{ background: #243049 !important; color: #F0F6FF; }

body:not(.light-mode) .field-input,
body:not(.light-mode) .field-select       { background: var(--bg-elevated) !important; color: #F0F6FF; }
body:not(.light-mode) .field-select option{ background: #1A2540; }

/* ── Dark mode: footer text brightness ─────────────────── */
body:not(.light-mode) .footer-brand-desc  { color: #94A3B8; }
body:not(.light-mode) .footer-col-title   { color: #64748B; }
body:not(.light-mode) .footer-link        { color: #94A3B8; }
body:not(.light-mode) .footer-link:hover  { color: #60A5FA; }
body:not(.light-mode) .footer-copy,
body:not(.light-mode) .footer-disc        { color: #64748B; }

/* ── Dark mode: card text ───────────────────────────────── */
body:not(.light-mode) .category-card-name { color: #F0F6FF; }
body:not(.light-mode) .category-card-desc { color: #94A3B8; }
body:not(.light-mode) .category-card-count{ color: #64748B; }
body:not(.light-mode) .category-tag       { background: rgba(96,165,250,0.12); color: #60A5FA; }
body:not(.light-mode) .popular-card-name  { color: #F0F6FF; }
body:not(.light-mode) .popular-card-cat   { color: #60A5FA; }
body:not(.light-mode) .related-card       { color: #94A3B8; }
body:not(.light-mode) .related-card:hover { color: #60A5FA; border-color: #3B82F6; }

/* ── Dark mode: calc page ───────────────────────────────── */
body:not(.light-mode) .calc-card-header   { background: linear-gradient(135deg,#1a2540 0%,#1e2d4a 100%) !important; }
body:not(.light-mode) .calc-card-title    { color: #F0F6FF; }
body:not(.light-mode) .calc-card-subtitle { color: #64748B; }
body:not(.light-mode) .calc-page-title    { color: #F0F6FF; }
body:not(.light-mode) .calc-page-desc     { color: #94A3B8; }
body:not(.light-mode) .section-title-text { color: #F0F6FF; }
body:not(.light-mode) .breadcrumb         { color: #64748B; }
body:not(.light-mode) .breadcrumb a       { color: #60A5FA; opacity: 0.85; }

/* ── Dark mode: sidebar ─────────────────────────────────── */
body:not(.light-mode) .sidebar-link       { color: #94A3B8; }
body:not(.light-mode) .sidebar-link:hover { color: #F0F6FF; background: rgba(255,255,255,0.05); }
body:not(.light-mode) .sidebar-link.active{ color: #60A5FA; background: rgba(96,165,250,0.08); border-left-color: #3B82F6; }
body:not(.light-mode) .sidebar-heading    { color: #475569; }

/* ── Dark mode: search dropdown ─────────────────────────── */
body:not(.light-mode) .search-result-item      { color: #94A3B8; }
body:not(.light-mode) .search-result-item:hover{ background: #1A2540; color: #F0F6FF; }
body:not(.light-mode) .search-result-cat       { color: #60A5FA; background: rgba(96,165,250,0.10); }

/* ── Dark mode: SEO & formula sections ──────────────────── */
body:not(.light-mode) .formula-block   { background: rgba(37,99,235,0.12); border-left-color: #60A5FA; color: #93C5FD; }
body:not(.light-mode) .seo-section     { border-top-color: rgba(255,255,255,0.06); }
body:not(.light-mode) .seo-section h2  { color: #F0F6FF; }
body:not(.light-mode) .seo-section h3  { color: #60A5FA; }
body:not(.light-mode) .seo-section p,
body:not(.light-mode) .seo-section li  { color: #94A3B8; }
body:not(.light-mode) .faq-q           { color: #F0F6FF; }
body:not(.light-mode) .faq-a           { color: #94A3B8; }
body:not(.light-mode) .faq-item        { border-color: rgba(255,255,255,0.06); }
body:not(.light-mode) .hero-stat-val   { color: #60A5FA; }
body:not(.light-mode) .hero-stat-lbl   { color: #64748B; }

/* ═══════════════════════════════════════════════════════════════
   DARK MODE — final patch v2.2
   Fixes: hero search dim, footer dim text
   ═══════════════════════════════════════════════════════════════ */

/* Hero search bar — dark background + readable placeholder */
body:not(.light-mode) .hero-search {
  background: #1A2540 !important;
  color: #F0F6FF;
  border-color: rgba(96,165,250,0.2);
}
body:not(.light-mode) .hero-search::placeholder { color: #4E6080 !important; }
body:not(.light-mode) .hero-search-icon         { color: #3B82F6; }
body:not(.light-mode) .hero-search:focus {
  border-color: #3B82F6;
  box-shadow: 0 0 0 4px rgba(59,130,246,0.15);
}

/* Nav search bar placeholder */
body:not(.light-mode) .nav-search::placeholder  { color: #4E6080 !important; }

/* Footer — make everything crisp and bright */
body:not(.light-mode) .footer-col-title  { color: #CBD5E1 !important; }
body:not(.light-mode) .footer-brand-desc { color: #94A3B8 !important; }
body:not(.light-mode) .footer-link       { color: #94A3B8 !important; display: block; }
body:not(.light-mode) .footer-link:hover { color: #60A5FA !important; }
body:not(.light-mode) .footer-copy       { color: #64748B !important; }
body:not(.light-mode) .footer-disc       { color: #475569 !important; }

/* Footer brand name gradient stays bright in dark */
body:not(.light-mode) .footer-brand-name {
  background: linear-gradient(135deg, #60A5FA 0%, #22D3EE 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ═══════════════════════════════════════════════════════════════
   MOBILE NAV — Hamburger + slide-down menu  v2.3
   ═══════════════════════════════════════════════════════════════ */

/* ── Hamburger button (hidden on desktop) ────────────────────── */
.nav-hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  width: 40px;
  height: 40px;
  background: none;
  border: 0.5px solid var(--border);
  border-radius: var(--radius-md);
  cursor: pointer;
  padding: 8px;
  margin-left: auto;
  flex-shrink: 0;
  transition: background 0.15s;
}
.nav-hamburger:hover       { background: var(--bg-elevated); }
.nav-hamburger span {
  display: block;
  width: 20px;
  height: 2px;
  background: var(--text-secondary);
  border-radius: 2px;
  transition: all 0.25s ease;
  transform-origin: center;
}
/* Animate to × when open */
.nav-hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-hamburger.open span:nth-child(2) { opacity: 0; transform: scaleX(0); }
.nav-hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ── Mobile breakpoint ───────────────────────────────────────── */
@media (max-width: 900px) {
  .nav-hamburger   { display: flex; }
  .nav-links       { display: none !important; }
  .nav-search-wrap { display: none; }
}

/* ── Mobile menu panel ───────────────────────────────────────── */
.nav-mobile-menu {
  display: none;
  position: absolute;
  top: 60px;
  left: 0;
  right: 0;
  z-index: 98;
  background: var(--bg-surface);
  border-bottom: 0.5px solid var(--border);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  animation: mobileMenuIn 0.22s ease both;
}
.nav-mobile-menu.open { display: block; }

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

.nav-mobile-link {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 13px 1.5rem;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-secondary);
  border-bottom: 0.5px solid var(--border);
  transition: background 0.12s, color 0.12s;
  text-decoration: none;
}
.nav-mobile-link:last-child  { border-bottom: none; }
.nav-mobile-link:hover       { background: var(--bg-elevated); color: var(--nova-blue); }
.nav-mobile-icon             { font-size: 1.1rem; flex-shrink: 0; }

/* Dark mode mobile menu */
body:not(.light-mode) .nav-hamburger span          { background: #94A3B8; }
body:not(.light-mode) .nav-mobile-menu             { background: #1E293B; border-bottom-color: rgba(255,255,255,0.06); }
body:not(.light-mode) .nav-mobile-link             { color: #94A3B8; border-bottom-color: rgba(255,255,255,0.05); }
body:not(.light-mode) .nav-mobile-link:hover       { background: #1A2540; color: #60A5FA; }

/* ═══════════════════════════════════════════════════════════════
   DARK MODE — footer brightness boost  v2.4
   ═══════════════════════════════════════════════════════════════ */
body:not(.light-mode) .footer-brand-desc  { color: #CBD5E1 !important; }
body:not(.light-mode) .footer-col-title   { color: #E2E8F0 !important; font-weight: 700; }
body:not(.light-mode) .footer-link        { color: #94A3B8 !important; }
body:not(.light-mode) .footer-link:hover  { color: #60A5FA !important; }
body:not(.light-mode) .footer-copy        { color: #64748B !important; }
body:not(.light-mode) .footer-disc        { color: #64748B !important; }
body:not(.light-mode) .footer-brand-name  {
  background: linear-gradient(135deg,#60A5FA 0%,#22D3EE 100%);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}
/* Also brighten any inline-styled footer text as fallback */
body:not(.light-mode) .footer *           { color: inherit; }

/* ═══════════════════════════════════════════════════════════════
   MORE DROPDOWN  v2.5
   ═══════════════════════════════════════════════════════════════ */
.nav-more-wrap {
  position: relative;
}

.nav-more-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-family: inherit;
}

.nav-more-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  background: var(--bg-surface);
  border: 0.5px solid var(--border-hover);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  min-width: 200px;
  overflow: hidden;
  z-index: 200;
  animation: mobileMenuIn 0.18s ease both;
}
.nav-more-dropdown.open { display: block; }

.nav-more-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-secondary);
  text-decoration: none;
  transition: all 0.12s;
  border-bottom: 0.5px solid var(--border);
}
.nav-more-item:last-child { border-bottom: none; }
.nav-more-item:hover      { background: var(--bg-elevated); color: var(--nova-blue); }

/* Dark mode */
body:not(.light-mode) .nav-more-dropdown { background: #1E293B; border-color: rgba(255,255,255,0.08); }
body:not(.light-mode) .nav-more-item     { color: #94A3B8; border-bottom-color: rgba(255,255,255,0.05); }
body:not(.light-mode) .nav-more-item:hover { background: #1A2540; color: #60A5FA; }

/* ── Footer bottom text brightness fix ── */
body:not(.light-mode) .footer-copy,
body:not(.light-mode) .footer-disc,
body:not(.light-mode) .footer-bottom,
body:not(.light-mode) .footer-bottom span,
body:not(.light-mode) .footer-bottom p  { color: #94A3B8 !important; }

/* ══════════════════════════════════════════════════════
   FINAL NAV RULES — overrides all duplicates above
   ══════════════════════════════════════════════════════ */
@media (min-width: 901px) {
  .nav-links     { display: flex !important; }
  .nav-hamburger { display: none !important; }
  .nav-mobile-menu { display: none !important; }
}
@media (max-width: 900px) {
  .nav-links       { display: none !important; }
  .nav-hamburger   { display: flex !important; }
  .nav-search-wrap { display: none !important; }
}

/* ── Affiliate box accent ── */
.affiliate-box {
  border-left: 3px solid #10B981 !important;
  background: linear-gradient(135deg, rgba(16,185,129,0.06) 0%, var(--bg-elevated) 100%) !important;
}
.affiliate-box a[href] {
  background: linear-gradient(135deg, #059669 0%, #10B981 100%) !important;
  box-shadow: 0 4px 14px rgba(16,185,129,0.3) !important;
}
body:not(.light-mode) .affiliate-box {
  background: linear-gradient(135deg, rgba(16,185,129,0.08) 0%, var(--bg-elevated) 100%) !important;
}

/* Affiliate box green accent */
.affiliate-box{border-left:3px solid #10B981 !important;background:linear-gradient(135deg,rgba(16,185,129,0.06) 0%,var(--bg-elevated) 100%) !important;}
.affiliate-box a[href]{background:linear-gradient(135deg,#059669 0%,#10B981 100%) !important;box-shadow:0 4px 14px rgba(16,185,129,0.3) !important;}
body:not(.light-mode) .affiliate-box{background:linear-gradient(135deg,rgba(16,185,129,0.08) 0%,var(--bg-elevated) 100%) !important;}

/* Fix Education/Travel/Home layout */
.main-content {
  max-width: 860px;
  width: 100%;
  box-sizing: border-box;
  padding: 0 1.5rem;
}
/* Fix Education/Travel/Home calculator card padding */
.calc-inputs {
  padding: 0 1.25rem 1.25rem;
}

.calc-inputs .field {
  margin-bottom: 1rem;
}

.btn-calculate {
  margin: 0 1.25rem 1.25rem;
  width: calc(100% - 2.5rem);
}
/* Hide Reset button — to be implemented later */
.btn-reset { display: none !important; }.calc-card-subtitle

/* Fix result-rows class used in Education/Travel/Home pages */
.result-rows { display: flex; flex-direction: column; gap: 0; }
.result-rows .result-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 0;
  border-bottom: 0.5px solid rgba(16,185,129,0.12);
  gap: 1rem;
}
.result-rows .result-row:last-child { border-bottom: none; }
/* Fix result-rows for Education/Travel/Home pages */
.result-rows { display: flex; flex-direction: column; gap: 0; }
.result-rows .result-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 0;
  border-bottom: 0.5px solid rgba(16,185,129,0.12);
  gap: 1rem;
}
.result-rows .result-row:last-child { border-bottom: none; }
.result-rows .result-row-label { font-size: 0.82rem; color: var(--text-secondary) !important; }
.result-rows .result-row-value { font-size: 0.9rem; font-weight: 600; color: var(--text-primary) !important; white-space: nowrap; }

/* Fix result-rows text visibility in dark mode */
body:not(.light-mode) .result-rows .result-row-label { color: #334155 !important; }
body:not(.light-mode) .result-rows .result-row-value { color: #0F172A !important; }
body:not(.light-mode) .result-breakdown .result-row-label { color: #334155 !important; }
body:not(.light-mode) .result-breakdown .result-row-value { color: #0F172A !important; }

/* Fix State Tax Return link color */
.affiliate-box a[href*="11917140"] {
  color: white !important;
}
/* Fix btn-calculate to match blue gradient style */
.btn-calculate {
  background: linear-gradient(135deg, #2563EB 0%, #0891B2 100%) !important;
  color: white !important;
  border: none !important;
  border-radius: var(--radius-md) !important;
  padding: 14px 24px !important;
  font-size: 0.95rem !important;
  font-weight: 600 !important;
  cursor: pointer !important;
  width: 100% !important;
  box-shadow: 0 4px 14px rgba(37,99,235,0.28) !important;
  transition: all 0.15s !important;
}
.btn-calculate:hover {
  filter: brightness(1.07) !important;
  box-shadow: 0 6px 22px rgba(37,99,235,0.42) !important;
}

/* Fix State Tax button to match IRS green button */
.affiliate-box a[href*="11917140"] {
  background: linear-gradient(135deg, #059669 0%, #10B981 100%) !important;
  color: white !important;
  padding: 12px 18px !important;
  border-radius: 8px !important;
  font-weight: 600 !important;
  font-size: 0.9rem !important;
  display: block !important;
  text-align: center !important;
  text-decoration: none !important;
  margin-bottom: 0.5rem !important;
}

.calc-related-link {
    display: inline-flex;
    align-items: center;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--nova-blue);
    text-decoration: none;
    padding: 5px 12px;
    border: 0.5px solid var(--border);
    border-radius: 8px;
    background: var(--bg-card);
    transition: border-color 0.15s;
}
.calc-related-link:hover { border-color: var(--nova-blue); }

/* ═══════════════════════════════════════════════════════════════
   Chemistry / Physics formula table and example readability fix
   ═══════════════════════════════════════════════════════════════ */

/* Dark mode: readable table headings and data cells */
body:not(.light-mode) .formula-table th {
  background: #18213A !important;
  color: #F8FAFC !important;
  border-color: rgba(148,163,184,0.28) !important;
}
body:not(.light-mode) .formula-table td,
body:not(.light-mode) .formula-table tr:nth-child(even) td {
  background: #111827 !important;
  color: #E5E7EB !important;
  border-color: rgba(148,163,184,0.24) !important;
}

/* Dark mode: use a dark card instead of cream with pale text */
body:not(.light-mode) .example-block {
  background: #111827 !important;
  border-color: rgba(148,163,184,0.22) !important;
  border-left-color: #6366F1 !important;
}
body:not(.light-mode) .example-block p {
  color: #CBD5E1 !important;
}
body:not(.light-mode) .example-block .ex-title,
body:not(.light-mode) .example-block strong {
  color: #F8FAFC !important;
}
body:not(.light-mode) .example-block .step-list li {
  color: #DBEAFE !important;
}
body:not(.light-mode) .example-block .answer-box {
  background: rgba(16,185,129,0.17) !important;
  color: #A7F3D0 !important;
  border-left-color: #34D399 !important;
}

/* Light mode: retain strong contrast */
body.light-mode .formula-table th {
  background: #E0E7FF !important;
  color: #0F172A !important;
  border-color: #C7D2FE !important;
}
body.light-mode .formula-table td,
body.light-mode .formula-table tr:nth-child(even) td {
  background: #FFFFFF !important;
  color: #1E293B !important;
  border-color: #DBE4F0 !important;
}
body.light-mode .example-block {
  background: #FFFBEB !important;
  border-color: #FDE68A !important;
  border-left-color: #6366F1 !important;
}
body.light-mode .example-block p {
  color: #475569 !important;
}
body.light-mode .example-block .ex-title,
body.light-mode .example-block strong {
  color: #1E293B !important;
}

/* Keep wide reference tables usable on phones */
@media (max-width: 700px) {
  .formula-table {
    display: block;
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
}
