:root {
  color-scheme: light;
  --bg: #f4f3ef;
  --surface: #fff;
  --surface-soft: #faf9f6;
  --ink: #171717;
  --muted: #6f6b63;
  --line: #dedbd3;
  --gold: #9a7740;
  --dark: #181817;
  --radius: 16px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: radial-gradient(circle at 16% 0%, rgba(154,119,64,.075), transparent 30rem), var(--bg);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}

.sitebar, footer {
  width: min(1040px, calc(100% - 36px));
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
}
.sitebar { padding: 22px 0; border-bottom: 1px solid var(--line); }
.brand { color: var(--ink); text-decoration: none; font-weight: 800; letter-spacing: .08em; }
.sitebar nav { display: flex; align-items: center; gap: 18px; }
.sitebar nav a, footer a { color: var(--muted); text-decoration: none; font-weight: 650; }
.sitebar nav a:hover, footer a:hover { color: var(--ink); }

.shell { width: min(1040px, calc(100% - 36px)); margin: 0 auto; padding: 38px 0 56px; }
.hero { max-width: 760px; margin: 0 0 20px; }
.eyebrow, .result-kicker, .tier-label {
  color: var(--gold);
  font-size: .69rem;
  font-weight: 800;
  letter-spacing: .1em;
  line-height: 1.25;
  text-transform: uppercase;
}
h1, h2, h3 { margin-top: 0; color: var(--ink); font-family: Georgia, "Times New Roman", serif; }
h1 { max-width: 760px; margin: 8px 0 10px; font-size: clamp(2.15rem, 4.3vw, 3.65rem); line-height: 1.02; letter-spacing: -.035em; font-weight: 600; }
h2 { margin-bottom: 11px; font-size: 1.38rem; line-height: 1.15; }
h3 { margin-bottom: 8px; font-size: 1.14rem; }
p, li, small { line-height: 1.52; }
p { margin-top: 0; }
.hero-lead { margin: 0 0 8px; color: #34312d; font-family: Georgia, "Times New Roman", serif; font-size: 1.15rem; }
.hero p:not(.hero-lead) { max-width: 700px; margin-bottom: 7px; color: var(--muted); font-size: .95rem; }

.card { padding: 20px; border: 1px solid var(--line); border-radius: var(--radius); background: rgba(255,255,255,.92); box-shadow: 0 10px 28px rgba(35,31,25,.045); }
.how-card { margin-bottom: 16px; }
.how-card h2 { font-size: 1.25rem; }
.how-card ol { margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); list-style: none; counter-reset: steps; }
.how-card li { position: relative; min-height: 74px; padding: 0 15px 0 34px; color: #4b4842; font-size: .87rem; }
.how-card li + li { border-left: 1px solid var(--line); }
.how-card li::before {
  counter-increment: steps;
  content: counter(steps);
  position: absolute;
  left: 10px;
  top: 1px;
  width: 19px;
  height: 19px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--dark);
  color: #fff;
  font-size: .66rem;
  font-weight: 800;
}
.how-card li:first-child { padding-left: 25px; }
.how-card li:first-child::before { left: 0; }

