:root {
  --bg: #f5f7fa;
  --surface: #ffffff;
  --surface-subtle: #f9fbfc;
  --surface-strong: #eef6f2;
  --text: #111827;
  --text-soft: #425066;
  --text-muted: #6b7280;
  --border: #d7dee7;
  --border-strong: #c6d1dd;
  --accent: #2f8f5b;
  --accent-deep: #247149;
  --accent-ink: #173d2c;
  --blue: #416a9c;
  --blue-soft: #dfeaf5;
  --radius-card: 8px;
  --radius-input: 8px;
  --radius-pill: 999px;
  --container: 1120px;
  --shadow-soft: 0 14px 34px rgba(17, 24, 39, 0.07);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
}

img,
svg {
  display: block;
  max-width: 100%;
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

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

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

[hidden] {
  display: none !important;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.page-shell {
  min-height: 100vh;
}

.header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(215, 222, 231, 0.9);
}

.header-inner {
  max-width: calc(var(--container) + 40px);
  margin: 0 auto;
  padding: 10px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.logo-link {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
}

.logo-img {
  width: 300px;
  height: auto;
}

.header-nav {
  display: flex;
  align-items: center;
  gap: 24px;
  margin-right: auto;
  margin-left: 20px;
}

.header-nav-link {
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--text-soft);
  transition: color 0.2s ease;
}

.header-nav-link:hover,
.header-nav-link:focus-visible {
  color: var(--accent);
  outline: none;
}

.menu-button {
  width: 38px;
  height: 38px;
  display: none;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: var(--surface);
  color: var(--text-soft);
  transition: border-color 0.2s ease, color 0.2s ease, transform 0.2s ease, background-color 0.2s ease;
}

.menu-button:hover,
.menu-button:focus-visible {
  border-color: var(--accent);
  color: var(--accent);
  transform: translateY(-1px);
  outline: none;
}

.menu-button-box {
  width: 16px;
  height: 14px;
  display: grid;
  align-content: space-between;
}

.menu-button-line {
  display: block;
  width: 16px;
  height: 2px;
  border-radius: 999px;
  background: currentColor;
  transition: transform 0.22s ease, opacity 0.2s ease;
}

.header--menu-open .menu-button {
  border-color: var(--accent);
  color: var(--accent);
  background: rgba(47, 143, 91, 0.08);
}

.header--menu-open .menu-button-line:nth-child(1) {
  transform: translateY(6px) rotate(45deg);
}

.header--menu-open .menu-button-line:nth-child(2) {
  opacity: 0;
}

.header--menu-open .menu-button-line:nth-child(3) {
  transform: translateY(-6px) rotate(-45deg);
}

.mobile-menu {
  padding: 12px 16px 16px;
  border-top: 1px solid rgba(215, 222, 231, 0.9);
  background: rgba(255, 255, 255, 0.96);
}

.mobile-menu-nav {
  display: grid;
  gap: 10px;
}

.mobile-menu-link {
  min-height: 46px;
  padding: 0 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text-soft);
  font-size: 0.92rem;
  font-weight: 700;
  text-align: left;
  transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.mobile-menu-link:hover,
.mobile-menu-link:focus-visible {
  background: rgba(47, 143, 91, 0.08);
  border-color: var(--accent);
  color: var(--accent);
  transform: translateY(-1px);
  outline: none;
}

main {
  display: block;
}

.planner-hero {
  padding: 28px 16px 24px;
  background:
    linear-gradient(180deg, rgba(238, 246, 251, 0.9) 0%, rgba(245, 247, 250, 0) 72%),
    var(--bg);
}

.planner-shell,
.content-section,
.footer-inner {
  max-width: calc(var(--container) + 40px);
  margin: 0 auto;
}

.planner-shell {
  display: grid;
  gap: 18px;
}

.planner-copy {
  display: grid;
  gap: 16px;
}

.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  color: var(--text-soft);
  font-size: 0.9rem;
}

.breadcrumb a:hover,
.breadcrumb a:focus-visible {
  color: var(--accent);
  outline: none;
}

.breadcrumb-separator {
  color: var(--text-muted);
}

