/* Finance calculators: layout on top of the shared tokens in /assets/css/site.css. Tokens only, no hard-coded colours. */
.calc-grid { display: grid; gap: 1.25rem; margin-top: 1.5rem; align-items: start; }
@media (min-width: 900px) { .calc-grid { grid-template-columns: minmax(300px, 380px) minmax(0, 1fr); } }
.calc-grid > * { min-width: 0; }
.fields { display: grid; gap: .9rem; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.field label { margin-bottom: .3rem; }
.field .hint { color: var(--muted); font-size: .82rem; margin-top: .25rem; }
.field .err { color: var(--accent); font-size: .85rem; margin-top: .25rem; min-height: 0; }
.field .err:empty { display: none; }
input[aria-invalid="true"] { border-color: var(--accent); border-width: 2px; }
.field-full { grid-column: 1 / -1; }
fieldset { border: 1px solid var(--line); border-radius: 12px; padding: .9rem 1rem 1rem; min-width: 0; }
legend { font-family: var(--display); font-weight: 650; padding: 0 .4rem; }
.opt-block { display: grid; gap: 1rem; }
@media (min-width: 640px) and (max-width: 899px) { .opt-block.three { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 900px) { .opt-block.three { grid-template-columns: repeat(3, minmax(0, 1fr)); } .calc-grid.wide { grid-template-columns: minmax(0, 1fr); } }
.results { display: grid; gap: 1rem; }
.big { display: grid; gap: .25rem; }
.big .k { color: var(--muted); font-size: .9rem; }
.big .v { font-family: var(--display); font-weight: 700; font-size: clamp(2rem, 6vw, 2.9rem); line-height: 1.05; letter-spacing: -.03em; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.stats { display: grid; gap: .75rem; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.stat { border: 1px solid var(--line); border-radius: 10px; padding: .65rem .8rem; background: var(--bg); min-width: 0; }
.stat .k { color: var(--muted); font-size: .84rem; }
.stat .v { font-weight: 650; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.chart-box { position: relative; height: 300px; width: 100%; }
@media (min-width: 900px) { .chart-box { height: 340px; } }
.chart-box canvas { position: absolute; inset: 0; }
.actions { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; }
.status { color: var(--muted); font-size: .9rem; min-height: 1.4em; }
.tag { display: inline-block; padding: .1rem .5rem; border-radius: 999px; border: 1px solid var(--c-finance); font-size: .8rem; font-weight: 600; }
.best { outline: 2px solid var(--c-finance); outline-offset: -2px; }
.sec-title { font-family: var(--display); font-weight: 650; font-size: 1.2rem; letter-spacing: -.015em; margin-bottom: .6rem; }
.page-head { margin-bottom: .5rem; }
.assume { margin-top: 1.5rem; }
.assume li { margin: .25rem 0 .25rem 1.1rem; list-style: disc; color: var(--muted); font-size: .92rem; }
details > summary { cursor: pointer; min-height: 44px; display: flex; align-items: center; font-weight: 600; }
.table-scroll { max-height: 420px; overflow: auto; }
.table-scroll table { min-width: 460px; }
.table-scroll th[scope="col"] { position: sticky; top: 0; background: var(--surface); }
td, th { white-space: nowrap; }
td.num, th.num { text-align: right; }
[hidden] { display: none !important; }
.calc-grid, .results, .opt-block { grid-template-columns: minmax(0, 1fr); }
@media (min-width: 900px) { .calc-grid { grid-template-columns: minmax(300px, 380px) minmax(0, 1fr); } .calc-grid.wide { grid-template-columns: minmax(0, 1fr); } .opt-block.three { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 640px) and (max-width: 899px) { .opt-block.three { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.table-scroll td { text-align: right; font-variant-numeric: tabular-nums; }
.table-scroll th[scope="row"] { text-align: left; }
