/* ============================================================
   CalcWise — Global Design System
   styles.css  (single source of truth, part 1 of 2)
   Premium fintech aesthetic. Pure CSS, no @import.
   Fonts are loaded via <link> in the HTML <head>.
   ============================================================ */

/* ── 1. Design Tokens ───────────────────────────────────── */
:root {
  /* Brand colors */
  --primary: #1a56db;
  --primary-dark: #1e429f;
  --primary-light: #e8f0fe;
  --accent: #0e9f6e;
  --accent-light: #def7ec;
  --danger: #e02424;
  --warning: #ff5a1f;

  /* --color-* aliases: several calculator pages reference these names
     inline for chart/legend swatches (var(--color-primary) etc.). Defining
     them here keeps every page's charts on the same brand palette instead
     of falling back to mismatched hardcoded hex values per page. */
  --color-primary: var(--primary);
  --color-accent: var(--accent);
  --color-success: var(--accent);
  --color-danger: var(--danger);
  --color-warning: var(--warning);
  --color-info: var(--primary);

  /* Surfaces & text */
  --bg: #f9fafb;
  --surface: #ffffff;
  --surface-2: #f3f6fb;
  --text: #111827;
  --text-2: #6b7280;
  --border: #e5e7eb;
  --border-2: #eef2f7;

  /* Radii */
  --r-sm: 8px;
  --r: 12px;
  --r-lg: 16px;
  --r-xl: 24px;
  --r-full: 9999px;

  /* Shadows */
  --shadow-sm: 0 1px 2px rgb(16 24 40 / .05), 0 1px 3px rgb(16 24 40 / .04);
  --shadow: 0 4px 12px -2px rgb(16 24 40 / .08), 0 2px 6px -2px rgb(16 24 40 / .05);
  --shadow-lg: 0 18px 40px -12px rgb(16 24 40 / .18), 0 8px 16px -8px rgb(16 24 40 / .08);
  --shadow-primary: 0 10px 28px -8px rgb(26 86 219 / .45);

  /* Spacing scale */
  --s-1: 0.25rem;
  --s-2: 0.5rem;
  --s-3: 0.75rem;
  --s-4: 1rem;
  --s-5: 1.25rem;
  --s-6: 1.5rem;
  --s-8: 2rem;
  --s-10: 2.5rem;
  --s-12: 3rem;
  --s-16: 4rem;
  --s-20: 5rem;

  /* Layout */
  --maxw: 1200px;

  /* Motion */
  --transition: 200ms cubic-bezier(.4, 0, .2, 1);
  --transition-fast: 140ms cubic-bezier(.4, 0, .2, 1);

  /* Font stack — system fallback renders text instantly */
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;

  /* Z-index */
  --z-header: 1000;
  --z-dropdown: 1100;
  --z-mobilenav: 1200;
  --z-float: 900;
  --z-cookie: 1300;
}

/* ── 2. Reset & Base ────────────────────────────────────── */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  font-size: 16px;
}

