:root {
  color-scheme: light;
  --ink: #17211d;
  --muted: #607069;
  --line: #dfe7e2;
  --paper: #fbfcf8;
  --panel: #ffffff;
  --green: #247a5a;
  --green-dark: #14563d;
  --teal: #0e8a91;
  --gold: #c98c1d;
  --rose: #bf5b63;
  --blue: #396ab1;
  --shadow: 0 18px 55px rgba(28, 45, 37, 0.12);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background:
    linear-gradient(180deg, rgba(36, 122, 90, 0.08), rgba(251, 252, 248, 0) 460px),
    var(--paper);
  color: var(--ink);
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

a {
  color: inherit;
  text-decoration: none;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 18px clamp(18px, 5vw, 64px);
  background: rgba(251, 252, 248, 0.88);
  border-bottom: 1px solid rgba(223, 231, 226, 0.82);
  backdrop-filter: blur(14px);
}

.brand,
.top-nav,
.hero-actions,
.panel-heading,
.allocation-header,
.site-footer {
  display: flex;
  align-items: center;
}

.brand {
  gap: 10px;
  font-weight: 800;
}

.brand-logo {
  display: block;
  width: 36px;
  height: 36px;
  border-radius: 8px;
}

.brand-mark,
.goal-icon {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: var(--green);
  color: #ffffff;
  font-weight: 800;
}

.top-nav {
  gap: 22px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
}

.nav-dropdown {
  position: relative;
}

.nav-dropdown::after {
  position: absolute;
  top: 100%;
  right: 0;
  left: 0;
  height: 10px;
  content: "";
}

.nav-dropdown-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
  font: inherit;
  font-weight: 800;
  padding: 0;
}

.nav-dropdown-toggle::after {
  width: 7px;
  height: 7px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  content: "";
  transform: rotate(45deg) translateY(-2px);
}

.nav-dropdown-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 20;
  display: grid;
  min-width: 240px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: var(--shadow);
  opacity: 0;
  padding: 8px;
  pointer-events: none;
  transform: translateY(-6px);
  transition:
    opacity 160ms ease,
    transform 160ms ease;
}

.nav-dropdown:hover .nav-dropdown-menu,
.nav-dropdown:focus-within .nav-dropdown-menu {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.nav-dropdown-menu a {
  border-radius: 8px;
  color: var(--ink);
  padding: 10px 12px;
}

.nav-dropdown-menu a:hover,
.nav-dropdown-menu a:focus {
  background: #f7faf6;
  color: var(--green-dark);
}

.hero-shell {
  display: grid;
  grid-template-columns: minmax(0, 0.82fr) minmax(420px, 1fr);
  gap: clamp(28px, 4vw, 64px);
  align-items: center;
  width: min(1180px, calc(100% - 36px));
  min-height: calc(100vh - 72px);
  margin: 0 auto;
  padding: clamp(26px, 5vw, 70px) 0;
}

.hero-copy {
  max-width: 620px;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--green);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

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

h1 {
  margin-bottom: 18px;
  font-size: clamp(42px, 5vw, 72px);
  line-height: 0.98;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 0;
  font-size: clamp(26px, 3vw, 38px);
  line-height: 1.08;
  letter-spacing: 0;
}

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

.hero-text {
  max-width: 560px;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.65;
}

.hero-actions {
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 28px;
}

.primary-action,
.secondary-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0 18px;
  border-radius: 8px;
  font-weight: 800;
}

.primary-action {
  background: var(--green);
  color: #ffffff;
}

.secondary-action {
  border: 1px solid var(--line);
  background: #ffffff;
}

.planner-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: var(--shadow);
  padding: clamp(18px, 3vw, 30px);
}

.panel-heading {
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 22px;
}

.status-pill {
  flex: 0 0 auto;
  border: 1px solid rgba(36, 122, 90, 0.22);
  border-radius: 999px;
  background: rgba(36, 122, 90, 0.09);
  color: var(--green-dark);
  padding: 7px 10px;
  font-size: 12px;
  font-weight: 800;
}

