/* ============================================================
   Business Loan Calculator Hub — Design System
   Brand-neutral. Navy + gold. No connection to any other brand.
   Single stylesheet, no @import chains (perf).
   ============================================================ */

:root {
  /* Palette */
  --navy: #16305b;
  --navy-700: #1e3e73;
  --navy-900: #0f2244;
  --gold: #c69749;
  --gold-600: #b3853a;
  --ink: #1c2733;
  --body: #33414f;
  --muted: #667585;
  --line: #e3e8ef;
  --line-2: #eef2f7;
  --bg: #f6f8fb;
  --card: #ffffff;
  --good: #1f9d61;
  --warn: #c0821f;
  --bad: #c14444;

  /* Type */
  --serif: "Source Serif 4", Georgia, "Times New Roman", serif;
  --sans: "Libre Franklin", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;

  /* Layout */
  --wrap: 1120px;
  --radius: 14px;
  --radius-sm: 9px;
  --shadow: 0 1px 2px rgba(16, 34, 68, .06), 0 10px 30px rgba(16, 34, 68, .07);
  --shadow-sm: 0 1px 2px rgba(16, 34, 68, .08);
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--sans);
  color: var(--body);
  background: var(--bg);
  line-height: 1.6;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 { font-family: var(--serif); color: var(--ink); line-height: 1.2; margin: 0 0 .5em; font-weight: 600; }
h1 { font-size: clamp(1.8rem, 4vw, 2.6rem); color: var(--navy); }
h2 { font-size: clamp(1.4rem, 3vw, 1.9rem); }
h3 { font-size: 1.2rem; }
p { margin: 0 0 1rem; }
a { color: var(--navy-700); }
a:hover { color: var(--gold-600); }

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 20px; }
.narrow { max-width: 800px; }

