@font-face {
    font-family: "Inter";
    src: url("/fonts/InterVariable.woff2?v=4.1") format("woff2");
    font-style: normal;
    font-weight: 100 900;
    font-display: swap;
}

:root {
    --ink: #17282e;
    --ink-soft: #50636a;
    --paper: #f5f8f9;
    --surface: #ffffff;
    --surface-alt: #f8fbfc;
    --line: #d9e5e8;
    --field-line: #7d969f;
    --green: #1b667a;
    --green-dark: #123b4a;
    --green-pale: #dcecf1;
    --amber: #b15b1a;
    --blue: #2d657b;
    --danger: #a32929;
    --danger-pale: #fff0ed;
    --shadow: 0 10px 30px rgba(18, 59, 74, 0.055);
    font-family: "Inter", Arial, Helvetica, sans-serif;
    color: var(--ink);
    background: var(--paper);
    font-synthesis: none;
}

* {
    box-sizing: border-box;
}

[hidden] {
    display: none !important;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    min-width: 320px;
    background: var(--paper);
}

button,
input,
select {
    font: inherit;
}

button,
select {
    cursor: pointer;
}

:where(button, a):focus-visible {
    outline: 3px solid var(--green);
    outline-offset: 3px;
}

.results-panel :where(button, a):focus-visible {
    outline-color: #9ed5e2;
}

.site-header {
    width: 100%;
    padding: 19px max(20px, calc((100% - 1180px) / 2));
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--line);
    background: var(--surface);
}

.site-header nav {
    display: flex;
    align-items: center;
    gap: 20px;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: var(--green-dark);
    font-weight: 750;
    letter-spacing: -0.025em;
    text-decoration: none;
}

.brand-logo {
    width: 36px;
    height: 36px;
    flex: 0 0 36px;
    display: block;
    object-fit: contain;
}

.text-button {
    color: var(--green-dark);
    font-weight: 700;
}

.header-link {
    color: var(--green);
    font-weight: 650;
    text-decoration-thickness: 1px;
    text-underline-offset: 5px;
}

.intro {
    width: min(1180px, calc(100% - 40px));
    margin: 42px auto 30px;
}

.step-label {
    margin: 0 0 10px;
    color: var(--green);
    font-size: 0.78rem;
    font-weight: 750;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.step-label-with-logo {
    display: inline-flex;
    align-items: center;
    gap: 7px;
}

.step-label-logo {
    width: 22px;
    height: 22px;
    flex: 0 0 22px;
    display: block;
    object-fit: contain;
}

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

h1 {
    margin-bottom: 12px;
    font-size: clamp(2.25rem, 4vw, 3.4rem);
    line-height: 1.08;
    letter-spacing: -0.045em;
}

.intro p {
    margin-bottom: 0;
    max-width: 740px;
    color: var(--ink-soft);
    font-size: clamp(1rem, 1.5vw, 1.16rem);
    font-weight: 500;
    line-height: 1.55;
    letter-spacing: -0.012em;
}

.method-badge {
    padding: 8px 12px;
    border: 1px solid rgba(27, 102, 122, 0.22);
    border-radius: 999px;
    color: var(--green-dark);
    background: rgba(255, 255, 255, 0.55);
    font-size: 0.82rem;
    font-weight: 700;
}

.app-layout {
    width: min(1180px, calc(100% - 40px));
    margin: 0 auto 24px;
    display: grid;
    grid-template-columns: minmax(0, 1.12fr) minmax(350px, 0.88fr);
    gap: 18px;
    align-items: start;
}

.app-layout.is-wizard-view,
.app-layout.is-result-view {
    grid-template-columns: minmax(0, 1fr);
}

.app-layout.is-wizard-view {
    max-width: 820px;
}

.input-stack,
.result-stack {
    min-width: 0;
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 18px;
    align-content: start;
}

@media (min-width: 921px) {
    .app-layout {
        grid-template-rows: auto auto;
    }

    .input-stack,
    .result-stack {
        grid-row: 1 / span 2;
        grid-template-rows: subgrid;
        align-content: stretch;
    }

    .input-stack {
        grid-column: 1;
    }

    .result-stack {
        grid-column: 2;
    }

    .results-panel {
        align-self: start;
    }

    .app-layout.is-wizard-view {
        grid-template-columns: minmax(0, 1fr);
        grid-template-rows: auto;
    }

    .app-layout.is-wizard-view .input-stack {
        grid-column: 1;
        grid-row: 1;
        grid-template-rows: auto;
    }

    .app-layout.is-result-view {
        grid-template-columns: minmax(0, 1fr);
        grid-template-rows: auto;
    }

    .app-layout.is-result-view .result-stack {
        grid-column: 1;
        grid-row: 1;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        grid-template-rows: auto;
        align-items: start;
    }
}

.additional-resources {
    width: min(1180px, calc(100% - 40px));
    margin: 0 auto 24px;
    padding: clamp(24px, 3.4vw, 36px);
}

.resources-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 28px;
}

.resources-heading h2 {
    margin-bottom: 10px;
    font-size: clamp(1.5rem, 2.8vw, 2rem);
    letter-spacing: -0.035em;
}

.resources-heading p:last-child {
    max-width: 720px;
    margin-bottom: 0;
    color: var(--ink-soft);
    line-height: 1.5;
}

.add-resource-button,
.remove-resource-button {
    border-radius: 10px;
    font-weight: 700;
}