body {
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1.7;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

img, picture, video, canvas, svg { display: block; max-width: 100%; }
input, button, textarea, select { font: inherit; color: inherit; }
ul, ol { list-style: none; }

a {
  color: var(--primary);
  text-decoration: none;
  transition: color var(--transition-fast);
}
a:hover { color: var(--primary-dark); }

/* ── 3. Typography ──────────────────────────────────────── */
h1, h2, h3, h4, h5, h6 { overflow-wrap: break-word; }

h1 {
  font-size: clamp(2rem, 5vw, 2.75rem);
  font-weight: 800;
  line-height: 1.12;
  letter-spacing: -0.025em;
}
h2 {
  font-size: clamp(1.5rem, 3vw, 1.9rem);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.02em;
}
h3 { font-size: 1.35rem; font-weight: 700; line-height: 1.3; letter-spacing: -0.01em; }
h4 { font-size: 1.125rem; font-weight: 700; line-height: 1.4; }
h5 { font-size: 1rem; font-weight: 700; line-height: 1.5; }
h6 { font-size: .875rem; font-weight: 700; line-height: 1.5; }

p { margin-bottom: var(--s-4); }
p:last-child { margin-bottom: 0; }
strong, b { font-weight: 700; }
em, i { font-style: italic; }
small { font-size: .875rem; }

.lead {
  font-size: 1.2rem;
  line-height: 1.7;
  color: var(--text-2);
  max-width: 760px;
  margin-bottom: var(--s-6);
}

/* ── 4. Layout ──────────────────────────────────────────── */
.container {
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: var(--s-6);
}

.section { padding-block: var(--s-16); }
.section-tight { padding-block: var(--s-10); }

/* ── 5. Skip link / a11y helpers ────────────────────────── */
.skip-link {
  position: absolute;
  left: var(--s-4);
  top: -60px;
  z-index: calc(var(--z-mobilenav) + 1);
  background: var(--primary);
  color: #fff;
  padding: 12px 20px;
  border-radius: var(--r);
  font-weight: 700;
  box-shadow: var(--shadow-lg);
  transition: top var(--transition);
}
.skip-link:focus { top: var(--s-4); color: #fff; }

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

:focus-visible {
  outline: 3px solid rgb(26 86 219 / .55);
  outline-offset: 2px;
  border-radius: 4px;
}

/* ── 6. Header ──────────────────────────────────────────── */
.site-header {
  position: sticky;
  top: 0;
  z-index: var(--z-header);
  height: 64px;
  background: rgb(255 255 255 / .9);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  display: flex;
  align-items: center;
  gap: var(--s-4);
  height: 100%;
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: var(--s-6);
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
  font-size: 1.3rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text);
  flex-shrink: 0;
}
.logo:hover { color: var(--primary); }
.logo-emoji { font-size: 1.25rem; line-height: 1; }

.main-nav {
  display: flex;
  align-items: center;
  height: 100%;
  margin-left: var(--s-4);
}
.main-nav > ul {
  display: flex;
  align-items: center;
  gap: 2px;
  height: 100%;
}
.main-nav > ul > li { height: 100%; display: flex; align-items: center; }
.main-nav > ul > li > a {
  display: inline-flex;
  align-items: center;
  height: 38px;
  padding: 0 14px;
  font-size: .9rem;
  font-weight: 600;
  color: var(--text-2);
  border-radius: var(--r-sm);
  transition: color var(--transition-fast), background var(--transition-fast);
}
.main-nav > ul > li > a:hover { color: var(--primary); background: var(--primary-light); }

/* Dropdown */
.has-dropdown { position: relative; }
.has-dropdown > a::after {
  content: '';
  display: inline-block;
  width: 6px; height: 6px;
  margin-left: 7px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg) translateY(-1px);
  transition: transform var(--transition);
  opacity: .6;
}
.has-dropdown:hover > a::after { transform: rotate(225deg) translateY(-1px); }

.dropdown-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%) translateY(8px);
  min-width: 520px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-lg);
  padding: var(--s-3);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity var(--transition), transform var(--transition), visibility var(--transition);
  z-index: var(--z-dropdown);
}
.has-dropdown:hover .dropdown-menu,
.has-dropdown:focus-within .dropdown-menu {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateX(-50%) translateY(0);
}
.dropdown-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2px;
}
.dropdown-menu a {
  display: flex;
  align-items: center;
  gap: var(--s-2);
  padding: 10px 12px;
  font-size: .875rem;
  font-weight: 600;
  color: var(--text);
  border-radius: var(--r-sm);
  transition: background var(--transition-fast), color var(--transition-fast);
}
.dropdown-menu a:hover { background: var(--primary-light); color: var(--primary); }

.nav-cta { margin-left: auto; flex-shrink: 0; }

