:root {
  --ink: #192524;
  --muted: #61706d;
  --line: #dce6e2;
  --paper: #fbfcf8;
  --white: #ffffff;
  --teal: #0b5c5a;
  --teal-2: #117b73;
  --gold: #d99b2b;
  --red: #b94d3a;
  --blue: #3667a6;
  --green-soft: #e7f3ee;
  --gold-soft: #fbf1d9;
  --red-soft: #f8e9e3;
  --shadow: 0 18px 45px rgba(31, 44, 40, 0.12);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--paper);
  letter-spacing: 0;
}
a { color: inherit; }
button, input, select { font: inherit; }
.skip-link {
  position: absolute;
  left: 1rem;
  top: -4rem;
  background: var(--ink);
  color: white;
  padding: .6rem .8rem;
  z-index: 20;
}
.skip-link:focus { top: 1rem; }
.shell {
  width: min(1160px, calc(100% - 32px));
  margin: 0 auto;
}
.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(251, 252, 248, 0.92);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.nav-shell {
  min-height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: .65rem;
  font-weight: 800;
  text-decoration: none;
}
.brand span span { color: var(--teal); }
.brand-mark {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 8px;
  background: var(--teal);
  color: white;
  font-size: .85rem;
}
nav {
  display: flex;
  align-items: center;
  gap: .45rem;
  flex-wrap: wrap;
}
nav a {
  text-decoration: none;
  color: var(--muted);
  padding: .45rem .65rem;
  border-radius: 8px;
  font-size: .94rem;
}
nav a:hover { background: var(--green-soft); color: var(--ink); }
.calculator-band {
  position: relative;
  overflow: hidden;
  padding: 34px 0 44px;
  background:
    linear-gradient(90deg, rgba(11, 92, 90, .10), transparent 38%),
    linear-gradient(180deg, #f8fbf5 0%, #eef6f1 100%);
  border-bottom: 1px solid var(--line);
}
.calculator-band::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(248, 251, 245, .96) 0%, rgba(248, 251, 245, .72) 42%, rgba(248, 251, 245, .34) 100%),
    url("hero-cost-map.webp") right top / min(62vw, 930px) auto no-repeat;
  opacity: .72;
  pointer-events: none;
}
.calculator-band::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 42%;
  background: linear-gradient(180deg, transparent, rgba(238, 246, 241, .94));
  pointer-events: none;
}
.calculator-band > .shell {
  position: relative;
  z-index: 1;
}
.app-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.02fr) minmax(360px, .98fr);
  gap: 22px;
  align-items: stretch;
}
.calc-panel, .result-panel, .partner-card, .state-card, .formula-card, .lead-form, .stat-grid > div {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
  box-shadow: var(--shadow);
}
.calc-panel, .result-panel { padding: clamp(20px, 3vw, 34px); }
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  color: var(--teal);
  text-transform: uppercase;
  font-size: .78rem;
  font-weight: 800;
  letter-spacing: .08em;
  margin: 0 0 .75rem;
}
.eyebrow svg { width: 16px; height: 16px; }
h1, h2, h3, p { margin-top: 0; }
h1 {
  font-size: clamp(2rem, 5vw, 4.3rem);
  line-height: .98;
  letter-spacing: 0;
  max-width: 820px;
  margin-bottom: 1rem;
}
.content-page h1 {
  font-size: clamp(2rem, 4vw, 3.2rem);
}
h2 {
  font-size: clamp(1.5rem, 3vw, 2.35rem);
  line-height: 1.05;
  letter-spacing: 0;
}
.intro, .content-page p, .section-heading p, .two-col p, .method-grid p {
  color: var(--muted);
  line-height: 1.62;
}
.calc-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 22px;
}
label {
  display: grid;
  gap: 7px;
  color: #364541;
  font-weight: 700;
  font-size: .9rem;
}
input, select {
  width: 100%;
  border: 1px solid #c8d5cf;
  border-radius: 8px;
  min-height: 46px;
  padding: 0 .85rem;
  background: #fff;
  color: var(--ink);
}
input:focus, select:focus, button:focus {
  outline: 3px solid rgba(17, 123, 115, .22);
  outline-offset: 2px;
}
.input-wrap {
  display: flex;
  align-items: center;
  gap: .35rem;
  border: 1px solid #c8d5cf;
  border-radius: 8px;
  background: #fff;
  min-height: 46px;
  padding: 0 .8rem;
}
.input-wrap input {
  min-height: 42px;
  padding: 0;
  border: 0;
}
.optional-field { display: none; }
.optional-field.is-visible { display: grid; }
.form-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  grid-column: 1 / -1;
  margin-top: 4px;
}
.primary-button, .secondary-button {
  border: 0;
  border-radius: 8px;
  min-height: 46px;
  padding: 0 1rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  font-weight: 800;
  cursor: pointer;
  text-decoration: none;
}
.primary-button {
  color: white;
  background: var(--teal);
}
.primary-button:hover { background: var(--teal-2); }
.secondary-button {
  color: var(--ink);
  background: #ecf2ee;
  border: 1px solid var(--line);
}
.primary-button svg, .secondary-button svg { width: 17px; height: 17px; }
.result-panel {
  display: grid;
  gap: 18px;
  min-height: 100%;
}
.result-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}
.result-top h2 {
  margin: 0;
  font-size: clamp(2rem, 4vw, 3.3rem);
}
.state-chip {
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  border-radius: 8px;
  background: var(--gold-soft);
  color: #75520d;
  font-weight: 900;
}
.range-meter {
  display: grid;
  grid-template-columns: 1fr 1.1fr 1fr;
  gap: 5px;
  height: 14px;
}
.range-meter span {
  border-radius: 999px;
  background: var(--teal);
}
.range-meter span:nth-child(2) { background: var(--gold); }
.range-meter span:nth-child(3) { background: var(--red); }
.metric-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}
.metric-row div, .breakdown-row {
  background: #f7faf6;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
}
.metric-row span, .breakdown-row span, .stat-grid span {
  display: block;
  color: var(--muted);
  font-size: .78rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .06em;
}
.metric-row strong {
  display: block;
  margin-top: 4px;
  font-size: 1.05rem;
}
.breakdown {
  display: grid;
  gap: 8px;
}
.breakdown-row {
  display: grid;
  grid-template-columns: minmax(120px, 1fr) minmax(120px, auto);
  gap: 12px;
  align-items: center;
}
.breakdown-row strong { text-align: right; }
.confidence-box {
  border-left: 4px solid var(--gold);
  padding: 12px 14px;
  background: var(--gold-soft);
  border-radius: 8px;
}
.confidence-box p, .fine-print { color: var(--muted); line-height: 1.5; }
.result-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.section-band {
  padding: 56px 0;
}
.white-band { background: #fff; }
.two-col, .method-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, .85fr);
  gap: 30px;
  align-items: center;
}
.data-visual {
  width: 100%;
  min-height: 220px;
  object-fit: contain;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #fff;
}
.state-grid, .partner-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-top: 24px;
}
.state-card, .partner-card {
  box-shadow: none;
  text-decoration: none;
  padding: 16px;
  display: grid;
  gap: 8px;
}
.state-card span {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 8px;
  color: white;
  background: var(--blue);
  font-weight: 900;
}
.state-card small, .partner-card span {
  color: var(--muted);
  line-height: 1.45;
}
.partner-card:nth-child(2) { border-top: 4px solid var(--gold); }
.partner-card:nth-child(3) { border-top: 4px solid var(--blue); }
.partner-card:nth-child(4) { border-top: 4px solid var(--red); }
.provider-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin: 24px 0;
}
.provider-grid article {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 18px;
  display: grid;
  align-content: start;
  gap: 12px;
}
.provider-grid h2 {
  margin: 0;
}
.provider-grid .primary-button {
  width: fit-content;
}
.lead-form {
  margin-top: 18px;
  padding: 16px;
  display: grid;
  grid-template-columns: 1fr 220px auto;
  gap: 12px;
  align-items: end;
  box-shadow: none;
}
.formula-card {
  padding: 20px;
  display: grid;
  gap: 12px;
  box-shadow: none;
  background: #172522;
  color: #e9f5ef;
}
.formula-card code, pre {
  white-space: pre-wrap;
  line-height: 1.55;
}
.content-page {
  padding: 46px 0 68px;
}
.narrow {
  max-width: 850px;
}
.content-page h2 {
  margin-top: 2rem;
  font-size: 1.55rem;
}
.content-page a { color: var(--teal); font-weight: 800; }
pre {
  background: #172522;
  color: #e9f5ef;
  padding: 18px;
  border-radius: 8px;
  overflow: auto;
}
.source-list {
  margin-top: 30px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  display: grid;
  gap: 8px;
}
.faq-list {
  display: grid;
  gap: 10px;
}
details {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px 16px;
}
summary {
  cursor: pointer;
  font-weight: 900;
}
.stat-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin: 22px 0;
}
.stat-grid > div {
  box-shadow: none;
  padding: 16px;
}
.stat-grid strong {
  display: block;
  margin-top: 8px;
  font-size: 1.35rem;
}
.clean-list {
  padding-left: 1.15rem;
  line-height: 1.65;
  color: var(--muted);
}
.compare-table {
  display: grid;
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}
.compare-table > div {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 1px;
}
.compare-table span, .compare-table strong {
  background: #fff;
  padding: 12px;
}
.site-footer {
  background: #172522;
  color: #e7f3ee;
  padding: 34px 0;
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.3fr .8fr .8fr;
  gap: 28px;
}
.footer-grid p, .footer-grid a {
  color: #bbcbc5;
}
.footer-grid a {
  display: block;
  text-decoration: none;
  margin: 7px 0;
}
.footer-grid h2 {
  font-size: 1rem;
  margin-bottom: 10px;
}
.footer-brand { color: #fff; }

@media (max-width: 900px) {
  .calculator-band::before {
    background:
      linear-gradient(180deg, rgba(248, 251, 245, .96) 0%, rgba(248, 251, 245, .82) 45%, rgba(238, 246, 241, .96) 100%),
      url("hero-cost-map.webp") center top / 1080px auto no-repeat;
    opacity: .55;
  }
  .app-grid, .two-col, .method-grid, .footer-grid {
    grid-template-columns: 1fr;
  }
  .state-grid, .partner-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .provider-grid {
    grid-template-columns: 1fr;
  }
  .lead-form {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 640px) {
  .nav-shell {
    align-items: flex-start;
    padding: 12px 0;
  }
  nav {
    justify-content: flex-end;
  }
  nav a {
    font-size: .86rem;
    padding: .35rem .45rem;
  }
  .calc-form, .metric-row, .stat-grid, .state-grid, .partner-grid {
    grid-template-columns: 1fr;
  }
  h1 { font-size: clamp(2rem, 11vw, 3rem); }
  .result-top {
    align-items: flex-start;
  }
  .breakdown-row {
    grid-template-columns: 1fr;
  }
  .breakdown-row strong { text-align: left; }
  .compare-table > div {
    grid-template-columns: 1fr;
  }
}