.add-resource-button {
    min-width: 170px;
    min-height: 48px;
    padding: 10px 18px;
    border: 0;
    color: white;
    background: var(--green);
}

.add-resource-button:hover {
    background: var(--green-dark);
}

.resource-guidance {
    display: grid;
    gap: 4px;
    margin: 24px 0;
    padding: 15px 17px;
    border-left: 3px solid var(--amber);
    border-radius: 0 10px 10px 0;
    color: var(--ink-soft);
    background: #faf2e9;
    font-size: 0.88rem;
    line-height: 1.45;
}

.resource-guidance strong {
    color: var(--ink);
}

.resource-sync-status {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin: 0 0 24px;
    padding: 15px 17px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--surface-alt);
}

.resource-sync-status > div {
    display: grid;
    gap: 3px;
}

.resource-sync-status strong {
    font-size: 0.88rem;
}

.resource-sync-status div span {
    color: var(--ink-soft);
    font-size: 0.8rem;
    line-height: 1.4;
}

.resource-sync-status > span {
    flex: 0 0 auto;
    padding: 6px 9px;
    border-radius: 999px;
    color: var(--green-dark);
    background: var(--green-pale);
    font-size: 0.7rem;
    font-weight: 800;
}

.resource-sync-status.is-dirty {
    border-color: rgba(176, 116, 15, 0.34);
    background: #fff9eb;
}

.resource-sync-status.is-dirty > span {
    color: #6f4800;
    background: #ffedbd;
}

.resource-type-picker {
    margin-bottom: 24px;
    padding: 20px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: var(--surface-alt);
}

.resource-type-picker > p {
    margin-bottom: 14px;
    font-weight: 800;
}

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

.resource-type-grid button {
    min-height: 130px;
    padding: 17px;
    border: 1px solid var(--line);
    border-radius: 12px;
    color: var(--ink);
    background: white;
    text-align: left;
}

.resource-type-grid button:hover,
.resource-type-grid button:focus-visible {
    border-color: var(--green);
    box-shadow: 0 0 0 3px rgba(27, 102, 122, 0.10);
}

.resource-type-grid strong,
.resource-type-grid span {
    display: block;
}

.resource-type-grid strong {
    margin-bottom: 7px;
}

.resource-type-grid span {
    color: var(--ink-soft);
    font-size: 0.79rem;
    line-height: 1.4;
}

.resources-empty {
    padding: 22px;
    border: 1px dashed var(--field-line);
    border-radius: 14px;
    color: var(--ink-soft);
    text-align: center;
}

.resources-empty p {
    max-width: 700px;
    margin: 0 auto;
    line-height: 1.5;
}

.resources-list {
    display: grid;
    gap: 18px;
}

.resource-card {
    --resource-accent: var(--green);
    --resource-tint: var(--green-pale);
    padding: clamp(20px, 3vw, 30px);
    border: 1px solid var(--line);
    border-left: 4px solid var(--resource-accent);
    border-radius: 14px;
    background: var(--surface);
}

.resource-card[data-resource-type="PERIODIC_INCOME"],
.resource-chart-panel[data-resource-type="PERIODIC_INCOME"] {
    --resource-accent: var(--blue);
    --resource-tint: #e9f3f6;
}

.resource-card[data-resource-type="FUTURE_LUMP_SUM"],
.resource-chart-panel[data-resource-type="FUTURE_LUMP_SUM"] {
    --resource-accent: var(--amber);
    --resource-tint: #faf2e9;
}

.resource-card-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 22px;
}

.resource-type-badge {
    display: inline-block;
    margin-bottom: 9px;
    padding: 5px 9px;
    border-radius: 999px;
    color: var(--resource-accent);
    background: var(--resource-tint);
    font-size: 0.7rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.resource-card-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-bottom: 9px;
}

.resource-card-meta .resource-type-badge {
    margin-bottom: 0;
}

.resource-calculation-status {
    display: inline-block;
    padding: 5px 9px;
    border-radius: 999px;
    color: var(--ink-soft);
    background: var(--surface-alt);
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.02em;
}

.resource-card.is-calculated .resource-calculation-status {
    color: var(--green-dark);
    background: var(--green-pale);
}

.resource-card.is-dirty .resource-calculation-status {
    color: #6f4800;
    background: #ffedbd;
}

.resource-card-heading h3 {
    margin-bottom: 6px;
    font-size: 1.22rem;
}

.resource-card-heading p {
    margin: 0;
    color: var(--ink-soft);
    font-size: 0.88rem;
    line-height: 1.45;
}

.remove-resource-button {
    min-height: 40px;
    padding: 8px 11px;
    border: 1px solid rgba(163, 41, 41, 0.28);
    color: var(--danger);
    background: white;
}

.remove-resource-button:hover {
    background: var(--danger-pale);
}

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

.resource-pac-impact {
    margin: 20px 0 0;
    padding: 14px 16px;
    border: 1px solid rgba(27, 102, 122, 0.2);
    border-radius: 12px;
    color: var(--green-dark);
    background: rgba(27, 102, 122, 0.08);
    font-size: 0.88rem;
    font-weight: 650;
    line-height: 1.5;
}