/* Hamburger */
.hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 42px; height: 42px;
  margin-left: auto;
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  cursor: pointer;
  padding: 0 9px;
  transition: background var(--transition-fast);
}
.hamburger:hover { background: var(--surface-2); }
.hamburger span {
  display: block;
  height: 2px;
  width: 100%;
  background: var(--text);
  border-radius: var(--r-full);
  transition: transform var(--transition), opacity var(--transition);
}
body.nav-open .hamburger span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
body.nav-open .hamburger span:nth-child(2) { opacity: 0; transform: scaleX(0); }
body.nav-open .hamburger span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* Mobile nav panel */
.mobile-nav {
  position: fixed;
  inset: 64px 0 0 0;
  z-index: var(--z-mobilenav);
  background: var(--surface);
  border-top: 1px solid var(--border);
  overflow-y: auto;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px);
  transition: opacity var(--transition), transform var(--transition), visibility var(--transition);
}
body.nav-open .mobile-nav {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
body.nav-open { overflow: hidden; }
.mobile-nav-inner {
  display: flex;
  flex-direction: column;
  padding: var(--s-4) var(--s-6) var(--s-12);
}
.mobile-nav-inner a {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  padding: 14px 8px;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
  border-bottom: 1px solid var(--border-2);
}
.mobile-nav-inner a:hover { color: var(--primary); }

/* ── 7. Home gradient hero ──────────────────────────────── */
.hero {
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, #1a56db 0%, #1e429f 100%);
  color: #fff;
  padding-block: clamp(3.5rem, 8vw, 6rem);
}
.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(circle at 20% 20%, rgb(255 255 255 / .12), transparent 42%),
    radial-gradient(circle at 85% 0%, rgb(255 255 255 / .10), transparent 40%),
    url("data:image/svg+xml,%3Csvg width='40' height='40' viewBox='0 0 40 40' xmlns='http://www.w3.org/2000/svg'%3E%3Ccircle cx='2' cy='2' r='1.4' fill='%23ffffff' fill-opacity='0.10'/%3E%3C/svg%3E");
  pointer-events: none;
}
.hero-inner { position: relative; text-align: center; max-width: 820px; margin-inline: auto; }
.hero-title {
  color: #fff;
  margin-bottom: var(--s-5);
  text-wrap: balance;
}
.hero-subtitle {
  font-size: clamp(1.05rem, 2.2vw, 1.25rem);
  color: #dbe7ff;
  max-width: 620px;
  margin: 0 auto var(--s-8);
}
.hero-cta {
  display: inline-flex;
  flex-wrap: wrap;
  gap: var(--s-3);
  justify-content: center;
  margin-bottom: var(--s-10);
}
.hero-stats {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--s-3) var(--s-4);
}
.hero-stat {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: var(--s-4) var(--s-6);
  background: rgb(255 255 255 / .1);
  border: 1px solid rgb(255 255 255 / .18);
  border-radius: var(--r-lg);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  min-width: 140px;
}
.stat-number { font-size: 1.9rem; font-weight: 800; line-height: 1; color: #fff; letter-spacing: -0.02em; }
.stat-label { font-size: .8rem; font-weight: 600; color: #c5d8ff; text-transform: uppercase; letter-spacing: .05em; }

/* ── 8. Page hero (inner pages) ─────────────────────────── */
.page-hero {
  position: relative;
  background:
    radial-gradient(120% 140% at 100% 0%, rgb(26 86 219 / .07), transparent 55%),
    linear-gradient(180deg, var(--primary-light) 0%, var(--surface) 100%);
  border-bottom: 1px solid var(--border-2);
  padding-block: clamp(2.25rem, 5vw, 3.5rem);
}
.page-hero-inner { max-width: 820px; }
.page-hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
  padding: 5px 14px;
  margin-bottom: var(--s-4);
  background: var(--surface);
  border: 1px solid #c7d7fd;
  border-radius: var(--r-full);
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--primary);
  box-shadow: var(--shadow-sm);
}
.page-hero-title { margin-bottom: var(--s-3); text-wrap: balance; }
.page-hero-sub { font-size: clamp(1rem, 2vw, 1.15rem); color: var(--text-2); max-width: 680px; }

/* ── 9. Breadcrumb ──────────────────────────────────────── */
.breadcrumb { padding-block: var(--s-4); }
.breadcrumb ol {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--s-2);
  font-size: .85rem;
  color: var(--text-2);
}
.breadcrumb li { display: inline-flex; align-items: center; gap: var(--s-2); }
.breadcrumb li:not(:first-child)::before {
  content: '/';
  color: var(--border);
  font-weight: 600;
}
.breadcrumb a { color: var(--text-2); font-weight: 600; }
.breadcrumb a:hover { color: var(--primary); }
.breadcrumb [aria-current="page"] { color: var(--text); font-weight: 600; }

