/* ============================================================
   Saving Calculators — Design System v2
   Single theme: Editor's Black on warm off-white.
   Two-column page layout: main content + sticky right rail
   (ads + nav widgets), reused across homepage and tool pages.
   ============================================================ */

/* ---------- Tokens ---------- */
:root {
  /* Surface */
  --bg: #FBFBF8;
  --surface: #FFFFFF;
  --surface-soft: #F4F4F0;
  --border: #E8E8E3;
  --border-strong: #D8D8D2;

  /* Text */
  --text: #0E1411;
  --text-muted: #6B6F6A;
  --text-faint: #7A7E78;

  /* Default theme = BLACK */
  --accent: #0E1411;
  --accent-soft: #F4F4F0;
  --accent-on: #FFFFFF;
  --accent-hairline: rgba(14, 20, 17, 0.18);

  /* Secondary accent: section labels + interactive hover state */
  --green:        #5DB075;
  --green-deep:   #4A9560;
  --green-soft:   #E8F4ED;

  /* Type */
  --font-sans: "Inter", "Poppins", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-serif: "DM Serif Display", Georgia, serif;
  --font-serif-body: "Sora", sans-serif;

  /* Geometry */
  --radius-sm: 8px;
  --radius:    12px;
  --radius-lg: 14px;
  --radius-pill: 999px;

  /* Spacing scale (8px grid) */
  --s-1: 4px;
  --s-2: 8px;
  --s-3: 12px;
  --s-4: 16px;
  --s-5: 20px;
  --s-6: 24px;
  --s-8: 32px;
  --s-10: 40px;
  --s-12: 48px;
  --s-16: 64px;
  --s-20: 80px;
  --s-24: 96px;

  /* Container */
  --max-w: 1200px;

  /* Motion */
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font-sans);
  color: var(--text);
  background: var(--bg);
  font-size: 16px;
  line-height: 1.55;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; border: 0; background: transparent; color: inherit; }
input { font: inherit; color: inherit; }
ul { list-style: none; padding: 0; margin: 0; }

/* ---------- Layout primitives ---------- */
.container {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 var(--s-6);
  position: relative;
  z-index: 1;
}

.section { padding: var(--s-12) 0; }
.section--tight { padding: var(--s-8) 0; }

.eyebrow {
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  margin: 0 0 var(--s-3) 0;
  display: flex;
  align-items: center;
  gap: 8px;
}
.eyebrow .dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--accent);
  display: inline-block;
}
/* Section-header eyebrows (those with a leading dot) get the green accent */
.eyebrow:has(.dot) {
  color: var(--green);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.eyebrow:has(.dot) .dot {
  background: var(--green);
}
.eyebrow--inline { margin: 0; }

/* Generic hide helper used by the search/category filter */
.is-hidden { display: none !important; }

h1 { font-family: var(--font-serif); font-weight: 400; letter-spacing: -0.02em; margin: 0; color: var(--text); line-height: 1.15; }
h2, h3, h4 { font-weight: 700; letter-spacing: -0.02em; margin: 0; color: var(--text); }
h2 { font-size: 28px; line-height: 1.2; }
h3 { font-size: 20px; line-height: 1.3; }

/* ---------- Navbar ---------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(251, 251, 248, 0.92);
  backdrop-filter: saturate(140%) blur(8px);
  -webkit-backdrop-filter: saturate(140%) blur(8px);
  border-bottom: 1px solid var(--border);
}
.nav__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 var(--s-6);
}
.brand,
.nav__brand {
  display: inline-flex;
  align-items: center;
  gap: var(--s-1);
  font-size: 18px;
  letter-spacing: -0.01em;
  text-decoration: none;
  color: var(--text);
}
.brand__logo,
.nav__logo,
.footer__brand__logo img {
  width: 20px;
  height: 20px;
  object-fit: contain;
  display: block;
}
.brand__text { font-weight: 400; color: var(--text-muted); }
.brand__text strong { font-weight: 700; color: var(--accent); }

.nav__links {
  display: flex;
  gap: var(--s-8);
  font-size: 14px;
  font-weight: 500;
  color: var(--text-muted);
}
.nav__links a { transition: color 0.15s var(--ease); }
.nav__links a:hover { color: var(--text); }

/* ---------- Hamburger toggle ---------- */
.nav__toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 36px;
  height: 36px;
  padding: 6px;
  background: none;
  border: none;
  cursor: pointer;
  border-radius: var(--radius-sm);
}
.nav__toggle span {
  display: block;
  width: 20px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: transform 0.22s var(--ease), opacity 0.22s var(--ease);
}
.nav__toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav__toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; transform: scaleX(0); }
.nav__toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
.nav__mobile {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  padding: var(--s-3) var(--s-6) var(--s-5);
  z-index: 49;
  box-shadow: 0 8px 24px -8px rgba(14,20,17,0.12);
}
.nav__mobile.is-open { display: block; }
.nav__mobile nav { display: flex; flex-direction: column; }
.nav__mobile a {
  font-size: 15px;
  font-weight: 500;
  color: var(--text);
  padding: var(--s-3) 0;
  border-bottom: 1px solid var(--border);
  text-decoration: none;
  transition: color 0.15s var(--ease);
}
.nav__mobile a:last-child { border-bottom: none; }
.nav__mobile a:hover { color: var(--accent); }
@media (max-width: 720px) { .nav__toggle { display: flex; } }

/* ---------- Top utility bar (search) ---------- */
.top {
  padding: var(--s-12) 0 var(--s-6) 0;
}
.search {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
  height: 48px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0 var(--s-4);
  transition: border-color 0.15s var(--ease), box-shadow 0.15s var(--ease);
}
.search:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-hairline);
}
.search__icon {
  color: var(--text-muted);
  flex-shrink: 0;
}
.search__input {
  flex: 1;
  height: 100%;
  border: 0;
  outline: 0;
  margin-left: var(--s-3);
  background: transparent;
  font-size: 15px;
  color: var(--text);
}
.search__input::placeholder { color: var(--text-faint); }

/* ---------- Category tabs ---------- */
.cats {
  display: flex;
  gap: var(--s-2);
  flex-wrap: wrap;
  margin: var(--s-6) 0 0 0;
}
.cat {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 13px;
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  flex-shrink: 0;
  color: var(--text-muted);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition: all 0.15s var(--ease);
}
.cat:hover {
  color: var(--text);
  border-color: var(--border-strong);
}
.cat[aria-pressed="true"] {
  background: var(--accent);
  color: var(--accent-on);
  border-color: var(--accent);
}

/* ---------- Two-column layout (main + rail) ---------- */
.layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: var(--s-10);
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 var(--s-6);
  align-items: start;
}
.layout__main { min-width: 0; }
/* Right rail starts 100px lower than main column on all layout pages */
.layout__rail {
  align-self: start;
  padding-top: 100px;
}

/* Sections inside the main column are no longer .container-width;
   the .layout already handles centering + padding */
.layout__main .section,
.layout__main .section--tight {
  padding-left: 0;
  padding-right: 0;
}

/* ---------- Tool card grid ---------- */
.grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--s-5);
  margin-top: var(--s-6);
}
.grid--secondary {
  grid-template-columns: repeat(4, 1fr);
  gap: var(--s-4);
}

.card {
  display: flex;
  flex-direction: column;
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--s-6);
  min-height: 168px;
  transition: border-color 0.18s var(--ease), transform 0.18s var(--ease), box-shadow 0.18s var(--ease);
}
.card:hover {
  border-color: var(--accent-hairline);
  transform: translateY(-1px);
  box-shadow: 0 6px 20px -12px rgba(14, 20, 17, 0.18);
}
.card__icon {
  width: 40px;
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--accent-soft);
  border-radius: 10px;
  color: var(--accent);
  margin-bottom: var(--s-4);
}
.card__icon svg { width: 22px; height: 22px; }
.card__title {
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--text);
  margin: 0 0 var(--s-2) 0;
  transition: color 0.18s var(--ease);
}
.card:hover .card__title { color: var(--green-deep); }
.card__desc {
  font-size: 13.5px;
  line-height: 1.5;
  color: var(--text-muted);
  margin: 0;
}
.card__arrow {
  position: absolute;
  right: var(--s-5);
  bottom: var(--s-5);
  color: var(--text-faint);
  transition: transform 0.18s var(--ease), color 0.18s var(--ease);
}
.card:hover .card__arrow {
  color: var(--accent);
  transform: translateX(3px);
}

