:root {
  --bg: #f7f3ec;
  --surface: #fffdf8;
  --surface-2: #efe7db;
  --ink: #14211d;
  --muted: #64716b;
  --line: #d8cdbf;
  --forest: #17473f;
  --blue: #275d7d;
  --amber: #c4822f;
  --coral: #b94f3b;
  --mint: #dceee7;
  --shadow: 0 18px 50px rgba(20, 33, 29, 0.12);
  --radius: 8px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.5;
}

a {
  color: inherit;
}

button,
input,
select {
  font: inherit;
}

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

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  min-width: 210px;
}

.brand-mark {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  color: var(--surface);
  background: var(--forest);
  border-radius: var(--radius);
}

.brand-mark svg {
  width: 28px;
  height: 28px;
  fill: currentColor;
}

.brand strong,
.brand small {
  display: block;
}

.brand small {
  color: var(--muted);
  font-size: 0.78rem;
}

.site-nav {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.site-nav a {
  padding: 9px 11px;
  border-radius: 999px;
  color: var(--muted);
  text-decoration: none;
  font-size: 0.92rem;
}

.site-nav a:hover {
  color: var(--ink);
  background: var(--mint);
}

.tool-band {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 440px);
  gap: clamp(24px, 5vw, 72px);
  align-items: end;
  padding: clamp(46px, 7vw, 92px) clamp(18px, 5vw, 72px) 32px;
  background:
    linear-gradient(90deg, rgba(23, 71, 63, 0.08), transparent 36%),
    var(--surface);
  border-bottom: 1px solid var(--line);
}

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

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

h1 {
  max-width: 860px;
  margin-bottom: 14px;
  font-size: clamp(2.4rem, 7vw, 5.7rem);
  line-height: 0.95;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 8px;
  font-size: clamp(1.35rem, 2.4vw, 2rem);
  line-height: 1.08;
}

h3 {
  margin-bottom: 8px;
  font-size: 1.05rem;
  line-height: 1.2;
}

.lead {
  max-width: 740px;
  color: var(--muted);
  font-size: clamp(1rem, 2vw, 1.2rem);
}

.trust-row,
.source-strip,
.tool-list {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
}

.trust-row span,
.tool-list span,
.tool-list a,
.source-strip a {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 7px 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--muted);
  font-size: 0.88rem;
  text-decoration: none;
}

.hero-panel,
.input-panel,
.results-panel,
.wide-card,
.metric-card,
.ladder-card,
.method-list article,
.faq-list details {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.hero-panel {
  padding: 24px;
  box-shadow: var(--shadow);
}

.panel-label {
  margin-bottom: 8px;
  color: var(--amber);
  font-weight: 800;
}

.hero-panel p:last-child {
  margin-bottom: 0;
  color: var(--muted);
}

.calculator-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.18fr) minmax(340px, 0.82fr);
  gap: 20px;
  padding: 24px clamp(18px, 5vw, 72px) 56px;
}

.input-panel,
.results-panel {
  padding: clamp(18px, 3vw, 28px);
}

.results-panel {
  position: sticky;
  top: 86px;
  align-self: start;
  box-shadow: var(--shadow);
}

.section-heading {
  margin-bottom: 18px;
}

.section-heading.compact {
  margin-top: 28px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
}

.section-heading.center {
  max-width: 760px;
  margin-inline: auto;
  text-align: center;
}

.field-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 700;
}

input,
select {
  width: 100%;
  min-height: 46px;
  padding: 10px 12px;
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  outline: none;
}

input:focus,
select:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(39, 93, 125, 0.16);
}

.money-input {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  min-height: 46px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}

.money-input span {
  padding: 0 11px;
  color: var(--muted);
}

.money-input input {
  min-height: 44px;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

.money-input.percent {
  grid-template-columns: 1fr auto;
}

.check-field {
  grid-template-columns: 18px 1fr;
  align-items: center;
  min-height: 46px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}

.check-field input {
  min-height: auto;
  width: 18px;
  height: 18px;
  accent-color: var(--forest);
}

.check-field.wide {
  grid-column: 1 / -1;
}

.actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 24px;
}

.primary-btn,
.ghost-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 11px 16px;
  border-radius: var(--radius);
  border: 1px solid transparent;
  cursor: pointer;
  font-weight: 800;
  text-decoration: none;
}

