:root {
  --bg: #f5f5f7;
  --surface: #ffffff;
  --text: #1d1d1f;
  --muted: #6e6e73;
  --border: #d2d2d7;
  --soft-border: #ececf0;
  --accent: #0071e3;
  --finance: #12805c;
  --danger: #b42318;
  --shadow: 0 22px 70px rgba(0, 0, 0, 0.08);
  --radius-lg: 28px;
  --radius-md: 16px;
  --radius-sm: 12px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", sans-serif;
  letter-spacing: 0;
}

a {
  color: inherit;
  text-decoration: none;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(245, 245, 247, 0.82);
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
  backdrop-filter: saturate(180%) blur(18px);
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 1180px;
  min-height: 48px;
  margin: 0 auto;
  padding: 0 22px;
  font-size: 13px;
}

.brand {
  font-weight: 650;
}

.nav-links {
  display: flex;
  gap: 28px;
  color: var(--muted);
}

.nav-links a:hover {
  color: var(--text);
}

.hero {
  max-width: 980px;
  margin: 0 auto;
  padding: 72px 22px 34px;
  text-align: center;
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--finance);
  font-size: 17px;
  font-weight: 650;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  max-width: 840px;
  margin: 0 auto;
  font-size: 76px;
  line-height: 0.98;
  font-weight: 760;
}

.hero-copy {
  max-width: 640px;
  margin: 22px auto 0;
  color: var(--muted);
  font-size: 26px;
  line-height: 1.22;
}

.trust-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-top: 24px;
}

.trust-row span {
  min-height: 34px;
  padding: 8px 14px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--muted);
  font-size: 13px;
  font-weight: 650;
}

.calculator-shell,
.content-band {
  max-width: 1180px;
  margin: 0 auto;
  padding: 22px;
}

.calculator-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(340px, 0.78fr);
  gap: 18px;
  align-items: stretch;
}

.input-panel,
.result-panel,
.formula-card,
.table-wrap,
.faq-list,
.related-tools a {
  background: var(--surface);
  border: 1px solid var(--soft-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}

.input-panel {
  display: grid;
  gap: 16px;
  padding: 40px;
}

.panel-heading h2,
.section-heading h2,
.split h2 {
  margin: 0;
  font-size: 48px;
  line-height: 1.04;
  font-weight: 740;
}

.panel-heading p {
  margin: 10px 0 6px;
  color: var(--muted);
  font-size: 17px;
}

.field {
  position: relative;
  display: grid;
  gap: 8px;
}

.field span:first-child {
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
}

.field input {
  width: 100%;
  min-height: 56px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: #fbfbfd;
  color: var(--text);
  font: inherit;
  font-size: 21px;
  font-weight: 620;
  outline: none;
  padding: 12px 18px;
  transition: border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.field:has(.control-prefix) input {
  padding-left: 48px;
  padding-right: 14px;
}

.field:has(.control-suffix) input {
  padding-left: 18px;
  padding-right: 74px;
}

.term-field input {
  padding-right: 86px;
}

.field:has(.stepper-suffix) input {
  appearance: textfield;
  padding-left: 18px;
  padding-right: 86px;
}

.field:has(.stepper-suffix) input::-webkit-outer-spin-button,
.field:has(.stepper-suffix) input::-webkit-inner-spin-button {
  margin: 0;
  appearance: none;
}

.field input:focus {
  border-color: var(--accent);
  background: #fff;
  box-shadow: 0 0 0 4px rgba(0, 113, 227, 0.14);
}

.control-prefix,
.control-suffix {
  position: absolute;
  bottom: 15px;
  color: var(--muted);
  font-size: 21px;
  font-weight: 620;
  pointer-events: none;
}

.control-prefix {
  left: 18px;
}

.control-suffix {
  right: 18px;
}

.term-field .control-suffix {
  right: 16px;
}

.stepper-suffix {
  position: absolute;
  right: 14px;
  bottom: 10px;
  z-index: 1;
  display: grid;
  grid-template-columns: 16px auto;
  align-items: center;
  gap: 10px;
  min-height: 36px;
  color: var(--muted);
  pointer-events: auto;
}

.stepper-buttons {
  display: grid;
  gap: 2px;
}

.stepper-buttons button {
  display: grid;
  place-items: center;
  width: 16px;
  height: 14px;
  padding: 0;
  border: 0;
  background: transparent;
  color: #8e8e93;
  cursor: pointer;
  font-size: 10px;
  line-height: 1;
}

.stepper-buttons button:hover {
  color: var(--accent);
}

.suffix-text {
  color: var(--muted);
  font-size: 21px;
  font-weight: 620;
}

.field-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.result-panel {
  display: flex;
  flex-direction: column;
  min-height: 100%;
  padding: 42px;
}

.result-topline {
  color: var(--muted);
  font-size: 15px;
  font-weight: 650;
}

.monthly {
  display: block;
  margin-top: 10px;
  font-size: 78px;
  line-height: 0.96;
  font-weight: 780;
  letter-spacing: 0;
}

.result-note {
  margin: 14px 0 28px;
  color: var(--muted);
  font-size: 16px;
}

.metric-list {
  display: grid;
  gap: 0;
  margin: 0;
  border-top: 1px solid var(--soft-border);
}

.metric-list div {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  padding: 17px 0;
  border-bottom: 1px solid var(--soft-border);
}

.metric-list dt {
  color: var(--muted);
  font-size: 15px;
}

.metric-list dd {
  margin: 0;
  font-size: 17px;
  font-weight: 680;
  text-align: right;
}

.primary-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  margin-top: auto;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-weight: 650;
}

.primary-cta:hover {
  background: #0077ed;
}

.fine-print {
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.38;
}

.content-band {
  padding-top: 64px;
}

.section-heading {
  margin-bottom: 24px;
}

.section-copy {
  max-width: 660px;
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.45;
}

.secondary-button {
  min-height: 44px;
  margin: 0 0 16px;
  padding: 0 18px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: #fff;
  color: var(--text);
  cursor: pointer;
  font: inherit;
  font-size: 15px;
  font-weight: 650;
}

.secondary-button:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.scroll-hint {
  display: none;
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 650;
}

.table-wrap {
  overflow-x: auto;
  padding: 6px;
}

.summary-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin: 0 0 16px;
}