.grid { display: grid; grid-template-columns: minmax(0,1.17fr) minmax(320px,.83fr); gap: 16px; align-items: start; }
.form-card { display: grid; gap: 15px; }
.form-card > h2 { margin-bottom: 1px; }
.field { display: grid; gap: 5px; }
.field label { font-size: .92rem; font-weight: 760; }
.field input {
  width: 100%;
  min-height: 43px;
  padding: 9px 11px;
  border: 1px solid #d8d4cc;
  border-radius: 9px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-size: .96rem;
}
.field input:focus { outline: 3px solid rgba(154,119,64,.12); border-color: var(--gold); }
.field small, .hint, .privacy-note { color: var(--muted); font-size: .79rem; }
.advanced { margin-top: 1px; padding-top: 12px; border-top: 1px solid var(--line); }
.advanced summary { cursor: pointer; list-style-position: outside; color: #34312d; font-size: .9rem; font-weight: 800; }
.advanced[open] { display: grid; gap: 14px; }
.hint, .currency-note { margin: 0; color: var(--muted); font-size: .82rem; }
.calculate-button, .save-button {
  min-height: 45px;
  padding: 11px 16px;
  border: 0;
  border-radius: 9px;
  background: var(--dark);
  color: #fff;
  font: inherit;
  font-size: .92rem;
  font-weight: 800;
  cursor: pointer;
}
.calculate-button:hover, .save-button:hover { background: #2a2927; }

.results { display: grid; gap: 15px; padding: 21px; border-color: #1b1b19; background: linear-gradient(155deg,#1d1d1b 0%,#151514 100%); color: #fff; box-shadow: 0 18px 38px rgba(20,19,17,.14); }
.results .result-kicker { color: #d9bd83; }
.result-head { display: flex; justify-content: space-between; align-items: center; gap: 14px; }
.result-context { color: #aaa69e; font-size: .7rem; }
.target-block { padding: 1px 0 15px; border-bottom: 1px solid rgba(255,255,255,.12); }
.target-block > span { display: block; margin-bottom: 5px; color: #c2beb6; font-size: .78rem; }
.target-block strong { display: block; color: #fff; font-family: Georgia, "Times New Roman", serif; font-size: clamp(2rem,3.6vw,2.85rem); line-height: 1; letter-spacing: -.035em; font-weight: 500; }
.target-block p { max-width: 360px; margin: 9px 0 0; color: #a9a59d; font-size: .77rem; line-height: 1.45; }
.progress-block { display: grid; gap: 7px; }
.progress-copy { display: flex; justify-content: space-between; align-items: baseline; gap: 14px; }
.progress-copy span { color: #b8b4ad; font-size: .78rem; }
.progress-copy strong { color: #fff; font-size: .92rem; }
.progress-track { height: 6px; overflow: hidden; border-radius: 999px; background: rgba(255,255,255,.11); }
.progress-track span { display: block; width: 0; height: 100%; border-radius: 999px; background: linear-gradient(90deg,#b69050,#ddc281); transition: width .25s ease; }
.result-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.mini-metric { min-height: 74px; padding: 11px; border: 1px solid rgba(255,255,255,.09); border-radius: 10px; background: rgba(255,255,255,.035); }
.mini-metric span { display: block; margin-bottom: 5px; color: #aaa69e; font-size: .71rem; }
.mini-metric strong { color: #fff; font-size: 1rem; line-height: 1.2; }
.results .note { margin: 0; color: #aaa69e; font-size: .76rem; line-height: 1.45; }
.cta { display: block; padding: 13px 18px; border-radius: 10px; background: var(--gold); color: #fff; text-align: center; text-decoration: none; font-weight: 800; }
.save-button { width: 100%; background: var(--gold); }
.save-button:hover { background: #ad8748; }
.save-button:disabled, .text-button:disabled { cursor: wait; opacity: .62; }
.action-status { margin: 0; color: #aaa69e; font-size: .78rem; line-height: 1.45; text-align: center; }
.results > small { color: #aaa69e; text-align: center; }

.personal, .access, .explain, .assumptions { margin-top: 16px; }
.personal-heading { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; }
.personal-heading h2 { margin: 5px 0 0; }
.scenario-count { color: var(--gold); font-size: 1.1rem; }
.scenario-list { margin: 18px 0 0; padding: 0; display: grid; gap: 10px; list-style: none; }
.scenario-list > li { display: flex; justify-content: space-between; align-items: center; gap: 18px; padding: 13px 0; border-top: 1px solid var(--line); }
.scenario-list > li > div:first-child { display: grid; gap: 4px; }
.scenario-list small { color: var(--muted); }
.scenario-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.text-button { padding: 8px 11px; border: 1px solid var(--line); border-radius: 9px; background: #fff; color: var(--ink); font: inherit; font-size: .84rem; font-weight: 700; cursor: pointer; }
.text-button:hover { border-color: var(--gold); }
.danger-button { color: #8b2c24; }
.privacy-note { margin: 16px 0 0; padding-top: 14px; border-top: 1px solid var(--line); }
.inline-error { margin-top: 12px; padding: 11px 12px; border-radius: 9px; background: #f8e5e2; color: #7d251f; font-size: .9rem; }

.access > h2 { max-width: 700px; margin-top: 5px; }
.access-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 15px; }
.access-grid article { padding: 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-soft); }
.access-grid article h3 { margin: 5px 0 8px; }
.access-grid article p { margin-bottom: 9px; color: #56524c; font-size: .85rem; }
.access-grid .account-tier { border-color: var(--dark); background: var(--dark); }
.access-grid .account-tier h3 { color: #fff; }
.access-grid .account-tier .tier-label { color: #d9bd83; }
.access-grid .account-tier p { color: #bbb7af; }
.fi-link { display: inline-block; margin-top: 2px; color: #d9bd83; font-size: .84rem; font-weight: 800; text-underline-offset: 3px; }

.explain { padding: 0; overflow: hidden; }
.explain summary { cursor: pointer; padding: 17px 20px; font-family: Georgia, "Times New Roman", serif; font-size: 1.08rem; font-weight: 700; }
.explain-body { padding: 0 20px 17px; color: #55514a; font-size: .86rem; }
.explain-body p:last-child { margin-bottom: 0; }
.assumptions { padding: 17px 20px; background: transparent; box-shadow: none; }
.assumptions h2 { margin-bottom: 6px; font-size: 1.08rem; }
.assumptions p { margin-bottom: 8px; color: var(--muted); font-size: .82rem; }
.assumptions p:last-child { margin-bottom: 0; padding-top: 10px; border-top: 1px solid var(--line); }
footer { padding: 24px 0 36px; border-top: 1px solid var(--line); color: var(--muted); font-size: .9rem; }

@media (max-width: 900px) {
  .how-card ol { grid-template-columns: 1fr 1fr; gap: 12px; }
  .how-card li, .how-card li:first-child { min-height: 0; padding-left: 32px; border-left: 0; }
  .how-card li::before, .how-card li:first-child::before { left: 0; }
}

@media (max-width: 760px) {
  .sitebar { align-items: flex-start; }
  .sitebar nav { flex-direction: column; align-items: flex-end; gap: 8px; }
  .shell { width: min(100% - 24px,1040px); padding: 25px 0 42px; }
  h1 { font-size: clamp(2rem,10vw,2.75rem); }
  .grid, .access-grid, .how-card ol { grid-template-columns: 1fr; }
  .scenario-list > li { align-items: flex-start; flex-direction: column; }
}

@media (max-width: 430px) {
  .sitebar, footer { width: calc(100% - 20px); }
  .card { padding: 16px; border-radius: 14px; }
  .shell { width: calc(100% - 20px); }
  .result-head { align-items: flex-start; flex-direction: column; gap: 3px; }
  .target-block strong { font-size: 2rem; }
  .result-grid { grid-template-columns: 1fr; }
}
