/* Calculator pages */
.calc-hero .wrap { display: grid; grid-template-columns: 1.15fr .85fr; gap: 48px; align-items: end; }
.calc-hero .tags { display: flex; gap: 22px; margin-top: 26px; color: #C9D0E0; font-size: .86rem; position: relative; z-index: 1; flex-wrap: wrap; }
.calc-hero .tags span { display: flex; align-items: center; gap: 8px; }
.calc-hero .tags svg { width: 16px; height: 16px; color: var(--gold); }
.live { position: relative; z-index: 1; border: 1px solid var(--navy-line); background: rgba(255,255,255,.03); padding: 22px 24px; border-radius: 6px; backdrop-filter: blur(6px); }
.live small { color: #9AA5BD; font-size: .78rem; display: flex; gap: 8px; align-items: center; }
.live small::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: #3FD39A; box-shadow: 0 0 0 4px rgba(63, 211, 154, .15); }
.live .lbl { color: #C9D0E0; font-size: .88rem; margin-top: 12px; }
.live .val { font-family: var(--serif); font-size: clamp(2.6rem, 5vw, 3.6rem); font-weight: 600; color: var(--gold-hi); line-height: 1.05; }
.live .meta { color: #9AA5BD; font-size: .82rem; }
.live svg.spark { width: 100%; height: 70px; margin: 14px 0 6px; }
.live .mini { display: grid; grid-template-columns: repeat(3, 1fr); border-top: 1px solid var(--navy-line); padding-top: 12px; }
.live .mini span { display: block; color: #8590A8; font-size: .7rem; font-weight: 700; letter-spacing: .06em; }
.live .mini b { color: #F2ECDB; font-size: .98rem; }
@media (max-width: 900px) { .calc-hero .wrap { grid-template-columns: 1fr; } }

.calc-main { padding: 40px 0 80px; }
.calc-layout { display: grid; grid-template-columns: minmax(300px, 400px) minmax(0, 1fr); gap: 28px; align-items: start; margin-top: -24px; position: relative; z-index: 2; }
@media (max-width: 980px) { .calc-layout { grid-template-columns: minmax(0, 1fr); } }
.results { min-width: 0; grid-template-columns: minmax(0, 1fr); }
.tbl td.wrap-ok, .card > .tbl td { white-space: normal; }

.panel { background: var(--white); border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.params { position: sticky; top: 92px; max-height: calc(100vh - 110px); overflow-y: auto; scrollbar-width: thin; }
@media (max-width: 980px) { .params { position: static; max-height: none; } }
.panel-head { background: var(--navy); color: #fff; padding: 18px 22px; display: flex; justify-content: space-between; align-items: center; }
.panel-head small, .res-head small { display: block; font-size: .72rem; font-weight: 700; letter-spacing: .08em; color: var(--gold); }
.panel-head b { font-size: 1.15rem; }
.btn-sm { padding: 8px 14px; border-radius: 4px; font-size: .78rem; font-weight: 700; letter-spacing: .04em; border: 1px solid rgba(235,211,151,.4); background: transparent; color: #F1E6C6; }
.btn-sm:hover { background: rgba(235,211,151,.1); }
.panel-body { padding: 6px 22px 22px; }

.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 4px; overflow: hidden; }
.seg button { border: 0; background: none; padding: 7px 12px; font-size: .8rem; font-weight: 600; color: var(--muted); }
.seg button.on { background: var(--navy); color: var(--gold-hi); }
.row-inline { display: flex; align-items: center; justify-content: space-between; padding: 16px 0; border-bottom: 1px solid var(--line); font-size: .75rem; font-weight: 700; letter-spacing: .08em; color: var(--muted); }

.group { padding-top: 18px; }
.group-title { display: flex; gap: 10px; align-items: center; font-size: .74rem; font-weight: 800; letter-spacing: .08em; color: var(--ink); margin-bottom: 4px; text-transform: uppercase; }
.group-title i { font-style: normal; color: var(--gold-lo); }
.field { padding: 14px 0 12px; border-bottom: 1px dashed var(--line); }
.field:last-child { border-bottom: 0; }
.f-top { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.f-top label { font-size: .74rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.f-input { display: flex; align-items: center; border: 1px solid var(--line); border-radius: 4px; background: var(--paper); padding: 0 10px; min-width: 132px; max-width: 170px; }
.f-input:focus-within { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(201,162,74,.18); }
.f-input input { border: 0; background: none; width: 100%; padding: 9px 4px; font: 700 .98rem var(--sans); color: var(--ink); text-align: right; outline: none; }
.f-input span { color: var(--muted); font-size: .85rem; font-weight: 600; }
.f-scale { display: flex; justify-content: space-between; font-size: .72rem; color: #8B94A8; margin-top: 2px; }
.hint { font-size: .78rem; color: #7A849A; margin-top: 4px; }

input[type=range] { -webkit-appearance: none; appearance: none; width: 100%; height: 22px; background: transparent; margin: 10px 0 0; cursor: pointer; }
input[type=range]::-webkit-slider-runnable-track { height: 4px; border-radius: 4px; background: linear-gradient(90deg, var(--gold) var(--pct, 50%), var(--paper-2) var(--pct, 50%)); }
input[type=range]::-moz-range-track { height: 4px; border-radius: 4px; background: linear-gradient(90deg, var(--gold) var(--pct, 50%), var(--paper-2) var(--pct, 50%)); }
input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 20px; height: 20px; border-radius: 50%; background: var(--white); border: 5px solid var(--navy); margin-top: -8px; box-shadow: 0 2px 6px rgba(6,13,31,.3); transition: transform .15s; }
input[type=range]::-moz-range-thumb { width: 12px; height: 12px; border-radius: 50%; background: var(--white); border: 5px solid var(--navy); }
input[type=range]:active::-webkit-slider-thumb { transform: scale(1.15); }

.adv-toggle { width: 100%; margin-top: 16px; display: flex; justify-content: space-between; align-items: center; border: 1px dashed var(--gold); background: #FBF6EA; color: var(--ink); padding: 12px 14px; border-radius: 4px; font-weight: 700; font-size: .88rem; }
.adv-toggle b { font-size: 1.2rem; color: var(--gold-lo); transition: transform .2s; }
.adv-toggle[aria-expanded=true] b { transform: rotate(45deg); }

.glance { margin-top: 16px; background: var(--paper); border-radius: 4px; padding: 14px; }
.glance small { font-size: .7rem; font-weight: 800; letter-spacing: .08em; color: var(--muted); }
.glance .bar { display: flex; height: 8px; border-radius: 4px; overflow: hidden; margin: 10px 0 8px; background: var(--paper-2); }
.glance .bar i { display: block; height: 100%; }
.ph-sip { background: var(--navy); } .ph-grow { background: var(--gold); } .ph-swp { background: #7A8FB8; }
.glance .legend { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; font-size: .74rem; color: var(--muted); }
.glance .legend b { display: block; color: var(--ink); font-size: .78rem; }
.glance .ends { display: flex; justify-content: space-between; font-size: .72rem; color: var(--muted); }

/* results */
.results { display: grid; gap: 22px; }
.res-head { display: flex; justify-content: space-between; align-items: flex-end; flex-wrap: wrap; gap: 14px; }
.res-head b { font-size: 1.4rem; }
.res-head small { color: var(--gold-lo); }
.res-actions { display: flex; gap: 10px; flex-wrap: wrap; }
@media (max-width: 520px) { .res-actions, .res-actions .btn { width: 100%; justify-content: center; } .kpis { grid-template-columns: 1fr; } .kpi.lead { grid-column: auto; } .card { padding: 18px 16px; } .slabs { grid-template-columns: repeat(4, 1fr); } .dates { grid-template-columns: 1fr; } }
.res-actions .btn { padding: 10px 16px; font-size: .85rem; }
.btn-line { border: 1px solid var(--line); background: var(--white); color: var(--ink); }
.btn-line:hover { border-color: var(--navy); }

.kpis { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.kpi b { overflow-wrap: anywhere; }
.kpi { background: var(--white); border: 1px solid var(--line); border-radius: 6px; padding: 18px 20px; }
.kpi.lead { grid-column: span 2; background: linear-gradient(150deg, var(--navy-3), var(--navy) 65%); color: #fff; border-color: var(--navy); }
.kpi small { display: block; font-size: .7rem; font-weight: 800; letter-spacing: .08em; color: var(--muted); text-transform: uppercase; }
.kpi.lead small { color: var(--gold); }
.kpi b { display: block; font-size: 1.6rem; font-weight: 800; letter-spacing: -.02em; margin-top: 6px; line-height: 1.15; }
.kpi.lead b { font-family: var(--serif); font-weight: 600; font-size: clamp(2.4rem, 4vw, 3.2rem); color: var(--gold-hi); letter-spacing: 0; }
.kpi span { display: block; font-size: .8rem; color: var(--muted); margin-top: 4px; }
.kpi.lead span { color: #AEB8CD; }
.kpi.good b { color: #1F8A5B; } .kpi.bad b { color: #B4442E; }
@media (max-width: 700px) { .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } .kpi.lead { grid-column: span 2; } }

.callout { background: #FBF6EA; border-left: 3px solid var(--gold); padding: 16px 20px; font-size: .93rem; color: var(--ink); }
.callout b { display: block; margin-bottom: 2px; }
.callout.warn { background: #FCEFEC; border-color: #B4442E; }
.callout.good { background: #ECF7F1; border-color: #1F8A5B; }

.card { background: var(--white); border: 1px solid var(--line); border-radius: 8px; padding: 22px 24px; }
.card-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 14px; gap: 10px; flex-wrap: wrap; }
.card-head h3 { font-family: var(--sans); font-size: 1.05rem; font-weight: 800; letter-spacing: 0; }
.card-head h3 i { font-style: normal; color: var(--gold-lo); margin-right: 10px; font-size: .85rem; }
.card-head small { font-size: .7rem; font-weight: 800; letter-spacing: .08em; color: var(--muted); }
.chart-box { position: relative; height: 300px; }
.legend-row { display: flex; gap: 18px; font-size: .78rem; color: var(--muted); margin-top: 10px; flex-wrap: wrap; }
.legend-row i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 6px; vertical-align: -1px; }

.tbl-wrap { max-height: 460px; overflow: auto; border: 1px solid var(--line); border-radius: 4px; }
table.tbl { width: 100%; border-collapse: collapse; font-size: .85rem; font-variant-numeric: tabular-nums; }
.tbl th { position: sticky; top: 0; background: var(--navy); color: #DDE3EE; font-size: .7rem; letter-spacing: .08em; text-transform: uppercase; text-align: right; padding: 10px 12px; font-weight: 700; }
.tbl td { text-align: right; padding: 9px 12px; border-bottom: 1px solid var(--paper-2); white-space: nowrap; }
.tbl th:first-child, .tbl td:first-child { text-align: left; }
.tbl tr.mark td { background: #FBF6EA; font-weight: 700; }
.tbl td em { font-style: normal; font-size: .62rem; font-weight: 800; letter-spacing: .06em; color: var(--gold-lo); margin-left: 8px; }
.tbl tfoot td { font-weight: 800; background: var(--paper); }
.note { font-size: .8rem; color: #7A849A; line-height: 1.6; }

/* tax: fund type options + slab buttons */
.opts { display: grid; gap: 8px; margin-top: 10px; }
.opt { display: flex; gap: 12px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 6px; cursor: pointer; }
.opt input { accent-color: var(--navy); margin-top: 4px; }
.opt b { font-size: .92rem; display: block; }
.opt span { font-size: .78rem; color: var(--muted); }
.opt:has(input:checked) { border-color: var(--navy); background: var(--paper); box-shadow: inset 3px 0 0 var(--gold); }
.slabs { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; margin-top: 10px; }
.slabs button { border: 1px solid var(--line); background: var(--white); padding: 8px 0; border-radius: 4px; font-size: .8rem; font-weight: 700; color: var(--muted); }
.slabs button.on { background: var(--navy); color: var(--gold-hi); border-color: var(--navy); }
.dates { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 12px; }
.dates label { font-size: .72rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.dates input { width: 100%; margin-top: 6px; padding: 10px; border: 1px solid var(--line); border-radius: 4px; font: 600 .9rem var(--sans); background: var(--paper); color: var(--ink); }
.split { display: flex; height: 34px; border-radius: 4px; overflow: hidden; margin: 8px 0 12px; }
.split i { display: block; height: 100%; }
.c-inv { background: var(--navy); } .c-gain { background: var(--gold); } .c-tax { background: #B4442E; }

/* returns: investment rows */
.inv { border: 1px solid var(--line); border-radius: 6px; padding: 14px; margin-top: 12px; }
.inv-top { display: flex; gap: 10px; align-items: center; }
.inv-top i { font-style: normal; font-size: .75rem; font-weight: 800; color: var(--gold-lo); }
.inv-top input { flex: 1; border: 0; border-bottom: 1px dashed var(--line); font: 700 .95rem var(--sans); padding: 4px 0; background: none; color: var(--ink); min-width: 0; }
.inv-top button { border: 0; background: var(--paper); width: 28px; height: 28px; border-radius: 50%; color: var(--muted); font-size: 1.1rem; line-height: 1; }
.inv-top button:hover { background: #FCEFEC; color: #B4442E; }
.inv-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 12px; }
.inv-grid label { font-size: .68rem; font-weight: 700; letter-spacing: .06em; color: var(--muted); text-transform: uppercase; }
.inv-grid .f-input { max-width: none; min-width: 0; margin-top: 4px; }
.inv-held { display: flex; gap: 6px; }
.inv-out { display: grid; grid-template-columns: repeat(3, 1fr); margin-top: 12px; background: var(--paper); border-radius: 4px; padding: 10px; text-align: center; }
.inv-out span { display: block; font-size: .64rem; font-weight: 800; letter-spacing: .08em; color: var(--muted); }
.inv-out b { font-size: .95rem; }
.add-inv { width: 100%; margin-top: 12px; border: 1px dashed var(--gold); background: #FBF6EA; padding: 12px; border-radius: 6px; font-weight: 700; color: var(--ink); }
.hbars { display: grid; gap: 12px; }
.hbar { display: grid; grid-template-columns: 150px 1fr 70px; gap: 12px; align-items: center; font-size: .85rem; }
.hbar .track { height: 12px; background: var(--paper-2); border-radius: 6px; overflow: hidden; }
.hbar .track i { display: block; height: 100%; background: var(--gold); border-radius: 6px; }
.hbar.total .track i { background: var(--navy); }
.hbar b { text-align: right; font-variant-numeric: tabular-nums; }
@media (max-width: 520px) { .hbar { grid-template-columns: 100px 1fr 60px; } }

/* below the calculator */
.calc-more { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; margin-top: 56px; }
.more-list a { display: flex; justify-content: space-between; padding: 14px 0; border-bottom: 1px solid var(--line); text-decoration: none; font-weight: 600; }
.more-list a:hover { color: var(--gold-lo); }
.cta-card { background: var(--navy); color: #fff; padding: 32px; border-radius: 8px; }
.cta-card h3 { font-size: 2rem; color: #FBF7EC; }
.cta-card p { color: #B4BDD0; margin: 12px 0 22px; }
.cta-card .btn { margin-right: 10px; margin-top: 6px; }
.explainer { margin-top: 64px; max-width: 820px; }
.explainer h2 { font-size: clamp(1.9rem, 3.4vw, 2.6rem); margin-bottom: 16px; }
.explainer p { color: var(--muted); margin-bottom: 14px; }
@media (max-width: 860px) { .calc-more { grid-template-columns: 1fr; } }

.toast { position: fixed; left: 50%; bottom: 28px; transform: translate(-50%, 20px); background: var(--navy); color: var(--gold-hi); padding: 12px 20px; border-radius: 4px; font-weight: 600; font-size: .9rem; opacity: 0; transition: .25s; z-index: 60; pointer-events: none; }
.toast.on { opacity: 1; transform: translate(-50%, 0); }

@media print {
  .params, .calc-more, .explainer, .res-actions, .live { display: none !important; }
  .calc-layout { grid-template-columns: 1fr; margin: 0; }
  .tbl-wrap { max-height: none; overflow: visible; }
  .card, .kpi { break-inside: avoid; }
}