.resource-pac-impact a {
    color: var(--green);
    font-weight: 800;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.resource-pac-impact a:hover,
.resource-pac-impact a:focus-visible {
    color: var(--green-dark);
}

.checkbox-control {
    min-height: 48px;
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 11px 13px;
    border: 1px solid var(--field-line);
    border-radius: 10px;
    background: white;
}

.checkbox-control input {
    width: 19px;
    height: 19px;
    min-height: 0;
    flex: 0 0 19px;
    accent-color: var(--green);
}

.checkbox-control span {
    color: var(--ink-soft);
    font-size: 0.84rem;
    font-weight: 500;
    line-height: 1.3;
}

.resources-actions {
    max-width: 520px;
    margin: 22px auto 0;
    text-align: center;
}

.resources-actions .primary-button {
    margin-top: 0;
}

.resources-actions small {
    display: block;
    margin-top: 9px;
    color: var(--ink-soft);
    line-height: 1.4;
}

.resources-result {
    margin-top: 28px;
    padding: clamp(20px, 3vw, 30px);
    border: 1px solid var(--line);
    border-radius: 14px;
    color: var(--ink);
    background: var(--surface-alt);
}

.resources-result .step-label {
    color: var(--green);
}

.resources-result h3 {
    margin-bottom: 18px;
    font-size: 1.35rem;
}

.resources-result dl {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0 26px;
    margin: 0;
}

.resources-result dl div {
    display: flex;
    justify-content: space-between;
    gap: 18px;
    padding: 12px 0;
    border-top: 1px solid var(--line);
}

.resources-result dt {
    color: var(--ink-soft);
    font-size: 0.84rem;
}

.resources-result dd {
    margin: 0;
    color: var(--ink);
    font-size: 0.88rem;
    font-weight: 750;
    font-variant-numeric: tabular-nums;
    text-align: right;
}

.projections {
    width: min(1180px, calc(100% - 40px));
    margin: 0 auto 74px;
}

.projections-heading {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 28px;
    margin-bottom: 24px;
}

.projections-heading h2 {
    margin-bottom: 0;
    font-size: clamp(1.5rem, 2.8vw, 2rem);
    letter-spacing: -0.035em;
}

.projections-heading > p {
    max-width: 410px;
    margin: 0;
    color: var(--ink-soft);
    font-size: 0.9rem;
    line-height: 1.5;
}

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

.resource-projections {
    margin-bottom: 32px;
}

.resource-chart-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 16px;
}

.resource-chart-panel {
    --resource-accent: var(--green);
    --resource-tint: var(--green-pale);
    border-top: 3px solid var(--resource-accent);
}

.resource-chart-type {
    display: inline-block;
    margin-bottom: 8px;
    color: var(--resource-accent);
    font-size: 0.76rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.resource-chart-panel h3 {
    overflow-wrap: anywhere;
}

.chart-panel {
    min-width: 0;
    margin: 0;
    padding: 22px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: var(--surface);
    box-shadow: var(--shadow);
}

.chart-panel figcaption {
    min-height: 100px;
}

.chart-panel h3 {
    margin-bottom: 6px;
    font-size: 1.18rem;
}

.chart-panel figcaption p {
    margin-bottom: 15px;
    color: var(--ink-soft);
    font-size: 0.88rem;
    line-height: 1.45;
}

.chart-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 18px;
}

.chart-legend button {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    min-height: 40px;
    padding: 6px 8px;
    border: 1px solid transparent;
    border-radius: 8px;
    color: var(--ink-soft);
    background: transparent;
    font-size: 0.84rem;
}

.chart-legend button:hover,
.chart-legend button:focus-visible {
    border-color: var(--line);
    background: var(--surface-alt);
    outline: none;
}

.chart-legend button:focus-visible {
    box-shadow: 0 0 0 3px rgba(27, 102, 122, 0.16);
}

.chart-legend button[aria-pressed="false"] {
    text-decoration: line-through;
}

.chart-legend button[aria-pressed="false"] .legend-swatch {
    opacity: 0.5;
}

.legend-swatch {
    width: 20px;
    height: 3px;
    border-radius: 99px;
}

.series-one {
    background: var(--green);
}

.series-two {
    background: var(--amber);
}

.legend-swatch.series-two {
    height: 0;
    border-top: 3px dashed var(--amber);
    background: transparent;
}

.resource-chart-panel .legend-swatch.series-one {
    background: var(--resource-accent);
}

.chart-wrap {
    position: relative;
    min-width: 0;
}

.projection-chart {
    display: block;
    width: 100%;
    min-height: 300px;
    overflow: visible;
    touch-action: pan-y;
}

.chart-frame {
    fill: var(--surface);
    stroke: var(--line);
}

.chart-grid-line {
    stroke: #e3ecef;
    stroke-width: 1;
}

.chart-axis-label,
.chart-axis-title {
    fill: var(--ink-soft);
    font-family: "Inter", Arial, Helvetica, sans-serif;
    font-size: 12px;
}

.chart-axis-title {
    font-weight: 700;
}

.chart-line {
    fill: none;
    stroke-width: 2.75;
    stroke-linecap: round;
    stroke-linejoin: round;
    vector-effect: non-scaling-stroke;
}

.chart-line-series-one,
.chart-hover-marker-series-one {
    stroke: var(--green);
}

.chart-line-series-two,
.chart-hover-marker-series-two {
    stroke: var(--amber);
}

.chart-line-series-two {
    stroke-dasharray: 7 5;
    stroke-width: 2.35;
}