.eyebrow,
.section-kicker {
  width: fit-content;
  display: inline-flex;
  align-items: center;
  color: var(--accent-deep);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0;
}

.eyebrow {
  min-height: 28px;
  padding: 0 10px;
  border-radius: var(--radius-pill);
  background: rgba(47, 143, 91, 0.1);
}

.calculator-title {
  font-size: 2.25rem;
  line-height: 1.08;
  letter-spacing: 0;
}

.calculator-subtitle {
  max-width: 66ch;
  color: var(--text-soft);
  font-size: 1rem;
}

.input-panel,
.result-card,
.projection-card,
.table-card,
.content-card,
.faq-item {
  border: 1px solid rgba(215, 222, 231, 0.95);
  border-radius: var(--radius-card);
  background: rgba(255, 255, 255, 0.96);
}

.input-panel {
  padding: 18px;
  display: grid;
  gap: 18px;
  box-shadow: 0 10px 28px rgba(17, 24, 39, 0.04);
}

.panel-heading {
  display: grid;
  gap: 6px;
}

.panel-heading h2,
.section-heading h2,
.projection-head h2,
.content-card h2 {
  font-size: 1.35rem;
  line-height: 1.22;
  letter-spacing: 0;
}

.panel-heading p,
.section-heading p,
.content-card p {
  color: var(--text-soft);
}

.field-grid {
  display: grid;
  gap: 14px;
}

.field-block {
  display: grid;
  gap: 8px;
}

.field-block label {
  color: var(--text);
  font-size: 0.92rem;
  font-weight: 750;
}

.input-shell {
  position: relative;
}

.currency-prefix,
.percent-suffix {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-weight: 750;
  pointer-events: none;
}

.currency-prefix {
  left: 14px;
}

.percent-suffix {
  right: 14px;
}

input,
select {
  width: 100%;
  height: 52px;
  border: 1px solid var(--border);
  border-radius: var(--radius-input);
  background: var(--surface);
  color: var(--text);
  font-size: 1rem;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

input {
  padding: 0 14px;
}

.input-shell input {
  padding-left: 36px;
}

.input-shell--suffix input {
  padding-left: 14px;
  padding-right: 38px;
}

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

input:focus-visible,
select:focus-visible {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(47, 143, 91, 0.14);
  outline: none;
}

input::-webkit-outer-spin-button,
input::-webkit-inner-spin-button {
  margin: 0;
  -webkit-appearance: none;
}

input[type="number"] {
  appearance: textfield;
}

.result-card {
  padding: 22px;
  display: grid;
  gap: 20px;
  align-content: start;
  box-shadow: var(--shadow-soft);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(249, 251, 252, 0.96)),
    var(--surface);
}

.result-label {
  color: var(--text-muted);
  font-size: 0.82rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0;
}

.result-value {
  color: var(--accent-ink);
  font-size: 2.2rem;
  font-weight: 850;
  line-height: 1.06;
  letter-spacing: 0;
}

.result-sentence {
  color: var(--text-soft);
  font-size: 1rem;
}

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

.kpi-card {
  min-height: 94px;
  padding: 14px;
  display: grid;
  align-content: space-between;
  gap: 10px;
  border: 1px solid rgba(215, 222, 231, 0.9);
  border-radius: 8px;
  background: var(--surface);
}

.kpi-card span {
  color: var(--text-muted);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0;
}

.kpi-card strong {
  color: var(--text);
  font-size: 1.18rem;
  line-height: 1.15;
  letter-spacing: 0;
}

.composition-panel {
  display: grid;
  gap: 12px;
}

.composition-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--text-muted);
  font-size: 0.84rem;
  font-weight: 800;
}

.composition-head strong {
  color: var(--text);
  white-space: nowrap;
}

.composition-track {
  position: relative;
  height: 16px;
  display: flex;
  overflow: hidden;
  border: 1px solid rgba(198, 209, 221, 0.9);
  border-radius: 999px;
  background: #eef2f6;
}

.composition-segment {
  min-width: 0;
  height: 100%;
}

.composition-segment--current {
  background: var(--blue);
}

.composition-segment--contributions {
  background: var(--accent);
}