.planner-form {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.money-input,
.select-row,
.percent-input,
.unit-input,
.readonly-output {
  display: flex;
  align-items: center;
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  overflow: hidden;
}

.money-input span {
  padding-left: 14px;
  color: var(--muted);
  font-weight: 800;
}

.percent-input,
.unit-input,
.readonly-output {
  padding: 0 12px;
}

.percent-input input,
.unit-input input {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: 0;
  color: var(--ink);
  font: inherit;
  font-weight: 800;
}

.percent-input span,
.unit-input span {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.readonly-output strong {
  color: var(--ink);
}

input[type="number"] {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  padding: 0 12px;
  color: var(--ink);
  font: inherit;
  font-weight: 800;
}

.select-row {
  gap: 14px;
  padding: 0 12px;
}

input[type="range"] {
  width: 100%;
  accent-color: var(--green);
}

.result-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin: 20px 0;
}

.result-grid article {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f7faf6;
  padding: 14px;
}

.result-grid span,
.allocation-header span,
.bar-row span,
.insights-band span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.result-grid strong {
  display: block;
  margin-top: 8px;
  font-size: clamp(18px, 2.2vw, 24px);
}

.allocation-box {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
}

.allocation-header {
  justify-content: space-between;
  margin-bottom: 14px;
}

.allocation-bars {
  display: grid;
  gap: 13px;
}

.bar-row {
  display: grid;
  grid-template-columns: 105px minmax(80px, 1fr) 82px;
  gap: 10px;
  align-items: center;
}

.bar-track {
  height: 10px;
  border-radius: 999px;
  background: #ecf1ed;
  overflow: hidden;
}

.bar {
  display: block;
  height: 100%;
  border-radius: inherit;
}

.bar.home {
  width: 40%;
  background: var(--green);
}

.bar.education {
  width: 25%;
  background: var(--teal);
}

.bar.purchase {
  width: 20%;
  background: var(--gold);
}

.bar.buffer {
  width: 15%;
  background: var(--rose);
}

.bar-row strong {
  text-align: right;
  font-size: 13px;
}

.goals-section,
.calculators-section,
.method-section {
  width: min(1180px, calc(100% - 36px));
  margin: 0 auto;
  padding: 42px 0;
}

.section-heading {
  max-width: 720px;
  margin-bottom: 24px;
}

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

.goal-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  padding: 20px;
  transition:
    border-color 160ms ease,
    transform 160ms ease,
    box-shadow 160ms ease;
}

.goal-card:hover {
  border-color: rgba(36, 122, 90, 0.38);
  box-shadow: 0 12px 32px rgba(28, 45, 37, 0.08);
  transform: translateY(-2px);
}

.goal-card:nth-child(2) .goal-icon {
  background: var(--blue);
}

.goal-card:nth-child(3) .goal-icon {
  background: var(--teal);
}

.goal-card:nth-child(4) .goal-icon {
  background: var(--gold);
}

.goal-card:nth-child(5) .goal-icon {
  background: var(--rose);
}

.goal-card:nth-child(6) .goal-icon {
  background: #6e5aa7;
}

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

.goal-icon {
  margin-bottom: 18px;
  font-size: 13px;
  letter-spacing: 0;
}

.goal-card:nth-child(7) .goal-icon,
.goal-card:nth-child(11) .goal-icon {
  background: var(--green-dark);
}

.goal-card:nth-child(8) .goal-icon {
  background: var(--teal);
}

.goal-card:nth-child(9) .goal-icon {
  background: var(--blue);
}

.goal-card:nth-child(10) .goal-icon {
  background: var(--gold);
}

.calculator-stack {
  display: grid;
  gap: 18px;
}

.calculator-card {
  display: grid;
  grid-template-columns: 0.78fr 1.22fr;
  gap: 22px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  padding: clamp(18px, 3vw, 26px);
}

.calculator-copy p:not(.eyebrow) {
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.6;
}

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

.calculator-results {
  grid-column: 2;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.calculator-results article {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f7faf6;
  padding: 14px;
}

.calculator-results span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.calculator-results strong {
  display: block;
  margin-top: 8px;
  font-size: clamp(17px, 2vw, 23px);
  line-height: 1.18;
}

.calculator-note {
  grid-column: 2;
  margin: 0;
  border-left: 3px solid var(--green);
  padding-left: 12px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.55;
}

.insights-band {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  width: min(1180px, calc(100% - 36px));
  margin: 30px auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--line);
  overflow: hidden;
}

