/* Calculator-only components; shared site typography, logo and palette remain in styles.css. */
.calculator-page {
 --brand-font:var(--font-body); --navy-2:var(--navy-700); --sky:var(--teal-soft);
 --surface:#fff; --surface-2:var(--bg-soft); --ink-2:var(--muted); --ink-3:#566b87;
 --line-2:#e8eef5; --good:#1b7a4e; --good-bg:#e4f3eb; --warn:#9a6400; --warn-bg:#fbf0d6;
 --bad:#b0372e; --bad-bg:#f9e4e2; --bar-up:#1f8a5a; --bar-down:#c2463d; --bar-total:var(--navy); --focus:var(--teal-ink);
 font-size:15px; font-variant-numeric:tabular-nums;
}
.calculator-page button,.calculator-page input,.calculator-page select {font:inherit;color:inherit;}
.calculator-page h2 {font-size:18px;font-weight:600;}
.calculator-page svg {stroke:none;stroke-width:0;}
.calculator-page .gauge circle {stroke-width:10;}
.calculator-page .gauge text {fill:var(--ink);}
.calculator-shell{width:100%;}
.calculator-workspace{padding-bottom:64px;}
.eyebrow{color:var(--navy-2);font-weight:600;font-size:14px;margin-bottom:10px}
.calculator-hero{border-bottom:1px solid var(--line)}
.calculator-hero-inner{display:flex;flex-wrap:wrap;gap:20px 40px;align-items:flex-end;justify-content:space-between;}
.calculator-hero p{color:var(--ink-2);max-width:64ch;margin-top:12px;font-size:16.5px}
.toolbar{display:flex;flex-wrap:wrap;gap:8px}
.calculator-shell .btn{border:1px solid var(--line);background:var(--surface);border-radius:8px;padding:9px 14px;cursor:pointer;font-size:14px;font-weight:500;color:var(--ink)}
.calculator-shell .btn.sample-link{border-color:var(--teal);background:var(--teal-soft);color:var(--navy);text-decoration:none;}
.calculator-shell .btn.sample-link:hover{background:var(--teal);border-color:var(--teal-ink);}
.calculator-shell .btn:hover{border-color:var(--navy-2);color:var(--navy)}
.calculator-shell .btn.primary{background:var(--navy);color:#fff;border-color:var(--navy)}
.calculator-shell .btn.primary:hover{background:var(--navy-2)}
.calculator-shell .btn.quiet{border-color:transparent;background:transparent;color:var(--ink-2)}
.calculator-shell .btn:focus-visible,input:focus-visible,select:focus-visible,a:focus-visible{outline:2px solid var(--focus);outline-offset:2px}

.layout{display:grid;grid-template-columns:minmax(0,1fr) 400px;gap:28px;margin-top:28px;align-items:start}
.inputs{display:flex;flex-direction:column;gap:18px;min-width:0}
.results{position:sticky;top:calc(82px + env(safe-area-inset-top,0px));display:flex;flex-direction:column;gap:18px}

.panel{background:var(--surface);border:1px solid var(--line);border-radius:14px;box-shadow:0 1px 2px rgba(2,54,114,.04)}
.panel > summary, .panel-head{display:flex;align-items:baseline;justify-content:space-between;gap:12px;padding:16px 20px;cursor:pointer;list-style:none}
.panel > summary::-webkit-details-marker{display:none}
.panel > summary::after{content:"−";color:var(--ink-3);font-size:18px;line-height:1}
.panel:not([open]) > summary::after{content:"+"}
.panel-head h2 small, .panel > summary h2 small{display:block;font-size:13px;font-weight:400;color:var(--ink-2);margin-top:3px}
.panel-body{padding:0 20px 18px}

table{width:100%;border-collapse:collapse}
th,td{text-align:right;padding:8px 6px;border-bottom:1px solid var(--line-2);vertical-align:middle}
th{font-weight:500;color:var(--ink-2);font-size:13px}
th:first-child,td:first-child{text-align:left;padding-left:0}
td:last-child,th:last-child{padding-right:0}
tr.derived td{color:var(--ink-2);font-size:14px;background:var(--surface-2)}
tr.derived td:first-child{font-weight:600;color:var(--ink);padding-left:8px;border-radius:6px 0 0 6px}
tr.derived td:last-child{padding-right:8px;border-radius:0 6px 6px 0}
tr.total td{font-weight:600;border-top:1px solid var(--navy);border-bottom:none}
.hint{color:var(--ink-3);font-size:12px;display:block;font-weight:400}
.num{width:100%;max-width:160px;text-align:right;padding:7px 9px;border:1px solid var(--line);border-radius:7px;background:var(--surface)}
.num:hover{border-color:var(--ink-3)}
.num.neg{color:var(--bad)}
.period-label{width:100%;max-width:150px;text-align:right;padding:4px 6px;border:1px solid transparent;border-radius:6px;background:transparent;font-weight:600;color:var(--navy)}
.period-label:hover{border-color:var(--line)}
.wrap{overflow-x:auto}

.adj-table td{padding:6px 4px}
.adj-table select,.adj-table .text{width:100%;padding:7px 9px;border:1px solid var(--line);border-radius:7px;background:var(--surface)}
.adj-table .text{text-align:left}
.adj-table .num{max-width:120px}
.icon-btn{border:none;background:transparent;color:var(--ink-3);cursor:pointer;padding:4px 7px;border-radius:5px;font-size:16px;line-height:1}
.icon-btn:hover{color:var(--bad);background:var(--bad-bg)}
.adj-foot{display:flex;justify-content:space-between;align-items:center;gap:12px;margin-top:12px;flex-wrap:wrap}
.legend{font-size:13px;color:var(--ink-2);max-width:60ch}

.score-panel{padding:20px;background:linear-gradient(180deg,var(--sky),var(--surface) 70%)}
.score-row{display:flex;align-items:center;gap:18px}
.gauge{width:104px;height:104px;flex:none}
.score-text .grade{font-size:40px;font-weight:700;line-height:1;letter-spacing:-.02em;color:var(--navy)}
.score-text .label{color:var(--ink-2);margin-top:5px;font-weight:500}
.score-text .scale{font-size:13px;color:var(--ink-3);margin-top:6px}

.bridge-panel{padding:20px}
.bridge-head{display:flex;justify-content:space-between;align-items:center;gap:12px;flex-wrap:wrap;margin-bottom:6px}
.bridge-head select{padding:6px 9px;border:1px solid var(--line);border-radius:7px;background:var(--surface)}
.bridge svg{width:100%;height:auto;display:block}
.bridge .axis{stroke:var(--line);stroke-width:1}
.bridge .connector{stroke:var(--ink-3);stroke-width:1;stroke-dasharray:3 3}
.bridge text{font-family:inherit;fill:var(--ink-2);font-size:11px}
.bridge text.val{fill:var(--ink);font-weight:600}
.bridge-summary{display:grid;grid-template-columns:repeat(3,1fr);gap:8px;margin-top:12px}
.bridge-summary div{background:var(--surface-2);border-radius:8px;padding:9px 11px}
.bridge-summary b{display:block;font-size:16px;font-weight:600;color:var(--navy)}
.bridge-summary span{font-size:12px;color:var(--ink-2)}

.metrics{padding:6px 20px 12px}
.metric{display:grid;grid-template-columns:1fr auto auto;gap:4px 12px;align-items:center;padding:11px 0;border-bottom:1px solid var(--line-2)}
.metric:last-child{border-bottom:none}
.metric .name{font-weight:600}
.metric .why{grid-column:1 / -1;font-size:12.5px;color:var(--ink-2)}
.metric .value{font-weight:600;white-space:nowrap}
.rating{font-size:12px;font-weight:600;padding:3px 9px;border-radius:999px;white-space:nowrap}
.rating.good{background:var(--good-bg);color:var(--good)}
.rating.warn{background:var(--warn-bg);color:var(--warn)}
.rating.bad{background:var(--bad-bg);color:var(--bad)}
.rating.na{background:var(--surface-2);color:var(--ink-3)}
.pts{font-size:12px;color:var(--ink-3)}

.method{font-size:13.5px;color:var(--ink-2);padding:0 20px 18px;line-height:1.55}
.method ul{margin:6px 0 0;padding-left:18px}
.method li{margin:3px 0}

.cta-band{margin-top:40px;background:var(--navy);color:#fff;border-radius:16px;padding:32px;display:flex;flex-wrap:wrap;gap:16px 32px;align-items:center;justify-content:space-between}
.cta-band h2{font-size:24px;font-weight:700;color:#fff}
.cta-band p{color:rgba(255,255,255,.82);max-width:60ch;margin-top:6px}
.cta-band a{background:#fff;color:var(--navy);text-decoration:none;font-weight:600;padding:12px 20px;border-radius:10px;white-space:nowrap}
.disclaimer{font-size:12.5px;color:var(--ink-3);margin-top:18px;max-width:80ch}
.toast{position:fixed;left:50%;bottom:calc(20px + env(safe-area-inset-bottom,0px));transform:translateX(-50%) translateY(20px);background:var(--navy);color:#fff;padding:10px 16px;border-radius:8px;font-size:14px;opacity:0;transition:opacity .2s,transform .2s;pointer-events:none}
.toast.show{opacity:1;transform:translateX(-50%) translateY(0)}

@media (max-width:900px){
  .layout{grid-template-columns:1fr}
  .results{position:static}
  .calculator-workspace{padding-bottom:48px}
  h1{font-size:30px}
  .num{max-width:120px}
  .cta-band{padding:24px}
}
@media (prefers-reduced-motion: reduce){ .toast{transition:none} }
@media print{
  .layout{grid-template-columns:1fr}
  .panel{break-inside:avoid;border-color:#999;box-shadow:none}
  body{background:#fff;color:#000}
}

.calculator-hero {padding:70px 0 32px;background:radial-gradient(ellipse at top right,var(--teal-soft),transparent 60%);}
@media(max-width:900px){.calculator-hero{padding-top:56px;}}
.calculator-hero h1 {font-size:clamp(34px,4.4vw,52px);letter-spacing:-.025em;max-width:760px;}
.calculator-hero .eyebrow {color:var(--teal-ink);font-size:12px;letter-spacing:.14em;}
.calculator-hero p {max-width:66ch;}
.calculator-page .calculator-shell .btn {white-space:normal;min-height:44px;}
.calculator-page .inputs {min-width:0;}
.calculator-page .panel {overflow:hidden;}
.calculator-page .wrap {overflow-x:auto;}
.calculator-page #isTable,.calculator-page #cfTable {min-width:570px;}
.calculator-page .adj-table {min-width:720px;}
.calculator-page .adj-table td:first-child {min-width:170px;}
.calculator-page .adj-table td:nth-child(2) {min-width:180px;}
.calculator-page .adj-table .num {min-width:100px;}
.calculator-page .num,.calculator-page .period-label {min-height:40px;}
.calculator-page .metric {grid-template-columns:minmax(0,1fr) auto;}
.calculator-page .metric .name {grid-column:1 / -1;}
.calculator-page .metric .value {white-space:normal;overflow-wrap:anywhere;}
.calculator-page .metric .rating {justify-self:end;}
.calculator-page .bridge {overflow-x:auto;}
.calculator-page .bridge svg {max-width:none;}
.calculator-page .score-text .scale {color:var(--muted);}
.calculator-page .calculator-notice {padding:16px;border:1px solid var(--line);background:var(--bg-soft);margin-top:20px;}
.calculator-page .icon-btn {min-width:40px;min-height:40px;}
.calculator-page .toast {z-index:100;max-width:calc(100% - 32px);width:max-content;}
.calculator-page [aria-invalid="true"] {border-color:var(--bad);background:var(--bad-bg);}
@media(max-width:1100px){.calculator-page .layout{grid-template-columns:1fr}.calculator-page .results{position:static;display:grid;grid-template-columns:1fr 1fr}.calculator-page .results>.panel:last-child{grid-column:1/-1}}
@media(max-width:600px){.calculator-page .results{display:flex}.calculator-page .panel-body,.calculator-page .panel-head,.calculator-page .panel>summary{padding-left:14px;padding-right:14px}.calculator-page .toolbar{display:grid;grid-template-columns:1fr 1fr;width:100%}.calculator-page .num{font-size:16px}.calculator-page .bridge-summary b{font-size:15px}}
@media print{.calculator-shell{padding:0;max-width:none}.calculator-page .layout,.calculator-page .results{display:block}.calculator-page .panel{margin:12px 0;overflow:visible}.calculator-page .wrap,.calculator-page .bridge{overflow:visible}.calculator-page .results{position:static}.calculator-page .num{max-width:none}.calculator-page .financial-background-canvas{display:none!important}.calculator-page .adj-table{min-width:0}.calculator-page .adj-table td:first-child,.calculator-page .adj-table td:nth-child(2){min-width:0}.calculator-page .adj-table .num{min-width:0}.calculator-page .bridge svg{width:100%!important;min-width:0!important}.calculator-page input,.calculator-page select{border:0!important}}

.calculator-page .layout{min-width:0;}
.calculator-page .results,.calculator-page .panel,.calculator-page .bridge{min-width:0;max-width:100%;}
.calculator-page .panel-head h2 small,.calculator-page .panel>summary h2 small{font-family:var(--font-body);line-height:1.45;margin-top:6px;}
.calculator-page .calculator-validation{color:var(--bad);flex-basis:100%;font-weight:500;}
.calculator-page .scroll-hint{font-size:12px;color:var(--muted);margin:10px 0;}
.calculator-page .table-scroll-hint{display:none;}
@media(max-width:1100px){.calculator-page .layout{grid-template-columns:minmax(0,1fr)}.calculator-page .results{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:700px){.calculator-page .table-scroll-hint{display:block;}}

@media print {
 .calculator-page .site-header,.calculator-page .toolbar,.calculator-page .icon-btn,.calculator-page .adj-foot button,.calculator-page .toast,.calculator-page .cta-band,.calculator-page .site-footer,.calculator-page .scroll-hint {display:none!important}
 .calculator-page .calculator-hero {padding:10px 0 20px;background:none}
 .calculator-page .calculator-workspace {padding:0}
 .calculator-page .calculator-shell .container {max-width:none;padding:0}
 .calculator-page .calculator-hero h1 {font-size:28px}
 .calculator-page .bridge-panel {break-inside:avoid}
}
/* Print values as wrapping text so long labels and adjustments are not clipped in controls. */
.calculator-page .print-value {display:none}
.calculator-page .calculator-storage-status {margin-top:12px;color:var(--warn);font-size:13px}
@media print {
 .calculator-page {font-size:10pt;line-height:1.3}
 .calculator-page .calculator-hero p {font-size:10pt;max-width:none;margin-top:8px}
 .calculator-page .panel {break-inside:auto;margin:10px 0;box-shadow:none}
 .calculator-page .panel>summary,.calculator-page .panel-head {padding:8px 10px;break-after:avoid}
 .calculator-page .panel>summary::after {display:none}
 .calculator-page .panel-body {padding:0 10px 10px}
 .calculator-page .panel h2 {font-size:12pt}
 .calculator-page .panel h2 small,.calculator-page .hint {font-size:8pt;line-height:1.3}
 .calculator-page th,.calculator-page td {padding:4px;font-size:9pt}
 .calculator-page .calculator-shell input,.calculator-page .calculator-shell select {display:none!important}
 .calculator-page .print-value {display:inline;white-space:pre-wrap;overflow-wrap:anywhere}
 .calculator-page #isTable,.calculator-page #cfTable,.calculator-page .adj-table {min-width:0;table-layout:fixed}
 .calculator-page #isTable th:first-child,.calculator-page #cfTable th:first-child {width:40%}
 .calculator-page .adj-table th:first-child {width:23%}
 .calculator-page .adj-table th:nth-child(2) {width:28%}
 .calculator-page .adj-table th:last-child,.calculator-page .adj-table td:last-child {display:none}
 .calculator-page .adj-table tr.total td:last-child {display:table-cell}
 .calculator-page .adj-table tr.total td:last-child:empty {display:none}
 .calculator-page .adj-table th,.calculator-page .adj-table td {font-size:8pt;vertical-align:top}
 .calculator-page tr,.calculator-page .metric {break-inside:avoid}
 .calculator-page .method {font-size:9pt;line-height:1.3;padding:0 10px 10px}
 .calculator-page .score-panel {padding:10px;break-inside:avoid}
 .calculator-page .gauge {width:70px;height:70px}
 .calculator-page .score-text .grade {font-size:25px}
 .calculator-page .bridge-panel {padding:10px}
 .calculator-page .bridge svg {max-height:180px}
 .calculator-page .metrics {padding:0 10px 8px}
 .calculator-page .metric {padding:4px 0}
 .calculator-page .metric .why,.calculator-page .pts,.calculator-page .rating {font-size:8pt}
 .calculator-page .metric .name {grid-column:auto}
 .calculator-page .metric {grid-template-columns:1fr auto auto}
 .calculator-page .disclaimer {font-size:8pt;margin-top:10px}
 .calculator-page .legend {font-size:8pt}
}