/* ── 10. Buttons ────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--s-2);
  padding: 12px 22px;
  font-size: .925rem;
  font-weight: 700;
  line-height: 1;
  border: 1.5px solid transparent;
  border-radius: var(--r);
  cursor: pointer;
  white-space: nowrap;
  user-select: none;
  transition: background var(--transition-fast), border-color var(--transition-fast),
              color var(--transition-fast), box-shadow var(--transition-fast), transform var(--transition-fast);
}
.btn:active { transform: translateY(1px); }

.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff;
  box-shadow: var(--shadow-sm);
}
.btn-primary:hover {
  color: #fff;
  box-shadow: var(--shadow-primary);
  transform: translateY(-1px);
}

.btn-secondary {
  background: var(--accent);
  color: #fff;
}
.btn-secondary:hover { background: #0b7e58; color: #fff; transform: translateY(-1px); box-shadow: var(--shadow); }

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

.btn-ghost {
  background: transparent;
  color: var(--text-2);
}
.btn-ghost:hover { background: var(--surface-2); color: var(--text); }

.btn-sm { padding: 8px 14px; font-size: .82rem; border-radius: var(--r-sm); }
.btn-lg { padding: 16px 30px; font-size: 1.05rem; border-radius: var(--r); }
.btn-block { width: 100%; }

/* Full-width gradient calculate button */
.btn-calculate {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--s-2);
  width: 100%;
  padding: 17px 24px;
  font-size: 1.1rem;
  font-weight: 800;
  color: #fff;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  border: none;
  border-radius: var(--r);
  cursor: pointer;
  box-shadow: var(--shadow-primary);
  letter-spacing: .01em;
  transition: transform var(--transition-fast), box-shadow var(--transition-fast), filter var(--transition-fast);
}
.btn-calculate:hover { transform: translateY(-2px); filter: brightness(1.05); box-shadow: 0 16px 34px -8px rgb(26 86 219 / .55); }
.btn-calculate:active { transform: translateY(0); }
.btn-calculate:disabled { opacity: .55; cursor: not-allowed; transform: none; box-shadow: none; }

.btn-reset {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--s-2);
  width: 100%;
  padding: 12px 24px;
  margin-top: var(--s-2);
  font-size: .9rem;
  font-weight: 700;
  color: var(--text-2);
  background: transparent;
  border: 1.5px solid var(--border);
  border-radius: var(--r);
  cursor: pointer;
  transition: color var(--transition-fast), border-color var(--transition-fast), background var(--transition-fast);
}
.btn-reset:hover { color: var(--danger); border-color: #f6b9b9; background: #fff5f5; }

/* ── 11. Badges ─────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  font-size: .75rem;
  font-weight: 700;
  letter-spacing: .02em;
  border-radius: var(--r-full);
  line-height: 1.4;
}
.badge-primary { background: var(--primary-light); color: var(--primary-dark); }
.badge-success { background: var(--accent-light); color: #046c4e; }
.badge-warning { background: #fff3e6; color: #b43403; }
.badge-danger  { background: #fde8e8; color: #b91c1c; }

/* ── 12. Progress ───────────────────────────────────────── */
.progress {
  height: 10px;
  background: var(--surface-2);
  border-radius: var(--r-full);
  overflow: hidden;
}
.progress-bar {
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--primary), var(--primary-dark));
  border-radius: var(--r-full);
  transition: width .6s cubic-bezier(.4, 0, .2, 1);
}

/* ── 13. Callouts ───────────────────────────────────────── */
.callout {
  display: flex;
  gap: var(--s-3);
  padding: var(--s-4) var(--s-5);
  margin-block: var(--s-6);
  border: 1px solid var(--border);
  border-left: 4px solid var(--text-2);
  border-radius: var(--r);
  background: var(--surface-2);
  font-size: .95rem;
  line-height: 1.65;
}
.callout::before { font-size: 1.2rem; line-height: 1.4; flex-shrink: 0; }
.callout-info { border-left-color: var(--primary); background: var(--primary-light); }
.callout-info::before { content: 'ℹ️'; }
.callout-warn { border-left-color: var(--warning); background: #fff3e6; }
.callout-warn::before { content: '⚠️'; }
.callout-tip { border-left-color: var(--accent); background: var(--accent-light); }
.callout-tip::before { content: '💡'; }

/* ── 14. Article content ────────────────────────────────── */
.article-content {
  max-width: 760px;
  font-size: 1.05rem;
  line-height: 1.78;
  color: #1f2937;
}
.article-content h2 {
  margin-top: var(--s-12);
  margin-bottom: var(--s-4);
  scroll-margin-top: 80px;
}
.article-content h2:first-child { margin-top: 0; }
.article-content h3 { margin-top: var(--s-8); margin-bottom: var(--s-3); }
.article-content p { margin-bottom: var(--s-5); }
.article-content ul, .article-content ol { padding-left: var(--s-6); margin-bottom: var(--s-5); }
.article-content ul { list-style: disc; }
.article-content ol { list-style: decimal; }
.article-content li { margin-bottom: var(--s-2); }
.article-content li::marker { color: var(--primary); }
.article-content a { text-decoration: underline; text-underline-offset: 2px; font-weight: 600; }
.article-content strong { color: var(--text); }
.article-content blockquote {
  margin: var(--s-6) 0;
  padding: var(--s-4) var(--s-6);
  border-left: 4px solid var(--primary);
  background: var(--primary-light);
  border-radius: 0 var(--r) var(--r) 0;
  font-style: italic;
  color: var(--text-2);
}
.article-content code {
  font-family: ui-monospace, 'SF Mono', 'Cascadia Code', Consolas, monospace;
  font-size: .9em;
  background: var(--surface-2);
  border: 1px solid var(--border-2);
  padding: 2px 6px;
  border-radius: var(--r-sm);
  color: #be123c;
}
.article-content table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: var(--s-6);
  font-size: .92rem;
}
.article-content th, .article-content td {
  padding: 10px 14px;
  border: 1px solid var(--border);
  text-align: left;
}
.article-content th { background: var(--primary-light); font-weight: 700; color: var(--primary-dark); }

