[data-nf-calculator] {
  --nf-soft: #f0f1f4;
  --nf-ink: #141417;
  --nf-muted: #4d4e55;
  --nf-faint: #73757d;
  --nf-line: rgba(20, 20, 23, 0.12);
  --nf-black: #1b1b1f;
  --nf-blue: #4c55ff;
  box-sizing: border-box;
  margin-top: 38px;
  padding: 34px;
  border-radius: 32px;
  color: var(--nf-ink);
  background: var(--nf-soft);
  font-family: "Soehne", "Aptos", "Helvetica Neue", Arial, sans-serif;
}

[data-nf-calculator] *,
[data-nf-calculator] *::before,
[data-nf-calculator] *::after { box-sizing: border-box; }

.nf-calc-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-bottom: 24px; }
.nf-calc-tabs { display: flex; flex-wrap: wrap; gap: 8px; }
.nf-calc-tab { min-height: 44px; padding: 0 17px; border: 1px solid transparent; border-radius: 999px; color: var(--nf-ink); background: #fff; font: inherit; font-size: 14px; font-weight: 800; cursor: pointer; }
.nf-calc-tab[aria-selected="true"] { color: #fff; background: var(--nf-black); }
.nf-currency-switch { display: inline-grid; grid-template-columns: repeat(2, 1fr); padding: 4px; border: 1px solid var(--nf-line); border-radius: 999px; background: #fff; }
.nf-currency-btn { min-width: 70px; min-height: 36px; border: 0; border-radius: 999px; color: var(--nf-muted); background: transparent; font: inherit; font-size: 13px; font-weight: 850; cursor: pointer; }
.nf-currency-btn[aria-pressed="true"] { color: #fff; background: var(--nf-blue); }
.nf-calc-tab:focus-visible,
.nf-currency-btn:focus-visible,
.nf-stepper:focus-visible,
.nf-calc-input:focus-visible,
.nf-range:focus-visible,
.nf-calc-submit:focus-visible { outline: 3px solid rgba(76, 85, 255, 0.28); outline-offset: 2px; }

.nf-calc-panel { display: grid; grid-template-columns: minmax(270px, 0.36fr) minmax(0, 0.64fr); gap: 18px; }
.nf-calc-panel[hidden] { display: none; }
.nf-calc-controls { display: flex; min-width: 0; flex-direction: column; gap: 17px; padding: 28px; border-radius: 26px; background: #fff; }
.nf-field { display: grid; gap: 8px; }
.nf-field label { color: var(--nf-muted); font-size: 14px; font-weight: 760; }
.nf-field-note { color: var(--nf-faint); font-size: 12px; line-height: 1.35; }
.nf-input-row { display: grid; grid-template-columns: 42px 1fr 42px; align-items: center; gap: 8px; }
.nf-stepper,
.nf-calc-input { height: 48px; border: 1px solid var(--nf-line); border-radius: 999px; color: var(--nf-ink); background: #fff; font: inherit; font-weight: 800; font-variant-numeric: tabular-nums; }
.nf-stepper { display: grid; place-items: center; padding: 0; font-size: 20px; cursor: pointer; }
.nf-calc-input { width: 100%; padding: 0 17px; text-align: left; }
.nf-input-row .nf-calc-input { padding: 0 10px; text-align: center; }
.nf-range { width: 100%; accent-color: var(--nf-blue); }
.nf-range-meta { display: flex; justify-content: space-between; color: var(--nf-faint); font-size: 12px; font-variant-numeric: tabular-nums; }
.nf-frequency { display: flex; gap: 8px; }
.nf-frequency label { cursor: pointer; }
.nf-frequency input { position: absolute; opacity: 0; pointer-events: none; }
.nf-frequency span { display: inline-grid; min-height: 34px; place-items: center; padding: 0 14px; border: 1px solid var(--nf-line); border-radius: 999px; color: var(--nf-muted); background: var(--nf-soft); font-size: 12px; font-weight: 800; }
.nf-frequency input:checked + span { color: #fff; border-color: var(--nf-blue); background: var(--nf-blue); }
.nf-assumptions { margin-top: auto; padding: 15px 16px; border-radius: 16px; color: var(--nf-muted); background: var(--nf-soft); font-size: 12px; line-height: 1.45; }
.nf-assumptions strong { color: var(--nf-ink); }
.nf-calc-error { display: none; margin: 0; padding: 12px 14px; border-radius: 12px; color: #8c2b2b; background: #fff0f0; font-size: 12px; line-height: 1.4; }
.nf-calc-error.is-visible { display: block; }
.nf-calc-submit { min-height: 48px; border: 0; border-radius: 999px; color: #fff; background: var(--nf-blue); font: inherit; font-size: 14px; font-weight: 850; cursor: pointer; }
.nf-calc-submit:hover { background: #343de9; }

.nf-chart-card { min-width: 0; min-height: 560px; padding: 28px; border-radius: 28px; background: #fff; }
.nf-result-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 22px; }
.nf-result-grid--two { grid-template-columns: repeat(2, 1fr); }
.nf-result-card { min-height: 112px; padding: 17px; border-radius: 18px; background: var(--nf-soft); }
.nf-result-card:first-child { background: #dfe1ff; }
.nf-result-label { display: block; min-height: 34px; color: var(--nf-muted); font-size: 12px; font-weight: 750; line-height: 1.25; }
.nf-result-label--retirement { min-height: 44px; font-size: 15px; line-height: 1.3; }
.nf-result-value { display: block; margin-top: 8px; color: var(--nf-blue); font-size: clamp(20px, 2.2vw, 30px); line-height: 1; letter-spacing: -0.045em; font-variant-numeric: tabular-nums; }
.nf-chart-legend { display: flex; justify-content: flex-end; gap: 18px; flex-wrap: wrap; margin: 0 0 12px; color: var(--nf-muted); font-size: 12px; font-weight: 700; }
.nf-chart-legend span { display: inline-flex; align-items: center; gap: 7px; }
.nf-chart-legend i { width: 10px; height: 10px; border-radius: 50%; background: var(--nf-blue); }
.nf-chart-legend span:nth-child(2) i { background: #bec2ff; }
.nf-chart-legend span:nth-child(3) i { background: #15161a; }
.nf-chart { width: 100%; min-height: 330px; overflow: hidden; border-radius: 20px; background: #fafafd; }
.nf-chart svg { display: block; width: 100%; height: auto; }
.nf-chart text { fill: #70727a; font-family: inherit; font-size: 11px; }
.nf-chart .nf-grid-line { stroke: rgba(20, 20, 23, 0.09); stroke-width: 1; }
.nf-chart .nf-axis-line { stroke: rgba(20, 20, 23, 0.22); stroke-width: 1; }
.nf-chart .nf-retirement-line { stroke: rgba(20, 20, 23, 0.38); stroke-width: 1; stroke-dasharray: 4 5; }
.nf-chart-caption { margin: 16px 0 0; color: var(--nf-muted); font-size: 12px; line-height: 1.4; }

@media (max-width: 980px) {
  .nf-calc-panel { grid-template-columns: 1fr; }
  .nf-chart-card { min-height: auto; }
}

@media (max-width: 720px) {
  [data-nf-calculator] { padding: 18px; border-radius: 24px; }
  .nf-calc-toolbar { align-items: stretch; flex-direction: column; }
  .nf-calc-tabs { display: grid; grid-template-columns: 1fr; }
  .nf-currency-switch { width: 100%; }
  .nf-calc-controls,
  .nf-chart-card { padding: 20px; border-radius: 22px; }
  .nf-result-grid,
  .nf-result-grid--two { grid-template-columns: 1fr; }
  .nf-result-card,
  .nf-result-label { min-height: auto; }
  .nf-chart { min-height: 270px; overflow-x: auto; }
  .nf-chart svg { min-width: 620px; }
  .nf-chart[data-chart="retirement"] svg { min-width: 100%; }
}