/* Secondary (compact) card */
.card--compact {
  flex-direction: row;
  align-items: center;
  padding: var(--s-4) var(--s-5);
  min-height: 0;
  gap: var(--s-3);
}
.card--compact .card__icon {
  width: 36px; height: 36px;
  margin-bottom: 0;
  flex-shrink: 0;
  border-radius: 8px;
}
.card--compact .card__icon svg { width: 18px; height: 18px; }
.card--compact .card__title {
  font-size: 13.5px;
  font-weight: 600;
  margin: 0;
  line-height: 1.25;
}
.card--compact .card__arrow {
  position: static;
  margin-left: auto;
}

/* ---------- Ad slots ---------- */
/* Fake placeholder visuals (dashed border, "Advertisement 728 x 90" labels,
   reserved empty grey/cream boxes) are hidden by default. The <ins.adsbygoogle>
   hooks remain intact so real AdSense units can render when activated.
   When AdSense fills the <ins>, :has() restores a wrapper that lets the unit
   display naturally. */
.ad {
  position: relative;
  display: block;
  background: transparent;
  border: 0;
  color: transparent;
  margin: 0;
  padding: 0;
  width: 100%;
  max-width: none;
  height: 0;
  min-height: 0;
  overflow: hidden;
}
.ad__placeholder {
  display: none !important;
}
.ad .adsbygoogle {
  display: block;
  width: 100%;
  height: auto;
}
.ad:has(.adsbygoogle[data-ad-status="filled"]) {
  height: auto;
  margin: var(--s-10) auto;
}
.ad--leaderboard:has(.adsbygoogle[data-ad-status="filled"]) { max-width: 728px; }
.ad--rectangle:has(.adsbygoogle[data-ad-status="filled"])   { max-width: 728px; }
.ad--medium:has(.adsbygoogle[data-ad-status="filled"])      { max-width: 300px; }
.ad--tall:has(.adsbygoogle[data-ad-status="filled"])        { max-width: 300px; }
.ad--inline:has(.adsbygoogle[data-ad-status="filled"])      { max-width: 100%; margin: var(--s-12) auto; }

/* Collapse the rail wrapper around an unfilled ad so the bottom border /
   padding gap doesn't show as an empty strip. Rail widget reappears once
   AdSense fills its <ins>. */
.rail__widget:has(> .ad:only-child):not(:has(.adsbygoogle[data-ad-status="filled"])) {
  display: none;
}

/* Same idea for the pre-footer inline ad band: hide the bordered band when
   the only content is an unfilled placeholder ad. */
.prefooter:has(.ad):not(:has(.adsbygoogle[data-ad-status="filled"])) {
  display: none;
}

/* ---------- Blog well (no inner sidebar — rail handles that now) ---------- */
.well {
  display: block;
  margin-top: var(--s-6);
}

/* Featured article wrapper acts as a full-card link */
.featured {
  display: block;
  color: inherit;
  text-decoration: none;
  cursor: pointer;
}
.featured__media {
  aspect-ratio: 16 / 9;
  background: linear-gradient(135deg, var(--accent-soft) 0%, var(--surface-soft) 100%);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
  margin-bottom: var(--s-5);
  transition: border-color 0.25s var(--ease);
}
.featured__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.5s var(--ease), filter 0.3s var(--ease);
}
.featured:hover .featured__media {
  border-color: var(--green);
}
.featured:hover .featured__media img {
  transform: scale(1.03);
  filter: saturate(1.05);
}
/* Legacy SVG fallback (only renders when no <img> child is present) */
.featured__media svg {
  width: 64px; height: 64px;
  opacity: 0.7;
  transition: opacity 0.25s var(--ease), transform 0.35s var(--ease);
  color: var(--accent);
}
.featured:hover .featured__media svg {
  opacity: 1;
  transform: scale(1.06);
  color: var(--green-deep);
}

.featured__tag {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.14em;
  color: var(--accent);
  margin-bottom: var(--s-3);
}
.featured__title {
  font-family: var(--font-serif-body);
  font-size: 28px;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.2;
  margin: 0 0 var(--s-3) 0;
  transition: color 0.2s var(--ease);
}
.featured:hover .featured__title { color: var(--green-deep); }
.featured__excerpt {
  font-size: 15px;
  color: var(--text-muted);
  margin: 0 0 var(--s-4) 0;
  max-width: 580px;
}
.read-more {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  font-weight: 600;
  color: var(--accent);
  transition: gap 0.15s var(--ease);
}
.read-more:hover { gap: 10px; }

/* ---------- Article rows ---------- */
.articles--3col {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--s-5);
  margin-top: var(--s-6);
}
.articles--4col {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--s-5);
  margin-top: var(--s-6);
}
.article {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  color: inherit;
  text-decoration: none;
  cursor: pointer;
  transition: border-color 0.2s var(--ease),
              transform 0.2s var(--ease),
              box-shadow 0.2s var(--ease);
}
.article:hover {
  border-color: var(--green);
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(14, 20, 17, 0.06);
}
.article__media {
  aspect-ratio: 16 / 9;
  background: linear-gradient(135deg, var(--accent-soft) 0%, var(--surface-soft) 100%);
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
}
.article__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.4s var(--ease), filter 0.3s var(--ease);
}
.article:hover .article__media img {
  transform: scale(1.05);
  filter: saturate(1.05);
}
/* Legacy SVG fallback (only renders when no <img> child is present) */
.article__media svg {
  width: 36px; height: 36px;
  opacity: 0.55;
  transition: opacity 0.25s var(--ease), transform 0.3s var(--ease);
}
.article:hover .article__media svg {
  opacity: 1;
  transform: scale(1.08);
}
.article__body { padding: var(--s-4) var(--s-5) var(--s-5); }
.article__title {
  font-family: var(--font-serif-body);
  font-size: 18px;
  font-weight: 400;
  line-height: 1.35;
  margin: 0 0 var(--s-2) 0;
  letter-spacing: -0.01em;
  color: var(--text);
  text-decoration: none;
  transition: color 0.18s var(--ease);
}
.article:hover .article__title { color: var(--green-deep); }
.article__excerpt {
  font-size: 13px;
  color: var(--text-muted);
  margin: 0;
  line-height: 1.5;
}
.article__meta {
  margin-top: var(--s-3);
  font-size: 12px;
  color: var(--text-faint);
  letter-spacing: 0.04em;
}

/* Compact article (4col) */
.article--compact .article__body { padding: var(--s-3) var(--s-4); }
.article--compact .article__title { font-size: 18px; }

/* ---------- About band (full-width, sits between prefooter ad and footer) ---------- */
.about-band {
  border-top: 1px solid var(--border);
  padding: var(--s-8) 0 var(--s-8);
}
.about {
  max-width: 920px;
  margin: 0 auto;
  text-align: left;
}
.about__title {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.015em;
  margin: 0 0 var(--s-5) 0;
  color: var(--text);
}
.about__cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--s-10);
}
.about__body {
  font-size: 15px;
  color: var(--text-muted);
  line-height: 1.75;
  margin: 0;
}

/* ---------- Right rail widgets ---------- */
.rail__widget {
  padding: var(--s-5) 0;
  border-bottom: 1px solid var(--border);
}
.rail__widget:first-child { padding-top: 0; }
.rail__widget:last-child  { border-bottom: 0; }

.rail__label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin: 0 0 var(--s-3) 0;
}

