/* POP calculator palette and type scale, matching bonds and loan overpayments. */
:root {
  --ink: #000; --text: #000; --muted: #647083; --line: #d7dfee;
  --bg: #f5f9fc; --card: #fff; --accent: #089981; --accent-strong: #089981;
  --accent-soft: #f5f9fc; --loss: #cb2e3b; --loss-soft: #f5f9fc; --radius: 12px;
  --pop-navy: #002092; --pop-action: #ffb21b; --pop-border: #d7dfee; --pop-badge: #c3d4ff;
  --sans: "Inter Tight", sans-serif; --label: "Inter", "Inter Tight", sans-serif;
}
html { color-scheme: light; scroll-behavior: auto; }
body { display: flow-root; font: 400 14px/1.6 var(--sans); }
::selection { color: var(--ink); background: var(--pop-badge); }
input, select { caret-color: var(--pop-navy); }
button, a { touch-action: manipulation; }
button, input, select, summary, label { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 3px solid var(--pop-navy); outline-offset: 3px; }
.page { width: min(1152px, calc(100% - 64px)); max-width: none; margin: 0 auto 64px; padding: 0; }
.calc { grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); gap: 32px; }
.card { box-shadow: 0 5px 18px rgba(15,23,42,.035); }
.form-card, .result-card { padding: 24px; }
.part { margin-bottom: 24px; padding-bottom: 24px; }
.part h3, .years-label { display: flex; align-items: center; gap: 12px; font: 600 16px/1.6 var(--sans); }
.step-number { display: grid; place-items: center; width: 32px; height: 32px; flex: 0 0 32px; border-radius: 50%; background: var(--pop-badge); font: 800 16px/1 var(--label); }
.part-sub { margin: 4px 0 16px 44px; color: var(--muted); font-size: 13px; }
.field label, .adv-label, .adv-field > label:not(.check), .choice legend { margin-bottom: 8px; font: 600 14px/1.4 var(--sans); }
.pair { column-gap: 12px; }
.input { height: 52px; padding: 0; border-color: var(--line); border-radius: 12px; background: var(--bg); cursor: text; transition: none; }
.input input { align-self: stretch; height: auto; padding: 10px 14px; border-radius: inherit; font: 600 22px/1.2 var(--sans); }
.input b { margin: 0; padding-right: 14px; color: var(--muted); font: 600 16px/1 var(--sans); }
.input:focus-within { border-color: var(--line); outline: 3px solid var(--pop-navy); outline-offset: 3px; box-shadow: none; }
.input input:focus-visible { outline: none; }
.input.invalid { border-color: var(--loss); box-shadow: none; }
.field-error { font-size: 12px; font-weight: 600; }
.hint, .auto-note { font-size: 12px; line-height: 1.5; }
.years-head { flex-wrap: wrap; }
.input-short { width: 140px; }
#years-range, .check input { accent-color: var(--pop-navy); }
.range-ends { font-size: 12px; }
.part-years { margin-bottom: 8px; padding-bottom: 8px; }
.limit-box { padding: 16px; border: 1px solid var(--line); border-radius: 12px; }
.limit-icon { border: 0; color: var(--pop-navy); background: var(--pop-badge); font: 800 13px/26px var(--label); }
.limit-main { color: var(--ink); font-weight: 600; }
.limit-note { font-size: 12px; }
.advanced summary { padding: 14px 16px; font-size: 14px; }
.advanced-body { padding: 0 16px 16px; }
.advanced-lead { font-size: 13px; }
.adv-field select { min-height: 44px; height: auto; padding: 11px 12px; border-color: var(--line); border-radius: 9px; color: var(--ink); background: var(--bg); font: 500 14px/1.4 var(--sans); }
.choice label { min-width: 0; }
.choice input { top: 0; left: 0; width: 1px; height: 1px; margin: 0; clip-path: inset(50%); }
.choice span { display: flex; align-items: center; justify-content: center; min-height: 44px; border-color: var(--line); border-radius: 9px; color: var(--ink); background: var(--bg); font: 600 12px/1.4 var(--sans); transition: filter 150ms ease; }
.choice input:checked + span { border-color: var(--pop-action); color: var(--ink); background: var(--pop-action); }
.choice input:focus-visible + span { outline: 3px solid var(--pop-navy); outline-offset: 3px; }
:root[data-calc-input="pointer"] .choice input:focus + span { outline: none; }
@media (hover: hover) { .choice label:hover > input:not(:disabled) + span { filter: brightness(.95); } }
.choice label:active > input:not(:disabled) + span { filter: brightness(.95); }
.check { font-size: 13px; }
.rate-line { font-size: 13px; }
.rate-future .input-short { width: 170px; min-height: 44px; }
.rate-future .input input { font-size: 18px; }
.rate-future .input b { font-size: 12px; }
.reset, .outline-button, .year-more {
  min-height: 44px; padding: 10px 16px; border: 0; border-radius: 9px;
  color: var(--ink); background: var(--pop-action); box-shadow: 0 2px 7px rgba(0,0,0,.12);
  font: 700 12px/1.4 var(--label); cursor: pointer;
}
.reset:hover, .outline-button:hover, .year-more:hover { color: var(--ink); background: var(--pop-action); }
.outline-button { margin-top: 16px; }
.year-more { background: var(--bg); border: 1px solid var(--line); box-shadow: none; }
.year-more:hover { background: var(--bg); }
.result-card { top: 16px; }
body[data-embedded] .result-card { position: static; }
.headline { color: var(--ink); font: 600 16px/1.6 var(--sans); text-align: left; }
.big { margin: 4px 0 0; color: var(--accent); font: 600 clamp(40px, 4vw, 52px)/1.05 var(--sans); letter-spacing: -.02em; text-align: left; }
.period { margin-top: 12px; color: var(--muted); font-size: 13px; text-align: left; }
.threshold { margin: 24px 0 16px; padding: 16px; border: 1px solid var(--line); }
.threshold-title { margin-bottom: 4px; color: var(--ink); font-weight: 600; }
#threshold-text { font-size: 14px; }
.threshold-note { font-size: 12px; }
.final { gap: 12px; }
.final-box { padding: 12px; min-width: 0; }
.final-box.better { border-color: var(--accent); box-shadow: none; }
.final-label { font-size: 13px; }
.final-value { margin-top: 4px; font: 600 24px/1.2 var(--sans); overflow-wrap: anywhere; }
.final-box.better .final-value { color: var(--accent); }
.final-tag { margin-top: 6px; color: var(--accent); font-size: 12px; font-weight: 600; }
.row { padding: 12px 0; font-size: 13px; }
.row dt small, .row dd { font-size: 12px; }
.row dd strong { font-weight: 600; }
.loss-note { border: 1px solid var(--loss); border-radius: 9px; font-size: 13px; }
.assumptions-now, .disclaimer { color: var(--muted); font-size: 12px; line-height: 1.5; }
.disclaimer { margin-top: 16px; }
.custom-badge { padding: 2px 8px; color: var(--pop-navy); background: var(--bg); border: 1px solid var(--line); font-size: 11px; }
.table-card { margin-top: 32px; padding: 24px; scroll-margin-top: 112px; outline: 0; }
.table-card h2, .method h2, .seo h2 { font: 600 24px/1.2 var(--sans); }
.table-lead { font-size: 13px; }
.year-table { font-variant-numeric: tabular-nums; font-size: 13px; }
.year-table th, .year-table td { padding: 12px; }
.year-table thead th { font: 600 11px/1.4 var(--label); }
.year-table td.tax { color: var(--ink); font-weight: 600; }
.year-table .year-more { min-height: 44px; }
.method { margin-top: 32px; }
.method > details { border-color: var(--line); border-radius: 12px; }
.method summary h3 { font: 600 16px/1.4 var(--sans); }
.method-body { max-width: 75ch; font-size: 14px; }
.method a, .context-link a, .seo a { color: var(--pop-navy); text-underline-offset: 3px; }
.context-link { margin-top: 12px; font-size: 13px; }
.link-spot { color: inherit; font-weight: 600; }
.seo { max-width: none; width: 100%; margin-top: 32px; columns: 2; column-gap: 32px; }
.seo-section { display: flow-root; break-inside: avoid; margin: 0 0 32px; }
.seo .seo-section > h2 { margin: 0 0 10px; font: 600 16px/1.4 var(--sans); }
.seo br, .method-body br, .disclaimer br { display: none; }
.legal { margin-top: 32px; padding: 0; border: 0; border-radius: 0; background: transparent; box-shadow: none; }
.legal h2 { margin: 0 0 12px; font: 600 16px/1.4 var(--sans); }
.legal p { max-width: 90ch; margin: 0 0 12px; color: var(--muted); font: 400 13px/1.55 var(--sans); }
.legal p:last-child { margin-bottom: 0; }
body[data-embedded] .mobile-result { display: none !important; }
.result-card[data-calculation-state="invalid"] #result { visibility: hidden; pointer-events: none; }
.result-card[data-calculation-state="invalid"] #result-message { position: absolute; inset: 24px; display: grid; align-content: center; z-index: 1; }
.result-card:has(#result-message:not([hidden])) { position: relative; }
@media (max-width: 980px) { .calc { grid-template-columns: 1fr; gap: 32px; } .result-card { position: static; } }
@media (max-width: 760px) {
  .seo { columns: 1; }
  .page { width: calc(100% - 32px); margin-bottom: 32px; }
  .form-card, .result-card, .table-card { padding: 20px 16px; }
  .input input { font-size: 20px; padding: 10px 12px; }
  .input b { padding-right: 12px; font-size: 14px; }
  .part-sub { margin-left: 0; }
  .final { grid-template-columns: 1fr 1fr; }
  .final-value { font-size: 22px; }
  .row { grid-template-columns: 1fr; gap: 4px; }
  .row dd { text-align: left; }
  .year-table .wide { display: none; }
  .year-table .narrow { display: table-cell; }
  .year-table th, .year-table td { padding: 10px 8px; white-space: normal; }
  .year-more { width: 100%; min-width: 88px; padding: 8px; font-size: 11px; }
  .year-detail:not([hidden]) { display: table-row; }
  .year-detail td { background: var(--bg); }
  .year-detail dl { display: grid; gap: 8px; margin: 0; }
  .year-detail dl div { display: flex; justify-content: space-between; gap: 12px; }
  .year-detail dd { margin: 0; font-weight: 600; }
  .table-wrap { scrollbar-color: var(--line) var(--bg); }
  .legal { padding: 0; }
}
@media (max-width: 380px) { .final { grid-template-columns: 1fr; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; } }