.resource-chart-panel .chart-line-series-one,
.resource-chart-panel .chart-hover-marker-series-one {
    stroke: var(--resource-accent);
}

.chart-hover-guide {
    stroke: var(--ink-soft);
    stroke-width: 1;
    stroke-dasharray: 4 4;
    pointer-events: none;
}

.chart-hover-marker {
    fill: white;
    stroke-width: 2.5;
    pointer-events: none;
}

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

.chart-hit-area:focus-visible {
    stroke: var(--green);
    stroke-width: 3;
    outline: none;
}

.chart-tooltip {
    position: absolute;
    z-index: 4;
    width: max-content;
    max-width: min(240px, calc(100% - 16px));
    padding: 10px 12px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 10px;
    color: white;
    background: var(--green-dark);
    box-shadow: 0 10px 30px rgba(23, 40, 46, 0.18);
    font-size: 0.76rem;
    line-height: 1.45;
    pointer-events: none;
}

.chart-tooltip strong {
    display: block;
    margin-bottom: 4px;
}

.chart-tooltip span {
    display: flex;
    justify-content: space-between;
    gap: 18px;
}

.chart-tooltip i {
    width: 7px;
    height: 7px;
    margin: 5px 6px 0 0;
    border-radius: 50%;
    flex: 0 0 auto;
}

.chart-tooltip b {
    margin-left: auto;
}

.panel {
    border: 1px solid var(--line);
    border-radius: 18px;
    background: var(--surface);
    box-shadow: var(--shadow);
}

.form-panel,
.results-panel {
    padding: clamp(24px, 3.4vw, 36px);
}

.results-overview {
    grid-column: 1 / -1;
    padding: 8px 4px 6px;
}

.results-overview .step-label {
    margin-bottom: 8px;
}

.results-overview h2 {
    margin: 0;
    font-size: clamp(1.65rem, 3vw, 2.35rem);
    letter-spacing: -0.035em;
}

.results-overview > p:last-child {
    max-width: 680px;
    margin: 10px 0 0;
    color: var(--ink-soft);
    font-size: 0.96rem;
    font-weight: 500;
    line-height: 1.5;
}

.results-actions {
    grid-column: 1 / -1;
    display: flex;
    justify-content: center;
    padding: 2px 0 6px;
}

.results-actions .secondary-button {
    width: auto;
    min-width: 220px;
    border-color: var(--green);
    color: var(--green-dark);
    background: white;
    box-shadow: 0 6px 16px rgba(27, 102, 122, 0.08);
}

.results-actions .secondary-button:hover {
    color: var(--green-dark);
    background: var(--green-pale);
}

.results-panel {
    color: white;
    background: var(--green-dark);
}

.section-heading {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    align-items: start;
    margin-bottom: 24px;
}

.section-heading h2,
.explanation h2,
.disclaimer h2 {
    margin-bottom: 0;
    font-size: clamp(1.5rem, 2.8vw, 2rem);
    letter-spacing: -0.035em;
}

.wizard-intro {
    max-width: 580px;
    margin: 10px 0 0;
    color: var(--ink-soft);
    font-size: 0.92rem;
    line-height: 1.5;
}

.wizard-progress {
    margin: 6px 0 28px;
    overflow-x: auto;
    scrollbar-width: thin;
}

.wizard-progress ol {
    min-width: 540px;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(6, minmax(78px, 1fr));
    list-style: none;
}

.wizard-progress li {
    position: relative;
    display: grid;
    justify-items: center;
    gap: 7px;
    color: var(--ink-soft);
    font-size: 0.72rem;
    text-align: center;
}

.wizard-progress li::before {
    content: "";
    position: absolute;
    z-index: 0;
    top: 14px;
    right: 50%;
    width: 100%;
    height: 1px;
    background: var(--line);
}

.wizard-progress li:first-child::before {
    display: none;
}

.wizard-progress li > span {
    position: relative;
    z-index: 1;
    width: 29px;
    height: 29px;
    display: grid;
    place-items: center;
    border: 1px solid var(--line);
    border-radius: 50%;
    background: var(--surface);
    font-weight: 800;
}

.wizard-progress li[aria-current="step"] {
    color: var(--green-dark);
}

.wizard-progress li[aria-current="step"] > span {
    border-color: var(--green);
    color: white;
    background: var(--green);
    box-shadow: 0 0 0 4px rgba(27, 102, 122, 0.10);
}

.wizard-progress li.is-complete {
    color: var(--green-dark);
}

.wizard-progress li.is-complete::before {
    background: var(--green);
}

.wizard-progress li[aria-current="step"]::before {
    background: var(--green);
}

.wizard-progress li.is-complete > span {
    border-color: var(--green);
    color: var(--green-dark);
    background: var(--green-pale);
}

.wizard-steps {
    min-width: 0;
    display: grid;
    gap: 18px;
}

.wizard-edit-banner {
    margin-bottom: 18px;
    padding: 18px 20px;
    display: flex;
    justify-content: space-between;
    gap: 18px;
    align-items: center;
    border: 1px solid rgba(27, 102, 122, 0.22);
    border-radius: 14px;
    background: var(--green-pale);
}

.wizard-edit-banner h3 {
    margin: 0 0 5px;
    font-size: 1rem;
}

.wizard-edit-banner p {
    margin: 0;
    color: var(--ink-soft);
    font-size: 0.84rem;
    font-weight: 500;
    line-height: 1.45;
}