.rail__list { display: flex; flex-direction: column; gap: 2px; }
.rail__list a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-3);
  padding: 8px 0;
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  border-bottom: 1px solid transparent;
  transition: color 0.15s var(--ease);
}
.rail__list a:hover { color: var(--green-deep); }
.rail__list a .count {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-faint);
  letter-spacing: 0.02em;
}
.rail__list a .rank {
  display: inline-block;
  width: 18px;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-faint);
  letter-spacing: 0.04em;
}
.rail__list a:hover .rank { color: var(--green-deep); }
.rail__rank-row {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.rail__tip {
  font-size: 13px;
  line-height: 1.55;
  color: var(--text-muted);
}
.rail__tip strong { color: var(--text); font-weight: 600; }

/* ---- Rail: popular articles ---- */
.rail__article {
  display: flex;
  gap: var(--s-4);
  align-items: flex-start;
  padding: var(--s-4) 0;
  text-decoration: none;
  color: inherit;
  border-bottom: 1px solid var(--border);
  transition: color 0.15s var(--ease);
}
.rail__article:last-child { border-bottom: none; }
.rail__article:hover { color: var(--green-deep); }
.rail__article__thumb {
  width: 120px;
  height: 86px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  flex-shrink: 0;
  background: var(--surface-soft);
}
.rail__article__title {
  font-family: var(--font-serif-body);
  font-size: 16px;
  font-weight: 400;
  line-height: 1.4;
  color: var(--text);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  line-clamp: 3;
  overflow: hidden;
}
.rail__article:hover .rail__article__title { color: var(--green-deep); }

/* Rail-sized ad placeholder helper */
.rail .ad { margin: 0; }

/* ---------- Footer ---------- */
.footer {
  margin-top: var(--s-4);
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding: var(--s-6) 0 var(--s-4);
}
.footer__grid {
  display: grid;
  grid-template-columns: 1.6fr 1fr 1fr 1fr;
  gap: var(--s-10);
  align-items: start;
}

/* Brand column */
.footer__brand__logo {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 6px;
}
.footer__brand__logo img { border-radius: 6px; }
.footer__copyright {
  font-size: 12px;
  color: var(--text-faint);
  margin: 0;
}
.footer__brand__desc {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.65;
  margin: 0 0 var(--s-4) 0;
  max-width: 230px;
}
.footer__badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.footer__badges span {
  font-size: 11px;
  font-weight: 500;
  color: var(--text-faint);
  background: var(--surface-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  padding: 2px 9px;
}

/* Pre-footer inline ad band */
.prefooter {
  border-top: 1px solid var(--border);
  margin-top: var(--s-16);
  padding: var(--s-8) 0;
}
.prefooter .ad { margin: 0 auto; }
.footer__col h3,
.footer__col h4 {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin: 0 0 var(--s-3) 0;
  color: var(--text);
}
.footer__col ul {
  list-style: none;
  padding: 0;
  margin: 0;
}
.footer__col ul li {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 5px;
}
.footer__col ul li a { color: var(--text-muted); text-decoration: none; }
.footer__col ul li a:hover { color: var(--text); }

.footer__disclaimer {
  margin: var(--s-5) 0 var(--s-3) 0;
  padding-top: var(--s-4);
  border-top: 1px solid var(--border);
  font-size: 12px;
  line-height: 1.6;
  color: var(--text-faint);
  max-width: 880px;
}
.footer__disclaimer strong {
  color: var(--text-muted);
  font-weight: 600;
}

.footer__bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--s-8);
  font-size: 12px;
  color: var(--text-faint);
  margin-top: var(--s-6);
  padding-top: var(--s-4);
  border-top: 1px solid var(--border);
}
.footer__bottom__disclaimer {
  flex: 1;
  min-width: 0;
  line-height: 1.5;
  overflow-wrap: break-word;
  word-break: break-word;
}
.footer__bottom__disclaimer a {
  color: var(--text-muted);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.footer__bottom__disclaimer a:hover { color: var(--text); }

/* ---------- Section header ---------- */
.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: var(--s-2);
}
.section-head .eyebrow { margin: 0; }
.section-head a {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
}
.section-head a:hover { color: var(--green-deep); }

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
  .layout { grid-template-columns: 1fr; gap: var(--s-8); }
  .grid--secondary { grid-template-columns: repeat(4, 1fr); }
  .articles--4col { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 900px) {
  .grid { grid-template-columns: repeat(2, 1fr); }
  .grid--secondary { grid-template-columns: repeat(3, 1fr); }
  .articles--3col { grid-template-columns: repeat(2, 1fr); }
  .articles--4col { grid-template-columns: repeat(3, 1fr); }
  .footer__grid { grid-template-columns: 1fr 1fr; gap: var(--s-8); }
  .about__cols { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  .nav__links { display: none; }
  .grid, .grid--secondary { grid-template-columns: 1fr 1fr; }
  .articles--3col, .articles--4col { grid-template-columns: 1fr 1fr; }
  .top { padding-top: var(--s-8); }
  .ad { margin: var(--s-8) 0; }
  .featured__title { font-size: 22px; }
  .footer__grid { grid-template-columns: 1fr; gap: var(--s-5); }
  .footer__brand__desc { max-width: 100%; }
  .about__cols { grid-template-columns: 1fr; }
  .footer__bottom { flex-direction: column; gap: var(--s-2); }
}
@media (max-width: 480px) {
  .grid, .grid--secondary,
  .articles--3col, .articles--4col { grid-template-columns: 1fr; }
  .card--compact .card__title { font-size: 14px; }
}

/* ============================================================
   TOOL PAGE & CATEGORY PAGE
   Used by /<tool-slug>/ and /<category-slug>/
   Reuses .layout (main + sticky rail) from the homepage.
   ============================================================ */

/* ---------- Breadcrumb ---------- */
.breadcrumb {
  padding: var(--s-3) 0 0 0;
  font-size: 13px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}
.breadcrumb a { color: var(--text-muted); transition: color 0.15s var(--ease); }
.breadcrumb a:hover { color: var(--accent); }
.breadcrumb__sep { color: var(--text-faint); }
.breadcrumb [aria-current="page"] { color: var(--text); font-weight: 500; }

/* ---------- Tool header ---------- */
.tool-head {
  padding: var(--s-3) 0 var(--s-5) 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: var(--s-5);
}
.tool-head h1 {
  font-size: 36px;
  line-height: 1.1;
  margin: 0 0 var(--s-3) 0;
  letter-spacing: -0.025em;
}
.tool-head__lede {
  font-size: 15px;
  line-height: 1.55;
  color: var(--text-muted);
  max-width: 60ch;
  margin: 0;
}

/* ---------- Calculator card ---------- */
.calc {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--s-8);
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--s-8);
  align-items: start;
}
.calc__inputs {
  display: flex;
  flex-direction: column;
  gap: var(--s-5);
}
.calc__section-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--text-faint);
  padding-top: var(--s-3);
  border-top: 1px solid var(--border);
  margin-top: var(--s-2);
  margin-bottom: 0;
}
.calc__field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.calc__label {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.calc__hint {
  display: none;
}
.calc__input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}
.calc__prefix,
.calc__suffix {
  position: absolute;
  font-size: 14px;
  color: var(--text-muted);
  pointer-events: none;
  font-weight: 500;
}
.calc__prefix { left: var(--s-3); }
.calc__suffix { right: var(--s-3); }
.calc__input,
.calc__select {
  width: 100%;
  height: 44px;
  padding: 0 var(--s-3);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 15px;
  font-weight: 500;
  color: var(--text);
  outline: none;
  transition: border-color 0.15s var(--ease), box-shadow 0.15s var(--ease);
  appearance: none;
  -moz-appearance: textfield;
}
.calc__input::-webkit-outer-spin-button,
.calc__input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
.calc__input:has(+ .calc__suffix),
.calc__input-wrap:has(.calc__prefix) .calc__input { padding-left: var(--s-8); }
.calc__input-wrap:has(.calc__suffix) .calc__input { padding-right: var(--s-8); }
.calc__input:focus,
.calc__select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-hairline);
}
.calc__select {
  appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%236B6F6A' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='m6 9 6 6 6-6'/></svg>");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: var(--s-8);
  cursor: pointer;
}

/* ---------- Calculator results ---------- */
.calc__results-col {
  display: flex;
  flex-direction: column;
  gap: var(--s-3);
  align-self: stretch;
}
.calc__results {
  background: var(--surface-soft);
  border-radius: var(--radius);
  padding: var(--s-6);
  display: flex;
  flex-direction: column;
  gap: var(--s-4);
}
.calc__results-actions {
  display: flex;
  justify-content: flex-end;
}
.calc__results-actions .calc__btn {
  /* Compact pill, sits at bottom-right of the results column. */
  width: auto;
  min-width: 140px;
  justify-content: center;
}
.calc__result {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.calc__result-label {
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-muted);
}
/* Visual hierarchy ladder for result values:
     primary  → 40px  green   (the headline answer)
     default  → 22px  dark    (medium — secondary stats)
     small    → 16px  muted   (small — auxiliary numbers; opt-in via class) */
