/* V4: styles approved in the standalone preview. */
.unverified-baseline .interest-row strong{color:#2a927b!important}
.unverified-baseline .interest-bar .bar-track span:not(.old-bar){background:#718ca8!important}
#term-warning{line-height:1.6}
body[data-look=colour] #current-data-check,
body[data-look=colour] #result-data-check{color:#18b492;background:#f5f8fa;border-color:#20d9b1}
.inputs-grid .ltv-hint{display:block;color:#4f7aa5!important;background:#f5f8fa;border-radius:7px;padding:9px 11px;line-height:1.5;font-weight:400;margin-top:8px}
.inputs-grid .ltv-hint[hidden]{display:none}
#property-value::placeholder{color:#73889e;opacity:1;font-size:.85rem}

/* Required fields and shared comparison styles retained from V5. */
.required-marker{color:#18b492}
.required-fields-note{font-size:.9rem;line-height:1.65;color:#324c67;background:#f6f8fa;border:1px solid #b0e8dc;border-radius:10px;padding:14px 16px}
.fixed-rate-scope strong{display:block}
body[data-look=colour] .inputs-grid [aria-invalid=true]{border:2px solid #18b492;background:#f8fafb}
.inputs-grid .field-error{display:block;color:#18b492!important;font-weight:600;font-size:.8rem;line-height:1.5}
.comparison-caption{font-size:.96rem;font-weight:700;line-height:1.6;margin:28px 0 14px;overflow-wrap:anywhere}
.comparison-sr-caption{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap}
#comparison-content,#comparison-scroll,#mobile-comparison,.flow-results,.flow-panel,.panel,.grid>*{min-width:0;max-width:100%}
#comparison-scroll{margin-top:0}
#flow-comparison{table-layout:fixed;width:100%;min-width:0}
#flow-comparison th:first-child{position:static;left:auto;width:25%;min-width:0}
#flow-comparison th,#flow-comparison td{overflow-wrap:anywhere;white-space:normal}
body[data-look=colour] #flow-comparison .interest-row td strong{white-space:normal}
/* V6: a native table keeps every variant beside the others at all phone widths.
   Shared labels span the row; only values consume the two or three columns. */
#mobile-comparison{display:none}
#mobile-comparison .mobile-comparison-table{table-layout:fixed;width:100%;min-width:0;max-width:100%;border-collapse:separate;border-spacing:0;border:1px solid #b0e8dc;border-radius:12px;background:#ffffff;margin:0;color:#1c3753}
#mobile-comparison th,#mobile-comparison td{position:static;min-width:0;padding:12px 7px;text-align:center;vertical-align:top;white-space:normal;overflow-wrap:anywhere;word-break:normal;line-height:1.5;border:0}
#mobile-comparison [data-variant]{--column-tone:#20c8a4;--column-soft:#f6f8fa}
#mobile-comparison [data-variant=old]{--column-tone:#2f4861;--column-soft:#eff2f5}
#mobile-comparison [data-variant=plus300]{--column-tone:#39c4a6;--column-soft:#f5f7f9}
#mobile-comparison [data-variant=plus500]{--column-tone:#0c7b63;--column-soft:#f1f4f7}
#mobile-comparison [data-variant=years30]{--column-tone:#0f9477;--column-soft:#f2f5f8}
#mobile-comparison thead th{background:var(--column-soft);border-top:4px solid var(--column-tone);color:var(--column-tone);font-size:.84rem;font-weight:800}
#mobile-comparison thead th:first-child{border-top-left-radius:10px}
#mobile-comparison thead th:last-child{border-top-right-radius:10px}
#mobile-comparison .mobile-variant-name{display:block}
#mobile-comparison thead small{display:block;font-size:.69rem;line-height:1.4;margin-bottom:6px;color:#416386;font-weight:500}
#mobile-comparison thead em{display:block;font-size:.7rem;margin-top:6px;font-style:normal;font-weight:500}
#mobile-comparison .mobile-metric-label th{text-align:left;background:#f1f4f7;border-top:1px solid #b0e8dc;border-bottom:1px solid #b0e8dc;color:#395775;padding:7px 10px;font-size:.76rem;font-weight:600}
#mobile-comparison .mobile-values td{font-size:clamp(.81rem,3.5vw,.94rem);font-variant-numeric:tabular-nums;color:#1c3753}
#mobile-comparison .mobile-values td+td,#mobile-comparison thead th+th{border-left:1px solid #b0e8dc}
#mobile-comparison .mobile-values small{display:block;font-size:.72rem;line-height:1.5;margin-top:5px;color:#416386;font-weight:400}
#mobile-comparison .payment-row td{background:var(--column-soft);color:var(--column-tone);font-size:clamp(1rem,4.5vw,1.4rem);font-weight:800;vertical-align:middle}
#mobile-comparison .interest-row strong{font-size:inherit;color:#116351;display:block;font-weight:800}
#mobile-comparison .interest-row .cost-up{color:#26a186}
.unverified-baseline #mobile-comparison .interest-row strong{color:#2a927b}
#mobile-comparison .mobile-notes td{font-size:.75rem;text-align:left;line-height:1.6;color:#416386;padding-bottom:15px}
#mobile-comparison tbody:last-child td:first-child{border-bottom-left-radius:10px}
#mobile-comparison tbody:last-child td:last-child{border-bottom-right-radius:10px}
@media screen and (max-width:800px){
  #comparison-scroll{display:none}
  #mobile-comparison{display:block}
  .section-heading{flex-wrap:wrap;gap:12px}
  .section-heading>a{white-space:normal}
  .rate-assumption-panel{grid-template-columns:minmax(0,1fr)}
  .rate-assumption-panel>*{min-width:0}
  .schedule-scroll,.table-scroll{max-width:100%}
  .interest-bar>div:first-child{flex-wrap:wrap;gap:4px 12px}
  .interest-bar>div:first-child>*{min-width:0;overflow-wrap:anywhere}
  .journey-progress li{min-width:0;overflow-wrap:anywhere}
}
@media screen and (max-width:380px){
  #mobile-comparison th,#mobile-comparison td{padding-left:5px;padding-right:5px}
  #mobile-comparison thead th{font-size:.79rem}
  .journey-progress li{padding:10px 7px;font-size:.7rem;gap:5px}
  .journey-progress span{flex-shrink:0}
}
@media print{
  #mobile-comparison{display:none!important}
  #comparison-scroll{display:block!important;overflow:visible}
  #flow-comparison thead{display:table-header-group}
  #flow-comparison tbody{display:table-row-group}
  #flow-comparison tr{display:table-row}
  #flow-comparison th,#flow-comparison td{display:table-cell}
  #flow-comparison thead th:first-child{display:table-cell}
}

/* V7: explicit model acceptance; never auto-replace an entered payment. */
.payment-helper{margin-top:24px;padding:18px;border:1px solid #b0e8dc;border-radius:12px;background:#f5f8fa;color:#1c3753}
.payment-helper h3{font-size:1rem;margin:0 0 10px}
.payment-helper p{font-size:.84rem;line-height:1.65;margin:10px 0}
.payment-helper .actions{margin-top:14px}
.payment-helper button{white-space:normal;overflow-wrap:anywhere;max-width:100%;font-size:.84rem}
#model-payment-accepted{border-left:3px solid #0c7b63;padding:10px 12px;background:#eaeff4;color:#145e4e}

/* V8: one scenario palette for desktop, phone, balances and interest bars. */
#comparison-content [data-variant]{--column-tone:#20c8a4;--column-soft:#f6f8fa}
#comparison-content [data-variant=old]{--column-tone:#2f4861;--column-soft:#eff2f5}
#comparison-content [data-variant=plus300]{--column-tone:#39c4a6;--column-soft:#f5f7f9}
#comparison-content [data-variant=plus500]{--column-tone:#0c7b63;--column-soft:#f1f4f7}
#comparison-content [data-variant=years30]{--column-tone:#0f9477;--column-soft:#f2f5f8}
body[data-look=colour] #flow-comparison thead th[data-variant]{background:var(--column-soft);border-color:var(--column-tone);border-top:4px solid var(--column-tone);color:var(--column-tone)}
body[data-look=colour] #flow-comparison tbody td[data-variant]{background:var(--column-soft)}
body[data-look=colour] #flow-comparison .payment-row td[data-variant]{color:var(--column-tone)}
body[data-look=colour] #interest-bars .interest-bar[data-variant] .bar-track span{background:var(--column-tone)}
.balance-panel{margin-top:24px}
.balance-panel[hidden]{display:none}
.balance-panel h3{margin:0 0 8px}
.balance-legend{display:flex;flex-wrap:wrap;gap:10px 24px;margin:16px 0;font-size:.82rem}
.balance-legend>span{display:flex;align-items:center;gap:8px;color:var(--column-tone)}
.balance-swatch{display:inline-block;width:24px;border-top:3px solid var(--column-tone);flex-shrink:0}
[data-variant=old]>.balance-swatch{border-top-style:dashed}
#balance-svg{display:block;width:100%;height:310px;overflow:visible;font-family:inherit}
.balance-grid{stroke:#b0e8dc;stroke-width:1}
.balance-axis-label{fill:#45698e;font-size:11px}
.balance-curve{stroke:var(--column-tone);stroke-width:3;stroke-linejoin:round;stroke-linecap:round}
.balance-curve[data-variant=old]{stroke-dasharray:6 6;stroke-width:2.5}
.balance-dot{fill:var(--column-tone);stroke:white;stroke-width:2}
.balance-marker-line{stroke:#45698e;stroke-width:1;stroke-dasharray:4 4}
.balance-slider-label{display:flex;justify-content:space-between;gap:12px;margin:16px 0 0;align-items:center;font-size:.85rem}
.balance-slider-label label{margin:0}
.balance-slider-label output{font-weight:700;white-space:nowrap}
/* V8.1: align the center of the range thumb with the SVG marker at every value. */
.balance-panel{--balance-plot-left:54px;--balance-plot-right:16px;--balance-thumb-size:20px}
#balance-month{display:block;box-sizing:border-box;appearance:none;-webkit-appearance:none;direction:ltr;width:calc(100% - var(--balance-plot-left) - var(--balance-plot-right) + var(--balance-thumb-size));padding:0;border:0;border-radius:0;height:44px;min-height:44px;margin:0 0 14px calc(var(--balance-plot-left) - var(--balance-thumb-size)/2);cursor:pointer;box-shadow:none;background:transparent}
#balance-month::-webkit-slider-runnable-track{height:6px;border:0;border-radius:3px;background:#d3dce5;box-shadow:none}
#balance-month::-webkit-slider-thumb{appearance:none;-webkit-appearance:none;box-sizing:border-box;width:var(--balance-thumb-size);height:var(--balance-thumb-size);margin-top:-7px;border:2px solid #ffffff;border-radius:50%;background:#2f4861;box-shadow:0 0 0 1px #2f4861}
#balance-month::-moz-range-track{height:6px;border:0;border-radius:3px;background:#d3dce5;box-shadow:none}
#balance-month::-moz-range-thumb{box-sizing:border-box;width:var(--balance-thumb-size);height:var(--balance-thumb-size);border:2px solid #ffffff;border-radius:50%;background:#2f4861;box-shadow:0 0 0 1px #2f4861}
#balance-month::-moz-range-progress{height:6px;background:#d3dce5}

#balance-month:focus-visible{outline:2px solid #20c8a4;outline-offset:3px}
.balance-values{display:grid;grid-template-columns:repeat(var(--balance-columns,3),minmax(0,1fr));gap:10px}
.balance-value{border-top:3px solid var(--column-tone);background:var(--column-soft);border-radius:7px;padding:12px;min-width:0;overflow-wrap:anywhere}
.balance-name{display:block;color:var(--column-tone);font-size:.8rem;font-weight:700;line-height:1.5}
.balance-value strong{display:block;margin:8px 0;color:var(--column-tone);font-size:clamp(.95rem,2.6vw,1.45rem);font-variant-numeric:tabular-nums}
.balance-value small{display:block;color:#395775;font-size:.75rem;line-height:1.5}
.balance-explanation{font-size:.76rem;color:#45698e;line-height:1.65;margin:16px 0 0}
@media screen and (max-width:500px){
 .balance-panel{padding:14px 10px}
 .balance-legend{gap:8px 14px;font-size:.75rem}
 .balance-values{gap:5px}
 .balance-value{padding:10px 6px}
 .balance-name{font-size:.73rem}
 .balance-value small{font-size:.7rem}
}

/* Keep long Polish words and guide amounts inside narrow screens with enlarged text. */
@media screen and (max-width:800px){
  .journey-page main{overflow-wrap:anywhere}
  .journey-page .guide-numbers strong{white-space:normal}
}