.wizard-edit-banner > span {
    flex: 0 0 auto;
    padding: 6px 9px;
    border-radius: 999px;
    color: var(--green-dark);
    background: rgba(255, 255, 255, 0.78);
    font-size: 0.7rem;
    font-weight: 800;
}

.wizard-edit-banner.is-dirty {
    border-color: rgba(176, 116, 15, 0.34);
    background: #fff5dc;
}

.wizard-edit-banner.is-dirty > span {
    color: #6f4800;
}

.wizard-panel.is-edit-mode .wizard-steps {
    gap: 14px;
}

.wizard-panel.is-edit-mode .wizard-step {
    background: white;
}

.wizard-step {
    min-width: 0;
    padding: 22px;
    border: 1px solid var(--line);
    border-radius: 15px;
    background: var(--surface-alt);
}

.wizard-step:not([hidden]) {
    animation: wizard-step-in 180ms ease-out;
}

@keyframes wizard-step-in {
    from {
        opacity: 0;
        transform: translateY(5px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.wizard-step-heading {
    margin-bottom: 20px;
}

.wizard-step-heading > p {
    margin-bottom: 7px;
    color: var(--green);
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.07em;
    text-transform: uppercase;
}

.wizard-step-heading h3 {
    margin-bottom: 7px;
    font-size: 1.16rem;
    letter-spacing: -0.02em;
}

.wizard-step-heading > span {
    display: block;
    color: var(--ink-soft);
    font-size: 0.86rem;
    line-height: 1.5;
}

.method-choice-field > p {
    margin-bottom: 12px;
    color: var(--ink);
    font-size: 0.92rem;
    font-weight: 650;
}

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

.method-choice-card {
    min-width: 0;
    padding: 16px;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 12px;
    align-items: start;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: white;
    cursor: pointer;
    transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.method-choice-card:hover {
    border-color: var(--field-line);
    transform: translateY(-1px);
}

.method-choice-card:has(input:checked) {
    border-color: var(--green);
    background: rgba(220, 236, 241, 0.42);
    box-shadow: 0 0 0 3px rgba(27, 102, 122, 0.09);
}

.method-choice-card:has(input:focus-visible) {
    outline: 3px solid var(--green);
    outline-offset: 3px;
}

.method-choice-card input {
    width: 18px;
    min-height: 18px;
    margin: 2px 0 0;
    padding: 0;
    accent-color: var(--green);
    box-shadow: none;
}

.method-choice-copy {
    min-width: 0;
    display: grid;
    gap: 7px;
}

.method-choice-copy strong {
    font-size: 0.96rem;
}

.method-choice-copy small {
    color: var(--ink-soft);
    font-size: 0.8rem;
    font-style: normal;
    font-weight: 400;
    line-height: 1.45;
}

.method-choice-copy em {
    width: fit-content;
    padding: 4px 8px;
    border-radius: 999px;
    color: var(--green-dark);
    background: var(--green-pale);
    font-size: 0.68rem;
    font-style: normal;
    font-weight: 750;
}

.method-description {
    display: block;
    margin-top: 12px;
    color: var(--ink-soft);
    font-size: 0.82rem;
    font-weight: 400;
    line-height: 1.45;
}

.wizard-navigation {
    margin-top: 20px;
    display: grid;
    grid-template-columns: minmax(120px, 1fr) auto minmax(120px, 1fr);
    gap: 14px;
    align-items: center;
}

.wizard-navigation button {
    width: auto;
    min-width: 120px;
    margin: 0;
}

.wizard-navigation .wizard-back,
.wizard-navigation .wizard-cancel-edit {
    grid-column: 1;
    justify-self: start;
    border-color: var(--field-line);
    color: var(--green-dark);
    background: white;
}

.wizard-navigation .wizard-back:hover,
.wizard-navigation .wizard-cancel-edit:hover {
    border-color: var(--green);
    color: var(--green-dark);
    background: var(--green-pale);
}

.wizard-navigation .wizard-next,
.wizard-navigation .wizard-submit {
    grid-column: 3;
    justify-self: end;
}

.wizard-navigation > p {
    grid-column: 2;
    grid-row: 1;
    margin: 0;
    color: var(--ink-soft);
    font-size: 0.78rem;
    font-weight: 650;
    text-align: center;
}

.text-button {
    padding: 4px 0;
    border: 0;
    border-bottom: 1px solid currentColor;
    background: transparent;
    white-space: nowrap;
}

fieldset {
    margin: 0;
    padding: 22px 0;
    border: 0;
    border-top: 1px solid var(--line);
}

legend {
    padding: 0 0 16px;
    font-size: 1rem;
    font-weight: 750;
}

.fieldset-note {
    margin: 14px 0 0;
    color: var(--ink-soft);
    font-size: 0.82rem;
    line-height: 1.45;
}

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

.field {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 7px;
    color: var(--ink);
    font-size: 0.92rem;
    font-weight: 650;
}

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

.field-align-label > .label-with-info {
    min-height: 36px;
}

.field small {
    color: var(--ink-soft);
    font-size: 0.84rem;
    font-weight: 400;
    line-height: 1.45;
}

.tax-basis-control {
    margin-top: 17px;
    padding: 14px 16px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--surface-alt);
}

.tax-basis-control > p {
    margin: 0;
    color: var(--ink-soft);
    font-size: 0.84rem;
    line-height: 1.5;
}

.tax-basis-control .field {
    margin-top: 14px;
}

.inline-action {
    padding: 0;
    border: 0;
    border-bottom: 1px solid currentColor;
    color: var(--green);
    background: transparent;
    font-weight: 750;
}

.inline-action:hover,
.inline-action:focus-visible {
    color: var(--green-dark);
}

input:disabled,
select:disabled {
    cursor: not-allowed;
    opacity: 0.7;
}

input,
select,
.input-prefix,
.input-suffix {
    width: 100%;
}

input,
select {
    min-width: 0;
    min-height: 50px;
    padding: 11px 13px;
    border: 1px solid var(--field-line);
    border-radius: 10px;
    color: var(--ink);
    background: white;
    outline: none;
}

input[type="number"] {
    font-variant-numeric: tabular-nums;
}

input:focus,
select:focus {
    border-color: var(--green);
    box-shadow: 0 0 0 3px rgba(27, 102, 122, 0.14);
}

input[aria-invalid="true"],
select[aria-invalid="true"] {
    border-color: var(--danger);
    box-shadow: 0 0 0 3px rgba(163, 41, 41, 0.10);
}

.input-prefix,
.input-suffix {
    display: grid;
    align-items: center;
    border: 1px solid var(--field-line);
    border-radius: 10px;
    background: white;
    overflow: hidden;
}

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

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

.input-prefix > span,
.input-suffix > span {
    padding: 0 13px;
    color: var(--ink-soft);
    font-weight: 700;
}

.input-prefix input,
.input-suffix input {
    border: 0;
    border-radius: 0;
    box-shadow: none;
}

.input-prefix:focus-within,
.input-suffix:focus-within {
    border-color: var(--green);
    box-shadow: 0 0 0 3px rgba(27, 102, 122, 0.14);
}

.primary-button,
.secondary-button {
    width: 100%;
    min-height: 54px;
    border-radius: 12px;
    font-weight: 750;
}

.primary-button {
    margin-top: 10px;
    border: 0;
    color: white;
    background: var(--green);
    box-shadow: 0 6px 16px rgba(27, 102, 122, 0.13);
}

.primary-button:hover {
    background: var(--green-dark);
}

.primary-button:disabled {
    cursor: not-allowed;
    opacity: 0.75;
}

.primary-button.is-loading {
    cursor: wait;
}

.button-help {
    display: block;
    margin-top: 10px;
    color: var(--ink-soft);
    font-size: 0.84rem;
    line-height: 1.4;
    text-align: center;
}

.button-loader {
    display: none;
    width: 18px;
    height: 18px;
    margin-left: 9px;
    border: 2px solid rgba(255, 255, 255, 0.45);
    border-top-color: white;
    border-radius: 50%;
    vertical-align: middle;
    animation: spin 0.75s linear infinite;
}

.is-loading .button-loader {
    display: inline-block;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.alert {
    margin-bottom: 22px;
    padding: 14px 16px;
    border: 1px solid rgba(163, 41, 41, 0.24);
    border-radius: 12px;
    color: var(--danger);
    background: var(--danger-pale);
    line-height: 1.45;
}

.alert ul {
    margin: 8px 0 0;
    padding-left: 20px;
}

.input-warnings {
    margin-bottom: 22px;
    padding: 14px 16px;
    border: 1px solid rgba(176, 116, 15, 0.34);
    border-radius: 12px;
    color: #6f4800;
    background: #fff5dc;
    font-size: 0.88rem;
    line-height: 1.45;
}

.input-warnings strong {
    display: block;
    margin-bottom: 4px;
}

.input-warnings ul {
    margin: 0;
    padding-left: 20px;
}

.results-placeholder {
    min-height: 320px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.compact-placeholder {
    min-height: 200px;
}

.results-placeholder h2 {
    margin: 18px 0 8px;
}

.results-placeholder p {
    max-width: 330px;
    margin: 0;
    color: rgba(255, 255, 255, 0.68);
    line-height: 1.5;
}

.placeholder-number {
    width: 64px;
    height: 64px;
    display: grid;
    place-items: center;
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 50%;
    color: var(--amber);
    font-weight: 800;
}

.results-panel .step-label {
    color: #9ed5e2;
}

.results-heading {
    align-items: center;
}

.results-heading h2 {
    color: white;
}

.method-badge {
    color: white;
    border-color: rgba(255, 255, 255, 0.25);
    background: rgba(255, 255, 255, 0.08);
}

.result-hero {
    padding: 24px 0 28px;
    border-top: 1px solid rgba(255, 255, 255, 0.16);
    border-bottom: 1px solid rgba(255, 255, 255, 0.16);
}

.result-hero p,
.result-card p {
    margin-bottom: 9px;
    color: rgba(255, 255, 255, 0.70);
    font-size: 0.86rem;
}

.result-hero strong {
    display: block;
    margin-bottom: 5px;
    color: #fff;
    font-size: clamp(2.25rem, 4.5vw, 3.6rem);
    line-height: 1;
    letter-spacing: -0.045em;
    font-variant-numeric: tabular-nums;
    overflow-wrap: anywhere;
}

.result-hero span,
.result-card span {
    color: rgba(255, 255, 255, 0.62);
    font-size: 0.78rem;
}

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

.fire-withdrawal-card,
.pac-primary-result {
    margin: 18px 0;
}

.pac-primary-result {
    min-height: 0;
}

.result-card {
    min-height: 122px;
    padding: 18px;
    border: 1px solid rgba(255, 255, 255, 0.13);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.06);
}

.accent-card {
    border-color: rgba(158, 213, 226, 0.35);
    background: rgba(158, 213, 226, 0.11);
}

.result-card strong {
    display: block;
    margin-bottom: 7px;
    color: white;
    font-size: 1.55rem;
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.03em;
}

.result-list {
    margin: 0;
}

.result-list div {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    padding: 12px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.10);
}

.result-list dt {
    color: rgba(255, 255, 255, 0.64);
    font-size: 0.82rem;
}

.result-list dd {
    margin: 0;
    color: white;
    font-size: 0.88rem;
    font-weight: 750;
    font-variant-numeric: tabular-nums;
    text-align: right;
}

.result-note {
    margin: 20px 0;
    padding: 13px 14px;
    border-radius: 10px;
    color: #def3f7;
    background: rgba(126, 205, 224, 0.10);
    font-size: 0.86rem;
    line-height: 1.45;
}

.label-with-info {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    width: fit-content;
}

.info-button {
    display: inline-grid;
    place-items: center;
    width: 32px;
    height: 32px;
    flex: 0 0 32px;
    padding: 0;
    border: 1px solid currentColor;
    border-radius: 50%;
    color: var(--green-dark);
    background: transparent;
    font-family: "Inter", Arial, Helvetica, sans-serif;
    font-size: 0.78rem;
    font-weight: 700;
    line-height: 1;
    opacity: 1;
}

.info-button:hover,
.info-button:focus-visible {
    color: white;
    background: var(--green-dark);
    opacity: 1;
}

.results-panel .info-button,
.resources-result .info-button {
    color: rgba(255, 255, 255, 0.82);
}

.resources-result .info-button {
    color: var(--green);
}

.results-panel .info-button:hover,
.results-panel .info-button:focus-visible,
.resources-result .info-button:hover,
.resources-result .info-button:focus-visible {
    color: var(--green-dark);
    background: white;
}

.resources-result .info-button:hover,
.resources-result .info-button:focus-visible {
    color: white;
    background: var(--green-dark);
}

.result-note.is-warning {
    color: #fff4d2;
    background: rgba(177, 91, 26, 0.24);
    box-shadow: inset 3px 0 0 var(--amber);
}

.secondary-button {
    border: 1px solid rgba(255, 255, 255, 0.28);
    color: white;
    background: transparent;
}

.secondary-button:hover {
    background: rgba(255, 255, 255, 0.08);
}

.explanation,
.disclaimer {
    width: min(1180px, calc(100% - 40px));
    margin: 0 auto 74px;
}

.explanation > h2 {
    max-width: 680px;
}

.explanation-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
    margin-top: 26px;
}

.explanation article {
    padding: 26px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: var(--surface);
}

.explanation article > span {
    width: 32px;
    height: 32px;
    display: inline-grid;
    place-items: center;
    border-radius: 50%;
    color: var(--green);
    background: var(--green-pale);
    font-size: 0.84rem;
    font-weight: 750;
}

.explanation h3 {
    margin: 18px 0 10px;
    font-size: 1.14rem;
}

.explanation article p,
.disclaimer p {
    margin-bottom: 0;
    color: var(--ink-soft);
    line-height: 1.55;
}

.disclaimer {
    padding: clamp(24px, 5vw, 46px);
    border-radius: 18px;
    background: var(--green-pale);
}

.disclaimer h2 {
    margin-bottom: 12px;
}

.help-dialog {
    width: min(680px, calc(100% - 32px));
    max-height: min(720px, calc(100% - 32px));
    padding: 0;
    border: 0;
    border-radius: 18px;
    color: var(--ink);
    background: var(--surface);
    box-shadow: 0 28px 80px rgba(9, 33, 42, 0.28);
    overflow: auto;
}

.help-dialog::backdrop {
    background: rgba(9, 33, 42, 0.58);
    backdrop-filter: blur(3px);
}

.help-dialog-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
    padding: 24px 24px 18px;
    border-bottom: 1px solid var(--line);
}

.help-dialog-heading h2 {
    margin: 0;
    color: var(--ink);
    font-size: 1.35rem;
    letter-spacing: -0.02em;
}

.help-dialog-close {
    width: 40px;
    height: 40px;
    flex: 0 0 40px;
    padding: 0;
    border: 1px solid var(--line);
    border-radius: 50%;
    color: var(--ink);
    background: white;
    font-size: 1.4rem;
    line-height: 1;
}

#parameter-help-content {
    padding: 22px 24px 26px;
    color: var(--ink-soft);
    line-height: 1.55;
}

