/* FinCalc — global styles */
:root {
  --brand: #0F6E56;
  --brand-dark: #085041;
  --brand-light: #E1F5EE;
  --ink: #1c221f;
  --muted: #5f6b66;
  --border: rgba(0, 0, 0, .12);
  --bg: #ffffff;
  --surface: #f6f8f7;
  --radius: 12px;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0; color: var(--ink); background: var(--bg);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 16px; line-height: 1.65;
  -webkit-text-size-adjust: 100%;
}
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }

/* header / footer */
.site-header {
  border-bottom: 1px solid var(--border);
  background: #fff;
  position: sticky; top: 0; z-index: 20;
}
.site-header .wrap { display: flex; align-items: center; gap: 20px; height: 58px; }
.brand {
  display: flex; align-items: center; gap: 9px;
  font-weight: 700; font-size: 19px; color: var(--brand-dark); letter-spacing: -.2px;
}
.brand:hover { text-decoration: none; }
.brand .mark {
  width: 28px; height: 28px; border-radius: 8px; background: var(--brand);
  color: #fff; display: inline-flex; align-items: center; justify-content: center;
  font-size: 15px; font-weight: 700;
}
.nav { display: flex; gap: 4px; flex-wrap: wrap; margin-left: auto; }
.nav a { padding: 7px 11px; border-radius: 8px; color: var(--muted); font-size: 14.5px; }
.nav a:hover, .nav a.active { background: var(--brand-light); color: var(--brand-dark); text-decoration: none; }
.wrap { max-width: 880px; margin: 0 auto; padding: 0 20px; }

/* breadcrumb */
.crumbs { font-size: 13px; color: var(--muted); margin: 14px 0 4px; }
.crumbs a { color: var(--muted); }

/* hero */
.hero { padding: 34px 0 6px; }
.hero h1 { font-size: 30px; margin: 6px 0 10px; line-height: 1.25; letter-spacing: -.4px; }
.hero .lede { color: var(--muted); font-size: 17px; max-width: 700px; margin: 0 0 6px; }

h2 { font-size: 21px; margin: 34px 0 10px; letter-spacing: -.2px; }
h3 { font-size: 17px; margin: 22px 0 8px; }
p { margin: 10px 0; }
main { padding-bottom: 48px; }

/* calculator card */
.calc-card {
  background: #fff; border: 1px solid var(--border); border-radius: var(--radius);
  padding: 20px 22px; margin: 22px 0;
}
.calc-grid { display: grid; grid-template-columns: 1fr; gap: 12px; }
@media (min-width: 640px) { .calc-grid { grid-template-columns: 1fr 1fr; } }
.fc-field { display: flex; flex-direction: column; gap: 5px; }
.fc-field label { font-size: 13.5px; font-weight: 600; color: var(--ink); }
.fc-hint { font-size: 12px; color: var(--muted); }
.fc-control { display: flex; align-items: stretch; }
.fc-control .prefix, .fc-control .suffix {
  flex: none; display: flex; align-items: center; padding: 0 10px;
  background: var(--surface); border: 1px solid var(--border); color: var(--muted);
  font-size: 14px; border-radius: 8px 0 0 8px;
}
.fc-control .suffix { border-radius: 0 8px 8px 0; border-left: 0; }
.fc-control .prefix + input { border-radius: 0 8px 8px 0; }
.fc-control input, .fc-control select {
  width: 100%; padding: 9px 11px; font-size: 15px; font-family: inherit;
  border: 1px solid var(--border); border-radius: 8px; background: #fff; color: var(--ink);
}
.fc-control input:focus, .fc-control select:focus {
  outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(15, 110, 86, .12);
}
.fc-control .prefix + input:focus, .fc-control input:focus + .suffix { box-shadow: none; }

/* results */
.fc-result { margin-top: 4px; }
.fc-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin: 16px 0 14px; }
.fc-card { background: var(--brand-light); border-radius: 10px; padding: 14px 16px; }
.fc-card-label { font-size: 12.5px; color: var(--brand-dark); font-weight: 600; }
.fc-card-value { font-size: 24px; font-weight: 700; color: var(--brand-dark); margin-top: 2px; letter-spacing: -.4px; }
.fc-card-sub { font-size: 12px; color: var(--brand-dark); opacity: .75; margin-top: 2px; }
.fc-chart { margin: 14px 0 6px; }
.fc-note { font-size: 13px; color: var(--muted); background: var(--surface); border-radius: 8px; padding: 10px 14px; margin-top: 14px; }

