:root {
  --bg: #f5f7fa;
  --surface: #ffffff;
  --surface-muted: #f9fbfc;
  --text: #111827;
  --text-soft: #4b5563;
  --text-muted: #6b7280;
  --border: #d7dee7;
  --border-strong: #c6d1dd;
  --accent: #2f8f5b;
  --accent-deep: #247149;
  --accent-soft: rgba(47, 143, 91, 0.12);
  --shadow: 0 20px 50px rgba(17, 24, 39, 0.08);
  --radius-card: 16px;
  --radius-input: 10px;
  --radius-pill: 999px;
  --container: 960px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", system-ui, sans-serif;
  background:
    radial-gradient(circle at top left, rgba(95, 165, 238, 0.12), transparent 28%),
    linear-gradient(180deg, #eef6fb 0%, var(--bg) 20%, var(--bg) 100%);
  color: var(--text);
  line-height: 1.5;
}

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

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

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

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

[hidden] {
  display: none !important;
}

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

.header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(255, 255, 255, 0.92);
  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;
  display: block;
}

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

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

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

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

.info-button:hover,
.info-button:focus-visible {
  border-color: var(--accent);
  color: var(--accent);
  transform: translateY(-1px);
  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: 0 16px 16px;
  border-top: 1px solid rgba(215, 222, 231, 0.9);
  background: rgba(255, 255, 255, 0.96);
}

.mobile-menu[hidden] {
  display: none;
}

.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: 14px;
  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;
}

.hero-section {
  padding: 24px 16px 28px;
}

.hero-inner {
  max-width: calc(var(--container) + 40px);
  margin: 0 auto;
}

.calculator-card {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), #ffffff 100%);
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow);
  padding: 20px;
  overflow: hidden;
}

.calculator-header {
  margin-bottom: 22px;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(47, 143, 91, 0.1);
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  margin-bottom: 14px;
}

.calculator-title {
  font-size: clamp(1.9rem, 5vw, 2.75rem);
  line-height: 1.05;
  letter-spacing: -0.04em;
  margin-bottom: 10px;
}

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

.calculator-layout {
  display: grid;
  gap: 22px;
}

.inputs-column,
.results-column {
  min-width: 0;
}

.inputs-group {
  display: grid;
  gap: 18px;
}

.input-block {
  padding: 16px;
  border-radius: 14px;
  background: var(--surface-muted);
  border: 1px solid rgba(215, 222, 231, 0.8);
  transition: background-color 0.24s ease, border-color 0.2s ease, transform 0.2s ease;
}

.input-highlight {
  background-color: rgba(47, 143, 91, 0.08);
}

.field-header,
.slider-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.label-wrap {
  display: grid;
  gap: 4px;
}