.calc__result-value {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.015em;
  color: var(--text);
  font-variant-numeric: tabular-nums;
  line-height: 1.15;
}
.calc__result-value--primary {
  color: var(--green-deep);
  font-size: 40px;
  letter-spacing: -0.025em;
  font-weight: 800;
  line-height: 1.05;
}
.calc__result-value--small {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-muted);
}
.calc__result {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.calc__result-label {
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.calc__result-hint {
  font-size: 12px;
  color: var(--text-faint);
  line-height: 1.45;
  margin-top: 2px;
}
.calc__result-hint svg {
  width: 12px;
  height: 12px;
  vertical-align: -1px;
  margin-right: 3px;
  color: var(--text-faint);
}
.calc__result-value--text { font-size: 15px; font-weight: 500; letter-spacing: 0; line-height: 1.4; }
.calc__result-sub {
  font-size: 13px;
  color: var(--text-muted);
}

/* ---------- CD calculator pilot — example-mode mute (CD ONLY) ----------
   Scoped to .calc--cd-example-mode so it can ONLY affect CD calculator's
   .calc card. Mutes only the result values (not inputs/labels). The class
   is added by cd_calculator's calc_js when no numeric input has a user
   value, and removed the moment the user types. */
.calc--cd-example-mode .calc__result-value {
  opacity: 0.55;
  transition: opacity 0.18s var(--ease);
}

/* ---------- Batch 1 — example-mode mute, per-tool scoped ----------
   Same pattern as CD, scoped to its own per-tool class. Each toggle is
   handled in that tool's own calc_js — no shared helper changes. */
.calc--hy-example-mode .calc__result-value,
.calc--sg-example-mode .calc__result-value,
.calc--si-example-mode .calc__result-value,
.calc--ci-example-mode .calc__result-value,
.calc--fv-example-mode .calc__result-value,
.calc--pl-example-mode .calc__result-value,
.calc--lp-example-mode .calc__result-value,
.calc--sl-example-mode .calc__result-value,
.calc--ccp-example-mode .calc__result-value,
.calc--dti-example-mode .calc__result-value,
.calc--apy-example-mode .calc__result-value,
.calc--r72-example-mode .calc__result-value,
.calc--sr-example-mode .calc__result-value,
.calc--up-example-mode .calc__result-value,
.calc--rs-example-mode .calc__result-value,
.calc--b1080-example-mode .calc__result-value,
.calc--ef-example-mode .calc__result-value,
.calc--eb-example-mode .calc__result-value,
.calc--ot-example-mode .calc__result-value,
.calc--pr-example-mode .calc__result-value,
.calc--k401-example-mode .calc__result-value,
.calc--cf-example-mode .calc__result-value,
.calc--ir-example-mode .calc__result-value,
.calc--mms-example-mode .calc__result-value,
.calc--mep-example-mode .calc__result-value,
.calc--ds-example-mode .calc__result-value,
.calc--ha-example-mode .calc__result-value,
.calc--col-example-mode .calc__result-value,
.calc--ri-example-mode .calc__result-value,
.calc--pc-example-mode .calc__result-value,
.calc--st-example-mode .calc__result-value,
.calc--pt-example-mode .calc__result-value,
.calc--tr-example-mode .calc__result-value,
.calc--bt-example-mode .calc__result-value,
.calc--cg-example-mode .calc__result-value,
.calc--tip-example-mode .calc__result-value,
.calc--al-example-mode .calc__result-value,
.calc--inf-example-mode .calc__result-value {
  opacity: 0.55;
  transition: opacity 0.18s var(--ease);
}

/* ---------- Related calculators strip ---------- */
.related-strip {
  display: grid;
  /* auto-fit + a higher minimum keeps "X Calculator" on one line.
     Names can also wrap inside the pill if they truly don't fit. */
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: var(--s-3);
  margin-top: var(--s-4);
}
.rel-card {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  padding: var(--s-4) var(--s-4);
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 10px;
  text-decoration: none;
  color: var(--text);
  transition: border-color 0.15s var(--ease), box-shadow 0.15s var(--ease);
}
.rel-card:hover {
  border-color: var(--accent);
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}
.rel-card__icon {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  background: var(--bg-card);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
}
.rel-card__icon svg { width: 18px; height: 18px; }
.rel-card__name {
  flex: 1;
  font-size: 13.5px;
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: -0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}
.rel-card__arrow {
  flex-shrink: 0;
  color: var(--text-faint);
  transition: color 0.15s var(--ease), transform 0.15s var(--ease);
}
.rel-card:hover .rel-card__arrow {
  color: var(--accent);
  transform: translateX(2px);
}

/* ---------- Tool body sections ---------- */
.tool-section {
  margin-top: var(--s-10);
}
.tool-section h2 {
  font-size: 24px;
  letter-spacing: -0.02em;
  margin: 0 0 var(--s-4) 0;
}
.tool-section p {
  font-size: 15.5px;
  line-height: 1.65;
  color: var(--text);
  margin: 0 0 var(--s-3) 0;
  max-width: 70ch;
}
.tool-section p strong { font-weight: 600; }
.tool-section a:not(.article):not(.rel-card) {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  text-decoration-color: var(--border-strong);
  transition: text-decoration-color 0.15s var(--ease);
}
.tool-section a:not(.article):not(.rel-card):hover { text-decoration-color: var(--accent); }

/* Formula display */
.formula {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius-sm);
  padding: var(--s-4) var(--s-5);
  margin: var(--s-4) 0;
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 15px;
  color: var(--text);
  overflow-x: auto;
}
.formula__legend {
  margin: var(--s-3) 0 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 6px var(--s-3);
  font-size: 14px;
  color: var(--text-muted);
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
}
.formula__legend dt { font-weight: 600; color: var(--text); }
.formula__legend dd { margin: 0; }

/* ---------- FAQ accordion ---------- */
.faq { display: flex; flex-direction: column; gap: 0; margin-top: var(--s-4); }
.faq__item {
  border-bottom: 1px solid var(--border);
}
.faq__item:first-child { border-top: 1px solid var(--border); }
.faq__q {
  width: 100%;
  text-align: left;
  padding: var(--s-4) 0;
  font-size: 15.5px;
  font-weight: 600;
  color: var(--text);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-3);
  cursor: pointer;
  list-style: none;
}
.faq__q::-webkit-details-marker { display: none; }
.faq__q::after {
  content: "";
  width: 12px;
  height: 12px;
  border-right: 2px solid var(--text-muted);
  border-bottom: 2px solid var(--text-muted);
  transform: rotate(45deg);
  margin-top: -4px;
  transition: transform 0.2s var(--ease);
  flex-shrink: 0;
}
.faq__item[open] .faq__q::after {
  transform: rotate(-135deg);
  margin-top: 4px;
}
.faq__a {
  padding: 0 0 var(--s-4) 0;
  font-size: 15px;
  line-height: 1.65;
  color: var(--text-muted);
  max-width: 70ch;
}

/* ---------- Source citation ---------- */
.source-cite {
  margin-top: var(--s-4);
  padding: var(--s-3) var(--s-4);
  background: var(--green-soft);
  border-radius: var(--radius-sm);
  font-size: 13px;
  color: var(--text-muted);
  border-left: 3px solid var(--green);
}
.source-cite strong { color: var(--text); font-weight: 600; }
.source-cite a { color: var(--green-deep); }

/* ---------- Category page ---------- */
.cat-head {
  padding: var(--s-5) 0 var(--s-5) 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: var(--s-3);
}
.cat-head h1 {
  font-size: 36px;
  line-height: 1.1;
  margin: 0 0 var(--s-3) 0;
  letter-spacing: -0.025em;
}
.cat-head__lede {
  font-size: 16px;
  line-height: 1.6;
  color: var(--text-muted);
  max-width: 65ch;
  margin: 0;
}

/* Sibling-category list (used in rail on category + tool pages) */
.sibling-cats { display: flex; flex-direction: column; }
.sibling-cats a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--s-3) 0;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
  color: var(--text);
  transition: color 0.15s var(--ease);
}
.sibling-cats a:last-child { border-bottom: 0; }
.sibling-cats a:hover { color: var(--green-deep); }
.sibling-cats a[aria-current="page"] {
  color: var(--green-deep);
  font-weight: 600;
}
.sibling-cats .count {
  font-size: 12px;
  color: var(--text-faint);
  font-variant-numeric: tabular-nums;
}

/* ---------- Responsive tool page ---------- */
@media (max-width: 800px) {
  .calc {
    grid-template-columns: 1fr;
    padding: var(--s-5);
    gap: var(--s-6);
  }
  .tool-head h1 { font-size: 27px; }
  .calc__result-value { font-size: 18px; }
  .calc__result-value--primary { font-size: 30px; }
}

/* ============================================================
   LEGAL PAGE (About / Contact / Privacy / Terms)
   Single-column, narrow line-length for comfortable reading.
   ============================================================ */