.insights-band article {
  min-height: 132px;
  background: #ffffff;
  padding: 22px;
}

.insights-band strong {
  display: block;
  margin-top: 12px;
  font-size: 20px;
  line-height: 1.32;
}

.method-section {
  display: grid;
  grid-template-columns: 0.8fr 1fr;
  gap: 40px;
  align-items: start;
}

.method-section p {
  color: var(--muted);
  font-size: 17px;
  line-height: 1.7;
}

.method-section .disclaimer {
  grid-column: 2;
  border-left: 3px solid var(--gold);
  padding-left: 14px;
  font-size: 14px;
}

.site-footer {
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  width: min(1180px, calc(100% - 36px));
  margin: 30px auto 0;
  padding: 26px 0 36px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 14px;
}

.site-footer span:first-child {
  color: var(--ink);
  font-weight: 800;
}

.footer-brand {
  display: grid;
  gap: 6px;
  text-align: left;
}

.footer-brand strong {
  color: var(--ink);
}

.footer-links {
  display: grid;
  justify-content: flex-end;
  gap: 9px;
  text-align: right;
}

.footer-links a {
  color: var(--green-dark);
  font-weight: 800;
}

.page-hero {
  width: min(1180px, calc(100% - 36px));
  margin: 0 auto;
  padding: clamp(34px, 6vw, 72px) 0 24px;
}

.page-hero h1 {
  max-width: 840px;
}

.page-hero .hero-text {
  max-width: 760px;
}

.tool-shell {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(320px, 0.55fr);
  gap: 18px;
  width: min(1180px, calc(100% - 36px));
  margin: 0 auto;
  padding: 10px 0 34px;
}

.tool-card,
.chart-panel,
.content-panel,
.faq-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

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

.tool-card .calculator-form,
.tool-card .planner-form {
  margin-top: 18px;
}

.tool-card .calculator-results,
.tool-card .result-grid {
  grid-column: auto;
}

.tool-card .calculator-results {
  margin-top: 20px;
}

.tool-card .calculator-note {
  margin-top: 12px;
}

.chart-panel {
  align-self: start;
  display: grid;
  gap: 18px;
}

.donut {
  position: relative;
  display: grid;
  place-items: center;
  width: min(270px, 100%);
  aspect-ratio: 1;
  margin: 4px auto 0;
  border-radius: 50%;
  background: #ecf1ed;
}

.donut::after {
  position: absolute;
  width: 58%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: #ffffff;
  content: "";
}

.donut span {
  position: relative;
  z-index: 1;
  max-width: 110px;
  text-align: center;
  color: var(--ink);
  font-size: 19px;
  font-weight: 800;
  line-height: 1.15;
}

.chart-legend {
  display: grid;
  gap: 10px;
}

