  :root {
    --navy: #0D3F2B;
    --navy-soft: #4A7A62;
    --navy-tint: #E0F2E8;
    --green: #0E8C4A;
    --green-hover: #0A7039;
    --green-tint: #E0F5E8;
    --sun: #0A7039;
    --sun-light: #34D67B;
    --warm-bg: #F0F9F4;
    --line: #C8DDD0;
    --bg: #FFFFFF;
    --bg-alt: #F5FAF7;
    --danger: #B3261E;
    --maxw: 880px;
  }
  * { box-sizing: border-box; }
  html { scroll-behavior: smooth; }
  body {
    margin: 0; font-family: "Inter", system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
    color: var(--navy); background: var(--bg); line-height: 1.5; -webkit-font-smoothing: antialiased;
    font-variant-numeric: tabular-nums;
  }
  h1, h2, h3 { font-family: "Archivo", "Inter", sans-serif; font-weight: 800; letter-spacing: -0.01em; margin: 0; color: var(--navy); }
  p { margin: 0; }
  button { font-family: inherit; }
  a { color: inherit; }

  .wrap { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 20px; }
  section { padding: 40px 0; }
  .hairline { border-top: 1px solid var(--line); }

  /* ---------- Header ---------- */
  header.top {
    border-bottom: 1px solid var(--line); padding: 14px 0;
  }
  header.top .wrap { display: flex; align-items: center; justify-content: space-between; }
  .brand { font-weight: 800; font-size: 15px; color: var(--navy); display: flex; align-items: center; gap: 7px; }
  .brand .sun-icon { flex: none; }
  .brand-tag { font-size: 12.5px; color: var(--navy-soft); font-weight: 600; }

  /* ---------- Hero ---------- */
  .hero { padding: 36px 0 8px; background: var(--warm-bg); border-bottom: 1px solid var(--line); }
  .hero h1 { font-size: clamp(26px, 4.4vw, 36px); line-height: 1.15; }
  .hero .sub { margin-top: 10px; font-size: 16px; color: var(--navy-soft); max-width: 60ch; }
  .hero .summer-note { margin-top: 10px; font-size: 13.5px; color: var(--green); font-weight: 700; }
  .hero .calc-card { background: var(--bg); }

  @keyframes cardUp {
    from { opacity: 0; transform: translateY(24px); }
    to   { opacity: 1; transform: translateY(0); }
  }
  @keyframes thumbGlow {
    0%,100% { box-shadow: 0 0 0 1.5px var(--green); }
    50%     { box-shadow: 0 0 0 6px rgba(14,140,74,.25); }
  }
  @keyframes tabNudge {
    0%,100% { border-color: var(--line); }
    50%     { border-color: var(--green); }
  }
  @keyframes ctaPulse {
    0%,100% { box-shadow: 0 2px 8px rgba(14,140,74,.25); }
    50%     { box-shadow: 0 2px 16px rgba(14,140,74,.45); }
  }

  /* ---------- Calculator card ---------- */
  .calc-card {
    margin-top: 28px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg);
    padding: 24px; display: grid; gap: 22px;
    animation: cardUp .5s cubic-bezier(.22,1,.36,1) both;
  }
  .field-row { display: grid; gap: 14px; }
  @media (min-width: 640px) { .field-row { grid-template-columns: 1fr 1fr; } }
  .field label { display: block; font-size: 12.5px; font-weight: 700; color: var(--navy-soft); text-transform: uppercase; letter-spacing: .03em; margin-bottom: 6px; }
  .amount-input-wrap { display: flex; align-items: center; border: 1.5px solid var(--line); border-radius: 8px; overflow: hidden; }
  .amount-input-wrap .prefix { padding: 0 12px; color: var(--navy-soft); font-weight: 700; background: var(--bg-alt); align-self: stretch; display: flex; align-items: center; border-right: 1px solid var(--line); }
  .amount-input-wrap input { border: none; outline: none; padding: 12px 12px; font-size: 18px; font-weight: 700; color: var(--navy); width: 100%; font-family: inherit; }
  .amount-input-wrap:focus-within { border-color: var(--green); }

  .slider-wrap { padding-top: 4px; }
  input[type="range"] {
    width: 100%; -webkit-appearance: none; appearance: none; height: 6px; border-radius: 999px;
    background: var(--line); outline: none; margin: 10px 0 6px;
  }
  input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none; appearance: none; width: 22px; height: 22px; border-radius: 50%;
    background: var(--green); border: 3px solid #fff; box-shadow: 0 0 0 1.5px var(--green); cursor: pointer;
  }
  .hint-slider input[type="range"]::-webkit-slider-thumb {
    animation: thumbGlow 1.6s ease-in-out infinite;
  }
  input[type="range"]::-moz-range-thumb {
    width: 22px; height: 22px; border-radius: 50%; background: var(--green); border: 3px solid #fff;
    box-shadow: 0 0 0 1.5px var(--green); cursor: pointer;
  }
  .hint-slider input[type="range"]::-moz-range-thumb {
    animation: thumbGlow 1.6s ease-in-out infinite;
  }
  .slider-scale { display: flex; justify-content: space-between; font-size: 11.5px; color: var(--navy-soft); font-weight: 600; }

  .term-tabs { display: flex; gap: 8px; flex-wrap: wrap; }
  .term-tab {
    flex: 1; min-width: 76px; text-align: center; padding: 10px 8px; border: 1.5px solid var(--line); border-radius: 8px;
    background: var(--bg); color: var(--navy); font-weight: 700; font-size: 14px; cursor: pointer;
    transition: background .12s, border-color .12s, color .12s, transform .1s, box-shadow .12s;
  }
  .term-tab[aria-selected="true"] { background: var(--green); border-color: var(--green); color: #fff; box-shadow: 0 2px 6px rgba(14,140,74,.2); }
  .term-tab:hover:not([aria-selected="true"]) { border-color: var(--green); }
  .term-tab:active { transform: scale(.96); }
  .hint-tabs .term-tab:not([aria-selected="true"]) { animation: tabNudge 2s ease-in-out infinite; }
  .hint-tabs .term-tab:nth-child(2):not([aria-selected="true"]) { animation-delay: .25s; }
  .hint-tabs .term-tab:nth-child(3):not([aria-selected="true"]) { animation-delay: .5s; }
  .hint-tabs .term-tab:nth-child(4):not([aria-selected="true"]) { animation-delay: .75s; }

  @keyframes pulse { 0%,100% { transform: scale(1); } 50% { transform: scale(1.015); } }
  .result-panel { border: 1px solid var(--line); border-radius: 8px; background: var(--bg-alt); padding: 18px 20px; transition: box-shadow .3s; }
  .result-panel.flash { animation: pulse .35s ease; }
  .result-row { display: flex; justify-content: space-between; align-items: baseline; padding: 7px 0; border-bottom: 1px dashed var(--line); font-size: 14.5px; }
  .result-row:last-child { border-bottom: none; }
  .result-row .k { color: var(--navy-soft); font-weight: 600; }
  .result-row .v { font-weight: 800; color: var(--navy); font-size: 15.5px; }
  .result-row.headline { background: var(--green-tint); margin: -7px -12px 4px; padding: 12px 12px; border-radius: 6px; border-bottom: none; }
  .result-row.headline .v { color: var(--green); font-size: 26px; transition: transform .2s ease; }
  .result-row.headline .v.pop { transform: scale(1.08); }
  .result-row.headline .k { font-size: 15px; font-weight: 700; color: var(--navy); }
  .calc-note { margin-top: 12px; font-size: 12.5px; color: var(--navy-soft); }

  .cta-row { display: flex; flex-direction: column; gap: 8px; align-items: center; }
  .btn-primary {
    display: inline-flex; align-items: center; justify-content: center; width: 100%; max-width: 420px;
    background: var(--green); color: #fff; font-weight: 800; font-size: 17px; padding: 16px 20px;
    border-radius: 8px; border: none; cursor: pointer; text-decoration: none;
    box-shadow: 0 2px 8px rgba(14,140,74,.25);
    transition: background .15s, box-shadow .15s;
  }
  .btn-primary:hover { background: var(--green-hover); box-shadow: 0 4px 14px rgba(14,140,74,.35); }
  .hint-cta .btn-primary { animation: ctaPulse 2s ease-in-out infinite; }
  .micro { font-size: 13px; color: var(--navy-soft); text-align: center; font-weight: 500; }
  .micro::before { content: "\1F512\00a0"; font-size: 11px; }

  /* ---------- Sticky recap bar ---------- */
  .sticky-bar {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; background: #fff; border-top: 1px solid var(--line);
    box-shadow: 0 -4px 16px rgba(11,42,74,.08); padding: 10px 16px; display: none; align-items: center; justify-content: space-between; gap: 12px;
  }
  .sticky-bar.show { display: flex; }
  .sticky-bar .info { font-size: 13px; line-height: 1.3; }
  .sticky-bar .info b { display: block; font-size: 18px; color: var(--green); font-weight: 800; }
  .sticky-bar .btn-primary { width: auto; padding: 12px 18px; font-size: 14.5px; max-width: none; }

  /* ---------- Tables ---------- */
  table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
  th, td { text-align: right; padding: 9px 10px; border-bottom: 1px solid var(--line); }
  th:first-child, td:first-child { text-align: left; }
  thead th { font-size: 11.5px; text-transform: uppercase; letter-spacing: .03em; color: var(--navy-soft); font-weight: 700; border-bottom: 2px solid var(--line); }
  tbody tr:nth-child(even) { background: var(--bg-alt); }
  .col-interest { color: var(--navy-soft); }
  .col-principal { color: var(--navy); font-weight: 600; }
  .col-balance { font-weight: 700; }
  tr.ellipsis td { text-align: center; color: var(--navy-soft); font-style: italic; border-bottom: 1px solid var(--line); }
  tr.selected-term td { background: var(--green-tint); }

  .table-card { border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
  .table-card .table-scroll { overflow-x: auto; }
  .table-toggle {
    display: block; width: 100%; text-align: center; padding: 12px; background: var(--bg-alt); border: none;
    border-top: 1px solid var(--line); color: var(--navy); font-weight: 700; font-size: 13.5px; cursor: pointer;
  }
  .table-toggle:hover { background: var(--navy-tint); }
  .full-rows { display: none; }
  .full-rows.show { display: table-row-group; }

  h2.section-h { font-size: 21px; margin-bottom: 4px; }
  .section-sub { font-size: 14px; color: var(--navy-soft); margin-bottom: 18px; max-width: 62ch; }

  /* ---------- Next steps ---------- */
  .steps { display: grid; gap: 14px; }
  @media (min-width: 640px) { .steps { grid-template-columns: repeat(3, 1fr); } }
  .step { border: 1px solid var(--line); border-radius: 8px; padding: 16px; }
  .step .num { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; border-radius: 50%; background: var(--green); color: #fff; font-weight: 800; font-size: 13px; margin-bottom: 10px; }
  .step h3 { font-size: 14.5px; margin-bottom: 6px; }
  .step p { font-size: 13.5px; color: var(--navy-soft); }

  /* ---------- FAQ ---------- */
  .faq-item { border-bottom: 1px solid var(--line); }
  .faq-q {
    width: 100%; text-align: left; background: none; border: none; padding: 16px 2px; cursor: pointer;
    display: flex; align-items: center; justify-content: space-between; gap: 12px; font-weight: 700; font-size: 15px; color: var(--navy);
  }
  .faq-q .plus { flex: none; width: 18px; height: 18px; position: relative; }
  .faq-q .plus::before, .faq-q .plus::after { content: ""; position: absolute; background: var(--green); top: 50%; left: 50%; transform: translate(-50%,-50%); }
  .faq-q .plus::before { width: 14px; height: 2px; }
  .faq-q .plus::after { width: 2px; height: 14px; transition: transform .15s; }
  .faq-item.open .plus::after { transform: translate(-50%,-50%) rotate(90deg) scaleY(0); }
  .faq-a { max-height: 0; overflow: hidden; transition: max-height .2s ease; }
  .faq-a p { padding: 0 2px 16px; font-size: 14.5px; color: var(--navy-soft); max-width: 68ch; }

  /* ---------- Final CTA ---------- */
  .final-cta { text-align: center; border: 1px solid var(--line); border-radius: 10px; padding: 36px 20px; background: var(--warm-bg); }
  .final-cta h2 { font-size: 22px; margin-bottom: 8px; }
  .final-cta .sub { font-size: 14.5px; color: var(--navy-soft); margin-bottom: 18px; }

  /* ---------- Footer ---------- */
  footer { border-top: 1px solid var(--line); padding: 24px 0 90px; }
  .foot-disc { font-size: 12px; color: var(--navy-soft); max-width: 72ch; }
  .foot-copy { font-size: 12px; color: var(--navy-soft); margin-top: 10px; }

  @media (max-width: 640px) {
    .result-row { font-size: 13.5px; }
    .result-row.headline .v { font-size: 19px; }
  }

  /* ---------- Additions ---------- */
  .does-not-affect { font-size: 13px; color: var(--green); font-weight: 700; text-align: center; }
  .sticky-cta { display: flex; flex-direction: column; align-items: center; gap: 3px; }
  .sticky-cta .does-not-affect { font-size: 11px; }
  .foot-links { font-size: 12px; margin-top: 10px; color: var(--navy-soft); }

  /* ---------- APR advisory strip (as on StarBorrow) ---------- */
  .top-text-container { padding: 8px 0; }
  .top-text-container .top-text { max-width: var(--maxw); margin: 0 auto; padding: 0 20px; font-size: 14px; line-height: 1.3; text-align: center; font-weight: 600; color: var(--navy); }