#parameter-help-content > p {
    margin: 0;
}

.help-formula {
    margin-top: 20px;
    padding-top: 18px;
    border-top: 1px solid var(--line);
}

.help-formula h3,
.help-formula h4 {
    color: var(--ink);
}

.help-formula h3 {
    margin: 0 0 12px;
    font-size: 0.96rem;
}

.help-formula h4 {
    margin: 17px 0 8px;
    font-size: 0.82rem;
}

.help-equations {
    display: grid;
    gap: 8px;
}

.help-equations code {
    display: block;
    padding: 11px 12px;
    border: 1px solid rgba(27, 102, 122, 0.18);
    border-radius: 9px;
    color: var(--green-dark);
    background: var(--green-pale);
    font-family: "Inter", Arial, Helvetica, sans-serif;
    font-size: 0.84rem;
    font-weight: 650;
    line-height: 1.45;
    overflow-wrap: anywhere;
}

.help-symbols {
    margin: 0;
}

.help-symbols div {
    display: grid;
    grid-template-columns: minmax(76px, 0.28fr) minmax(0, 1fr);
    gap: 12px;
    padding: 8px 0;
    border-top: 1px solid rgba(23, 40, 46, 0.09);
}

.help-symbols dt,
.help-symbols dd {
    margin: 0;
}

