
:root {
  color-scheme: dark;
  --background: #100d17;
  --panel: #181321;
  --text: #f8f4fc;
  --muted: #b4a8c0;
  --purple: #cbb1ff;
  --mint: #a6ead7;
  --line: #352b41;
  font-family: Inter, "Segoe UI", system-ui, sans-serif;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-height: 100vh; position: relative; isolation: isolate; background: var(--background); color: var(--text); }
button, input { font: inherit; }
button, summary { cursor: pointer; }
button:focus-visible, a:focus-visible, summary:focus-visible, input:focus-visible, [tabindex]:focus-visible { outline: 2px solid var(--purple); outline-offset: 4px; }
button { transition: background .2s, color .2s, border-color .2s; }
.atmosphere {
  position:absolute; inset:0 0 auto; height:550px; overflow:hidden; z-index:-1;
  pointer-events:none; perspective:1000px;
  background:radial-gradient(ellipse at 82% 28%,#4a3058 0%,#26192f 32%,transparent 72%);
  mask-image:linear-gradient(#000 55%,transparent);
}
.sculpture-stage {
  position:absolute; width:clamp(310px,33vw,440px); top:12px;
  right:max(0px,calc((100vw - 1230px)/2)); transform-style:preserve-3d;
  animation:unfold-sculpture 1.8s cubic-bezier(.16,.8,.24,1) both;
}
.family-scene {
  display:block; width:100%; height:auto;
  transition:transform 1.1s cubic-bezier(.22,.75,.2,1);
  filter:drop-shadow(0 22px 24px #10081b99);
}
body[data-scene="fd"] .family-scene {transform:rotateY(-19deg) rotateZ(-10deg) translateZ(14px);}
body[data-scene="swp"] .family-scene {transform:rotateY(17deg) rotateZ(12deg) translateZ(22px);}
.family-scene {position:relative;container-type:inline-size;}
.family-scene img {display:block;width:100%;height:auto;position:relative;}
.rain-coin {position:absolute;left:var(--x);top:0;width:var(--size);aspect-ratio:1;
  display:grid;place-items:center;border-radius:50%;border:1px solid #ebc579;
  background:linear-gradient(135deg,#fff0b9,#dba95d 50%,#9d642c);color:#6e451e;
  font:700 2.35cqw/1 Georgia,serif;box-shadow:inset 0 0 0 1px #ae782e,1px 1px #84531f;
  animation:falling-rupee var(--time) linear var(--delay) infinite;}
@keyframes falling-rupee {
  0% {top:4%;opacity:0;transform:rotate(-20deg) rotateY(50deg);}
  15% {opacity:.95;} 52% {transform:rotate(12deg) rotateY(-35deg);}
  80% {opacity:.9;} 100% {top:59%;opacity:0;transform:rotate(25deg) rotateY(65deg);}
}
@media(prefers-reduced-motion:reduce){.family-scene .rain-coin {animation:none;top:var(--rest);opacity:.85;}}
@keyframes unfold-sculpture {
  from {opacity:0;transform:translate3d(9%,14px,-110px) rotateY(-48deg) rotateZ(-17deg);}
  to {opacity:1;transform:translate3d(0,0,0);}
}
@media(max-width:820px){
  .sculpture-stage {right:-40px;top:2px;width:280px;}
  .atmosphere {mask-image:linear-gradient(90deg,transparent,#000 94%),linear-gradient(#000 44%,transparent);mask-composite:intersect;}
}
@media(max-width:540px){.sculpture-stage {right:0;top:5px;width:220px;opacity:.65;}}
@media(prefers-reduced-motion:reduce){
  .sculpture-stage {animation:none;}
  .atmosphere .family-scene {transition:none;transform:none;}
}
.masthead, main, footer { width: min(1120px, calc(100% - 80px)); margin-inline: auto; }
.masthead { min-height: 74px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid #c7b0ec22; }
.brand { display: inline-flex; align-items: center; gap: 11px; text-decoration: none; color: inherit; font-size: 1.62rem; font-weight: 680; letter-spacing: -.06em; }
.brand > span { opacity: .63; }
.currency { display: inline-flex; align-items: center; gap: 7px; border: 1px solid #a991d344; background: #21182d88; color: #e8daff; border-radius: 30px; padding: 6px 13px; font-size: .8125rem; font-weight: 650; }
.intro { padding: 53px 0 36px; animation: enter .65s ease-out both; }
h1,h2,h3,p { margin: 0; }
h1 { font-size: clamp(2.75rem, 6.25vw, 5.5rem); font-weight: 630; line-height: 1.05; letter-spacing: -.073em; }
h1 em { font-family: Georgia, serif; color: #dbbeff; font-weight: 400; letter-spacing: -.073em; }
.intro p { margin-top: 18px; color: #c6b9d2; line-height: 1.6; max-width: 535px; }
.workspace { display: grid; align-items: start; grid-template-columns: minmax(300px,.76fr) minmax(0,1.24fr); gap: 20px; animation: enter .65s .12s ease-out both; }
@keyframes enter { from { opacity: 0; transform: translateY(17px); } to { opacity: 1; transform: translateY(0); } }
.panel { border: 1px solid #42334f; border-radius: 22px; min-width: 0; box-shadow: 0 16px 50px #08050b50; }
.settings { background: linear-gradient(145deg,#201729,#17121f 65%); padding: 24px; }
.mode-picker { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; border: 1px solid #392d45; border-radius: 12px; background: #130f1c; }
.plan-picker { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 450px) { .plan-picker button span { display: none; } }
.field select { width: 100%; margin-top: 7px; padding: 8px; border: 1px solid #44344f; border-radius: 8px; background: #120e1a; color: var(--text); font: inherit; }
.fd-summary { margin-top: 16px; padding: 12px; border: 1px solid #44344f; border-radius: 10px; }
.fd-summary dl { display: grid; grid-template-columns: 1fr auto; gap: 7px 12px; margin: 0; font-size: .85rem; }
.fd-summary dt { color: var(--muted); }
.fd-summary dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; }
.mode-picker button, .view-picker button { color: var(--muted); background: transparent; border: 1px solid transparent; border-radius: 8px; white-space: nowrap; }
.mode-picker button { padding: 10px 3px; font-weight: 700; font-size: .925rem; }
.mode-picker button span { font-weight: 450; }
.mode-picker button[aria-pressed="true"], .view-picker button[aria-pressed="true"] { color: #f1e6ff; background: #38264d; border-color: #5c4477; }
.mode-picker button:hover, .view-picker button:hover { color: white; background-color: #483357; }
.section-title { display: flex; align-items: center; justify-content: space-between; margin: 23px 0 12px; }
.section-title h2 { font-size: 1.125rem; letter-spacing: -.025em; }
.reset { display: flex; align-items: center; gap: 6px; padding: 5px 0 5px 8px; border: 0; background: transparent; color: var(--muted); font-size: .875rem; }
.reset:hover { color: var(--text); }
.reset svg { width: 15px; }
.field { padding: 13px 0 11px; }
.field + .field { border-top: 1px solid #33283c; }
.field-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.field label { font-size: .9rem; font-weight: 570; }
.number-shell { display: flex; align-items: center; gap: 5px; min-width: 105px; justify-content: space-between; background: #120e1a; border: 1px solid #44344f; border-radius: 8px; padding: 0 9px; color: #d1b9fa; font-size: .875rem; }
.number-shell:focus-within { border-color: var(--purple); }
.number-shell input { min-width: 0; width: 90px; text-align: right; background: transparent; color: var(--text); border: 0; padding: 8px 0; appearance: textfield; font-variant-numeric: tabular-nums; }
.number-shell input::-webkit-inner-spin-button { appearance: none; }
.number-shell input:focus-visible { outline: none; }
.number-shell input[aria-invalid="true"] { color: #ffb5ca; }
.number-steps { display: grid; align-self: stretch; flex: 0 0 28px; margin-right: -9px; border-left: 1px solid #44344f; }
.number-steps button { border: 0; min-height: 24px; padding: 0; background: #251a32; color: #e9d8ff; font: inherit; line-height: 1; }
.number-steps button:first-child { border-radius: 0 7px 0 0; }
.number-steps button:last-child { border-top: 1px solid #44344f; border-radius: 0 0 7px 0; }
.number-steps button:hover { background: #483357; }
.number-steps button:focus-visible { outline-offset: -2px; }
.field-hint, .field-error { font-size: .79rem; line-height: 1.42; margin-top: 5px; color: var(--muted); }
.field-error { color: #ffb5ca; }
input[type=range] { display: block; appearance: none; width: 100%; height: 6px; margin: 15px 0 10px; border-radius: 20px; background: linear-gradient(90deg,#9362ec,#c9a7ff) 0/var(--fill, 0%) 100% no-repeat, #3b2e47; cursor: pointer; }
input[type=range]::-webkit-slider-thumb { appearance: none; width: 16px; height: 16px; border-radius: 50%; background: #e9d8ff; border: 2px solid #a77bfa; box-shadow: 0 0 11px #ae83ff80; }
input[type=range]::-moz-range-thumb { width: 13px; height: 13px; border-radius: 50%; background: #e9d8ff; border: 2px solid #a77bfa; box-shadow: 0 0 11px #ae83ff80; }
.range-bounds { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 5px; font-size: .75rem; color: var(--muted); }
.range-bounds-ends { grid-template-columns: 1fr 1fr; }
.range-with-thumb-value { position: relative; padding-top: 19px; }
.range-thumb-value { position: absolute; top: 0; left: calc(8px + (100% - 16px) * var(--thumb-progress, 0)); transform: translateX(-50%); padding: 3px 6px; border: 1px solid #634982; border-radius: 6px; background: #38264d; font-size: .75rem; line-height: 1; white-space: nowrap; pointer-events: none; }
.range-bounds > :last-child { text-align: right; }
.range-current { color: #e9d8ff; font-weight: 650; font-variant-numeric: tabular-nums; }
.results { background: linear-gradient(144deg,#241932 0%,#1b1426 45%,#181320 100%); padding: 26px; }
.result-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.result-header h2 { color: #e2d3ef; font-size: .925rem; font-weight: 570; }
.headline { font-size: clamp(2rem,4vw,3.95rem); letter-spacing: -.058em; line-height: 1.12; font-weight: 650; font-variant-numeric: tabular-nums; margin-top: 7px; overflow-wrap: anywhere; }
.horizon { margin-top: 7px; color: var(--muted); font-size: .875rem; }
.result-icon { display: grid; place-items: center; border: 1px solid #735698; border-radius: 12px; width: 43px; height: 43px; flex: 0 0 auto; background: #3a2850; color: var(--purple); }
.result-icon svg { width: 22px; }
.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 20px; }
.stats > div { min-width: 0; padding: 12px 14px; background: #150f1ecc; border: 1px solid #40304d; border-radius: 11px; }
.stats p { color: var(--muted); font-size: .85rem; margin-bottom: 4px; }
.stats strong { display: block; font-weight: 650; font-size: clamp(.98rem, 2vw, 1.3rem); letter-spacing: -.023em; overflow-wrap: anywhere; }
.stats > div:nth-child(2) strong { color: var(--mint); }
.status { margin-top: 12px; color: #f4cba0; font-size: .875rem; }
.projection { padding-top: 19px; margin-top: 21px; border-top: 1px solid var(--line); }
.projection-header { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.projection-header h3 { font-size: 1rem; font-weight: 620; }
.view-picker { display: flex; gap: 3px; padding: 3px; border: 1px solid #3b2c48; border-radius: 9px; background: #15101e; }
.view-picker button { font-size: .8125rem; padding: 5px 8px; }
.legend { display: flex; flex-wrap: wrap; gap: 8px 18px; margin: 13px 0 4px; color: #c7bad4; font-size: .8rem; }
.legend > span { display: flex; align-items: center; gap: 7px; }
.legend i { width: 14px; height: 3px; border-radius: 3px; background: #c49bff; }
.legend > span + span i { background: transparent; height: 0; border-top: 2px dashed #ab9bbd; border-radius: 0; }
.chart { width: 100%; height: 211px; }
.chart svg { display: block; width: 100%; height: 100%; overflow: visible; }
.chart text { font-size: 12px; fill: #b8aac8; }
.chart .primary-line { stroke: #c9a2ff; filter: drop-shadow(0 0 4px #b783ff80); }
.chart .chart-reveal { transform-origin: left; animation: reveal .62s cubic-bezier(.2,.8,.3,1) both; }
@keyframes reveal { from { clip-path: inset(0 100% 0 0); } to { clip-path: inset(0 0 0 0); } }
.table-view { overflow: auto; height: 237px; margin-top: 11px; }
table { width: 100%; min-width: 340px; border-collapse: collapse; font-variant-numeric: tabular-nums; font-size: .875rem; }
th,td { padding: 10px 9px; text-align: right; border-bottom: 1px solid var(--line); }
th:first-child,td:first-child { text-align: left; }
th { position: sticky; top: 0; background: #261b32; color: #e0d0ef; font-weight: 570; }
.assumptions { margin-top: 22px; padding: 14px 0; color: var(--muted); font-size: .875rem; }
.assumptions summary { color: #d8c6e9; width: fit-content; }
.assumptions p { max-width: 780px; line-height: 1.65; margin-top: 9px; }
footer { margin-top: 13px; padding: 18px 0 25px; border-top: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; color: var(--muted); font-size: .8125rem; }
.foot-brand { opacity: .62; }
footer { gap: 16px; flex-wrap: wrap; }
@media (max-width: 820px) {
  .masthead,main,footer { width: min(680px, calc(100% - 36px)); }
  .workspace { grid-template-columns: 1fr; }
  .intro { padding: 39px 0 27px; }
}
@media (max-width: 420px) {
  .settings,.results { padding: 16px; }
  .projection-header { flex-wrap: wrap; }
  .stats > div { padding: 10px; }
}
@media (prefers-reduced-motion: reduce) {
  *,*::before,*::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

#corpus-source, #withdrawal-format, #reinvest-option { margin-bottom: 8px; }
#corpus-source-label, #withdrawal-format-label { margin-bottom: 6px; color: var(--muted); font-size: .875rem; }
#withdrawal-equivalent { color: var(--mint); }
.reinvest-split { margin-top: 10px; padding: 8px 10px; border-left: 2px solid var(--purple); background: #38264d55; border-radius: 0 6px 6px 0; }
.reinvest-split p { color: var(--muted); font-size: .875rem; line-height: 1.5; }
.reinvest-split strong { color: var(--text); font-variant-numeric: tabular-nums; }
.reinvest-split p:last-child strong { color: var(--mint); }
.corpus-picker { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
.corpus-option { display: flex; align-items: center; gap: 7px; min-height: 44px; padding: 6px 8px; border: 1px solid var(--line); border-radius: 8px; font-size: .875rem; cursor: pointer; }
.corpus-option input { flex: 0 0 auto; width: 16px; height: 16px; margin: 0; accent-color: var(--purple); }
.corpus-option:has(input:checked) { color: #f1e6ff; background: #38264d; border-color: #5c4477; }
.bank-rate-notes { border-top: 1px solid var(--line); margin-top: 16px; padding-bottom: 0; }
.bank-rate-notes dl { margin: 12px 0 0; }
.bank-rate-notes dt { margin-top: 10px; color: var(--text); font-weight: 650; }
.bank-rate-notes a { color: var(--purple); }
.bank-rate-notes dd { margin: 2px 0 0; line-height: 1.55; }
#inflation-table-note { text-align: left; color: var(--muted); font-size: .875rem; padding: 0 0 8px; }
.savings-comparison { margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--line); }
.savings-comparison h3 { font-size: 1rem; }
.savings-comparison .field-hint { line-height: 1.6; }
.savings-results { margin-top: 12px; }
.savings-totals { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin: 12px 0; }
.savings-total { padding: 8px 10px; background: #150f1ecc; border: 1px solid var(--line); border-radius: 9px; }
.savings-total p { color: var(--muted); font-size: .875rem; }
.savings-total i { display: inline-block; width: 10px; height: 3px; border-radius: 3px; margin: 0 6px 2px 0; }
.savings-total .bank-name { margin-bottom: 6px; color: var(--text); font-weight: 650; }
.savings-total .bank-balance { margin-top: 7px; padding-top: 7px; border-top: 1px solid var(--line); }
.savings-total .bank-balance strong { color: var(--mint); }
.savings-total strong { display: block; margin-top: 3px; overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
.savings-table { overflow: auto; max-height: 300px; margin-top: 10px; }
.savings-table table { min-width: 520px; }
.savings-table td { white-space: nowrap; }
.savings-table small { display: block; color: var(--muted); font-size: .75rem; margin-top: 3px; }
.savings-table caption { text-align: left; padding: 6px 0 8px; color: var(--muted); font-size: .875rem; }
.linked-corpus { color: #e9d8ff; font-size: .95rem; font-weight: 650; text-align: right; overflow-wrap: anywhere; }
.start-swp { margin-top: 14px; padding: 8px 12px; color: #f4eaff; background: #39264e; border: 1px solid #634982; border-radius: 8px; font-size: .875rem; font-weight: 600; }
.start-swp:hover:not(:disabled) { background: #4d3468; border-color: var(--purple); }
.start-swp:disabled { opacity: .5; cursor: default; }

.sip-funding { margin:0 0 16px; padding:0; border:0; }
.sip-funding legend { margin-bottom:6px; }
.age-method { margin-bottom: 12px; }
#birth-date { display:block; margin-top:8px; padding:8px 12px; max-width:100%; border:1px solid #594369; border-radius:8px; background:#18121e; color:inherit; color-scheme:dark; font:inherit; }
.event-card { border:1px solid var(--line); border-radius:10px; margin:12px 0; padding:12px; min-width:0; }
.event-card label {display:block;margin:8px 0;}
.event-card input:not([type=checkbox]) {display:block;width:100%;padding:8px;border:1px solid var(--line);border-radius:6px;background:#16111d;color:inherit;font:inherit;}
#add-event {margin-top:10px;}
#expanded-table { box-sizing:border-box; margin:auto; width:min(96vw,100rem); max-width:96vw; max-height:92dvh; padding:1rem; border:1px solid var(--line); border-radius:14px; color:var(--text); background:#201827; }
#expanded-table::backdrop { background:#100b18cf; }
#expanded-table header { display:flex; align-items:center; justify-content:space-between; gap:1rem; margin-bottom:.75rem; }
#expanded-table .expanded-scroll { overflow:auto; max-height:calc(90dvh - 5rem); overscroll-behavior:contain; }
#expanded-table td { white-space:nowrap; }
#expanded-table small { display:block; }
.table-action { display:flex; justify-content:flex-end; margin-top:.5rem; }
.reroute-highlight .number-shell { outline: 2px solid #c9a2ff; }
@media (prefers-reduced-motion: no-preference) {
  .reroute-highlight .number-shell { animation: reroute-pulse 1.6s ease-in-out 3; }
  @keyframes reroute-pulse { 50% { outline-color:transparent; box-shadow:0 0 12px #bd92fa70; } }
}