.legal-shell {
  max-width: 760px;
  margin: 0 auto;
  padding: var(--s-6);
}
.legal {
  padding: var(--s-8) 0;
}
.legal h1 {
  font-size: 36px;
  letter-spacing: -0.025em;
  margin: 0 0 var(--s-3) 0;
}
.legal__updated {
  font-size: 13px;
  color: var(--text-muted);
  margin: 0 0 var(--s-8) 0;
}
.legal__disclaimer-box {
  background: var(--surface-soft);
  border: 1px solid var(--border-strong);
  border-left: 4px solid var(--accent);
  border-radius: var(--radius);
  padding: var(--s-5) var(--s-6);
  margin: 0 0 var(--s-10) 0;
}
.legal__disclaimer-box h2 {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0;
  margin: 0 0 var(--s-3) 0;
  color: var(--text);
}
.legal__disclaimer-box p,
.legal__disclaimer-box li {
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.7;
}
.legal__disclaimer-box ul {
  margin: var(--s-3) 0;
  padding-left: var(--s-5);
}
.legal__disclaimer-box li { margin-bottom: var(--s-2); }
.legal h2 {
  font-size: 22px;
  letter-spacing: -0.02em;
  margin: var(--s-10) 0 var(--s-4) 0;
}
.legal h3 {
  font-size: 17px;
  margin: var(--s-6) 0 var(--s-3) 0;
}
.legal p,
.legal li {
  font-size: 15.5px;
  line-height: 1.7;
  color: var(--text);
  margin: 0 0 var(--s-3) 0;
  max-width: 70ch;
}
.legal ul,
.legal ol {
  padding-left: var(--s-5);
  margin: 0 0 var(--s-4) 0;
}
.legal ul li,
.legal ol li { margin-bottom: var(--s-2); }
.legal ul { list-style: disc; }
.legal ol { list-style: decimal; }
.legal a {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-color: var(--border-strong);
  text-underline-offset: 3px;
  transition: text-decoration-color 0.15s var(--ease);
}
.legal a:hover { text-decoration-color: var(--accent); }
.legal strong { font-weight: 600; }
.legal table {
  width: 100%;
  border-collapse: collapse;
  margin: var(--s-4) 0;
  font-size: 14.5px;
}
.legal th,
.legal td {
  padding: var(--s-3);
  border: 1px solid var(--border);
  text-align: left;
  vertical-align: top;
}
.legal th {
  background: var(--surface-soft);
  font-weight: 600;
}

@media (max-width: 600px) {
  .legal h1 { font-size: 28px; }
  .legal h2 { font-size: 19px; }
}

/* ---------- Accessibility utilities ---------- */
.skip-link {
  position: absolute;
  top: -100%;
  left: 8px;
  z-index: 9999;
  padding: 8px 16px;
  background: var(--accent);
  color: var(--accent-on);
  font-size: 14px;
  font-weight: 600;
  border-radius: 0 0 4px 4px;
  text-decoration: none;
  transition: top 0.15s;
}
.skip-link:focus {
  top: 0;
}
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ============================================================
   Tool Slider (secondary grid, 2-row paged carousel)
   ============================================================ */

.tool-slider { position: relative; }
.tool-slider__viewport { overflow: hidden; }
.tool-slider__track {
  display: flex;
  transition: transform 0.36s cubic-bezier(0.22, 0.61, 0.36, 1);
}
.tool-slider__page {
  min-width: 100%;
  flex-shrink: 0;
}
.tool-slider__controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--s-3);
  margin-top: var(--s-5);
}
.tool-slider__btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-pill);
  background: var(--surface);
  cursor: pointer;
  transition: background 0.15s var(--ease), border-color 0.15s var(--ease), color 0.15s var(--ease), opacity 0.15s var(--ease);
  color: var(--text);
}
.tool-slider__btn:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-on);
}
.tool-slider__btn.is-disabled {
  opacity: 0.25;
  pointer-events: none;
}
.tool-slider__dots {
  display: flex;
  gap: 6px;
  align-items: center;
}
.tool-slider__dot {
  width: 7px;
  height: 7px;
  border-radius: var(--radius-pill);
  background: var(--border-strong);
  border: none;
  cursor: pointer;
  padding: 0;
  transition: width 0.2s var(--ease), background 0.2s var(--ease);
}
.tool-slider__dot.is-active {
  width: 22px;
  background: var(--accent);
}

/* ============================================================
   Newsletter subscription band
   ============================================================ */

.newsletter {
  background: var(--surface-soft);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: var(--s-16) var(--s-6);
  margin: var(--s-12) 0;
}
.newsletter__inner {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--s-10);
  align-items: center;
  max-width: var(--max-w);
  margin: 0 auto;
}
.newsletter__title {
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.02em;
  color: var(--text);
  margin: 0 0 var(--s-3);
}
.newsletter__sub {
  font-size: 0.875rem;
  color: var(--text-muted);
  line-height: 1.65;
  margin: 0;
}
.newsletter__form {
  display: flex;
  flex-direction: column;
  gap: var(--s-3);
}
.newsletter__input {
  width: 100%;
  padding: 14px var(--s-4);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  font-size: 0.9rem;
  font-family: var(--font-sans);
  background: var(--surface);
  color: var(--text);
  outline: none;
  box-sizing: border-box;
  transition: border-color 0.15s var(--ease), box-shadow 0.15s var(--ease);
}
.newsletter__input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(14,20,17,0.08);
}
.newsletter__input::placeholder { color: var(--text-faint); }
.newsletter__btn {
  padding: 14px var(--s-5);
  background: var(--accent);
  color: var(--accent-on);
  border: none;
  border-radius: var(--radius);
  font-size: 0.875rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  cursor: pointer;
  transition: opacity 0.15s var(--ease);
}
.newsletter__btn:hover { opacity: 0.82; }
@media (max-width: 760px) {
  .newsletter__inner { grid-template-columns: 1fr; gap: var(--s-6); }
}

/* ============================================================
   Contact page (/contact/)
   ============================================================ */

.contact-shell {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: var(--s-10) var(--s-6) var(--s-20);
}
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1.3fr;
  gap: var(--s-16);
  align-items: start;
}
.contact__eyebrow {
  display: block;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--green);
  margin-bottom: var(--s-3);
}
.contact__title {
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.02em;
  color: var(--text);
  margin: 0 0 var(--s-5);
}
.contact__desc {
  font-size: 0.95rem;
  line-height: 1.75;
  color: var(--text-muted);
  margin: 0 0 var(--s-6);
}
.contact__desc a { color: var(--text); font-weight: 600; text-decoration: underline; }
.contact__meta { display: flex; flex-direction: column; gap: var(--s-4); }
.contact__meta-item {
  font-size: 0.875rem;
  line-height: 1.55;
  color: var(--text-muted);
  margin: 0;
}
.contact__meta-item strong { display: block; color: var(--text); font-weight: 600; margin-bottom: 2px; }
.contact-form-wrap {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--s-8);
  box-shadow: 0 2px 16px rgba(14,20,17,0.05);
}
.contact-form { display: flex; flex-direction: column; gap: var(--s-5); }
.contact-form__row { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s-4); }
.contact-form__field { display: flex; flex-direction: column; gap: 6px; }
.contact-form__field label {
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-faint);
}
.contact-form__field input,
.contact-form__field select,
.contact-form__field textarea {
  padding: 12px var(--s-4);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  font-size: 0.9rem;
  font-family: var(--font-sans);
  color: var(--text);
  background: var(--bg);
  outline: none;
  transition: border-color 0.15s var(--ease), box-shadow 0.15s var(--ease);
  resize: vertical;
  box-sizing: border-box;
  width: 100%;
}
.contact-form__field input:focus,
.contact-form__field select:focus,
.contact-form__field textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(14,20,17,0.08);
}
.contact-form__field input::placeholder,
.contact-form__field textarea::placeholder { color: var(--text-faint); }
.contact-form__submit {
  align-self: flex-start;
  padding: 13px var(--s-8);
  background: var(--accent);
  color: var(--accent-on);
  border: none;
  border-radius: var(--radius);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  letter-spacing: 0.02em;
  transition: opacity 0.15s var(--ease);
}
.contact-form__submit:hover { opacity: 0.84; }
.contact-form__success {
  display: none;
  padding: var(--s-4);
  background: var(--green-soft);
  border: 1px solid var(--green);
  border-radius: var(--radius);
  color: var(--green-deep);
  font-size: 0.875rem;
  font-weight: 500;
}
@media (max-width: 860px) {
  .contact-grid { grid-template-columns: 1fr; gap: var(--s-8); }
  .contact-form__row { grid-template-columns: 1fr; }
}