.primary-btn {
  color: var(--surface);
  background: var(--forest);
}

.primary-btn:hover {
  background: #0e342f;
}

.ghost-btn {
  color: var(--ink);
  background: var(--surface-2);
  border-color: var(--line);
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.metric-card {
  padding: 15px;
}

.metric-card span,
.metric-card small {
  display: block;
  color: var(--muted);
}

.metric-card strong {
  display: block;
  margin: 7px 0 4px;
  font-size: clamp(1.25rem, 3vw, 2rem);
  line-height: 1;
}

.metric-card small {
  font-size: 0.78rem;
}

.callout {
  margin: 14px 0;
  padding: 14px;
  color: #19332d;
  border-left: 4px solid var(--amber);
  background: #fff5df;
  border-radius: var(--radius);
  font-weight: 700;
}

.ladder-card {
  padding: 16px;
}

.ladder-top,
.card-title-row {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: start;
  margin-bottom: 14px;
}

.ladder-top span,
.card-title-row > span {
  padding: 6px 9px;
  border-radius: 999px;
  color: var(--blue);
  background: #e6f0f5;
  font-size: 0.82rem;
  font-weight: 800;
  white-space: nowrap;
}

.ladder {
  display: grid;
  gap: 8px;
}

.ladder-row {
  display: grid;
  grid-template-columns: minmax(72px, 0.75fr) minmax(120px, 1fr);
  gap: 10px;
  align-items: center;
}

.ladder-label {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
}

.ladder-track {
  position: relative;
  min-height: 24px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--surface-2);
}

.ladder-fill {
  position: absolute;
  inset: 0 auto 0 0;
  width: 0;
  background: var(--blue);
}

.ladder-row.active .ladder-fill {
  background: var(--coral);
}

.ladder-value {
  position: relative;
  z-index: 1;
  display: flex;
  justify-content: space-between;
  padding: 3px 8px;
  color: var(--ink);
  font-size: 0.78rem;
  font-weight: 800;
}

.ad-slot {
  display: grid;
  place-items: center;
  min-height: 94px;
  margin-top: 14px;
  border: 1px dashed #b8aa99;
  border-radius: var(--radius);
  color: var(--muted);
  background: #faf6ef;
  text-align: center;
}

.ad-slot small {
  display: block;
}

.ad-strip {
  display: grid;
  place-items: center;
  min-height: 104px;
  margin: 0 clamp(18px, 5vw, 72px) 56px;
  border: 1px dashed #b8aa99;
  border-radius: var(--radius);
  color: var(--muted);
  background: #faf6ef;
  text-align: center;
}

.ad-strip small {
  display: block;
}

.insight-band,
.faq-band {
  padding: 64px clamp(18px, 5vw, 72px);
}

.insight-band {
  background: #eaf2ee;
  border-block: 1px solid var(--line);
}

.insight-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
  margin-top: 28px;
}

.wide-card {
  padding: clamp(18px, 3vw, 26px);
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 560px;
}

th,
td {
  padding: 12px 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
}

th {
  color: var(--muted);
  font-size: 0.78rem;
  text-transform: uppercase;
}

td {
  font-weight: 700;
}

.compact-table {
  margin-top: 14px;
}

.chart-wrap {
  min-height: 240px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}

#rmdChart {
  width: 100%;
  height: auto;
  display: block;
}

.content-band {
  padding: 66px clamp(18px, 5vw, 72px);
  background: var(--surface);
}

.content-grid {
  display: grid;
  grid-template-columns: minmax(260px, 0.8fr) minmax(0, 1.2fr);
  gap: 30px;
  align-items: start;
}

.content-grid > div:first-child p:last-child,
.seo-copy p {
  color: var(--muted);
}

.method-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.method-list article {
  padding: 16px;
}

.method-list p {
  margin-bottom: 0;
  color: var(--muted);
}

.source-strip {
  margin-top: 28px;
}

.seo-band {
  display: grid;
  grid-template-columns: minmax(260px, 0.8fr) minmax(0, 1.2fr);
  gap: 28px;
  padding: 56px clamp(18px, 5vw, 72px);
  color: var(--surface);
  background: var(--forest);
}

.seo-band .eyebrow,
.seo-band a {
  color: #bfdad1;
}