.summary-strip div,
.source-panel article {
  border: 1px solid var(--soft-border);
  border-radius: var(--radius-md);
  background: var(--surface);
}

.summary-strip div {
  display: grid;
  gap: 8px;
  min-height: 104px;
  padding: 20px;
}

.summary-strip span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 650;
}

.summary-strip strong {
  font-size: 24px;
  line-height: 1.1;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 680px;
}

th,
td {
  padding: 18px 20px;
  border-bottom: 1px solid var(--soft-border);
  text-align: right;
  font-size: 15px;
}

th:first-child,
td:first-child {
  text-align: left;
}

th {
  color: var(--muted);
  font-size: 13px;
  font-weight: 650;
}

tbody tr:last-child td {
  border-bottom: 0;
}

.split {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(0, 1fr);
  gap: 22px;
  align-items: start;
}

.formula-card {
  padding: 38px;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.55;
}

.source-list {
  display: grid;
  gap: 10px;
  margin: 22px 0 0;
  padding: 0;
  list-style: none;
}

.source-list a {
  color: var(--accent);
  font-weight: 650;
}

.source-list a:hover {
  text-decoration: underline;
}

.method-list {
  display: grid;
  gap: 14px;
}

.method-list article,
.source-panel article {
  padding: 24px;
  border: 1px solid var(--soft-border);
  border-radius: var(--radius-md);
  background: var(--surface);
}

.method-list h3,
.source-panel h3 {
  margin: 0 0 8px;
  font-size: 20px;
}

.method-list p,
.source-panel p {
  margin: 0;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.5;
}

.source-panel {
  display: grid;
  gap: 14px;
}

.source-panel p + p {
  margin-top: 12px;
}

.formula {
  color: var(--text);
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 24px;
  line-height: 1.35;
}

.faq-list {
  padding: 0 28px;
}

details {
  border-bottom: 1px solid var(--soft-border);
}

details:last-child {
  border-bottom: 0;
}

summary {
  min-height: 68px;
  cursor: pointer;
  list-style: none;
  padding: 22px 0;
  font-size: 20px;
  font-weight: 680;
}

summary::-webkit-details-marker {
  display: none;
}

details p {
  margin: 0;
  padding: 0 0 24px;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.48;
}

.related-tools {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  padding-bottom: 70px;
}

.related-tools a {
  display: grid;
  gap: 8px;
  padding: 28px;
}

.related-tools span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 650;
}

.related-tools strong {
  font-size: 24px;
}

.footer {
  max-width: 1180px;
  margin: 0 auto;
  padding: 30px 22px 46px;
  color: var(--muted);
  border-top: 1px solid var(--border);
  font-size: 13px;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  margin-top: 14px;
}

.footer a {
  color: var(--text);
}

@media (max-width: 860px) {
  .nav {
    align-items: flex-start;
    flex-direction: column;
    gap: 10px;
    padding-block: 12px;
  }

  .nav-links {
    width: 100%;
    gap: 16px;
    overflow-x: auto;
    padding-bottom: 2px;
  }

  .hero {
    padding-top: 48px;
    text-align: left;
  }

  h1 {
    font-size: 50px;
  }

  .hero-copy {
    font-size: 22px;
  }

  .panel-heading h2,
  .section-heading h2,
  .split h2 {
    font-size: 36px;
  }

  .monthly {
    font-size: 62px;
  }

  h1,
  .hero-copy {
    margin-left: 0;
  }

  .trust-row {
    justify-content: flex-start;
  }

  .calculator-grid,
  .split,
  .related-tools,
  .summary-strip {
    grid-template-columns: 1fr;
  }

  .result-panel {
    min-height: 0;
  }
}

@media (max-width: 520px) {
  .calculator-shell,
  .content-band {
    padding-inline: 14px;
  }

  .field-row {
    grid-template-columns: 1fr;
  }

  .input-panel,
  .result-panel,
  .formula-card,
  .faq-list {
    border-radius: 22px;
  }

  .input-panel,
  .result-panel,
  .formula-card {
    padding: 24px;
  }

  .field input {
    min-height: 54px;
    font-size: 19px;
  }

  .scroll-hint {
    display: block;
  }

  h1 {
    font-size: 42px;
  }

  .hero-copy {
    font-size: 20px;
  }

  .panel-heading h2,
  .section-heading h2,
  .split h2 {
    font-size: 32px;
  }

  .monthly {
    font-size: 54px;
  }

  .formula {
    font-size: 18px;
  }

  th,
  td {
    padding-inline: 14px;
  }
}