/* ── 15. FAQ ────────────────────────────────────────────── */
.faq-section { padding-block: var(--s-12); content-visibility: auto; contain-intrinsic-size: auto 800px; }
.faq-list {
  display: flex;
  flex-direction: column;
  gap: var(--s-3);
  max-width: 800px;
  margin-inline: auto;
}
.faq-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition: box-shadow var(--transition), border-color var(--transition);
}
.faq-item[open] { border-color: #c7d7fd; box-shadow: var(--shadow); }
.faq-item summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-4);
  padding: var(--s-5) var(--s-5);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text);
  cursor: pointer;
  list-style: none;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
  content: '';
  flex-shrink: 0;
  width: 22px; height: 22px;
  position: relative;
}
.faq-item summary::before {
  content: '';
  position: absolute;
  right: calc(var(--s-5) + 10px);
  width: 14px; height: 2px;
  background: var(--primary);
  border-radius: 2px;
}
.faq-item summary { position: relative; }
.faq-item summary::after {
  content: '';
  width: 2px; height: 14px;
  background: var(--primary);
  border-radius: 2px;
  margin-right: 10px;
  transition: transform var(--transition);
}
.faq-item[open] summary::after { transform: rotate(90deg) scaleX(0); }
.faq-answer {
  padding: 0 var(--s-5) var(--s-5);
  color: var(--text-2);
  line-height: 1.75;
}
.faq-answer p { margin-bottom: var(--s-3); }

/* ── 16. Related calculators ────────────────────────────── */
.related-section { padding-block: var(--s-12); content-visibility: auto; contain-intrinsic-size: auto 700px; }
.related-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: var(--s-5);
  margin-top: var(--s-8);
}
.related-card {
  display: block;
  padding: var(--s-6);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
}
.related-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
  border-color: #c7d7fd;
}
.related-card-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px; height: 48px;
  margin-bottom: var(--s-4);
  font-size: 1.5rem;
  background: var(--primary-light);
  border-radius: var(--r);
}
.related-card-title { font-size: 1.15rem; font-weight: 700; color: var(--text); margin-bottom: var(--s-2); }
.related-card-desc { font-size: .92rem; color: var(--text-2); line-height: 1.6; }

/* ── 17. Hub: calc grid / tiles ─────────────────────────── */
.calc-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: var(--s-5);
}
.calc-tile {
  display: flex;
  flex-direction: column;
  padding: var(--s-6);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
}
.calc-tile:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
  border-color: #c7d7fd;
}
.calc-tile-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 52px; height: 52px;
  margin-bottom: var(--s-4);
  font-size: 1.6rem;
  background: linear-gradient(135deg, var(--primary-light), #d6e4ff);
  border-radius: var(--r);
}
.calc-tile-title { font-size: 1.15rem; font-weight: 700; color: var(--text); margin-bottom: var(--s-2); }
.calc-tile-desc { font-size: .92rem; color: var(--text-2); line-height: 1.6; }