.seo-copy p {
  color: #dceee7;
}

.tool-list span {
  color: var(--surface);
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.22);
}

.tool-list a {
  color: var(--surface);
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.22);
}

.article-pills {
  align-content: start;
}

.faq-list {
  display: grid;
  max-width: 920px;
  margin: 26px auto 0;
  gap: 12px;
}

.faq-list details {
  padding: 16px 18px;
}

.faq-list summary {
  cursor: pointer;
  font-weight: 900;
}

.faq-list p {
  margin: 12px 0 0;
  color: var(--muted);
}

.site-footer {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding: 28px clamp(18px, 5vw, 72px);
  color: #d7e8e2;
  background: #0f2925;
}

.site-footer p {
  margin: 4px 0 0;
  max-width: 520px;
}

.site-footer a {
  display: inline-block;
  margin-left: 12px;
  color: #fffdf8;
}

.legal-page {
  min-height: 100vh;
  background: var(--bg);
}

.legal-card {
  max-width: 920px;
  margin: 48px auto;
  padding: clamp(22px, 5vw, 44px);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.legal-card h1 {
  font-size: clamp(2rem, 5vw, 3.8rem);
}

.legal-card h2 {
  margin-top: 28px;
  font-size: 1.25rem;
}

.legal-card p,
.legal-card li {
  color: var(--muted);
}

.article-shell {
  max-width: 1120px;
  margin: 0 auto;
  padding: 46px clamp(14px, 5vw, 72px) 72px;
}

.article-hero {
  display: grid;
  gap: 16px;
  max-width: 860px;
  margin-bottom: 28px;
}

.article-hero h1 {
  margin-bottom: 0;
  font-size: clamp(2.2rem, 6vw, 4.7rem);
  line-height: 0.98;
}

.article-meta {
  color: var(--muted);
  font-weight: 800;
}

.article-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: 28px;
  align-items: start;
}

.article-main,
.article-aside,
.article-card,
.about-panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.article-main {
  padding: clamp(20px, 4vw, 42px);
}

.article-main h2 {
  margin-top: 34px;
}

.article-main p,
.article-main li {
  color: var(--muted);
}

.article-main strong {
  color: var(--ink);
}

.article-main table {
  margin: 16px 0;
}

.article-aside {
  position: sticky;
  top: 96px;
  padding: 18px;
}

.article-aside a,
.article-main a,
.legal-card a {
  color: var(--blue);
  font-weight: 800;
}

.article-aside ul,
.article-main ul,
.legal-card ul {
  padding-left: 1.1rem;
}

.article-cta {
  margin-top: 28px;
  padding: 18px;
  border-radius: var(--radius);
  color: #17342e;
  background: var(--mint);
}

.article-cta p {
  margin-bottom: 14px;
  color: #17342e;
}

.article-grid-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.article-card {
  display: grid;
  gap: 10px;
  padding: 18px;
  text-decoration: none;
}

.article-card:hover {
  border-color: var(--blue);
  box-shadow: var(--shadow);
}

.article-card p {
  margin-bottom: 0;
  color: var(--muted);
}

.about-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 0.55fr);
  gap: 18px;
}

.about-panel {
  padding: 20px;
}

.contact-list {
  display: grid;
  gap: 12px;
  padding: 0;
  list-style: none;
}

.contact-list li {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}

@media (max-width: 1080px) {
  .calculator-layout,
  .insight-grid,
  .content-grid,
  .seo-band,
  .article-body,
  .about-grid,
  .tool-band {
    grid-template-columns: 1fr;
  }

  .results-panel {
    position: static;
  }

  .article-aside {
    position: static;
  }
}

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

  .site-nav {
    justify-content: flex-start;
  }

  .field-grid,
  .metric-grid,
  .method-list,
  .article-grid-list {
    grid-template-columns: 1fr;
  }

  .calculator-layout,
  .insight-band,
  .faq-band,
  .content-band,
  .seo-band,
  .tool-band,
  .ad-strip {
    padding-left: 14px;
    padding-right: 14px;
  }

  .ladder-top,
  .card-title-row,
  .site-footer {
    flex-direction: column;
  }

  h1 {
    font-size: clamp(2.35rem, 15vw, 4rem);
  }
}