/* ============================================================
   Calculators Directory Page (/calculators/)
   ============================================================ */

.page-hero {
  padding: var(--s-6) 0 var(--s-4);
}
.page-hero__title {
  font-size: clamp(1.8rem, 4vw, 2.4rem);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.02em;
  color: var(--text);
  margin: 0 0 var(--s-3);
}
.page-hero__sub {
  font-size: 1rem;
  color: var(--text-muted);
  margin: 0;
}

.calcs-search {
  margin: 0;
}
.calcs-search .search { max-width: 420px; }

.cats-directory {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-2);
  margin-bottom: var(--s-5);
}
.cats-directory a {
  display: inline-block;
  padding: 6px 14px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-pill);
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-muted);
  text-decoration: none;
  transition: background 0.15s var(--ease), color 0.15s var(--ease), border-color 0.15s var(--ease);
}
.cats-directory a:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-on);
}

.cat-section {
  margin-bottom: var(--s-12);
  scroll-margin-top: 80px;
}
.cat-section__head {
  display: flex;
  align-items: baseline;
  gap: var(--s-3);
  margin-bottom: var(--s-4);
  padding-bottom: var(--s-3);
  border-bottom: 2px solid var(--border);
}
.cat-section__title {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text);
  margin: 0;
}
.cat-section__count {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-faint);
  background: var(--surface-soft);
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  letter-spacing: 0.03em;
}
.cat-section__more {
  display: inline-block;
  margin-top: var(--s-4);
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-muted);
  text-decoration: none;
}
.cat-section__more:hover { color: var(--green-deep); }

/* ============================================================
   ALL CALCULATORS PAGE — masonry-style category cards
   Outer layout uses CSS multi-column so cards flow naturally
   without the wasted vertical space a strict grid creates.
   Inside each card the tools are a single comfortable column
   (one per row) — easier to scan than a 2-col mini-grid.
   ============================================================ */
.cats-grid {
  /* 3 explicit columns. Each column is sized to fit ITS OWN widest card
     (not the widest in the whole grid). Cards stack vertically inside
     each column with no step-down gaps. */
  display: flex;
  align-items: flex-start;
  gap: var(--s-4);
  margin: var(--s-5) 0 var(--s-8) 0;
}
.cats-col {
  /* Each of the 3 inner columns. Width = its widest card's content + padding. */
  display: flex;
  flex-direction: column;
  gap: var(--s-4);
}
.cat-col {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--s-5) var(--s-5) var(--s-3);
}
.cat-col__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: var(--s-3);
  padding-bottom: var(--s-3);
  border-bottom: 1px solid var(--border);
  gap: var(--s-3);
}
.cat-col__title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
  margin: 0;
  letter-spacing: -0.01em;
  line-height: 1.3;
}
.cat-col__count {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-faint);
  background: var(--surface-soft);
  border-radius: var(--radius-pill);
  padding: 2px 8px;
  flex-shrink: 0;
}

/* Single-column tool list inside each category card.
   One tool per row, comfortable font, names wrap (never truncate). */
.cat-col__tools {
  display: flex;
  flex-direction: column;
}
.cat-col__tool {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  padding: 8px 0;
  font-size: 14.5px;
  line-height: 1.35;
  color: var(--text);
  text-decoration: none;
  border-bottom: 1px solid var(--border);
  transition: color 0.15s var(--ease);
}
.cat-col__tool:last-child { border-bottom: none; }
.cat-col__tool:hover { color: var(--green-deep); }
.cat-col__tool:hover .cat-col__tool-icon { color: var(--green-deep); }
.cat-col__tool-name {
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  transition: color 0.15s var(--ease);
}
.cat-col__tool:hover .cat-col__tool-name {
  color: var(--green-deep);
}
.cat-col__tool-icon {
  flex-shrink: 0;
  color: var(--text-muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
}
.cat-col__tool-icon svg { width: 16px; height: 16px; display: block; }

.cat-col__more {
  display: inline-block;
  font-size: 13px;
  font-weight: 500;
  color: var(--accent);
  text-decoration: none;
  margin-top: var(--s-3);
  padding-top: var(--s-3);
  border-top: 1px solid var(--border);
  width: 100%;
}
.cat-col__more:hover { text-decoration: underline; }

/* Calculators page uses the cats-grid; the cards-list itself doesn't
   need the s-5 top margin because the H1+lede already sit above it. */
.layout__main .cats-grid:first-child { margin-top: 0; }

/* Homepage-only (data-mode="home"): shrink columns to share the main
   column width and let long tool names wrap to a 2nd line. The
   calculators page is unaffected — no data-mode="home" ancestor. */
[data-mode="home"] {
  margin-top: -15px;
}
[data-mode="home"] .cats-grid {
  width: 100%;
  min-width: 0;
}
[data-mode="home"] .cats-col {
  flex: 1 1 0;
  min-width: 0;
}
[data-mode="home"] .cat-col__tool-name {
  white-space: normal;
  overflow-wrap: break-word;
}
/* Lighter, smaller category titles + hide tool counts on the homepage. */
[data-mode="home"] .cat-col__title {
  font-size: 14.4px;
  color: var(--green-deep);
  font-weight: 600;
}
[data-mode="home"] .cat-col__count {
  display: none;
}

/* Responsive: 2 inner cols → 1 col on narrow viewports.
   When the layout collapses (≤1100px) the main column expands to full
   width — bump back to 3 inner cols so we use the regained space. */
@media (max-width: 1100px) {
  .cats-grid { column-count: 3; }
}
@media (max-width: 900px) {
  .cats-grid { column-count: 2; }
}
@media (max-width: 540px) {
  .cats-grid { column-count: 1; }
}


/* ============================================================
   Accessibility additions (WCAG 2.4.7 + 2.3.3)
   - Visible keyboard-only focus ring on every interactive element
   - Honor user's reduced-motion preference
   ============================================================ */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 2px;
}
/* Inputs already render their own focus ring via box-shadow; suppress the
   doubled outline only on those. */
.calc__input:focus-visible,
.calc__select:focus-visible,
.search input:focus-visible,
.contact-form__field input:focus-visible,
.contact-form__field select:focus-visible,
.contact-form__field textarea:focus-visible,
.newsletter__input:focus-visible {
  outline: none;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
  }
}


/* ============================================================
   Navbar search (Omni-style — center-mounted in the top bar)
   ============================================================ */
.nav__inner {
  /* Re-balance with three flex children: brand | search | nav-links */
  gap: var(--s-5);
}
.nav__search {
  flex: 1 1 auto;
  max-width: 460px;
  margin: 0;
  display: flex;
  align-items: center;
}
.nav__search .search {
  width: 100%;
  height: 38px;
  padding: 0 var(--s-3);
  background: var(--surface-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  transition: background 0.15s var(--ease), border-color 0.15s var(--ease), box-shadow 0.15s var(--ease);
}
.nav__search .search:focus-within {
  background: var(--surface);
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-hairline);
}
.nav__search .search__icon { color: var(--text-faint); flex-shrink: 0; }
.nav__search .search__input {
  border: 0; outline: 0;
  background: transparent;
  font-size: 14px;
  color: var(--text);
  margin-left: var(--s-2);
  flex: 1;
  min-width: 0;
}
.nav__search .search__input::placeholder { color: var(--text-faint); }

@media (max-width: 1100px) {
  .nav__search { max-width: 320px; }
}
@media (max-width: 900px) {
  /* On tablets the nav links wrap below; keep search visible but smaller */
  .nav__search { max-width: 240px; }
}
@media (max-width: 720px) {
  /* Mobile: collapse nav-links to hamburger and let search take the row */
  .nav__inner { gap: var(--s-3); flex-wrap: wrap; }
  .nav__search { order: 3; flex: 1 0 100%; max-width: 100%; padding: 0 0 var(--s-3); margin-top: var(--s-2); border-top: 1px solid var(--border); }
  .nav__search .search { height: 36px; }
}

/* ============================================================
   Category bar — single-line strip directly under the navbar
   on the calculators index page (Omni-style horizontal nav).
   ============================================================ */