/* ---------- Header ---------- */
.site-header {
  background: var(--navy);
  color: #fff;
  position: sticky; top: 0; z-index: 50;
  box-shadow: 0 2px 14px rgba(15, 34, 68, .18);
}
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; height: 66px; }
.brand { display: flex; align-items: center; gap: 10px; font-family: var(--serif); font-weight: 600; font-size: 1.18rem; color: #fff; text-decoration: none; }
.brand:hover { color: #fff; }
.brand .mark { width: 34px; height: 34px; border-radius: 8px; background: linear-gradient(135deg, var(--gold), var(--gold-600)); color: var(--navy-900); display: grid; place-items: center; font-weight: 800; font-size: 1.1rem; flex: 0 0 auto; }
.main-nav { display: flex; gap: 22px; align-items: center; }
.main-nav a { color: #d9e2f0; text-decoration: none; font-size: .95rem; font-weight: 500; }
.main-nav a:hover { color: #fff; }
.nav-toggle { display: none; background: none; border: 0; color: #fff; font-size: 1.5rem; cursor: pointer; }
@media (max-width: 720px) {
  .main-nav { display: none; position: absolute; top: 66px; left: 0; right: 0; background: var(--navy-900); flex-direction: column; gap: 0; padding: 8px 0; }
  .main-nav.open { display: flex; }
  .main-nav a { padding: 12px 20px; border-bottom: 1px solid rgba(255,255,255,.06); }
  .nav-toggle { display: block; }
}

/* ---------- Breadcrumb ---------- */
.crumb { font-size: .85rem; color: var(--muted); padding: 14px 0 0; }
.crumb a { color: var(--muted); text-decoration: none; }
.crumb a:hover { color: var(--navy-700); }

/* ---------- Hero / page intro ---------- */
.page-intro { padding: 26px 0 8px; }
.page-intro p.lead { font-size: 1.08rem; color: var(--body); max-width: 720px; }

/* ---------- Calculator layout ---------- */
.calc-grid { display: grid; grid-template-columns: 1fr .9fr; gap: 22px; align-items: start; margin: 18px 0 32px; }
@media (max-width: 860px) { .calc-grid { grid-template-columns: 1fr; } }

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 22px;
}
.card h2, .card h3 { margin-top: 0; }

.panel-title { font-family: var(--sans); font-weight: 700; font-size: .82rem; letter-spacing: .08em; text-transform: uppercase; color: var(--gold-600); margin-bottom: 16px; }

/* Inputs */
.field { margin-bottom: 20px; }
.field:last-child { margin-bottom: 0; }
.field-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 8px; gap: 12px; }
.field label { font-weight: 600; color: var(--ink); font-size: .95rem; }
.field .hint { font-size: .78rem; color: var(--muted); }

.val-input { display: inline-flex; align-items: center; gap: 4px; border: 1.5px solid var(--line); border-radius: var(--radius-sm); padding: 6px 10px; background: #fff; font-weight: 700; color: var(--navy); min-width: 96px; justify-content: flex-end; transition: border-color .15s; }
.val-input:focus-within { border-color: var(--gold); }
.val-input .pfx, .val-input .sfx { color: var(--muted); font-weight: 600; }
.val-input input { border: 0; outline: 0; width: 100%; text-align: right; font: inherit; color: var(--navy); background: transparent; }
.val-input input::-webkit-outer-spin-button, .val-input input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.val-input input[type=number] { -moz-appearance: textfield; }

/* Range slider */
input[type=range] { -webkit-appearance: none; appearance: none; width: 100%; height: 6px; border-radius: 6px; background: var(--line); outline: none; margin: 6px 0 2px; }
input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; appearance: none; width: 22px; height: 22px; border-radius: 50%; background: var(--navy); border: 3px solid #fff; box-shadow: 0 1px 4px rgba(16,34,68,.35); cursor: pointer; }
input[type=range]::-moz-range-thumb { width: 22px; height: 22px; border-radius: 50%; background: var(--navy); border: 3px solid #fff; box-shadow: 0 1px 4px rgba(16,34,68,.35); cursor: pointer; }
.range-ends { display: flex; justify-content: space-between; font-size: .72rem; color: var(--muted); }

/* Select + text inputs */
select.inp, input.inp, textarea.inp { width: 100%; border: 1.5px solid var(--line); border-radius: var(--radius-sm); padding: 10px 12px; font: inherit; color: var(--ink); background: #fff; }
select.inp:focus, input.inp:focus, textarea.inp:focus { border-color: var(--gold); outline: 0; }

/* Segmented toggle */
.seg { display: inline-flex; background: var(--line-2); border-radius: 999px; padding: 3px; gap: 2px; }
.seg button { border: 0; background: none; padding: 7px 16px; border-radius: 999px; font: inherit; font-weight: 600; font-size: .88rem; color: var(--muted); cursor: pointer; }
.seg button.active { background: #fff; color: var(--navy); box-shadow: var(--shadow-sm); }

/* ---------- Results panel ---------- */
.result-card { background: linear-gradient(165deg, var(--navy), var(--navy-900)); color: #fff; border: 0; }
.result-card .panel-title { color: var(--gold); }
.result-hero { text-align: center; padding: 8px 0 18px; border-bottom: 1px solid rgba(255,255,255,.12); margin-bottom: 18px; }
.result-hero .label { font-size: .8rem; letter-spacing: .06em; text-transform: uppercase; color: #aebfd8; }
.result-hero .big { font-family: var(--serif); font-size: clamp(2.2rem, 6vw, 3rem); font-weight: 700; color: #fff; margin: 4px 0 0; }
.result-hero .sub { color: #aebfd8; font-size: .9rem; }
.result-rows { display: grid; gap: 12px; }
.rrow { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.rrow .k { color: #c2cee2; font-size: .92rem; }
.rrow .v { font-weight: 700; color: #fff; font-variant-numeric: tabular-nums; }
.rrow.total { border-top: 1px solid rgba(255,255,255,.14); padding-top: 12px; margin-top: 4px; }
.rrow.total .v { color: var(--gold); font-size: 1.15rem; }

/* Donut */
.donut-wrap { display: flex; align-items: center; gap: 18px; margin: 18px 0 6px; }
.donut { width: 128px; height: 128px; border-radius: 50%; flex: 0 0 auto; display: grid; place-items: center; }
.donut .hole { width: 84px; height: 84px; border-radius: 50%; background: var(--navy-900); display: grid; place-items: center; text-align: center; }
.donut .hole .n { font-family: var(--serif); font-weight: 700; font-size: 1rem; color: #fff; }
.donut .hole .t { font-size: .66rem; color: #aebfd8; }
.legend { display: grid; gap: 8px; font-size: .85rem; }
.legend .li { display: flex; align-items: center; gap: 8px; color: #d5deee; }
.legend .dot { width: 11px; height: 11px; border-radius: 3px; flex: 0 0 auto; }

/* Light result variant (for simpler calcs) */
.result-light { background: var(--card); border: 1px solid var(--line); }
.result-light .result-hero .label { color: var(--muted); }
.result-light .result-hero .big { color: var(--navy); }
.result-light .result-hero { border-color: var(--line); }
.result-light .rrow .k { color: var(--body); }
.result-light .rrow .v { color: var(--ink); }
.result-light .rrow.total .v { color: var(--gold-600); }

/* ---------- Buttons ---------- */
.btn { display: inline-flex; align-items: center; gap: 8px; border: 0; border-radius: 999px; padding: 12px 22px; font: inherit; font-weight: 700; cursor: pointer; text-decoration: none; transition: transform .1s, box-shadow .15s; }
.btn-gold { background: linear-gradient(135deg, var(--gold), var(--gold-600)); color: var(--navy-900); box-shadow: var(--shadow-sm); }
.btn-gold:hover { transform: translateY(-1px); color: var(--navy-900); }
.btn-ghost { background: transparent; border: 1.5px solid var(--line); color: var(--navy); }

/* ---------- Content sections ---------- */
.section { padding: 26px 0; }
.prose { max-width: 760px; }
.prose h2 { margin-top: 1.4em; }
.prose ul, .prose ol { padding-left: 1.2em; }
.prose li { margin-bottom: .4em; }
.prose table { width: 100%; border-collapse: collapse; margin: 1em 0; font-size: .93rem; }
.prose th, .prose td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); }
.prose th { background: var(--line-2); font-weight: 700; color: var(--ink); }

/* Amortization / data table */
.data-table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius-sm); }
table.data { width: 100%; border-collapse: collapse; font-size: .88rem; font-variant-numeric: tabular-nums; }
table.data th, table.data td { padding: 9px 12px; text-align: right; border-bottom: 1px solid var(--line-2); white-space: nowrap; }
table.data th { background: var(--navy); color: #fff; font-weight: 600; position: sticky; top: 0; }
table.data th:first-child, table.data td:first-child { text-align: left; }
table.data tbody tr:hover { background: var(--line-2); }

/* ---------- FAQ ---------- */
.faq details { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 0; margin-bottom: 10px; background: #fff; }
.faq summary { cursor: pointer; padding: 14px 18px; font-weight: 600; color: var(--ink); list-style: none; display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; color: var(--gold-600); font-size: 1.3rem; font-weight: 400; }
.faq details[open] summary::after { content: "\2013"; }
.faq details[open] summary { border-bottom: 1px solid var(--line-2); }
.faq .faq-body { padding: 14px 18px; color: var(--body); }
.faq .faq-body :last-child { margin-bottom: 0; }

/* ---------- Related calculators / cards grid ---------- */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; }
.calc-card { display: block; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; text-decoration: none; color: inherit; transition: transform .12s, box-shadow .15s, border-color .15s; }
.calc-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: var(--gold); color: inherit; }
.calc-card .ic { width: 40px; height: 40px; border-radius: 10px; background: var(--line-2); color: var(--navy); display: grid; place-items: center; font-size: 1.2rem; margin-bottom: 12px; }
.calc-card h3 { font-size: 1.05rem; margin-bottom: 6px; }
.calc-card p { font-size: .88rem; color: var(--muted); margin: 0; }

/* ---------- Ad slots ---------- */
.ad-slot { margin: 22px auto; text-align: center; min-height: 90px; display: grid; place-items: center; background: repeating-linear-gradient(45deg, #f0f3f8, #f0f3f8 10px, #eef2f7 10px, #eef2f7 20px); border: 1px dashed var(--line); border-radius: var(--radius-sm); color: #9aa8ba; font-size: .78rem; letter-spacing: .05em; }
.ad-slot::before { content: "ADVERTISEMENT"; }
.ad-label { font-size: .68rem; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); text-align: center; margin-bottom: 4px; }

/* ---------- Callouts ---------- */
.note { border-left: 3px solid var(--gold); background: #fbf7ee; padding: 12px 16px; border-radius: 0 var(--radius-sm) var(--radius-sm) 0; font-size: .92rem; margin: 1em 0; }
.disclaimer { font-size: .82rem; color: var(--muted); border-top: 1px solid var(--line); padding-top: 14px; margin-top: 22px; }

/* ---------- Footer ---------- */
.site-footer { background: var(--navy-900); color: #b9c6dc; margin-top: 40px; padding: 40px 0 26px; font-size: .9rem; }
.site-footer a { color: #cdd8ea; text-decoration: none; }
.site-footer a:hover { color: #fff; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 28px; margin-bottom: 26px; }
@media (max-width: 720px) { .footer-grid { grid-template-columns: 1fr; gap: 20px; } }
.site-footer h4 { color: #fff; font-family: var(--sans); font-size: .8rem; letter-spacing: .08em; text-transform: uppercase; margin-bottom: 12px; }
.site-footer ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.footer-bottom { border-top: 1px solid rgba(255,255,255,.1); padding-top: 18px; font-size: .82rem; color: #8ea0bd; }

/* ---------- Cookie consent ---------- */
#cookie-consent { position: fixed; bottom: 0; left: 0; right: 0; z-index: 100; background: var(--navy-900); color: #dbe4f2; padding: 16px 20px; box-shadow: 0 -4px 20px rgba(0,0,0,.25); display: none; }
#cookie-consent.show { display: block; }
#cookie-consent .cc-inner { max-width: var(--wrap); margin: 0 auto; display: flex; align-items: center; gap: 18px; flex-wrap: wrap; justify-content: space-between; }
#cookie-consent p { margin: 0; font-size: .88rem; max-width: 720px; }
#cookie-consent .cc-actions { display: flex; gap: 10px; }

/* ---------- Utilities ---------- */
.text-good { color: var(--good); }
.text-warn { color: var(--warn); }
.text-bad { color: var(--bad); }
.mono { font-variant-numeric: tabular-nums; }
.center { text-align: center; }
.mt-0 { margin-top: 0; }
.hidden { display: none !important; }