/* tables */
.fc-table { width: 100%; border-collapse: collapse; font-size: 14.5px; margin: 10px 0; }
.fc-table th, .fc-table td { padding: 8px 10px; border-bottom: 1px solid rgba(0, 0, 0, .07); text-align: left; }
.fc-table tbody th { font-weight: 500; color: var(--muted); width: 46%; }
.fc-table td { text-align: right; font-variant-numeric: tabular-nums; }
.fc-table thead th { font-size: 12.5px; color: var(--muted); font-weight: 600; background: var(--surface); }
.fc-sched-table th, .fc-sched-table td { text-align: right; }
.fc-sched-table th:first-child, .fc-sched-table td:first-child { text-align: left; }
.fc-h3 { font-size: 16px; margin: 20px 0 8px; }
.fc-sched { margin-top: 18px; }
.fc-toggle { display: inline-flex; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
.fc-tbtn { padding: 5px 12px; font-size: 12.5px; background: #fff; border: 0; cursor: pointer; color: var(--muted); }
.fc-tbtn.active { background: var(--brand); color: #fff; }
.fc-more {
  display: block; width: 100%; margin-top: 8px; padding: 8px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 8px;
  font-size: 13.5px; cursor: pointer; color: var(--brand-dark);
}

/* content sections */
.prose { max-width: 760px; }
.prose ul, .prose ol { padding-left: 22px; margin: 10px 0; }
.prose li { margin: 5px 0; }
.faq-item { border-bottom: 1px solid rgba(0, 0, 0, .07); padding: 4px 0; }
.faq-item summary {
  cursor: pointer; padding: 12px 0; font-weight: 600; font-size: 15.5px; list-style: none;
  display: flex; justify-content: space-between; align-items: center; gap: 10px;
}
.faq-item summary::after { content: "+"; color: var(--brand); font-size: 18px; flex: none; }
.faq-item[open] summary::after { content: "–"; }
.faq-item p { color: var(--muted); font-size: 14.5px; margin: 0 0 12px; }

/* related + directory */
.rel-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 10px; margin: 14px 0; }
.rel-card {
  border: 1px solid var(--border); border-radius: 10px; padding: 12px 14px; display: block;
}
.rel-card:hover { border-color: var(--brand); text-decoration: none; background: var(--brand-light); }
.rel-card b { display: block; font-size: 14.5px; color: var(--ink); font-weight: 600; }
.rel-card span { font-size: 12.5px; color: var(--muted); }
.cat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; margin: 20px 0; }
.cat-card { border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 18px; }
.cat-card h3 { margin: 0 0 6px; font-size: 16.5px; }
.cat-card ul { margin: 6px 0 0; padding: 0 0 0 18px; }
.cat-card li { margin: 3px 0; font-size: 14.5px; }

/* ads */
.ad-slot { margin: 18px 0; text-align: center; }
.ad-slot[data-enabled="0"] { display: none; }

/* footer */
.site-footer { border-top: 1px solid var(--border); background: var(--surface); padding: 26px 0 34px; margin-top: 30px; }
.site-footer .wrap { display: flex; flex-wrap: wrap; gap: 8px 26px; font-size: 13.5px; color: var(--muted); }
.site-footer a { color: var(--muted); }
.disclaimer { font-size: 12.5px; color: var(--muted); max-width: 760px; }

@media (max-width: 560px) {
  .hero h1 { font-size: 24px; }
  .nav { display: none; }
  .calc-card { padding: 16px; }
  .fc-card-value { font-size: 20px; }
}


/* editorial guides */
.byline { color: var(--muted); font-size: 13px; margin-top: 8px; }
.guide-tool { margin: 22px 0; padding: 18px; }
.guide-tool h2 { margin: 0 0 6px; font-size: 17px; }
.guide-tool .rel-grid { margin-bottom: 0; }
.source-list { padding-left: 20px; font-size: 14px; }
.source-list li { margin: 4px 0; }
.formula {
  display: block; background: var(--surface); border: 1px solid var(--border);
  border-radius: 8px; padding: 14px 16px; margin: 12px 0;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 14px;
  overflow-x: auto;
}
.prose table { width: 100%; border-collapse: collapse; margin: 14px 0; font-size: 14.5px; }
.prose th, .prose td { padding: 8px 10px; border-bottom: 1px solid rgba(0, 0, 0, .07); text-align: left; }
.prose thead th { background: var(--surface); color: var(--muted); font-size: 12.5px; font-weight: 600; }
.prose td:last-child { text-align: right; font-variant-numeric: tabular-nums; }