.cat-bar {
  position: sticky;
  top: 64px;                         /* matches .nav height */
  z-index: 40;
  background: rgba(251, 251, 248, 0.96);
  backdrop-filter: saturate(140%) blur(8px);
  -webkit-backdrop-filter: saturate(140%) blur(8px);
  border-bottom: 1px solid var(--border);
}
.cat-bar__inner {
  display: flex;
  align-items: center;
  gap: var(--s-6);
  padding: 12px var(--s-6);
  overflow-x: auto;
  scrollbar-width: thin;
  -webkit-overflow-scrolling: touch;
  white-space: nowrap;
}
.cat-bar__link {
  display: inline-block;
  padding: 6px 0;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-muted);
  text-decoration: none;
  border-bottom: 2px solid transparent;
  transition: color 0.15s var(--ease), border-color 0.15s var(--ease);
  flex-shrink: 0;
}
.cat-bar__link:hover {
  color: var(--text);
  border-bottom-color: var(--accent);
}
.cat-bar__link.is-active {
  color: var(--text);
  font-weight: 600;
  border-bottom-color: var(--accent);
}

@media (max-width: 720px) {
  .cat-bar { top: auto; position: relative; }
  .cat-bar__inner { gap: var(--s-4); padding: 10px var(--s-4); }
  .cat-bar__link { font-size: 13px; }
}

/* Variant: when the cat-bar holds the homepage's pill filter buttons
   (.cat) instead of text-link anchors. Keep the buttons centered
   vertically and let the row scroll horizontally on narrow viewports. */
.cat-bar--filters {
  gap: var(--s-2);
  padding: 10px var(--s-6);
}
.cat-bar--filters .cat {
  flex-shrink: 0;
}

/* Empty-state inside the calculators grid when search returns nothing. */
.calcs-empty {
  grid-column: 1 / -1;
  column-span: all;
  text-align: center;
  padding: var(--s-12) var(--s-4);
  color: var(--text-muted);
  font-size: 15px;
}
.calcs-empty__clear {
  background: var(--accent);
  color: var(--accent-on);
  border: 0;
  border-radius: var(--radius-pill);
  padding: 6px 14px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  margin-left: var(--s-2);
}
.calcs-empty__clear:hover { opacity: 0.85; }
.calcs-loading { color: var(--text-muted); padding: var(--s-8) 0; }


/* ============================================================
   Homepage — filter grid
   Shown only when a category pill or search query is active.
   Replaces the primary + secondary grids with a single block of
   rectangular pill cards (same shape as .rel-card on tool pages).
   ============================================================ */
.filter-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: var(--s-3);
  margin-top: var(--s-4);
}
.filter-card {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  padding: 12px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  text-decoration: none;
  color: var(--text);
  transition: border-color 0.15s var(--ease), box-shadow 0.15s var(--ease), color 0.15s var(--ease);
}
.filter-card:hover {
  border-color: var(--accent);
  color: var(--green-deep);
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}
.filter-card__icon {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  background: var(--accent-soft);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
}
.filter-card__icon svg { width: 14px; height: 14px; }
.filter-card__name {
  flex: 1;
  min-width: 0;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: -0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.filter-card__arrow {
  flex-shrink: 0;
  color: var(--text-faint);
  transition: color 0.15s var(--ease), transform 0.15s var(--ease);
  display: inline-flex;
  align-items: center;
}
.filter-card:hover .filter-card__arrow {
  color: var(--accent);
  transform: translateX(2px);
}
.filter-empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: var(--s-12) var(--s-4);
  color: var(--text-muted);
  font-size: 15px;
}


/* ============================================================
   Homepage primary "Most Popular" grid + Category-page grid —
   scaled down 15% with smaller icons and tighter card gap.
   ============================================================ */
#primaryGrid,
#catGrid {
  /* Tighter gap between cards. */
  gap: var(--s-3);
}
#primaryGrid .card,
#catGrid .card {
  padding: 20px;
  min-height: 143px;
}
#primaryGrid .card__icon,
#catGrid .card__icon {
  /* Icon container -25% (40 → 30) */
  width: 30px;
  height: 30px;
  margin-bottom: 13px;
}
#primaryGrid .card__icon svg,
#catGrid .card__icon svg {
  /* SVG glyph -25% (22 → 17) */
  width: 17px;
  height: 17px;
}
#primaryGrid .card__arrow,
#catGrid .card__arrow {
  right: 17px;
  bottom: 17px;
}


/* =============================================================
   Variant chips — pSEO internal-link surface
   Renders all PARAM_OVERRIDES variants as crawlable <a> chips.
   Placed between FAQ and Related Calculators on every goldmine
   tool. Gives Googlebot a real path to every variant URL and
   feeds PageRank from the parent page into them.
   ============================================================ */
.variant-chips-section {
  margin-top: var(--s-10);
}
.variant-group {
  margin-top: var(--s-5);
}
.variant-group:first-of-type {
  margin-top: var(--s-4);
}
.variant-group__title {
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin: 0 0 var(--s-3) 0;
}
.variant-group__count {
  color: var(--text-faint);
  font-weight: 500;
  margin-left: 4px;
}
.variant-chips {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 6px 6px;
}
.variant-chips li { margin: 0; padding: 0; }
.variant-chip {
  display: inline-flex;
  align-items: center;
  padding: 6px 12px;
  font-size: 13.5px;
  font-weight: 500;
  line-height: 1.3;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  text-decoration: none !important;
  white-space: nowrap;
  transition: background 0.15s var(--ease), border-color 0.15s var(--ease), color 0.15s var(--ease);
}
.variant-chip:hover,
.variant-chip:focus-visible {
  background: var(--accent-soft);
  border-color: var(--accent-hairline);
  color: var(--accent);
}
@media (max-width: 720px) {
  .variant-chip { font-size: 13px; padding: 5px 10px; }
  .variant-chips { gap: 5px 5px; }
}


/* =============================================================
   "Your Summary" calculator layout (.calc--summary)
   Two-column desktop layout:
     Left  = stacked Assets card + Liabilities card
     Right = sticky Summary card (NET WORTH headline + 3 stat
             tiles + ratio hint + 2 comparison dropdowns)
   Bottom action row spans both columns: privacy line + Reset / Save.
   Used on net-worth. Builds on existing .calc tokens — same
   surface/border/spacing language as the rest of the site.
   ============================================================ */
.calc--summary {
  grid-template-columns: minmax(0, 1.2fr) minmax(280px, 340px);
  gap: var(--s-4);
  padding: var(--s-3);
  align-items: stretch;
}
.calc--summary > .calc__inputs-col {
  display: flex;
  flex-direction: column;
  gap: var(--s-3);
}
.calc--summary > .calc__summary-col {
  display: flex;
  flex-direction: column;
  align-self: stretch;
  gap: var(--s-3);
}

/* ---- Card primitive used inside the summary layout ---- */
.calc-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--s-3) var(--s-4);
}
.calc-card + .calc-card { margin-top: var(--s-3); }
.calc-card__head {
  margin-bottom: var(--s-2);
  padding-bottom: var(--s-2);
  border-bottom: 1px solid var(--border);
}
.calc-card__title {
  font-size: 14.5px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--text);
  margin: 0;
  line-height: 1.25;
}
.calc-card__sub {
  display: block;
  font-size: 12.5px;
  font-weight: 400;
  color: var(--text-muted);
  margin-top: 2px;
}

/* ---- Tabular row layout for inputs inside the cards ---- */
.calc-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 150px;
  align-items: center;
  gap: var(--s-3);
  padding: 8px 0;
}
.calc-row + .calc-row { border-top: 1px solid var(--border); }
.calc-row__label {
  font-size: 13.5px;
  color: var(--text);
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.calc-row__input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}
.calc-row__input-wrap .calc__prefix { left: 12px; pointer-events: none; font-size: 13px; }
.calc-row__input {
  width: 100%;
  height: 38px;
  padding: 0 12px 0 24px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 14.5px;
  font-weight: 500;
  color: var(--text);
  font-variant-numeric: tabular-nums;
  outline: none;
  text-align: right;
  transition: border-color 0.15s var(--ease), box-shadow 0.15s var(--ease);
  appearance: none;
  -moz-appearance: textfield;
}
.calc-row__input::placeholder {
  color: var(--text-faint);
  opacity: 0.55;
  font-weight: 400;
}
.calc-row__input::-webkit-outer-spin-button,
.calc-row__input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.calc-row__input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-hairline);
}