/* ── 18. Tables (shared) ────────────────────────────────── */
.table-wrap {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm);
  background: var(--surface);
}
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .9rem;
  min-width: 520px;
}
.data-table thead th {
  position: sticky;
  top: 0;
  background: var(--surface-2);
  color: var(--text);
  font-weight: 700;
  font-size: .78rem;
  text-transform: uppercase;
  letter-spacing: .05em;
  text-align: left;
  padding: 12px 16px;
  border-bottom: 2px solid var(--border);
  white-space: nowrap;
}
.data-table tbody td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-2);
  font-variant-numeric: tabular-nums;
}
.data-table tbody tr:nth-child(even) { background: #fafbfd; }
.data-table tbody tr:hover { background: var(--primary-light); }

.table-expand-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--s-2);
  width: 100%;
  padding: 13px 16px;
  background: var(--surface-2);
  border: none;
  border-top: 1px solid var(--border);
  font-size: .9rem;
  font-weight: 700;
  color: var(--primary);
  cursor: pointer;
  transition: background var(--transition-fast);
}
.table-expand-btn:hover { background: var(--primary-light); }

tr.hidden-row { display: none; }
.expanded tr.hidden-row,
tr.expanded.hidden-row { display: table-row; }

/* ── 19. Blog ───────────────────────────────────────────── */
.blog-hero {
  background: linear-gradient(180deg, var(--primary-light), var(--surface));
  border-bottom: 1px solid var(--border-2);
  padding-block: clamp(2.5rem, 6vw, 4rem);
  text-align: center;
}
.blog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: var(--s-6);
  content-visibility: auto;
  contain-intrinsic-size: auto 900px;
}
.blog-card {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition: transform var(--transition), box-shadow var(--transition);
}
.blog-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.blog-card { padding: var(--s-6); }
.blog-card-tag {
  align-self: flex-start;
  display: inline-flex;
  padding: 3px 10px;
  margin-bottom: var(--s-3);
  background: var(--primary-light);
  color: var(--primary-dark);
  font-size: .72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  border-radius: var(--r-full);
}
.blog-card-title { font-size: 1.2rem; font-weight: 700; line-height: 1.35; margin-bottom: var(--s-2); color: var(--text); }
.blog-card-title a { color: inherit; }
.blog-card-title a:hover { color: var(--primary); }
.blog-card-excerpt { font-size: .95rem; color: var(--text-2); line-height: 1.65; flex: 1; margin-bottom: var(--s-4); }
.blog-card-meta { display: flex; align-items: center; gap: var(--s-3); font-size: .82rem; color: var(--text-2); font-weight: 500; }

.post-header { max-width: 760px; margin-inline: auto; padding-block: var(--s-8) var(--s-6); text-align: center; }
.post-category {
  display: inline-flex;
  padding: 4px 14px;
  margin-bottom: var(--s-4);
  background: var(--primary-light);
  color: var(--primary-dark);
  font-size: .78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  border-radius: var(--r-full);
}
.post-meta { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: var(--s-3); margin-top: var(--s-4); font-size: .9rem; color: var(--text-2); }
.post-body { max-width: 760px; margin-inline: auto; }

