:root{--calc-ink:#142c47;--calc-accent:#1758d4;--calc-muted:#4b6076;--calc-border:#dce5ef}
body:has(.calc-studio){background:radial-gradient(ellipse at 0 0,#e9f2ff,transparent 50%),#f5f8fc;color:var(--calc-ink)}
body:has(.calc-studio) main{max-width:1180px}.calc-studio.panel{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:24px;padding:0;border:0;background:transparent;box-shadow:none;align-items:start}
.calc-inputs,.calc-results{background:#fff;border:1px solid var(--calc-border);border-radius:24px;padding:clamp(20px,3vw,34px);box-shadow:0 12px 40px #193e6410;min-width:0}
.calc-inputs{display:grid;gap:18px}.calc-inputs h2{margin:0;font-size:1.45rem}.calc-subtle{margin:-9px 0 3px;color:var(--calc-muted)}
.calc-field{display:grid;gap:8px;font-size:1rem;font-weight:650}.calc-field input,.calc-field select,.calc-field textarea{border:1px solid #b8c9dc;background:#f9fbfe;min-height:48px;border-radius:12px;padding:11px 13px;font-size:1rem;line-height:1.5;color:var(--calc-ink);width:100%;max-width:100%;resize:vertical;box-sizing:border-box}
.calc-field select{appearance:none;padding-right:36px;background-image:none}.calc-field:has(>select){position:relative}.calc-field:has(>select)::after{content:"";position:absolute;right:18px;bottom:21px;width:7px;height:7px;border-right:2px solid #142c47;border-bottom:2px solid #142c47;transform:rotate(45deg);pointer-events:none}
.calc-field :focus-visible,button:focus-visible,a:focus-visible{outline:3px solid #1766de;outline-offset:4px}.calc-actions{display:flex;flex-wrap:wrap;gap:10px;margin-top:4px}
.calc-primary,.calc-secondary{font:inherit;font-weight:650;border-radius:12px;padding:12px 20px;min-height:48px;cursor:pointer}.calc-primary{background:var(--calc-accent);border:1px solid var(--calc-accent);color:#fff}.calc-secondary{background:#fff;border:1px solid #b8c9dc;color:var(--calc-ink)}.calc-primary:hover{background:#1046ae}.calc-secondary:hover{background:#edf4ff}button:disabled{opacity:.55;cursor:default}
.calc-privacy{border-top:1px solid var(--calc-border);padding-top:16px;font-size:.875rem;color:var(--calc-muted);margin:0}.calc-results{position:sticky;top:20px;border-top:4px solid var(--calc-accent)}.calc-eyebrow{font-size:.875rem;color:var(--calc-accent);letter-spacing:.08em;font-weight:750;margin:0 0 18px}
.calc-main{font-size:clamp(1.75rem,4vw,2.75rem);letter-spacing:-.035em;line-height:1.17;font-weight:750;white-space:pre-wrap;overflow-wrap:anywhere;margin:0 0 24px}.calc-metrics{display:grid;gap:12px;margin:0 0 20px}.calc-metrics>div{display:grid;grid-template-columns:1fr 1fr;gap:12px;padding:12px 0;border-bottom:1px solid var(--calc-border)}.calc-metrics dt{color:var(--calc-muted)}.calc-metrics dd{margin:0;text-align:right;overflow-wrap:anywhere;font-weight:650}.calc-note{color:var(--calc-muted);font-size:1rem;line-height:1.65}.calc-status{font-size:.875rem;min-height:1.5em}.calc-error{border-top-color:#a62b3d}.calc-error .calc-eyebrow{color:#a62b3d}
.calc-explainer{margin-top:28px;background:#fff;border:1px solid var(--calc-border);border-radius:22px;padding:24px}.calc-explainer h2{margin-top:0}.calc-explainer p{line-height:1.7;overflow-wrap:anywhere}.calc-related{display:flex;flex-wrap:wrap;gap:10px}.calc-related a{background:#edf4ff;border-radius:9px;padding:9px 13px;text-decoration:none}.calc-directory{display:grid;gap:24px}.calc-directory ul{list-style:none;padding:0;display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,260px),1fr));gap:12px}.calc-directory li{padding:16px;border:1px solid var(--calc-border);border-radius:14px;background:white}.calc-directory a{font-weight:650}.calc-directory li p{color:var(--calc-muted);margin-bottom:0}.calc-directory section{scroll-margin-top:24px}.calc-directory-nav{display:flex;gap:12px;flex-wrap:wrap}
@media(max-width:760px){.calc-studio.panel{grid-template-columns:1fr}.calc-results{position:static}.calc-main{font-size:2rem}.calc-metrics>div{grid-template-columns:1fr}.calc-metrics dd{text-align:left}.page-heading h1{font-size:2.3rem}}
@media(prefers-reduced-motion:reduce){*{scroll-behavior:auto!important}}
.calc-breadcrumbs{display:flex;flex-wrap:wrap;gap:8px;font-size:.9rem;margin-bottom:22px;color:var(--calc-muted)}
.calc-guide h3{font-size:1.15rem;margin-top:26px}.calc-guide li{margin-block:7px}.calc-example-inputs{display:grid;grid-template-columns:repeat(auto-fit,minmax(220px,1fr));gap:12px}.calc-example-inputs>div{border:1px solid var(--calc-border);padding:12px;border-radius:10px}.calc-example-inputs dt{font-weight:650}.calc-example-inputs dd{margin:4px 0 0;overflow-wrap:anywhere}
.calc-chart-container{min-width:0;border-top:1px solid var(--calc-border);padding-top:14px;margin-top:20px}.calc-chart{margin:0;max-width:100%;overflow-x:auto}.calc-chart h3{font-size:1.15rem;margin:0 0 12px}.calc-chart svg{display:block;width:100%;min-width:560px;height:auto}.chart-grid{stroke:#dde6f1;stroke-dasharray:4 5}.chart-tick,.chart-axis{fill:#344e68;font-size:20px;font-family:inherit}.chart-total{fill:#142c47;font-size:36px;font-weight:750;font-family:inherit}.calc-chart figcaption{font-size:.9rem;color:var(--calc-muted);line-height:1.6}.chart-legend{list-style:none;display:flex;flex-wrap:wrap;gap:12px;padding:0;font-size:.9rem}.chart-series-0{color:#1859cf}.chart-series-1{color:#087e78}.chart-data{margin-top:14px;font-size:.9rem}.chart-data summary{cursor:pointer;font-weight:650;padding:8px 0}.chart-data table{border-collapse:collapse;width:100%;margin-top:12px}.chart-data th,.chart-data td{padding:8px;border:1px solid var(--calc-border);text-align:left}.chart-data caption{text-align:left;font-weight:650;margin-bottom:8px}
.calc-print-header,.calc-print-inputs,.calc-print-footer{display:none}
.calc-secondary:hover:not(:disabled){background:#edf4ff;color:var(--calc-ink)}.calc-primary:hover:not(:disabled){background:#1046ae;color:#fff}
.calc-studio>.calc-chart-container{grid-column:1/-1;background:#fff;border:1px solid var(--calc-border);border-radius:24px;padding:24px;margin-top:0}.calc-chart svg{max-width:960px;margin-inline:auto}
.calc-chart svg{min-width:0}.calc-chart{overflow-x:hidden}.chart-data{overflow-x:auto}
.calc-field .calc-option-search{font-weight:400;background:#fff;border-style:dashed;font-size:.9rem;min-height:42px}.calc-field-hint,.calc-options-count{font-size:.875rem;font-weight:400;color:#4b6076;line-height:1.5}.calc-field:has(>select)::after{bottom:21px}.calc-field:has(>select):has(>.calc-field-hint)::after{display:none}
.calc-select-wrap{position:relative}.calc-select-wrap::after{content:"";position:absolute;right:18px;top:calc(50% - 5px);width:7px;height:7px;border-right:2px solid #142c47;border-bottom:2px solid #142c47;transform:rotate(45deg);pointer-events:none}
.calc-directory-search{max-width:640px;margin:0 auto 28px}.calc-directory-search input{min-height:52px;background:#fff;border:1px solid #b8c9dc;border-radius:14px;font-size:1rem;padding:12px 16px}.calc-directory-search p{font-size:.9rem;color:#4b6076;min-height:1.5em}
.chart-switch{display:flex;flex-wrap:wrap;gap:6px;padding:6px;background:#edf3fc;border:1px solid #dce6f4;border-radius:15px;margin:16px 0 10px;width:fit-content;max-width:100%}.chart-switch button{background:transparent;color:#344e68;border:1px solid transparent;border-radius:10px;font-size:.9rem;min-height:42px;padding:9px 15px;font-weight:650;cursor:pointer}.chart-switch button:hover:not(:disabled){background:#fff;color:#17365c}.chart-switch button[aria-pressed=true]{background:#2563eb;color:#fff;box-shadow:0 3px 10px #2563eb24}.chart-switch button[aria-pressed=true]:hover:not(:disabled){background:#1d4ed8;color:#fff}.chart-switch button:focus-visible{outline:3px solid #164bab;outline-offset:2px}.chart-view-caption{font-size:.9rem;color:#4b6076;margin:0 0 12px}.chart-total-label{font-weight:700;color:#17365c}.chart-column-label{fill:#344e68;font-size:20px;font-family:inherit}.chart-series-2{color:#7c3aed}.chart-series-3{color:#b45309}.calc-chart svg{animation:chart-reveal .18s ease-out}@keyframes chart-reveal{from{opacity:.5}to{opacity:1}}@media(prefers-reduced-motion:reduce){.calc-chart svg{animation:none}}@media(max-width:550px){.chart-switch{width:100%;box-sizing:border-box}.chart-switch button{flex:1 1 auto;padding:9px 11px}.calc-chart h3{font-size:1.15rem}}@media print{.chart-switch{display:none!important}.chart-view-caption{font-size:9pt;margin-bottom:1mm}.calc-chart svg{animation:none}}
@page{size:A4;margin:14mm}
@media print{
 html,body:has(.calc-studio){background:#fff!important;color:#111!important;font-size:10.5pt;line-height:1.45}
 body:has(.calc-studio) header,body:has(.calc-studio) footer,.calc-breadcrumbs,.page-heading,.calc-actions,.calc-status,.calc-controls,.calc-inputs,.calc-guide,.calc-explainer,.back,.calc-privacy{display:none!important}
 body:has(.calc-studio) main{max-width:none;padding:0;margin:0}.calc-studio.panel{display:block!important;max-width:100%}.calc-print-header,.calc-print-inputs,.calc-print-footer{display:block}.calc-print-header{padding-bottom:6mm;border-bottom:2px solid #1859cf;margin-bottom:6mm}.calc-print-brand{font-weight:700;color:#1859cf}.calc-print-header h2{font-size:22pt;margin:3mm 0}.calc-print-inputs dl{display:grid;grid-template-columns:1fr 1fr;gap:3mm 7mm}.calc-print-inputs dl>div{break-inside:avoid;border-bottom:1px solid #ddd;padding-bottom:2mm}.calc-print-inputs dt{font-weight:700}.calc-print-inputs dd{margin:1mm 0 0;overflow-wrap:anywhere;white-space:pre-wrap}
 .calc-results{position:static;box-shadow:none;border:1px solid #bbb;border-radius:0;padding:6mm;margin-top:6mm;break-inside:auto}.calc-eyebrow{margin-bottom:3mm}.calc-main{font-size:24pt;margin:0 0 5mm;break-inside:avoid}.calc-note{font-size:10.5pt;line-height:1.5;orphans:3;widows:3}.calc-metrics>div{break-inside:avoid}.calc-chart-container,.calc-chart svg{break-inside:avoid}.calc-chart{overflow:visible;break-inside:auto}.calc-chart svg{min-width:0;width:100%;max-height:100mm}.calc-chart svg,.calc-print-brand{-webkit-print-color-adjust:exact;print-color-adjust:exact}.calc-chart h3{break-after:avoid}.chart-data{display:none!important}.calc-print-footer{margin-top:5mm;padding-top:3mm;border-top:1px solid #bbb;font-size:9pt;overflow-wrap:anywhere}.calc-print-footer p{orphans:3;widows:3}
}
@media print{
 .calc-print-header{padding-bottom:3mm;margin-bottom:3mm}.calc-print-header p{margin:1mm 0}.calc-print-header h2{font-size:18pt;margin:2mm 0}
 .calc-print-inputs h3{margin:2mm 0}.calc-print-inputs dl{margin:2mm 0;gap:2mm 5mm}.calc-print-inputs dt{font-size:9pt}.calc-print-inputs dd{font-size:9.5pt;line-height:1.3}
 .calc-results{padding:4mm;margin-top:3mm}.calc-eyebrow{font-size:9pt;margin-bottom:2mm}.calc-main{font-size:20pt;margin-bottom:3mm}.calc-metrics{gap:0;margin-bottom:3mm}.calc-metrics>div{padding:2mm 0}.calc-note{font-size:9.5pt;line-height:1.4;margin:2mm 0}
 .calc-studio>.calc-chart-container{border-radius:0;padding:3mm;margin-top:3mm}.calc-chart svg{max-height:60mm}.calc-chart h3{font-size:12pt;margin-bottom:1mm}.calc-chart figcaption,.chart-legend{font-size:9pt;line-height:1.35;margin-block:1mm}.calc-print-footer{margin-top:3mm;font-size:8.5pt}
}
.budget-expenses { display:grid; gap:10px; }
.budget-expense { display:grid; grid-template-columns:minmax(0,1fr) 100px auto; gap:6px; }
.budget-expense input { min-width:0; }
.budget-expense input, .budget-import select, .budget-import input[type=file] { box-sizing:border-box; width:100%; min-height:44px; padding:8px; border:1px solid #b8c9dc; border-radius:10px; background:#fff; font:inherit; }
.budget-import { padding:12px; background:#eef4fc; border-radius:14px; }
.budget-import summary { cursor:pointer; font-weight:700; }
.budget-import label { margin-top:8px; }
.budget-transactions { max-height:300px; overflow:auto; margin:12px 0; }
.budget-transactions label { display:flex; align-items:start; gap:8px; overflow-wrap:anywhere; font-size:.85rem; }
.budget-transactions input[type=checkbox] { flex:0 0 18px; width:18px; min-height:18px; }
@media(max-width:500px){.budget-expense{grid-template-columns:minmax(0,1fr) 90px;}.budget-expense button{grid-column:1/-1;justify-self:end;}}
