:root {
  --ink: #182335;
  --muted: #7b8798;
  --line: #e8edf3;
  --paper: #f5f7fb;
  --white: #ffffff;
  --navy: #111d31;
  --blue: #4c6fff;
  --blue-soft: #edf1ff;
  --mint: #b9f0dc;
  --green: #168d6b;
  --shadow: 0 18px 55px rgba(29, 46, 76, .07);
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--paper); color: var(--ink); font-family: "DM Sans", sans-serif; -webkit-font-smoothing: antialiased; }
button, input { font: inherit; }
button, a, input { -webkit-tap-highlight-color: transparent; }
.app-shell { max-width: 1240px; margin: 0 auto; padding: 0 38px; }
.topbar { height: 88px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid #e9edf3; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--navy); font-family: "Manrope", sans-serif; font-size: 21px; font-weight: 800; letter-spacing: -1px; text-decoration: none; }
.brand-mark { width: 34px; height: 34px; border-radius: 11px; background: var(--navy); color: #fff; display: grid; place-items: center; }
.brand-mark svg { width: 20px; height: 20px; }
.brand-dot { color: var(--blue); }
.topbar-note { display: flex; align-items: center; gap: 9px; color: #7b8798; font-size: 12px; font-weight: 600; }
.live-dot, .result-status span { width: 7px; height: 7px; border-radius: 50%; background: #27bd8b; box-shadow: 0 0 0 4px #e1f8ef; }
.hero { display: flex; align-items: end; justify-content: space-between; padding: 48px 0 34px; gap: 28px; }
.eyebrow, .section-kicker { display: flex; align-items: center; gap: 9px; color: var(--blue); font-size: 10px; font-weight: 800; letter-spacing: 1.55px; }
.eyebrow-line { width: 20px; height: 2px; background: var(--blue); border-radius: 2px; }
h1, h2, h3, p { margin-top: 0; }
h1 { margin: 15px 0 13px; font-family: "Manrope", sans-serif; font-size: clamp(35px, 4.3vw, 54px); line-height: 1.13; letter-spacing: -2.7px; font-weight: 800; }
h1 span { color: var(--blue); }
.hero-copy > p { max-width: 570px; margin-bottom: 0; color: #6d798a; font-size: 14px; line-height: 1.8; }
.hero-badge { display: flex; align-items: center; gap: 12px; margin-bottom: 5px; padding: 14px 17px; border: 1px solid #e7ebf2; border-radius: 14px; background: rgba(255,255,255,.7); white-space: nowrap; }
.badge-icon { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 11px; background: #e8fbf4; color: #139b71; font-size: 21px; }
.hero-badge strong, .hero-badge small { display: block; }
.hero-badge strong { font-size: 11px; margin-bottom: 4px; }
.hero-badge small { color: var(--muted); font-size: 10px; }
.calculator-grid { display: grid; grid-template-columns: minmax(0, .92fr) minmax(0, 1.08fr); gap: 22px; align-items: stretch; }
.panel { background: var(--white); border: 1px solid #e9edf3; border-radius: 20px; box-shadow: var(--shadow); }
.input-panel { padding: 28px 30px 23px; }
.panel-heading { display: flex; justify-content: space-between; align-items: center; margin-bottom: 26px; }
.panel-heading h2, .section-title-row h2 { margin: 8px 0 0; font-family: "Manrope", sans-serif; font-size: 23px; letter-spacing: -.8px; }
.heading-icon { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 13px; background: var(--blue-soft); color: var(--blue); font-size: 26px; }
.field-group { margin-bottom: 23px; }
.label-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.label-row label { font-size: 12px; font-weight: 700; }
.field-hint { color: #98a2b1; font-size: 10px; }
.money-input, .input-suffix { display: flex; align-items: center; height: 48px; border: 1px solid #e2e8f0; border-radius: 11px; background: #fbfcfe; transition: border-color .2s, box-shadow .2s; }
.money-input:focus-within, .input-suffix:focus-within { border-color: #8da0ff; box-shadow: 0 0 0 3px #eef1ff; }
.money-input input, .input-suffix input { width: 100%; min-width: 0; height: 100%; border: 0; outline: 0; background: transparent; padding: 0 14px; color: var(--ink); font-size: 17px; font-weight: 700; font-variant-numeric: tabular-nums; }
.money-input .currency { padding-right: 14px; color: #8490a1; font-size: 14px; font-weight: 700; }
.input-suffix input { padding-right: 5px; }
.input-suffix > span { padding: 0 14px; color: #8490a1; font-size: 14px; font-weight: 700; }
.range { display: block; width: 100%; height: 5px; margin: 17px 0 8px; appearance: none; border-radius: 10px; background: linear-gradient(to right, var(--blue) 0%, var(--blue) var(--range-progress, 30%), #e8edf4 var(--range-progress, 30%), #e8edf4 100%); cursor: pointer; }
.range::-webkit-slider-thumb { appearance: none; width: 15px; height: 15px; border: 3px solid white; border-radius: 50%; background: var(--blue); box-shadow: 0 0 0 1px var(--blue), 0 2px 5px #aab5d2; }
.range::-moz-range-thumb { width: 10px; height: 10px; border: 3px solid white; border-radius: 50%; background: var(--blue); box-shadow: 0 0 0 1px var(--blue), 0 2px 5px #aab5d2; }
.range-labels { display: flex; justify-content: space-between; color: #a0a9b7; font-size: 9px; }
.term-group { margin-bottom: 18px; }
.term-control { display: flex; align-items: center; justify-content: space-between; height: 48px; border: 1px solid #e2e8f0; border-radius: 11px; background: #fbfcfe; padding: 4px; }
.stepper { width: 38px; height: 38px; border: 0; border-radius: 8px; background: #edf1ff; color: var(--blue); font-size: 22px; cursor: pointer; transition: background .2s, transform .15s; }
.stepper:hover { background: #dfe6ff; }
.stepper:active { transform: scale(.95); }
.term-value { display: flex; align-items: baseline; gap: 7px; }
.term-value input { width: 46px; border: 0; outline: 0; background: transparent; text-align: right; color: var(--ink); font-size: 17px; font-weight: 700; }
.term-value span { color: #8792a3; font-size: 12px; }
.assumption-note { display: flex; gap: 10px; align-items: flex-start; padding: 12px 13px; border-radius: 10px; background: #f6f8fc; }
.note-icon { flex: 0 0 17px; display: grid; place-items: center; width: 17px; height: 17px; border-radius: 50%; background: #e5eaff; color: var(--blue); font-size: 11px; font-weight: 800; }
.assumption-note p { margin: 0; color: #7d899a; font-size: 10px; line-height: 1.6; }
.results-panel { padding: 29px 31px 25px; background: var(--navy); color: white; border-color: var(--navy); position: relative; overflow: hidden; }
.results-panel::before { content: ""; position: absolute; width: 260px; height: 260px; border-radius: 50%; right: -130px; top: -155px; border: 1px solid rgba(255,255,255,.07); box-shadow: 0 0 0 28px rgba(255,255,255,.018), 0 0 0 58px rgba(255,255,255,.018); pointer-events: none; }
.result-topline { display: flex; align-items: center; justify-content: space-between; position: relative; }
.results-panel .section-kicker { color: #aab9ff; }
.result-status { display: flex; align-items: center; gap: 7px; color: #b5c4d8; font-size: 10px; }
.result-status span { width: 6px; height: 6px; box-shadow: none; }
.monthly-label { margin-top: 34px; color: #b6c2d4; font-size: 12px; }
.monthly-amount { margin-top: 7px; color: #fff; font-family: "Manrope", sans-serif; font-size: clamp(36px, 4.4vw, 50px); font-weight: 800; letter-spacing: -2px; line-height: 1.15; font-variant-numeric: tabular-nums; white-space: nowrap; }
.amount-decimal { font-size: .58em; letter-spacing: -1px; }
.monthly-caption { margin-top: 8px; color: #93a2b9; font-size: 11px; }
.result-divider { height: 1px; background: rgba(255,255,255,.12); margin: 25px 0 22px; }
.metrics { display: grid; grid-template-columns: 1fr 1fr; column-gap: 18px; row-gap: 23px; }
.metric { display: flex; align-items: flex-start; gap: 11px; min-width: 0; }
.metric-icon { display: grid; place-items: center; flex: 0 0 34px; width: 34px; height: 34px; border-radius: 10px; font-size: 17px; font-weight: 700; }
.down-icon { background: rgba(101,218,183,.12); color: #71dfbb; }
.loan-icon { background: rgba(123,148,255,.15); color: #a8b7ff; }
.interest-icon { background: rgba(255,194,111,.12); color: #ffca7c; }
.total-icon { background: rgba(255,255,255,.09); color: #d4dce8; }
.metric > div { min-width: 0; }
.metric-label, .metric strong, .metric small { display: block; }
.metric-label { margin: 2px 0 6px; color: #9baac0; font-size: 10px; }
.metric strong { color: #fff; font-size: clamp(14px, 1.4vw, 17px); font-weight: 700; letter-spacing: -.4px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.metric small { margin-top: 5px; color: #8392a9; font-size: 9px; }
.cost-card { margin-top: 25px; padding: 15px 15px 13px; border: 1px solid rgba(255,255,255,.12); border-radius: 13px; background: rgba(255,255,255,.045); }
.cost-card-top { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 13px; color: #a6b4c8; font-size: 10px; }
.cost-card-top strong { color: #fff; font-size: 12px; }
.stacked-bar, .breakdown-bar { display: flex; overflow: hidden; width: 100%; height: 8px; border-radius: 8px; background: rgba(255,255,255,.12); }
.bar-equity { width: 20%; background: var(--mint); transition: width .2s; }
.bar-loan { width: 80%; background: #6f87ff; transition: width .2s; }
.bar-legend { display: flex; justify-content: space-between; gap: 12px; margin-top: 11px; color: #a7b5c9; font-size: 9px; }
.bar-legend span { display: flex; align-items: center; gap: 5px; }
.bar-legend strong { margin-left: 2px; color: white; font-size: 10px; }
.legend-dot { display: inline-block; flex: 0 0 7px; width: 7px; height: 7px; border-radius: 50%; }
.equity-dot { background: var(--mint); }.loan-dot { background: #6f87ff; }.principal-dot { background: var(--blue); }.interest-dot { background: #ffb96b; }
.secondary-button { display: flex; justify-content: center; align-items: center; gap: 9px; width: 100%; height: 43px; margin-top: 14px; border: 1px solid rgba(255,255,255,.19); border-radius: 10px; background: transparent; color: #e2e8f3; font-size: 11px; font-weight: 700; cursor: pointer; transition: background .2s, border-color .2s; }
.secondary-button:hover { background: rgba(255,255,255,.08); border-color: rgba(255,255,255,.35); }
.secondary-button svg { width: 16px; height: 16px; }
.details-section { margin-top: 46px; }
.section-title-row { display: flex; justify-content: space-between; align-items: end; gap: 20px; margin-bottom: 19px; }
.section-title-row h2 { font-size: 25px; }
.section-aside { color: #8a96a7; font-size: 11px; padding-bottom: 4px; }
.details-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; }
.breakdown-panel, .timeline-panel { padding: 24px 26px; box-shadow: none; }
.details-grid h3 { margin-bottom: 6px; font-family: "Manrope", sans-serif; font-size: 15px; letter-spacing: -.3px; }
.card-subtitle { margin-bottom: 19px; color: #8b96a6; font-size: 11px; }
.breakdown-total { margin-bottom: 13px; font-family: "Manrope", sans-serif; font-size: 28px; font-weight: 800; letter-spacing: -1px; font-variant-numeric: tabular-nums; }
.breakdown-bar { height: 9px; background: #eef1f6; }
.principal-segment { width: 68%; background: var(--blue); transition: width .2s; }
.interest-segment { width: 32%; background: #ffbd72; transition: width .2s; }
.breakdown-rows { display: grid; gap: 13px; margin-top: 19px; }
.breakdown-rows > div { display: flex; justify-content: space-between; align-items: center; gap: 12px; font-size: 11px; }
.breakdown-rows > div > span { display: flex; align-items: center; gap: 8px; color: #7d899a; }
.breakdown-rows strong { font-size: 12px; font-variant-numeric: tabular-nums; }
.timeline-panel { padding-left: 28px; }
.timeline-item { display: flex; align-items: flex-start; gap: 13px; }
.timeline-dot { flex: 0 0 12px; width: 12px; height: 12px; margin-top: 4px; border: 3px solid #dbe2ff; border-radius: 50%; background: var(--blue); box-shadow: 0 0 0 3px #f0f3ff; }
.timeline-dot.last { border-color: #d1f5e9; background: #28ae85; box-shadow: 0 0 0 3px #eafaf4; }
.timeline-line { width: 1px; height: 20px; margin: 3px 0 3px 5px; background: #e2e8f0; }
.timeline-label, .timeline-item strong, .timeline-item small { display: block; }
.timeline-label { color: #7e8a9a; font-size: 10px; margin-bottom: 6px; }
.timeline-item strong { font-family: "Manrope", sans-serif; font-size: 20px; letter-spacing: -.5px; font-variant-numeric: tabular-nums; }
.timeline-item small { margin-top: 5px; color: #9aa4b2; font-size: 10px; }
.disclaimer { display: flex; align-items: flex-start; gap: 13px; margin-top: 25px; padding: 18px 20px; border: 1px solid #e4e9f2; border-radius: 14px; background: #eef2f8; }
.disclaimer-icon { display: grid; place-items: center; flex: 0 0 23px; width: 23px; height: 23px; border-radius: 50%; background: #dce4f3; color: #687b9a; font-size: 12px; font-weight: 800; }
.disclaimer strong { display: block; margin: 1px 0 5px; font-size: 11px; }
.disclaimer p { margin: 0; color: #778497; font-size: 10px; line-height: 1.7; }
.footer { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 31px 0 27px; margin-top: 17px; color: #9aa4b3; font-size: 10px; }
.footer-brand { gap: 7px; font-size: 15px; }
.footer-brand .brand-mark { width: 25px; height: 25px; border-radius: 8px; font-size: 17px; }
.footer-year { color: #9aa4b3; }
:focus-visible { outline: 3px solid #8ca0ff; outline-offset: 3px; }
@media (max-width: 900px) {
  .app-shell { padding: 0 24px; }
  .hero { align-items: flex-start; flex-direction: column; padding-top: 38px; }
  .hero-badge { margin-top: 2px; }
  .calculator-grid { grid-template-columns: 1fr; }
  .results-panel { order: -1; }
  .monthly-amount { font-size: 48px; }
  .metric strong { font-size: 17px; }
}
@media (max-width: 600px) {
  .app-shell { padding: 0 15px; }
  .topbar { height: 70px; }
  .brand { font-size: 19px; }
  .topbar-note { font-size: 10px; }
  .hero { padding: 33px 0 24px; gap: 20px; }
  h1 { font-size: 39px; letter-spacing: -2px; }
  .hero-copy > p { font-size: 13px; }
  .hero-badge { width: 100%; white-space: normal; }
  .input-panel, .results-panel { padding: 23px 19px; border-radius: 16px; }
  .panel-heading { margin-bottom: 24px; }
  .panel-heading h2 { font-size: 21px; }
  .field-group { margin-bottom: 22px; }
  .field-hint { font-size: 9px; }
  .monthly-amount { font-size: clamp(36px, 10vw, 47px); }
  .metrics { column-gap: 9px; row-gap: 22px; }
  .metric { gap: 8px; }
  .metric-icon { flex-basis: 29px; width: 29px; height: 29px; font-size: 15px; }
  .metric-label { font-size: 9px; }
  .metric strong { font-size: clamp(12px, 3.8vw, 16px); }
  .metric small { font-size: 8px; line-height: 1.4; }
  .bar-legend { font-size: 8px; }
  .bar-legend strong { font-size: 9px; }
  .details-section { margin-top: 36px; }
  .section-title-row { align-items: flex-start; flex-direction: column; gap: 8px; }
  .section-title-row h2 { font-size: 22px; }
  .section-aside { font-size: 10px; }
  .details-grid { grid-template-columns: 1fr; gap: 14px; }
  .breakdown-panel, .timeline-panel { padding: 21px 19px; }
  .disclaimer { padding: 15px; }
  .footer { flex-wrap: wrap; padding-top: 25px; }
  .footer > span:nth-child(2) { order: 3; flex-basis: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; }
}