.field-label {
  font-size: 0.97rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.helper-text {
  color: var(--text-muted);
  font-size: 0.84rem;
}

.value-badge {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 0 12px;
  border-radius: 999px;
  background: #edf6f0;
  color: var(--accent);
  font-size: 0.84rem;
  font-weight: 700;
}

.input-shell {
  position: relative;
  margin-bottom: 12px;
}

.currency-prefix {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-weight: 600;
  pointer-events: none;
}

.number-input {
  width: 100%;
  height: 52px;
  border: 1px solid var(--border);
  border-radius: var(--radius-input);
  background: var(--surface);
  padding: 0 16px 0 36px;
  color: var(--text);
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
  appearance: textfield;
}

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

.number-input:focus,
.range-input:focus {
  outline: none;
}

.number-input:focus-visible {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(47, 143, 91, 0.14);
  background: #ffffff;
}

.pill-group {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.pill-group--split {
  width: 100%;
}

.pill-group--split .pill {
  flex: 1 1 0;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.pill {
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-soft);
  border-radius: var(--radius-pill);
  padding: 9px 14px;
  font-size: 0.88rem;
  font-weight: 600;
  line-height: 1;
  transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

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

.pill--active:hover,
.pill--active:focus-visible {
  background: #267a4e;
  border-color: #267a4e;
  color: #ffffff;
}

.pill:active {
  transform: translateY(0);
}

.pill--active {
  background: var(--accent);
  border-color: var(--accent);
  color: #ffffff;
  box-shadow: 0 10px 18px rgba(47, 143, 91, 0.2);
}

.slider-stack {
  display: grid;
  gap: 10px;
}

.slider-ticks {
  display: flex;
  justify-content: space-between;
  color: var(--text-muted);
  font-size: 0.77rem;
  padding: 0 2px;
}

.range-input {
  width: 100%;
  appearance: none;
  height: 6px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--accent) 0%, var(--accent) 42%, #d6dfe8 42%, #d6dfe8 100%);
}

.range-input::-webkit-slider-thumb {
  appearance: none;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #ffffff;
  border: 5px solid var(--accent);
  box-shadow: 0 6px 14px rgba(17, 24, 39, 0.12);
  cursor: pointer;
}

.range-input::-moz-range-thumb {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #ffffff;
  border: 5px solid var(--accent);
  box-shadow: 0 6px 14px rgba(17, 24, 39, 0.12);
  cursor: pointer;
}

.range-input::-moz-range-track {
  height: 6px;
  border-radius: 999px;
  background: #d6dfe8;
}

.static-display {
  min-height: 52px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 16px;
  border-radius: var(--radius-input);
  border: 1px solid var(--border);
  background: var(--surface);
}

.static-display__value {
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.static-display__note {
  color: var(--text-muted);
  font-size: 0.84rem;
  font-weight: 600;
}

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

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

.kpi-item {
  padding: 16px;
  border-radius: 14px;
  background: var(--surface-muted);
  border: 1px solid rgba(215, 222, 231, 0.8);
}

.kpi-label {
  display: block;
  color: var(--text-muted);
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 8px;
}

.kpi-value {
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: -0.03em;
}

.kpi-item--primary {
  background: linear-gradient(180deg, #f2fbf5 0%, #ffffff 100%);
  border-color: rgba(47, 143, 91, 0.24);
}

.kpi-item--primary .kpi-value {
  color: var(--accent);
  font-size: clamp(1.8rem, 5vw, 2.3rem);
}

.chart-panel {
  padding: 18px;
  border-radius: var(--radius-card);
  background: var(--surface);
  border: 1px solid rgba(215, 222, 231, 0.9);
  min-height: 220px;
  display: grid;
  gap: 14px;
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.panel-title {
  font-size: 0.96rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.panel-caption {
  color: var(--text-muted);
  font-size: 0.82rem;
  max-width: 42ch;
}

#chartContainer {
  position: relative;
  min-height: 220px;
  height: 280px;
  border-radius: 14px;
  background:
    linear-gradient(180deg, rgba(47, 143, 91, 0.05), rgba(47, 143, 91, 0.01)),
    linear-gradient(180deg, #ffffff 0%, #f8fbfc 100%);
  border: 1px solid rgba(215, 222, 231, 0.9);
  overflow: hidden;
  isolation: isolate;
  touch-action: pan-y;
}

.chart-hint {
  position: absolute;
  z-index: 3;
  color: var(--text-muted);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  pointer-events: none;
  opacity: 0.9;
}

.chart-hint--years {
  top: 12px;
  left: 14px;
}

.chart-hint--amount {
  top: 12px;
  right: 14px;
  bottom: auto;
  text-align: right;
}

.chart-empty {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.86rem;
  font-weight: 600;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.7), rgba(248, 251, 252, 0.85));
}

.chart-empty[hidden] {
  display: none;
}

.chart-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  z-index: 1;
  overflow: visible;
  transition: opacity 180ms ease;
}

.chart-svg .chart-grid-line,
.chart-svg .chart-axis-line {
  stroke: rgba(198, 209, 221, 0.8);
  stroke-width: 0.35;
  vector-effect: non-scaling-stroke;
}

.chart-svg .chart-axis-line--base {
  stroke: rgba(156, 169, 184, 0.95);
}

.chart-svg .chart-bars-original,
.chart-svg .chart-bars-adjusted,
.chart-svg .chart-axis-labels,
.chart-svg .chart-guide-line,
.chart-svg .chart-marker {
  transition: opacity 220ms ease, transform 240ms ease;
  transform-origin: left center;
}

.chart-svg.chart-svg--updating .chart-bars-original,
.chart-svg.chart-svg--updating .chart-bars-adjusted,
.chart-svg.chart-svg--updating .chart-axis-labels {
  opacity: 0.12;
  transform: translateY(5px);
}

.chart-bar {
  rx: 999;
  ry: 999;
}

.chart-bar--original {
  fill: rgba(156, 169, 184, 0.65);
}

.chart-bar--adjusted {
  fill: url(#chartBarAdjustedGradient);
}

.chart-axis-text {
  fill: var(--text-muted);
  font-size: 2.4px;
  font-weight: 700;
}

.chart-axis-text--year {
  text-anchor: end;
  dominant-baseline: middle;
}

.chart-axis-text--amount {
  dominant-baseline: middle;
}

.chart-axis-text--amount-start {
  text-anchor: start;
}

.chart-axis-text--amount-middle {
  text-anchor: middle;
}

.chart-axis-text--amount-end {
  text-anchor: end;
}

.chart-guide-line {
  stroke: rgba(36, 113, 73, 0.28);
  stroke-width: 0.45;
  stroke-dasharray: 1.4 1.6;
  vector-effect: non-scaling-stroke;
  opacity: 0;
}

.chart-marker {
  fill: #ffffff;
  stroke: rgba(36, 113, 73, 0.95);
  stroke-width: 0.8;
  vector-effect: non-scaling-stroke;
  opacity: 0;
}

.chart-hit-area {
  fill: transparent;
  cursor: pointer;
}

.chart-tooltip {
  position: absolute;
  z-index: 4;
  min-width: 132px;
  max-width: 190px;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.98);
  border: 1px solid rgba(215, 222, 231, 0.95);
  box-shadow: 0 14px 30px rgba(17, 24, 39, 0.12);
  color: var(--text);
  pointer-events: none;
  opacity: 0;
  transform: translate3d(0, 8px, 0);
  transition: opacity 180ms ease, transform 180ms ease;
}

.chart-tooltip.is-visible {
  opacity: 1;
  transform: translate3d(0, 0, 0);
}

.chart-tooltip__year {
  display: block;
  margin-bottom: 6px;
  color: var(--text-muted);
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.chart-tooltip__value {
  display: block;
  font-size: 0.96rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text);
}

.chart-tooltip__meta {
  display: block;
  margin-top: 3px;
  color: var(--text-soft);
  font-size: 0.77rem;
  font-weight: 600;
}

.scenario-toggles {
  margin-top: 18px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

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

.scenario-button:hover,
.scenario-button:focus-visible {
  transform: translateY(-1px);
  background: rgba(47, 143, 91, 0.14);
  border-color: rgba(47, 143, 91, 0.34);
  outline: none;
}

.scenario-button:active {
  transform: translateY(0);
}

.content-section {
  max-width: calc(var(--container) + 40px);
  margin: 0 auto;
  padding: 8px 16px 40px;
}

.section-intro {
  margin-bottom: 22px;
  max-width: 60ch;
}

.section-title {
  font-size: clamp(1.55rem, 4vw, 2.15rem);
  line-height: 1.1;
  letter-spacing: -0.04em;
  margin-bottom: 10px;
}

.section-copy {
  color: var(--text-soft);
}

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

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

.content-card--link:hover,
.content-card--link:focus-visible {
  background: rgba(47, 143, 91, 0.08);
  border-color: rgba(47, 143, 91, 0.28);
  transform: translateY(-1px);
  outline: none;
}

.content-card__cta {
  color: var(--accent);
  font-size: 0.88rem;
  font-weight: 700;
}

.content-cta {
  margin-top: 16px;
}

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

.faq-item {
  border: 1px solid rgba(215, 222, 231, 0.95);
  background: rgba(255, 255, 255, 0.88);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 8px 24px rgba(17, 24, 39, 0.04);
}

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

.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.28s ease;
}

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

.faq-item.open .faq-icon::after {
  opacity: 0;
  transform: translate(-50%, -50%) rotate(90deg) scale(0.9);
}

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

.footer-inner {
  max-width: calc(var(--container) + 40px);
  margin: 0 auto;
  padding: 22px 16px 34px;
  display: grid;
  gap: 18px;
}

.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 {
  color: var(--accent);
  outline: none;
}

.language-block {
  display: grid;
  gap: 10px;
}

.language-label {
  color: var(--text-muted);
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

@media (hover: none), (pointer: coarse) {
  .chart-tooltip {
    min-width: 140px;
    padding: 12px 14px;
    font-size: 13px;
    line-height: 1.4;
  }

  .chart-tooltip__year,
  .chart-tooltip__meta {
    font-size: 13px;
  }

  .chart-tooltip__value {
    font-size: 16px;
  }
}

@media (min-width: 480px) {
  .hero-section {
    padding-top: 30px;
  }

  .calculator-card {
    padding: 24px;
  }

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

@media (min-width: 768px) {
  .header-inner,
  .hero-inner,
  .content-section,
  .footer-inner {
    padding-left: 20px;
    padding-right: 20px;
  }

  .header-inner {
    padding: 12px 24px;
  }

  .hero-section {
    padding-top: 36px;
    padding-bottom: 36px;
  }

  .calculator-card {
    max-width: var(--container);
    margin: 0 auto;
    padding: 28px;
  }

  .calculator-layout {
    grid-template-columns: minmax(0, 1.08fr) minmax(320px, 0.92fr);
    align-items: start;
  }

  .results-column {
    position: sticky;
    top: 92px;
  }

  .results-stack {
    gap: 16px;
  }

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

  .kpi-item--primary {
    grid-column: 1 / -1;
    padding: 22px;
  }

  .kpi-item--primary .kpi-value {
    font-size: clamp(2.5rem, 4vw, 3.2rem);
  }

  .kpi-item:not(.kpi-item--primary) .kpi-value {
    font-size: 1.5rem;
  }

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

  .footer-inner {
    grid-template-columns: 1fr auto;
    align-items: center;
  }
}

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

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

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

  .header-nav,
  .info-button {
    display: none;
  }

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

  .mobile-menu {
    padding: 0 12px 12px;
  }
}

@media (max-width: 768px) {
  .logo-img {
    width: 200px;
    height: auto;
  }
}

@media (min-width: 1024px) {
  .calculator-card {
    padding: 32px;
  }

  .input-block,
  .kpi-item,
  .chart-panel {
    border-radius: 16px;
  }
}
