:root {
  color-scheme: light;
  --ink: #17212b;
  --muted: #5b6673;
  --line: #dce4e8;
  --surface: #f7fafb;
  --white: #ffffff;
  --teal: #006d67;
  --teal-dark: #004b47;
  --gold: #b9892d;
  --coral: #9f341f;
  --shadow: 0 18px 50px rgba(27, 45, 52, 0.14);
}

* {
  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(--surface);
}

a {
  color: inherit;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 16px clamp(18px, 4vw, 56px);
  background: rgba(255, 255, 255, 0.92);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(14px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  text-decoration: none;
}

.brand-mark {
  display: inline-grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 6px;
  background: var(--teal);
  color: var(--white);
  font-size: 0.78rem;
  letter-spacing: 0;
}

nav {
  display: flex;
  align-items: center;
  gap: clamp(12px, 2vw, 28px);
  color: var(--muted);
  font-weight: 650;
}

nav a {
  text-decoration: none;
}

.hero {
  min-height: 76vh;
  display: grid;
  grid-template-columns: minmax(0, 0.92fr) minmax(320px, 1.08fr);
  align-items: center;
  gap: clamp(28px, 5vw, 72px);
  padding: clamp(40px, 7vw, 84px) clamp(18px, 4vw, 56px) clamp(28px, 5vw, 64px);
  background: linear-gradient(180deg, #f9fcfb 0%, #eef6f4 100%);
}

.hero-copy {
  max-width: 680px;
  min-width: 0;
}

.hero > *,
.calculator-shell > *,
.formula-grid > * {
  min-width: 0;
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--teal);
  font-size: 0.83rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 18px;
  font-size: clamp(3rem, 7vw, 6.3rem);
  line-height: 0.95;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 12px;
  font-size: clamp(2rem, 4vw, 3.2rem);
  line-height: 1.05;
  letter-spacing: 0;
}

h3 {
  margin-bottom: 10px;
  font-size: 1.05rem;
}

.hero-text,
.section-heading p,
.source-band p {
  color: var(--muted);
  font-size: 1.08rem;
  line-height: 1.65;
}

.last-reviewed {
  width: max-content;
  max-width: 100%;
  margin: 0 0 18px;
  padding: 8px 10px;
  border: 1px solid #d4e2df;
  border-radius: 6px;
  color: var(--teal-dark);
  background: #eff7f5;
  font-size: 0.92rem;
  font-weight: 750;
}

.hero img {
  width: 100%;
  height: auto;
  border-radius: 8px;
  box-shadow: var(--shadow);
  object-fit: cover;
}

.hero-actions,
.source-band {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0 18px;
  border-radius: 6px;
  font-weight: 800;
  text-decoration: none;
  border: 1px solid transparent;
}

.button.primary {
  background: var(--teal);
  color: var(--white);
}

.button.secondary {
  background: var(--white);
  color: var(--teal-dark);
  border-color: var(--line);
}

.trust-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--line);
  border-block: 1px solid var(--line);
}

.trust-strip div {
  padding: 22px clamp(18px, 4vw, 56px);
  background: var(--white);
}

.trust-strip strong,
.trust-strip span {
  display: block;
}

.trust-strip span {
  margin-top: 6px;
  color: var(--muted);
}

.calculator-band,
.methodology,
.faq,
.tools-band {
  padding: clamp(54px, 8vw, 96px) clamp(18px, 4vw, 56px);
}

.section-heading {
  max-width: 820px;
  margin-bottom: 28px;
}

.calculator-shell {
  display: grid;
  grid-template-columns: minmax(280px, 0.9fr) minmax(320px, 1fr);
  gap: 22px;
  align-items: stretch;
}

.calculator-form,
.result-panel,
.formula-grid article,
details {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
}

.calculator-form {
  display: grid;
  gap: 18px;
  padding: clamp(18px, 3vw, 30px);
}

label span,
legend {
  display: block;
  margin-bottom: 8px;
  color: var(--ink);
  font-weight: 750;
}

input,
select {
  width: 100%;
  min-height: 48px;
  border: 1px solid #cbd7dc;
  border-radius: 6px;
  padding: 0 12px;
  font: inherit;
  color: var(--ink);
  background: #fbfdfd;
}

select {
  appearance: none;
  padding-right: 40px;
  background-image:
    linear-gradient(45deg, transparent 50%, var(--teal-dark) 50%),
    linear-gradient(135deg, var(--teal-dark) 50%, transparent 50%);
  background-position:
    calc(100% - 20px) 21px,
    calc(100% - 14px) 21px;
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
}

.field-help {
  margin: -2px 0 0;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.45;
}

.input-prefix {
  display: grid;
  grid-template-columns: 58px 1fr;
  align-items: center;
  border: 1px solid #cbd7dc;
  border-radius: 6px;
  background: #fbfdfd;
  overflow: hidden;
}

.input-prefix > span {
  display: grid;
  place-items: center;
  height: 100%;
  margin: 0;
  background: #eaf2f1;
  color: var(--teal-dark);
}