.composition-segment--growth {
  background: #9aa8b8;
}

.target-marker {
  position: absolute;
  top: -4px;
  bottom: -4px;
  width: 2px;
  background: var(--text);
  transform: translateX(-1px);
}

.composition-legend,
.chart-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 14px;
  color: var(--text-soft);
  font-size: 0.82rem;
  font-weight: 650;
}

.composition-legend span,
.chart-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.legend-dot {
  width: 9px;
  height: 9px;
  display: inline-block;
  border-radius: 50%;
}

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

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

.legend-dot--growth {
  background: #9aa8b8;
}

.legend-line {
  width: 16px;
  height: 2px;
  display: inline-block;
  border-radius: 999px;
  background: var(--text);
}

.result-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.action-button {
  min-height: 44px;
  padding: 0 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(47, 143, 91, 0.28);
  border-radius: var(--radius-pill);
  background: var(--surface);
  color: var(--accent-deep);
  font-size: 0.9rem;
  font-weight: 800;
  transition: transform 0.2s ease, border-color 0.2s ease, background-color 0.2s ease;
}

.action-button--primary {
  background: var(--accent);
  color: #ffffff;
  border-color: var(--accent);
}

.action-button:hover,
.action-button:focus-visible {
  transform: translateY(-1px);
  border-color: var(--accent);
  background: rgba(47, 143, 91, 0.08);
  outline: none;
}

.action-button--primary:hover,
.action-button--primary:focus-visible {
  background: var(--accent-deep);
  color: #ffffff;
}

.action-status {
  min-height: 20px;
  color: var(--text-muted);
  font-size: 0.84rem;
  font-weight: 650;
}

.content-section {
  padding: 24px 16px;
}

.section-heading {
  display: grid;
  gap: 8px;
  margin-bottom: 16px;
  max-width: 680px;
}

.scenario-grid {
  display: grid;
  gap: 12px;
}

.scenario-card {
  min-height: 132px;
  padding: 18px;
  display: grid;
  gap: 8px;
  justify-items: start;
  text-align: left;
  border: 1px solid rgba(215, 222, 231, 0.95);
  border-radius: var(--radius-card);
  background: var(--surface);
  color: var(--text);
  transition: transform 0.2s ease, border-color 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease;
}

.scenario-card:hover,
.scenario-card:focus-visible,
.scenario-card.is-active {
  border-color: rgba(47, 143, 91, 0.34);
  background: rgba(47, 143, 91, 0.06);
  box-shadow: 0 10px 24px rgba(17, 24, 39, 0.05);
  transform: translateY(-1px);
  outline: none;
}

.scenario-card span {
  color: var(--text-muted);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0;
}

.scenario-card strong {
  font-size: 1.06rem;
}

.scenario-card em {
  color: var(--accent-deep);
  font-style: normal;
  font-weight: 800;
}

.projection-card,
.table-card,
.content-card {
  padding: 18px;
}

.projection-card {
  display: grid;
  gap: 16px;
}

.projection-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}

.chart-wrap {
  min-height: 240px;
  border: 1px solid rgba(215, 222, 231, 0.9);
  border-radius: 8px;
  background: var(--surface-subtle);
  overflow: hidden;
}

.projection-chart {
  width: 100%;
  height: 280px;
}

.chart-grid {
  stroke: rgba(198, 209, 221, 0.75);
  stroke-width: 1;
}

.chart-axis {
  stroke: rgba(156, 169, 184, 0.95);
  stroke-width: 1.2;
}

.chart-balance-fill {
  fill: rgba(47, 143, 91, 0.1);
}