.help-symbols dt code {
    color: var(--green-dark);
    font-family: "Inter", Arial, Helvetica, sans-serif;
    font-size: 0.8rem;
    font-weight: 750;
}

.help-symbols dd {
    font-size: 0.84rem;
}

.help-reference {
    margin-top: 18px;
    padding: 15px 16px;
    border-radius: 12px;
    color: var(--ink);
    background: var(--green-pale);
}

.help-examples {
    display: grid;
    gap: 10px;
    margin-top: 20px;
}

.help-examples h3 {
    margin: 0 0 2px;
    color: var(--ink);
    font-size: 0.92rem;
}

.help-examples article {
    padding: 14px 15px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: white;
}

.help-examples strong {
    display: block;
    margin-bottom: 5px;
    color: var(--green-dark);
    font-size: 0.86rem;
}

.help-examples p {
    margin: 0;
    font-size: 0.87rem;
}

.help-reference strong {
    display: block;
    margin-bottom: 5px;
    color: var(--green-dark);
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.help-reference p {
    margin: 0;
    font-size: 0.9rem;
}

.help-source {
    display: inline-block;
    margin-top: 17px;
    color: var(--green-dark);
    font-size: 0.82rem;
    font-weight: 700;
    text-underline-offset: 4px;
}

footer {
    width: min(1180px, calc(100% - 40px));
    margin: 0 auto;
    padding: 26px 0 36px;
    display: flex;
    justify-content: space-between;
    gap: 20px;
    border-top: 1px solid rgba(23, 40, 46, 0.14);
    color: var(--ink-soft);
    font-size: 0.82rem;
}

@media (max-width: 920px) {
    .app-layout {
        grid-template-columns: 1fr;
    }

    .results-panel {
        position: static;
        min-height: 0;
    }

    .results-placeholder {
        min-height: 320px;
    }

    .chart-grid {
        grid-template-columns: 1fr;
    }

    .resource-chart-grid {
        grid-template-columns: 1fr;
    }

    .resource-type-grid {
        grid-template-columns: 1fr;
    }

    .resource-type-grid button {
        min-height: 0;
    }

    .chart-panel figcaption {
        min-height: 0;
    }
}

@media (max-width: 620px) {
    .intro,
    .app-layout,
    .additional-resources,
    .projections,
    .explanation,
    .disclaimer,
    footer {
        width: min(100% - 24px, 1180px);
    }

    .site-header {
        padding: 16px 12px;
    }

    .brand {
        gap: 8px;
    }

    .brand-logo {
        width: 32px;
        height: 32px;
        flex-basis: 32px;
    }

    .header-link {
        display: none;
    }

    .intro {
        margin: 28px auto 20px;
    }

    .panel {
        border-radius: 18px;
    }

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

    .projections {
        padding: 0;
    }

    .projections-heading {
        flex-direction: column;
        align-items: flex-start;
        margin-bottom: 24px;
    }

    .chart-panel {
        padding: 18px 10px 14px;
    }

    .chart-panel figcaption {
        padding: 0 8px;
    }

    .field-grid,
    .resource-field-grid,
    .primary-results,
    .explanation-grid,
    .method-choice-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .wizard-step {
        padding: 18px 16px;
    }

    .wizard-edit-banner {
        flex-direction: column;
        align-items: flex-start;
    }

    .wizard-progress {
        padding-bottom: 16px;
    }

    .wizard-progress ol {
        min-width: 480px;
    }

    .wizard-navigation {
        grid-template-columns: 1fr 1fr;
    }

    .wizard-navigation > p {
        grid-column: 1 / -1;
        grid-row: 1;
    }

    .wizard-navigation .wizard-back,
    .wizard-navigation .wizard-cancel-edit,
    .wizard-navigation .wizard-next,
    .wizard-navigation .wizard-submit {
        width: 100%;
        grid-row: 2;
    }

    .wizard-navigation .wizard-back,
    .wizard-navigation .wizard-cancel-edit {
        grid-column: 1;
    }

    .wizard-navigation .wizard-next,
    .wizard-navigation .wizard-submit {
        grid-column: 2;
    }

    .resources-heading,
    .resource-card-heading {
        flex-direction: column;
    }

    .resource-sync-status {
        align-items: flex-start;
        flex-direction: column;
    }

    .add-resource-button {
        width: 100%;
    }

    .remove-resource-button {
        align-self: flex-end;
    }

    .resources-result dl {
        grid-template-columns: 1fr;
    }

    .field-wide {
        grid-column: auto;
    }

    .result-list div {
        align-items: flex-end;
    }

    footer {
        flex-direction: column;
    }
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
    }
}
