:root {
  --ink: #132238;
  --muted: #5d6b7d;
  --brand: #075a52;
  --brand-dark: #06463f;
  --brand-pale: #e9f7f3;
  --accent: #d97706;
  --line: #d8e0e8;
  --surface: #ffffff;
  --canvas: #f5f7f9;
  --danger: #b42318;
  --shadow: 0 18px 50px rgba(15, 35, 55, 0.09);
  --radius: 16px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--ink);
  background: var(--canvas);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.6;
  text-rendering: optimizeLegibility;
}
a { color: #086f65; text-underline-offset: 0.18em; }
a:hover { color: var(--brand-dark); }
img, svg { max-width: 100%; }
button, input, select { font: inherit; }
button, .button { cursor: pointer; }
:focus-visible { outline: 3px solid #f2a33b; outline-offset: 3px; }
[hidden] { display: none !important; }
.skip-link {
  position: fixed;
  top: 8px;
  left: 8px;
  z-index: 100;
  transform: translateY(-150%);
  padding: 10px 14px;
  background: var(--ink);
  color: #fff;
  border-radius: 8px;
}
.skip-link:focus { transform: none; }
.container { width: min(1160px, calc(100% - 32px)); margin-inline: auto; }
.narrow { width: min(780px, calc(100% - 32px)); margin-inline: auto; }
.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(255, 255, 255, 0.96);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(10px);
}
.nav {
  min-height: 70px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; font-weight: 800; }
.brand-mark {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: var(--brand);
  color: #fff;
  letter-spacing: -0.06em;
}
.nav-links { display: flex; align-items: center; gap: 22px; margin: 0; padding: 0; list-style: none; }
.nav-links a { color: var(--ink); text-decoration: none; font-size: 0.94rem; font-weight: 650; }
.nav-links a:hover { color: var(--brand); }
.hero {
  padding: clamp(54px, 8vw, 100px) 0 48px;
  background:
    radial-gradient(circle at 85% 20%, rgba(245, 158, 11, 0.16), transparent 28%),
    linear-gradient(145deg, #eefaf6, #f8fafc 62%);
  border-bottom: 1px solid var(--line);
}
.eyebrow { margin: 0 0 12px; color: var(--brand); font-weight: 800; font-size: 0.82rem; text-transform: uppercase; letter-spacing: 0.08em; }
h1, h2, h3 { line-height: 1.16; letter-spacing: -0.025em; }
h1 { max-width: 900px; margin: 0; font-size: clamp(2.25rem, 5.2vw, 4.5rem); }
h2 { margin-top: 0; font-size: clamp(1.65rem, 3vw, 2.55rem); }
h3 { font-size: 1.25rem; }
.lede { max-width: 760px; margin: 20px 0 0; color: var(--muted); font-size: clamp(1.03rem, 1.8vw, 1.25rem); }
.trust-line { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 24px; }
.pill { padding: 6px 11px; border: 1px solid #b8d9d1; border-radius: 999px; background: #fff; color: #315c57; font-size: 0.84rem; font-weight: 700; }
.section { padding: 64px 0; }
.section.compact { padding: 38px 0; }
.grid { display: grid; gap: 22px; }
.grid > * { min-width: 0; }
.grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 6px 24px rgba(15, 35, 55, 0.05);
}
.card.pad { padding: clamp(22px, 4vw, 36px); }
.card h2, .card h3 { margin-top: 0; }
.calculator-shell { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(360px, 0.95fr); gap: 24px; align-items: start; }
.calculator-card { padding: clamp(22px, 4vw, 36px); }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.field { display: grid; gap: 7px; }
.field.full { grid-column: 1 / -1; }
.field label, .field-label { color: #273951; font-size: 0.91rem; font-weight: 750; }
.field small { color: var(--muted); }
.input-wrap { position: relative; }
.input-prefix, .input-suffix { position: absolute; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.input-prefix { left: 13px; }
.input-suffix { right: 13px; }
.with-prefix { padding-left: 29px !important; }
.with-suffix { padding-right: 90px !important; }
input, select {
  width: 100%;
  min-height: 48px;
  padding: 10px 12px;
  color: var(--ink);
  background: #fff;
  border: 1px solid #b9c5d1;
  border-radius: 10px;
}
input:hover, select:hover { border-color: #8595a6; }
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 11px 18px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: var(--brand);
  color: #fff;
  font-weight: 800;
  text-decoration: none;
}
.button:hover { background: var(--brand-dark); color: #fff; }
.button.secondary { background: #fff; color: var(--ink); border-color: var(--line); }
.button.ghost { background: transparent; color: var(--brand); border-color: #abd4cc; }
.actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 20px; }
.advanced { grid-column: 1 / -1; padding-top: 8px; }
.advanced-panel { margin-top: 14px; padding: 18px; background: #f8fafb; border: 1px solid var(--line); border-radius: 12px; }
.notice { padding: 14px 16px; border-radius: 10px; background: #eef5ff; border: 1px solid #c6d8f2; }
.notice.warning { background: #fff8e8; border-color: #f5d28e; }
.notice.error { color: var(--danger); background: #fff1f0; border-color: #f3b7b2; }
.results { padding: clamp(22px, 4vw, 32px); scroll-margin-top: 100px; }
.metrics { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.metric { padding: 16px; background: var(--brand-pale); border: 1px solid #c7e9df; border-radius: 12px; }
.metric span { display: block; color: var(--muted); font-size: 0.82rem; }
.metric strong { display: block; margin-top: 4px; font-size: 1.25rem; }
.breakdown { margin-top: 22px; }
.breakdown-row { display: flex; justify-content: space-between; gap: 20px; padding: 11px 0; border-bottom: 1px solid var(--line); }
.breakdown-row.negative strong { color: #8f2d25; }
.breakdown-row.total { padding-top: 16px; border-bottom: 0; font-size: 1.08rem; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 11px 12px; border-bottom: 1px solid var(--line); text-align: left; }
td:last-child { text-align: right; font-variant-numeric: tabular-nums; }
.breadcrumbs { padding: 18px 0 0; color: var(--muted); font-size: 0.9rem; }
.breadcrumbs ol { display: flex; flex-wrap: wrap; gap: 7px; margin: 0; padding: 0; list-style: none; }
.breadcrumbs li:not(:last-child)::after { content: "/"; margin-left: 7px; color: #9aa6b4; }
.prose { color: #26384c; }
.prose p, .prose li { max-width: 78ch; }
.prose h2 { margin-top: 2.2em; }
.prose h3 { margin-top: 1.8em; }
.source-list { padding-left: 20px; }
.source-list li { margin: 10px 0; }
.state-grid, .tool-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; }
.link-card { display: block; padding: 17px; color: var(--ink); text-decoration: none; background: #fff; border: 1px solid var(--line); border-radius: 12px; }
.link-card:hover { border-color: #83bdb4; box-shadow: 0 8px 24px rgba(15, 35, 55, 0.07); }
.link-card strong { display: block; }
.link-card span { color: var(--muted); font-size: 0.88rem; }
.ad-slot {
  min-height: 92px;
  display: grid;
  place-items: center;
  color: #7b8795;
  background: repeating-linear-gradient(135deg, #f4f6f8, #f4f6f8 8px, #eef1f4 8px, #eef1f4 16px);
  border: 1px dashed #bfc8d2;
  border-radius: 12px;
  font-size: 0.8rem;
  text-align: center;
}
.share-box { display: grid; grid-template-columns: 1fr auto; gap: 8px; margin-top: 14px; }
.share-box .button { min-height: 44px; }
.faq details { padding: 16px 0; border-bottom: 1px solid var(--line); }
.faq summary { cursor: pointer; font-weight: 800; }
.byline { display: flex; flex-wrap: wrap; gap: 10px 20px; color: var(--muted); font-size: 0.9rem; }
.footer { margin-top: 60px; padding: 46px 0 28px; color: #dce8e6; background: #102c2a; }
.footer a { color: #dce8e6; }
.footer-grid { display: grid; grid-template-columns: 1.4fr repeat(3, 1fr); gap: 28px; }
.footer h2, .footer h3 { color: #fff; font-size: 1rem; }
.footer ul { margin: 0; padding: 0; list-style: none; }
.footer li { margin: 8px 0; }
.footer small { display: block; margin-top: 30px; color: #a9bfbc; }
.widget-body { background: #fff; }
.widget-shell { padding: 14px; }
.widget-shell .calculator-card { padding: 0; border: 0; box-shadow: none; }
.widget-shell .hero, .widget-shell .site-header, .widget-shell .footer, .widget-shell [data-advanced-toggle], .widget-shell [data-advanced] { display: none; }
.widget-shell .calculator-shell { display: block; }
.widget-shell .results { margin-top: 14px; }
.widget-attribution { margin: 12px 0 0; text-align: center; font-size: 0.78rem; }
.code-block { max-width: 100%; padding: 16px; overflow-x: auto; overflow-wrap: anywhere; white-space: pre-wrap; background: #11263a; color: #eaf2f8; border-radius: 12px; }
.no-js { margin: 16px; }

@media (max-width: 880px) {
  .calculator-shell, .grid.three, .footer-grid { grid-template-columns: 1fr 1fr; }
  .calculator-shell { grid-template-columns: 1fr; }
  .footer-grid > :first-child { grid-column: 1 / -1; }
}
@media (max-width: 650px) {
  .nav { align-items: flex-start; padding: 14px 0; }
  .nav-links { justify-content: flex-end; flex-wrap: wrap; gap: 10px 16px; }
  .nav-links li:nth-child(4) { display: none; }
  .hero { padding-top: 46px; }
  .grid.two, .grid.three, .form-grid, .metrics, .footer-grid { grid-template-columns: minmax(0, 1fr); }
  .field.full { grid-column: auto; }
  .share-box { grid-template-columns: 1fr; }
  .section { padding: 46px 0; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}