.input-prefix input {
  border: 0;
  border-radius: 0;
}

fieldset {
  margin: 0;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.segmented-control {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 6px;
  padding: 4px;
  margin-bottom: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #eef5f4;
}

.segmented-control label {
  position: relative;
}

.segmented-control input {
  position: absolute;
  inset: 0;
  opacity: 0;
}

.segmented-control span {
  display: grid;
  place-items: center;
  min-height: 42px;
  margin: 0;
  border-radius: 6px;
  color: var(--muted);
  font-weight: 800;
  cursor: pointer;
}

.segmented-control input:checked + span {
  color: var(--white);
  background: var(--teal);
}

.segmented-control input:focus-visible + span {
  outline: 3px solid rgba(185, 137, 45, 0.45);
  outline-offset: 2px;
}

.check-row {
  display: grid;
  grid-template-columns: 22px 1fr;
  gap: 10px;
  align-items: center;
  margin-top: 10px;
}

.check-row input {
  min-height: auto;
}

.check-row span {
  margin: 0;
  font-weight: 650;
}

.result-panel {
  padding: clamp(20px, 4vw, 36px);
  background: #102a2d;
  color: var(--white);
}

.result-label {
  margin-bottom: 8px;
  color: #a9c6c6;
  font-weight: 800;
}

.result-amount {
  display: block;
  margin-bottom: 24px;
  color: #f4c260;
  font-size: clamp(2.4rem, 5vw, 4.8rem);
  line-height: 1;
  font-weight: 900;
}

.result-breakdown,
.result-list {
  display: grid;
  gap: 1px;
  margin: 0 0 18px;
  background: rgba(255, 255, 255, 0.12);
}

.result-breakdown div,
.result-list div {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 13px 0;
  background: #102a2d;
}

.result-breakdown dt,
.result-list dt {
  color: #b7cccb;
}

.result-breakdown dd,
.result-list dd {
  margin: 0;
  text-align: right;
  font-weight: 800;
}

.result-panel h2 {
  margin-bottom: 16px;
  font-size: clamp(1.55rem, 3vw, 2.25rem);
}

.result-panel p,
.result-panel ul {
  color: #dbe9e8;
  line-height: 1.55;
}

.result-panel .result-label {
  color: #a9c6c6;
}

.warning {
  color: #ffe0a3;
  font-weight: 750;
}

.result-panel .warning {
  color: #ffe0a3;
}

.small-text {
  font-size: 0.9rem;
}

.notice {
  margin: 0;
  color: #dbe9e8;
  line-height: 1.55;
}

.formula-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.tool-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 14px;
}

.tool-card {
  display: flex;
  min-height: 220px;
  flex-direction: column;
  justify-content: space-between;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
  text-decoration: none;
  transition: transform 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

.tool-card:hover {
  transform: translateY(-2px);
  border-color: rgba(0, 109, 103, 0.42);
  box-shadow: 0 14px 34px rgba(27, 45, 52, 0.1);
}

.tool-card span {
  width: max-content;
  padding: 5px 8px;
  border-radius: 6px;
  color: var(--teal-dark);
  background: #e8f3f1;
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.tool-card.live span {
  color: var(--white);
  background: var(--teal);
}

.tool-card h3 {
  margin: 24px 0 8px;
  font-size: 1.24rem;
}

.tool-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.formula-grid article {
  padding: 22px;
}

code {
  color: var(--coral);
  white-space: normal;
  overflow-wrap: anywhere;
}

.source-band {
  justify-content: space-between;
  padding: clamp(34px, 5vw, 54px) clamp(18px, 4vw, 56px);
  background: #fff7e8;
  border-block: 1px solid #ead7ae;
}

.source-band div {
  max-width: 760px;
}

.faq {
  display: grid;
  gap: 12px;
}

details {
  padding: 18px 20px;
}

summary {
  cursor: pointer;
  font-weight: 850;
}

details p {
  margin: 12px 0 0;
  color: var(--muted);
  line-height: 1.6;
}

.related-links {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

footer {
  padding: 28px clamp(18px, 4vw, 56px);
  color: #d7e7e6;
  background: #102a2d;
}

footer p {
  margin: 0 0 8px;
  line-height: 1.55;
}

@media (max-width: 860px) {
  .site-header {
    align-items: flex-start;
    flex-direction: column;
  }

  nav {
    width: 100%;
    justify-content: space-between;
  }

  .hero,
  .calculator-shell {
    grid-template-columns: 1fr;
  }

  .hero {
    min-height: auto;
  }

  .trust-strip,
  .formula-grid,
  .tool-grid {
    grid-template-columns: 1fr;
  }
}

@media (min-width: 861px) and (max-width: 1180px) {
  .tool-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 520px) {
  nav {
    font-size: 0.92rem;
  }

  h1 {
    font-size: 3.2rem;
  }

  .result-breakdown div,
  .result-list div {
    display: grid;
  }

  .result-breakdown dd,
  .result-list dd {
    text-align: left;
  }
}