.chart-balance-line {
  fill: none;
  stroke: var(--accent);
  stroke-width: 4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.chart-target-line {
  stroke: var(--text);
  stroke-width: 1.5;
  stroke-dasharray: 6 6;
}

.chart-label {
  fill: var(--text-muted);
  font-size: 13px;
  font-weight: 750;
}

.chart-target-label {
  fill: var(--text);
  font-size: 13px;
  font-weight: 800;
}

.table-card {
  margin-top: 16px;
  display: grid;
  gap: 14px;
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid rgba(215, 222, 231, 0.9);
  border-radius: 8px;
}

.projection-table {
  width: 100%;
  min-width: 760px;
  border-collapse: collapse;
  background: var(--surface);
  font-size: 0.9rem;
}

.projection-table th,
.projection-table td {
  padding: 12px 14px;
  border-bottom: 1px solid rgba(215, 222, 231, 0.78);
  text-align: right;
  white-space: nowrap;
}

.projection-table th:first-child,
.projection-table td:first-child,
.projection-table th:last-child,
.projection-table td:last-child {
  text-align: left;
}

.projection-table th {
  background: var(--surface-subtle);
  color: var(--text-muted);
  font-size: 0.74rem;
  font-weight: 850;
  text-transform: uppercase;
  letter-spacing: 0;
}

.projection-table tbody tr:last-child td {
  border-bottom: 0;
}

.content-grid {
  display: grid;
  gap: 14px;
}

.content-card {
  display: grid;
  gap: 12px;
}

.faq-list {
  display: grid;
  gap: 10px;
}

.faq-item {
  overflow: hidden;
}

.faq-question {
  width: 100%;
  min-height: 58px;
  padding: 16px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border: 0;
  background: transparent;
  color: var(--text);
  text-align: left;
  font-size: 0.98rem;
  font-weight: 800;
}

.faq-question:hover,
.faq-question:focus-visible {
  color: var(--accent);
  outline: none;
}

.faq-icon {
  position: relative;
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.faq-icon::before,
.faq-icon::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 14px;
  height: 2px;
  border-radius: 999px;
  background: currentColor;
  transform: translate(-50%, -50%);
  transition: transform 0.25s ease, opacity 0.25s ease;
}

.faq-icon::after {
  transform: translate(-50%, -50%) rotate(90deg);
}

.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.26s ease;
}

.faq-answer-inner {
  padding: 0 18px 18px;
  color: var(--text-soft);
}

.faq-item.open .faq-icon::after {
  opacity: 0;
}

.site-footer {
  margin-top: 28px;
  border-top: 1px solid rgba(215, 222, 231, 0.9);
  background: rgba(255, 255, 255, 0.88);
}

.footer-inner {
  padding: 22px 16px 34px;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  color: var(--text-soft);
  font-size: 0.94rem;
}

.footer-links a:hover,
.footer-links a:focus-visible,
.footer-links a[aria-current="page"] {
  color: var(--accent);
  outline: none;
}

@media (min-width: 560px) {
  .field-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .field-block--full {
    grid-column: 1 / -1;
  }

  .kpi-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (min-width: 760px) {
  .header-inner {
    padding: 12px 24px;
  }

  .planner-hero {
    padding-top: 44px;
    padding-bottom: 34px;
  }

  .content-section {
    padding-left: 20px;
    padding-right: 20px;
  }

  .calculator-title {
    font-size: 3.05rem;
  }

  .result-value {
    font-size: 2.65rem;
  }

  .scenario-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .content-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 980px) {
  .planner-shell {
    grid-template-columns: minmax(0, 1fr) minmax(380px, 0.82fr);
    align-items: start;
  }

  .result-card {
    position: sticky;
    top: 92px;
    margin-top: 38px;
  }
}

@media (max-width: 640px) {
  .header-inner {
    padding: 10px 12px;
    gap: 12px;
  }

  .logo-link {
    min-width: 0;
  }

  .header .logo-img {
    width: min(240px, calc(100vw - 84px));
  }

  .header-nav {
    display: none;
  }

  .menu-button {
    display: inline-flex;
  }

  .mobile-menu {
    padding: 12px;
  }

  .result-actions .action-button {
    flex: 1 1 150px;
  }
}

@media (max-width: 420px) {
  .planner-hero {
    padding-left: 12px;
    padding-right: 12px;
  }

  .content-section {
    padding-left: 12px;
    padding-right: 12px;
  }

  .calculator-title {
    font-size: 1.95rem;
  }

  .result-value {
    font-size: 1.85rem;
  }

  .input-panel,
  .result-card,
  .projection-card,
  .table-card,
  .content-card {
    padding: 16px;
  }
}