.legend-row {
  display: grid;
  grid-template-columns: 12px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.legend-dot {
  width: 12px;
  height: 12px;
  border-radius: 999px;
  background: var(--green);
}

.legend-dot.blue {
  background: var(--blue);
}

.legend-dot.teal {
  background: var(--teal);
}

.legend-dot.gold {
  background: var(--gold);
}

.legend-dot.rose {
  background: var(--rose);
}

.seo-content {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  width: min(1180px, calc(100% - 36px));
  margin: 0 auto;
  padding: 20px 0 46px;
}

.emergency-page .seo-content {
  align-items: start;
}

.content-panel,
.faq-panel {
  padding: clamp(18px, 3vw, 24px);
}

.content-panel p,
.faq-panel p {
  color: var(--muted);
  line-height: 1.65;
}

.formula-box {
  margin-top: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f7faf6;
  padding: 14px;
  color: var(--ink);
  font-weight: 800;
  line-height: 1.45;
}

.faq-item {
  border-top: 1px solid var(--line);
  padding-top: 16px;
}

.faq-item + .faq-item {
  margin-top: 16px;
}

.faq-item h3 {
  font-size: 17px;
}

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

.related-links a {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 9px 12px;
  color: var(--green-dark);
  font-size: 13px;
  font-weight: 800;
}

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

.blog-card {
  display: grid;
  align-content: start;
  min-height: 260px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  padding: 22px;
  transition:
    border-color 160ms ease,
    transform 160ms ease,
    box-shadow 160ms ease;
}

.blog-card:hover {
  border-color: rgba(36, 122, 90, 0.38);
  box-shadow: 0 12px 32px rgba(28, 45, 37, 0.08);
  transform: translateY(-2px);
}

.blog-card time,
.article-meta {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.blog-card h2 {
  margin: 14px 0 12px;
  font-size: 24px;
}

.blog-card p {
  color: var(--muted);
  line-height: 1.62;
}

.read-link {
  align-self: end;
  margin-top: 12px;
  color: var(--green-dark);
  font-weight: 800;
}

.article-shell {
  display: grid;
  grid-template-columns: minmax(0, 0.72fr) minmax(260px, 0.28fr);
  gap: 28px;
  width: min(1180px, calc(100% - 36px));
  margin: 0 auto;
  padding: 14px 0 50px;
}

.article-content,
.article-sidebar {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  padding: clamp(20px, 3vw, 30px);
}

.article-content h2 {
  margin-top: 30px;
  margin-bottom: 12px;
  font-size: clamp(24px, 2.5vw, 32px);
}

.article-content p,
.article-content li {
  color: var(--muted);
  font-size: 17px;
  line-height: 1.78;
}

.article-content ul {
  padding-left: 22px;
}

.article-sidebar {
  align-self: start;
  display: grid;
  gap: 14px;
}

.article-sidebar a {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  color: var(--green-dark);
  font-weight: 800;
}

.legal-shell {
  display: grid;
  grid-template-columns: minmax(0, 0.72fr) minmax(260px, 0.28fr);
  gap: 28px;
  width: min(1180px, calc(100% - 36px));
  margin: 0 auto;
  padding: 14px 0 50px;
}

.legal-content,
.legal-sidebar {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  padding: clamp(20px, 3vw, 30px);
}

.legal-content h2 {
  margin-top: 30px;
  margin-bottom: 12px;
  font-size: clamp(24px, 2.5vw, 32px);
}

.legal-content p,
.legal-content li {
  color: var(--muted);
  font-size: 17px;
  line-height: 1.78;
}

.legal-content ul {
  padding-left: 22px;
}

.legal-sidebar {
  align-self: start;
  display: grid;
  gap: 14px;
}

.legal-sidebar a,
.contact-link {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  color: var(--green-dark);
  font-weight: 800;
}

@media (max-width: 920px) {
  .hero-shell,
  .calculator-card,
  .tool-shell,
  .article-shell,
  .legal-shell,
  .seo-content,
  .method-section {
    grid-template-columns: 1fr;
    min-height: auto;
  }

  .calculator-results,
  .calculator-note {
    grid-column: auto;
  }

  .calculator-form {
    grid-template-columns: 1fr 1fr;
  }

  .method-section .disclaimer {
    grid-column: auto;
  }

  .goal-grid,
  .blog-grid,
  .insights-band {
    grid-template-columns: 1fr 1fr;
  }

  .emergency-page .seo-content {
    grid-template-columns: 0.82fr 1.18fr;
  }
}

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

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

  .nav-dropdown-menu {
    left: 0;
    right: auto;
    min-width: min(280px, calc(100vw - 36px));
  }

  h1 {
    font-size: 42px;
  }

  .planner-form,
  .calculator-form,
  .calculator-results,
  .result-grid,
  .goal-grid,
  .blog-grid,
  .insights-band,
  .emergency-page .seo-content {
    grid-template-columns: 1fr;
  }

  .panel-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .bar-row {
    grid-template-columns: 1fr;
    gap: 7px;
  }

  .bar-row strong {
    text-align: left;
  }

  .site-footer {
    align-items: flex-start;
    flex-direction: column;
  }

  .footer-links {
    justify-content: flex-start;
  }

  .footer-brand {
    text-align: left;
  }

  .footer-links {
    text-align: left;
  }
}