/* ---- "Your Summary" right card ---- */
.calc-summary {
  background: var(--green-soft);
  border: 1px solid rgba(74, 149, 96, 0.18);
  border-radius: var(--radius-lg);
  padding: var(--s-5) var(--s-5);
}
.calc-summary__title {
  text-align: center;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 0.02em;
  margin: 0 0 var(--s-4) 0;
}
.calc-summary__headline {
  text-align: center;
  padding-bottom: var(--s-4);
  border-bottom: 1px solid rgba(74, 149, 96, 0.18);
}
.calc-summary__headline-label {
  display: block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--green-deep);
  margin-bottom: 6px;
}
.calc-summary__headline-value {
  display: block;
  font-size: 48px;
  font-weight: 800;
  letter-spacing: -0.025em;
  line-height: 1.05;
  color: var(--green-deep);
  font-variant-numeric: tabular-nums;
}
.calc-summary__pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: var(--s-3);
  padding: 5px 11px;
  background: var(--surface);
  color: var(--green-deep);
  border-radius: var(--radius-pill);
  border: 1px solid rgba(74, 149, 96, 0.22);
  font-size: 12.5px;
  font-weight: 500;
}
.calc-summary__pill svg { width: 12px; height: 12px; }

/* Stat rows in the summary card — vertical stack, label on top, value below */
.calc-summary__stats {
  display: flex;
  flex-direction: column;
  gap: var(--s-3);
  padding: var(--s-4) 0;
  border-bottom: 1px solid rgba(74, 149, 96, 0.18);
}
.calc-summary__stat {
  display: flex;
  flex-direction: column;
  gap: 2px;
  text-align: center;
}
.calc-summary__stat-label {
  display: block;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
  line-height: 1.3;
}
.calc-summary__stat-value {
  display: block;
  font-size: 26px;
  font-weight: 700;
  color: var(--text);
  font-variant-numeric: tabular-nums;
  line-height: 1.15;
}

/* Single ratio hint sentence under the stat tiles */
.calc-summary__hint {
  margin: 0;
  padding: var(--s-3) 0 0 0;
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--text-muted);
  text-align: center;
}

/* Compare dropdowns BELOW the summary card (separate card, same column) */
.calc-summary__compare {
  display: flex;
  flex-direction: column;
  gap: var(--s-3);
}
.calc-summary__compare-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--s-3) var(--s-4);
}
.calc-summary__compare-card .calc__label {
  display: block;
  margin-bottom: 6px;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text);
}
.calc-summary__compare-card .calc__select {
  width: 100%;
  height: 40px;
}

/* Right-column footer — Reset button + privacy line, sits under the compare cards. */
.calc-summary__footer {
  display: flex;
  flex-direction: column;
  gap: var(--s-3);
  padding-top: var(--s-2);
}
.calc-summary__footer .calc__btn {
  width: 100%;
  justify-content: center;
}
.calc-summary__footer .calc__privacy {
  display: inline-flex;
  align-items: flex-start;
  gap: 6px;
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.45;
}
.calc-summary__footer .calc__privacy svg { color: var(--text-faint); flex-shrink: 0; margin-top: 2px; }

/* Old bottom action row — kept for any other tool that still uses it. */
.calc--summary > .calc__actions {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--s-4);
  padding: var(--s-4) var(--s-5);
  margin-top: var(--s-2);
  background: var(--surface-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.calc--summary > .calc__actions:empty { display: none; }

/* Mobile: stack to a single column, summary card moves above the inputs */
@media (max-width: 900px) {
  .calc--summary { grid-template-columns: 1fr; }
  .calc--summary > .calc__inputs-col { order: 2; }
  .calc--summary > .calc__summary-col { order: 1; }
  .calc--summary > .calc__summary-col .calc-summary__compare { margin-top: var(--s-3); }
  .calc--summary > .calc__actions { flex-direction: column-reverse; align-items: stretch; }
  .calc--summary .calc__action-buttons { display: flex; gap: var(--s-3); }
  .calc--summary .calc__action-buttons .calc__btn { flex: 1; justify-content: center; }
}
@media (max-width: 540px) {
  .calc-row { grid-template-columns: minmax(0, 1fr); row-gap: 6px; padding: 8px 0; }
}


/* Shared action buttons used by .calc--summary and any future layout */
.calc__action-buttons {
  display: inline-flex;
  align-items: center;
  gap: var(--s-3);
}
.calc__btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 42px;
  padding: 0 var(--s-5);
  border-radius: var(--radius-sm);
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border-strong);
  transition: background 0.15s var(--ease), border-color 0.15s var(--ease), color 0.15s var(--ease), opacity 0.15s var(--ease);
  text-decoration: none;
}
.calc__btn:hover { border-color: var(--accent-hairline); background: var(--surface-soft); }
.calc__btn--primary {
  background: var(--green-deep);
  color: #FFFFFF;
  border-color: var(--green-deep);
}
.calc__btn--primary:hover { opacity: 0.9; background: var(--green-deep); border-color: var(--green-deep); color: #FFFFFF; }
.calc__btn svg { width: 15px; height: 15px; flex-shrink: 0; }
.calc__btn--saved { background: var(--surface-soft); color: var(--text-muted); border-color: var(--border); }


/* =============================================================
   Homepage redesign — Hero + Category tiles
   Replaces the old "Most popular 14-card grid" + "Also available
   2-row slider" with a category-tile layout (Omni / Calculator.net
   / Bankrate pattern).
   ============================================================ */

/* Hero — direct head-term H1 + sub-heading with stacked SEO keywords */
.home-hero {
  padding: var(--s-2) 0 var(--s-6);
  margin-bottom: var(--s-2);
}
.home-hero__title {
  font-family: var(--font-serif);
  font-size: 44px;
  letter-spacing: -0.02em;
  line-height: 1.05;
  margin: 0 0 var(--s-3) 0;
  color: var(--text);
}
.home-hero__lede {
  font-size: 15.5px;
  line-height: 1.55;
  color: var(--text-muted);
  max-width: 64ch;
  margin: 0;
}
@media (max-width: 720px) {
  .home-hero__title { font-size: 30px; }
  .home-hero__lede  { font-size: 15px; }
}

/* Category tile grid: 4 cols on desktop, 7 categories + "Browse all" = 8 tiles
   = 2 clean rows × 4 columns. Specific rules below use higher specificity
   (grid > anchor) to win against any global anchor rules in the cascade. */
.cat-tiles {
  display: grid !important;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--s-3);
  align-items: stretch;
}
a.cat-tile,
.cat-tiles > a.cat-tile {
  display: block;
  padding: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  text-decoration: none;
  color: inherit;
  transition: border-color 0.18s var(--ease), transform 0.18s var(--ease), box-shadow 0.18s var(--ease);
  min-width: 0;
  height: 100%;
}
a.cat-tile:hover,
a.cat-tile:focus-visible {
  border-color: var(--accent-hairline);
  transform: translateY(-2px);
  box-shadow: 0 6px 18px -14px rgba(14, 20, 17, 0.18);
}
.cat-tile__inner {
  display: flex;
  flex-direction: column;
  gap: var(--s-2);
  padding: var(--s-4);
  height: 100%;
  box-sizing: border-box;
}
/* Header row — small icon + title + count, on a single line */
.cat-tile__head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 4px;
}
.cat-tile__icon {
  width: 22px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--green-deep);
  flex-shrink: 0;
}
.cat-tile__icon svg { width: 18px; height: 18px; }
.cat-tile__title {
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: -0.005em;
  margin: 0;
  color: var(--text);
  line-height: 1.2;
  flex: 1;
  min-width: 0;
}
.cat-tile__count {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-faint);
  font-variant-numeric: tabular-nums;
  flex-shrink: 0;
}
.cat-tile__sublinks {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.cat-tile__sub {
  font-size: 13px;
  color: var(--text-muted);
  text-decoration: none;
  line-height: 1.45;
  display: block;
}
.cat-tile__sub--muted {
  color: var(--text-faint);
  font-size: 12.5px;
}
.cat-tile__cta {
  margin-top: auto;
  padding-top: var(--s-3);
  font-size: 12.5px;
  font-weight: 600;
  color: var(--green-deep);
  letter-spacing: -0.005em;
}

/* Special "Browse all" tile — visually distinct */
.cat-tile--all {
  background: var(--green-soft);
  border-color: rgba(74, 149, 96, 0.20);
}
.cat-tile--all:hover { border-color: var(--green-deep); }
.cat-tile--all .cat-tile__head { border-bottom-color: rgba(74, 149, 96, 0.20); }

/* Responsive */
@media (max-width: 1100px) {
  .cat-tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  .cat-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 480px) {
  .cat-tiles { grid-template-columns: 1fr; }
}
