:root {
  --ink: #1f2933;
  --muted: #596873;
  --paper: #f7f9f6;
  --panel: #ffffff;
  --line: #d7dfdc;
  --teal: #096b72;
  --teal-2: #dff3f1;
  --leaf: #337357;
  --coral: #c95f42;
  --sun: #f8d56b;
  --lilac: #ece8ff;
  --blue: #dcecff;
  --shadow: 0 18px 55px rgba(31, 41, 51, 0.12);
  --font-body: Arial, sans-serif;
  --font-display: Arial, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: var(--font-body);
  line-height: 1.55;
}
a { color: inherit; }
.skip-link {
  position: absolute;
  top: -4rem;
  left: 1rem;
  z-index: 20;
  padding: 0.75rem 1rem;
  background: var(--ink);
  color: white;
}
.skip-link:focus { top: 1rem; }
.site-header {
  position: sticky;
  top: 0;
  z-index: 8;
  border-bottom: 1px solid var(--line);
  background: rgba(247, 249, 246, 0.94);
  backdrop-filter: blur(14px);
}
.nav {
  max-width: 1180px;
  min-height: 70px;
  margin: 0 auto;
  padding: 0 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.brand,
.nav-links,
.footer-links,
.button-row,
.result-line {
  display: flex;
  align-items: center;
  gap: 0.8rem;
}
.brand,
.nav-links a,
.button,
.tool-card,
.side-nav a {
  text-decoration: none;
}
.brand {
  font-weight: 850;
  white-space: nowrap;
}
.brand-mark {
  width: 38px;
  height: 38px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: var(--teal);
  color: white;
  font-weight: 900;
}
.nav-links {
  flex-wrap: wrap;
  justify-content: flex-end;
}
.nav-links a {
  color: var(--muted);
  font-size: 0.93rem;
  font-weight: 750;
}
.nav-links a:hover { color: var(--teal); }
.hero {
  background: linear-gradient(180deg, var(--teal-2), var(--paper));
  box-shadow: 0 0 0 100vmax var(--teal-2);
  clip-path: inset(0 -100vmax);
}
.hero-inner,
.section,
.article-layout,
.footer {
  max-width: 1180px;
  margin: 0 auto;
  padding-left: 1.25rem;
  padding-right: 1.25rem;
}
.hero-inner {
  min-height: calc(100vh - 70px);
  padding-top: 2.1rem;
  padding-bottom: 2.4rem;
  display: grid;
  grid-template-columns: minmax(300px, 0.82fr) minmax(360px, 1.18fr);
  gap: 1.4rem;
  align-items: start;
}
.hero-copy h1,
.article-hero h1,
.section-heading h2,
.legal-page h1 {
  font-family: var(--font-display);
  font-size: clamp(2.25rem, 5vw, 4.2rem);
  line-height: 1;
  margin: 0.35rem 0 1rem;
}
.article-hero h1,
.section-heading h2,
.legal-page h1 {
  font-size: clamp(2.1rem, 4vw, 4rem);
}
.eyebrow {
  margin: 0;
  color: var(--teal);
  font-size: 0.78rem;
  font-weight: 850;
  text-transform: uppercase;
  letter-spacing: 0;
}
.lead,
.article-hero p,
.section-heading p,
.article-body p,
.legal-page p,
.fine-print {
  color: var(--muted);
}
.lead {
  max-width: 620px;
  font-size: 1.08rem;
}
.quick-stats,
.tool-grid,
.mini-grid,
.result-grid,
.rule-grid {
  display: grid;
  gap: 1rem;
}
.quick-stats {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 1rem;
}
.quick-stat,
.tool-card,
.mini-card,
.side-nav,
.formula-box,
.article-callout {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}
.quick-stat {
  padding: 0.85rem;
  min-height: 96px;
}
.quick-stat strong,
.mini-card strong {
  display: block;
  font-size: 1.15rem;
}
.quick-stat span,
.mini-card span,
.tool-card p {
  color: var(--muted);
}
.calculator-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
  padding: 1rem;
}
.calculator-panel h2 {
  margin: 0 0 0.75rem;
  font-size: 1.15rem;
}
.form-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.62rem;
}
label {
  display: grid;
  gap: 0.32rem;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 750;
}
input,
select {
  width: 100%;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.5rem 0.68rem;
  color: var(--ink);
  background: white;
  font: inherit;
}
input:focus,
select:focus {
  outline: 3px solid rgba(9, 107, 114, 0.18);
  border-color: var(--teal);
}
.button {
  min-height: 44px;
  border: 1px solid var(--teal);
  border-radius: 8px;
  padding: 0.72rem 1rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--teal);
  background: white;
  font: inherit;
  font-weight: 850;
  cursor: pointer;
}
.button.primary {
  background: var(--teal);
  color: white;
}
.button:hover { filter: brightness(0.98); }
.wide { grid-column: 1 / -1; }
.result-panel {
  margin-top: 0.8rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fbfa;
  overflow: hidden;
}
.result-main {
  padding: 0.85rem;
  display: grid;
  gap: 0.45rem;
  border-bottom: 1px solid var(--line);
}
.result-main span {
  color: var(--muted);
  font-weight: 750;
}
.result-main strong {
  font-family: var(--font-display);
  font-size: clamp(2.35rem, 5vw, 4rem);
  line-height: 1;
}
.result-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.7rem;
  padding: 0.85rem;
}
.result-tile {
  min-height: 76px;
  border-radius: 8px;
  background: white;
  border: 1px solid var(--line);
  padding: 0.85rem;
}
.result-tile span {
  display: block;
  color: var(--muted);
  font-size: 0.86rem;
}
.result-tile strong {
  display: block;
  margin-top: 0.2rem;
  font-size: 1.2rem;
}
.meter {
  height: 14px;
  border-radius: 999px;
  background: #e8efec;
  overflow: hidden;
}
.meter-fill {
  height: 100%;
  width: 45%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--leaf), var(--sun), var(--coral));
  transition: width 180ms ease;
}
.budget-bars {
  display: grid;
  gap: 0.65rem;
  padding: 0 0.85rem 0.85rem;
}
.budget-row {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr) 90px;
  align-items: center;
  gap: 0.75rem;
  color: var(--muted);
  font-size: 0.9rem;
}
.bar-track {
  height: 12px;
  border-radius: 999px;
  background: #e8efec;
  overflow: hidden;
}
.bar-fill {
  height: 100%;
  width: 10%;
  border-radius: inherit;
  background: var(--teal);
}
.bar-fill.cost { background: var(--coral); }
.bar-fill.save { background: var(--leaf); }
.section {
  padding-top: 4rem;
  padding-bottom: 4rem;
}
.section.alt {
  background: var(--blue);
  box-shadow: 0 0 0 100vmax var(--blue);
  clip-path: inset(0 -100vmax);
}
.section.lilac {
  background: var(--lilac);
  box-shadow: 0 0 0 100vmax var(--lilac);
  clip-path: inset(0 -100vmax);
}
.section-heading {
  max-width: 760px;
  margin-bottom: 1.4rem;
}
.tool-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.tool-card {
  min-height: 170px;
  padding: 1.1rem;
  transition: transform 160ms ease, border-color 160ms ease;
}
.tool-card:hover {
  transform: translateY(-2px);
  border-color: var(--teal);
}
.tool-card h3 { margin: 0 0 0.5rem; }
.mini-grid,
.rule-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.mini-card,
.formula-box,
.article-callout {
  padding: 1rem;
}
.formula-box {
  background: var(--teal-2);
  font-weight: 800;
}
.article-hero {
  background: var(--teal-2);
  box-shadow: 0 0 0 100vmax var(--teal-2);
  clip-path: inset(0 -100vmax);
}
.article-layout {
  padding-top: 3rem;
  padding-bottom: 4rem;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 310px;
  gap: 2rem;
  align-items: start;
}
.article-body {
  display: grid;
  gap: 1rem;
}
.article-body h2,
.side-nav h2 {
  margin: 0.8rem 0 0;
}
.side-nav {
  position: sticky;
  top: 92px;
  display: grid;
  gap: 0.65rem;
  padding: 1rem;
}
.side-nav a {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.7rem;
  font-weight: 800;
}
.side-nav a:hover {
  border-color: var(--teal);
  color: var(--teal);
}
.compact-form {
  display: grid;
  gap: 0.85rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  padding: 1rem;
}
.result-note {
  min-height: 72px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #f8fbfa;
  padding: 0.9rem;
  font-weight: 750;
}
.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
}
table {
  width: 100%;
  border-collapse: collapse;
}
th,
td {
  border-bottom: 1px solid var(--line);
  padding: 0.75rem;
  text-align: left;
  white-space: nowrap;
}
tr:last-child td { border-bottom: 0; }
th {
  background: #f0f7f5;
  font-size: 0.88rem;
}
.legal-page {
  max-width: 820px;
  margin: 0 auto;
  padding: 4rem 1.25rem;
}
.legal-page h2 { margin-top: 2rem; }
.site-footer {
  background: var(--ink);
  color: white;
}
.footer {
  padding-top: 2rem;
  padding-bottom: 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.footer p,
.footer a {
  color: rgba(255, 255, 255, 0.78);
}

@media (max-width: 960px) {
  .hero-inner,
  .article-layout {
    grid-template-columns: 1fr;
  }
  .hero-inner { min-height: auto; }
  .side-nav { position: static; }
}

@media (max-width: 780px) {
  .quick-stats,
  .tool-grid,
  .mini-grid,
  .rule-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .nav,
  .nav-links,
  .footer,
  .button-row {
    align-items: stretch;
    flex-direction: column;
  }
  .nav {
    align-items: center;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 0.65rem;
  }
  .nav-links {
    width: 100%;
    align-items: center;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 0.45rem 0.65rem;
    overflow-x: visible;
    padding-bottom: 0.15rem;
  }
  .nav-links a {
    white-space: nowrap;
    font-size: 0.82rem;
  }
  .nav {
    min-height: auto;
    padding-top: 1rem;
    padding-bottom: 1rem;
  }
  .hero-inner {
    padding-top: 1.8rem;
  }
  .form-grid,
  .result-grid,
  .quick-stats,
  .tool-grid,
  .mini-grid,
  .rule-grid {
    grid-template-columns: 1fr;
  }
  .button { width: 100%; }
  .quick-stats { display: none; }
  .budget-row {
    grid-template-columns: 1fr;
    gap: 0.35rem;
  }
  .result-line {
    align-items: flex-start;
    flex-direction: column;
  }
}