.calculator-cta {
  margin-block: var(--s-8);
  padding: var(--s-8);
  text-align: center;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  border-radius: var(--r-xl);
  color: #fff;
  box-shadow: var(--shadow-primary);
  content-visibility: auto;
  contain-intrinsic-size: auto 260px;
}
.calculator-cta h2, .calculator-cta h3 { color: #fff; margin-bottom: var(--s-3); }
.calculator-cta p { color: #dbe7ff; margin-bottom: var(--s-5); max-width: 520px; margin-inline: auto; }

.related-posts { margin-top: var(--s-12); }

/* ── 20. Ad units ───────────────────────────────────────── */
.ad-unit {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--s-2);
  margin-block: var(--s-6);
  background: var(--primary-light);
  border: 1.5px dashed #9db8f5;
  border-radius: var(--r);
  overflow: hidden;
}
.ad-label {
  font-size: .68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .12em;
  color: var(--primary-dark);
}
.ad-unit ins { display: block; width: 100%; }
.ad-leaderboard { min-height: 90px; width: 100%; }
.ad-rectangle { min-height: 250px; width: 100%; max-width: 336px; margin-inline: auto; }

/* ── 21. Footer ─────────────────────────────────────────── */
.site-footer {
  background: #111827;
  color: #9ca3af;
  padding-top: var(--s-16);
}
.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: var(--s-10);
  max-width: var(--maxw);
  margin-inline: auto;
  padding: 0 var(--s-6) var(--s-12);
}
.footer-col h4 {
  font-size: .8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: #fff;
  margin-bottom: var(--s-4);
}
.footer-logo {
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
  font-size: 1.3rem;
  font-weight: 800;
  color: #fff;
  margin-bottom: var(--s-3);
}
.footer-logo:hover { color: #93c5fd; }
.footer-col p { font-size: .9rem; line-height: 1.65; color: #9ca3af; }
.footer-links { display: flex; flex-direction: column; gap: var(--s-2); }
.footer-links a { font-size: .9rem; color: #9ca3af; }
.footer-links a:hover { color: #fff; }

.footer-bottom {
  border-top: 1px solid #1f2937;
  max-width: var(--maxw);
  margin-inline: auto;
  padding: var(--s-6);
}
.footer-copyright { font-size: .85rem; color: #9ca3af; margin-bottom: var(--s-2); }
.footer-disclaimer { font-size: .78rem; color: #9ca3af; line-height: 1.6; max-width: 900px; }

/* ── 22. Cookie banner ──────────────────────────────────── */
.cookie-banner {
  position: fixed;
  left: var(--s-4);
  right: var(--s-4);
  bottom: var(--s-4);
  z-index: var(--z-cookie);
  background: #111827;
  color: #e5e7eb;
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-lg);
  padding: var(--s-5) var(--s-6);
}
.cookie-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-6);
  flex-wrap: wrap;
  max-width: var(--maxw);
  margin-inline: auto;
}
.cookie-content p { font-size: .9rem; color: #d1d5db; flex: 1; min-width: 240px; margin: 0; }
.cookie-content a { color: #93c5fd; text-decoration: underline; }
.cookie-actions { display: flex; gap: var(--s-3); flex-shrink: 0; }

/* ── 23. Back to top ────────────────────────────────────── */
.back-to-top {
  position: fixed;
  right: var(--s-6);
  bottom: var(--s-6);
  z-index: var(--z-float);
  width: 46px; height: 46px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: var(--r-full);
  cursor: pointer;
  font-size: 1.2rem;
  box-shadow: var(--shadow-lg);
  opacity: 0;
  pointer-events: none;
  transform: translateY(12px);
  transition: opacity var(--transition), transform var(--transition), background var(--transition-fast);
}
.back-to-top.visible { opacity: 1; pointer-events: auto; transform: translateY(0); }
.back-to-top:hover { background: var(--primary-dark); }

/* ── 24. Calc disclaimer (shared placement) ─────────────── */
.calc-disclaimer {
  margin-top: var(--s-6);
  padding: var(--s-4) var(--s-5);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--r);
  font-size: .82rem;
  color: var(--text-2);
  line-height: 1.65;
}
.calc-disclaimer strong { color: var(--text); }

/* ── 25. Responsive ─────────────────────────────────────── */
@media (max-width: 1280px) {
  .dropdown-menu { min-width: 460px; }
}

@media (max-width: 1024px) {
  .main-nav, .nav-cta { display: none; }
  .hamburger { display: flex; }
  .footer-grid { grid-template-columns: 1fr 1fr; gap: var(--s-8); }
}

@media (max-width: 768px) {
  .footer-grid { grid-template-columns: 1fr; gap: var(--s-6); }
  .cookie-content { flex-direction: column; align-items: stretch; }
  .cookie-actions { justify-content: stretch; }
  .cookie-actions .btn { flex: 1; }
  .hero-stat { min-width: 120px; padding: var(--s-3) var(--s-4); }
  .stat-number { font-size: 1.6rem; }
}

@media (max-width: 480px) {
  .container { padding-inline: var(--s-4); }
  .header-inner { padding-inline: var(--s-4); }
  .hero-stats { gap: var(--s-2); }
  .hero-stat { flex: 1 1 100px; min-width: 0; }
  .back-to-top { right: var(--s-4); bottom: var(--s-4); }
}

/* ── 26. Reduced motion ─────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  * {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}

/* ── 27. Print ──────────────────────────────────────────── */
@media print {
  .site-header, .mobile-nav, .hamburger, .nav-cta,
  .site-footer, .cookie-banner, .back-to-top,
  .ad-unit, .ad-leaderboard, .ad-rectangle,
  .btn, .btn-calculate, .btn-reset, .table-expand-btn,
  .breadcrumb, .related-section, .calculator-cta {
    display: none !important;
  }
  body { background: #fff; color: #000; }
  * { box-shadow: none !important; }
  a { color: #000; text-decoration: none; }
}
