:root {
  --ink: #17202a;
  --muted: #64707d;
  --line: #dfe4e8;
  --soft: #f5f7f8;
  --navy: #12395b;
  --blue: #1769aa;
  --blue-soft: #eaf4fb;
  --green: #16705a;
  --white: #fff;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--white);
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; font-size: 16px; line-height: 1.5; }
button, input, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
.site-header { height: 68px; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; padding: 0 max(24px, calc((100% - 1180px)/2)); position: sticky; top: 0; background: rgba(255,255,255,.96); z-index: 5; }
.brand { color: var(--navy); text-decoration: none; font-weight: 750; display: flex; gap: 10px; align-items: center; }
.brand-mark { background: var(--navy); color: white; width: 34px; height: 34px; border-radius: 8px; display: grid; place-items: center; font-size: .78rem; letter-spacing: .04em; }
.header-link { color: var(--navy); font-weight: 650; text-decoration: none; }
.site-header nav { display: flex; gap: 20px; }
main { min-height: 80vh; }
.intro { padding: 56px 24px 34px; max-width: 1180px; margin: auto; }
.eyebrow { color: var(--blue); font-size: .76rem; letter-spacing: .09em; font-weight: 800; margin: 0 0 6px; }
h1 { font-size: clamp(2rem, 4vw, 3.25rem); line-height: 1.08; margin: 0; letter-spacing: -.035em; color: var(--navy); }
.intro > p:not(.eyebrow) { color: var(--muted); font-size: 1.08rem; margin: 12px 0 25px; }
.global-settings { display: flex; gap: 12px; flex-wrap: wrap; margin: -8px 0 18px; }
.global-settings label { display: grid; gap: 5px; color: var(--muted); font-size: .78rem; font-weight: 700; }
.global-settings select { min-width: 170px; color: var(--navy); font-weight: 650; }
.trust-strip { display: flex; flex-wrap: wrap; gap: 8px 18px; color: var(--muted); font-size: .82rem; font-weight: 650; margin: 0 0 20px; }
.trust-strip span::before { content: '✓'; color: var(--green); margin-right: 6px; }
.search-box { max-width: 760px; border: 2px solid var(--navy); border-radius: 10px; display: flex; align-items: center; padding: 0 16px; gap: 10px; height: 58px; box-shadow: 0 7px 20px rgba(18,57,91,.08); }
.search-box span { font-size: 1.5rem; color: var(--navy); transform: rotate(-20deg); }
.search-box input { border: 0; outline: 0; width: 100%; color: var(--ink); font-size: 1rem; }
.filter-block { display:grid; gap:10px; margin-top:20px; }
.filter-row { display:flex; align-items:flex-start; gap:14px; }
.filter-row > span { width:92px; flex:0 0 92px; padding-top:9px; color:#66717c; font-size:.78rem; font-weight:750; text-transform:uppercase; letter-spacing:.04em; }
.filters { display: flex; gap: 8px; flex-wrap: wrap; }
.filter { border: 1px solid var(--line); background: white; color: #44505c; padding: 9px 14px; border-radius: 999px; cursor: pointer; font-weight: 650; }
.filter:hover, .filter.active { background: var(--navy); color: white; border-color: var(--navy); }
.collection-links { display:flex; flex-wrap:wrap; gap:8px 14px; margin-top:18px; padding-top:16px; border-top:1px solid var(--line); }
.collection-links a { color:var(--blue); font-size:.9rem; font-weight:700; text-decoration:none; }
.collection-links a:hover { text-decoration:underline; }
.layout { max-width: 1180px; margin: auto; padding: 18px 24px 70px; display: grid; grid-template-columns: minmax(0,1fr) 180px; gap: 34px; }
.section-heading { display: flex; justify-content: space-between; align-items: end; margin-bottom: 18px; }
h2 { color: var(--navy); font-size: 1.55rem; margin: 0; letter-spacing: -.02em; }
.section-heading p { margin: 2px 0 0; color: var(--muted); font-size: .9rem; }
select { border: 1px solid var(--line); background: white; border-radius: 8px; padding: 8px 34px 8px 10px; color: var(--ink); }
.calculator-grid { display:grid; gap:28px; }
.calculator-group { display:grid; gap:12px; }
.calculator-group-grid { display:grid; grid-template-columns:repeat(3,1fr); gap:12px; }
.group-heading { display:flex; align-items:center; justify-content:space-between; border-bottom:1px solid var(--line); padding-bottom:8px; }
.group-heading h3 { margin:0; font-size:1.05rem; color:var(--navy); }
.group-heading span { min-width:28px; padding:3px 8px; border-radius:999px; background:#eaf4fb; color:var(--navy); text-align:center; font-size:.8rem; font-weight:750; }
.calculator-card { position:relative; }
.advanced-badge { position:absolute; top:12px; right:12px; background:#eaf4fb; color:#12395b; border:1px solid #c7ddec; border-radius:999px; padding:3px 7px; font-size:.68rem; font-weight:800; text-transform:uppercase; letter-spacing:.03em; }
.inline-calculator { margin:28px 0 34px; padding:22px; border:1px solid var(--line); border-radius:14px; background:#f8fbfd; box-shadow:0 8px 28px rgba(18,57,91,.07); }
.inline-calculator-head { display:flex; justify-content:space-between; gap:18px; align-items:end; margin-bottom:18px; }
.inline-calculator-head h2 { margin:0; }
.inline-calculator-head label { display:grid; gap:6px; font-size:.82rem; font-weight:700; color:#52606d; }
.inline-calculator-head select { min-width:190px; padding:10px; border:1px solid var(--line); border-radius:8px; background:white; }
.related-links,.hub-grid { display:grid; grid-template-columns:repeat(2,1fr); gap:10px; margin:14px 0 28px; }
.related-links a,.hub-grid a { display:grid; gap:5px; padding:15px; border:1px solid var(--line); border-radius:10px; background:white; color:var(--navy); text-decoration:none; }
.related-links a:hover,.hub-grid a:hover { border-color:var(--blue); box-shadow:0 5px 16px rgba(18,57,91,.08); }
.related-links span,.hub-grid span { color:#5d6874; font-size:.86rem; line-height:1.45; }
.download-panel { display:flex; justify-content:space-between; gap:20px; align-items:center; margin:24px 0 30px; padding:20px; border:1px solid #bfd6e7; border-radius:12px; background:#eaf4fb; }
.download-panel > div { display:grid; gap:5px; }
.download-panel span { color:#53616d; }
.calculator-card { text-align: left; min-height: 166px; background: white; border: 1px solid var(--line); border-radius: 10px; padding: 18px; transition: .16s ease; display: flex; flex-direction: column; }
.calculator-card:hover { border-color: #8fb6d4; box-shadow: 0 7px 20px rgba(18,57,91,.09); transform: translateY(-2px); }
.card-icon { width: 34px; height: 34px; border-radius: 8px; background: var(--blue-soft); color: var(--blue); display: grid; place-items: center; font-weight: 800; margin-bottom: 12px; }
.calculator-card strong { color: var(--navy); font-size: 1rem; line-height: 1.25; }
.calculator-card small { color: var(--muted); line-height: 1.35; margin-top: 5px; }
.card-actions { margin-top: auto; padding-top: 13px; display: flex; align-items: center; gap: 14px; }
.card-actions button { border: 0; background: none; padding: 0; color: var(--blue); font-size: .82rem; font-weight: 750; cursor: pointer; }
.card-actions a { color: var(--muted); font-size: .8rem; }
.ad-placeholder { border: 1px dashed #cbd1d6; height: 300px; color: #9aa2a9; display: grid; place-content: center; text-align: center; position: sticky; top: 92px; }
.ad-placeholder span { font-size: .62rem; letter-spacing: .08em; }
.ad-placeholder p { margin: 6px; }
.no-results { text-align: center; background: var(--soft); border-radius: 10px; padding: 42px; }
.no-results h3, .no-results p { margin: 0 0 4px; }
.resources { background: var(--soft); padding: 58px max(24px, calc((100% - 1180px)/2)) 70px; }
.resource-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.resource-card { border: 1px solid var(--line); background: white; border-radius: 10px; padding: 18px; text-align: left; display: grid; grid-template-columns: 38px 1fr auto; gap: 12px; align-items: center; cursor: pointer; color: var(--blue); }
.resource-card { text-decoration: none; }
.resource-card:hover { border-color: #8fb6d4; }
.resource-card strong { color: var(--navy); display: block; }
.resource-card small { display: block; color: var(--muted); margin-top: 3px; }
.file-icon { background: var(--blue-soft); height: 36px; border-radius: 7px; display: grid; place-items: center; font-weight: 800; }
.guides { padding: 58px max(24px, calc((100% - 1180px)/2)) 70px; }
.guide-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 12px; }
.guide-grid a { border: 1px solid var(--line); border-radius: 10px; padding: 20px; text-decoration: none; display: grid; gap: 7px; }
.guide-grid a:hover { border-color: #8fb6d4; box-shadow: 0 7px 20px rgba(18,57,91,.07); }
.guide-grid strong { color: var(--navy); line-height: 1.3; }
.guide-grid small { color: var(--muted); font-size: .9rem; }
.content-page { width: min(780px,calc(100% - 32px)); margin: 0 auto; padding: 52px 0 72px; }
.content-page article { color: #33404c; }
.content-page h1 { font-size: clamp(2rem,5vw,3rem); margin-bottom: 16px; }
.content-page h2 { margin: 34px 0 10px; font-size: 1.45rem; }
.content-page p, .content-page li { line-height: 1.75; }
.lead { color: var(--muted); font-size: 1.12rem; }
.breadcrumbs { color: var(--muted); font-size: .9rem; margin-bottom: 32px; }
.breadcrumbs a, .text-link { color: var(--blue); }
.primary-link { display: inline-block; margin: 12px 0 6px; background: var(--navy); color: white; padding: 11px 16px; border-radius: 8px; text-decoration: none; font-weight: 750; }
.content-list { padding-left: 22px; columns: 2; column-gap: 32px; }
.content-list li { break-inside: avoid; margin-bottom: 7px; }
.content-note { margin-top: 34px; background: var(--soft); border-left: 4px solid var(--blue); padding: 16px 18px; color: #42515e; }
footer { padding: 38px max(24px, calc((100% - 1180px)/2)); display: grid; grid-template-columns: 1fr auto; gap: 24px; border-top: 1px solid var(--line); color: var(--muted); font-size: .9rem; }
footer strong { color: var(--navy); }
footer p { margin: 5px 0; }
footer > div:nth-child(2) { display: flex; gap: 18px; flex-wrap: wrap; }
footer a { color: var(--navy); text-decoration: none; }
.disclaimer { grid-column: 1/-1; border-top: 1px solid var(--line); padding-top: 18px; }
dialog { width: min(680px, calc(100% - 28px)); max-height: 90vh; border: 0; border-radius: 14px; padding: 26px; box-shadow: 0 25px 80px rgba(11,27,42,.32); }
dialog::backdrop { background: rgba(10,24,37,.58); }
.dialog-head { display: flex; justify-content: space-between; align-items: start; }
.icon-button { border: 1px solid var(--line); background: white; border-radius: 8px; width: 38px; height: 38px; cursor: pointer; font-size: 1.5rem; line-height: 1; }
.dialog-description { color: var(--muted); margin: 10px 0 20px; }
.field-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.field label { display: block; font-weight: 700; font-size: .88rem; margin-bottom: 6px; }
.input-wrap { border: 1px solid #cbd1d6; border-radius: 8px; height: 46px; display: flex; align-items: center; overflow: hidden; background: white; }
.input-wrap:focus-within { outline: 2px solid #a7cce7; border-color: var(--blue); }
.input-wrap span { color: var(--muted); padding: 0 0 0 12px; }
.input-wrap input { border: 0; outline: 0; width: 100%; padding: 10px 12px; min-width: 0; }
.calculate-button { width: 100%; border: 0; background: var(--navy); color: white; font-weight: 750; padding: 13px; border-radius: 8px; cursor: pointer; margin-top: 20px; }
.calculate-button:hover { background: #0b2d49; }
.optional-note { color: var(--muted); font-size: .8rem; margin: 12px 0 -8px; }
.location-controls { display:grid; grid-template-columns:minmax(190px,1fr) minmax(190px,1fr); gap:14px; align-items:end; margin:0 0 18px; padding:16px; border:1px solid var(--line); border-radius:10px; background:#f7fafc; }
.location-controls select { width:100%; min-height:46px; padding:10px 12px; border:1px solid #cbd1d6; border-radius:8px; background:#fff; font:inherit; }
.location-note { grid-column:1/-1; margin:0; color:var(--muted); font-size:.86rem; line-height:1.45; }
.check-field { display:flex; align-items:center; gap:9px; min-height:46px; font-weight:700; font-size:.88rem; }
.check-field input { width:18px; height:18px; }
.result-panel { margin-top: 18px; border: 1px solid #a8d5c9; background: #f0faf7; border-radius: 10px; padding: 18px; }
.result-main { display: flex; justify-content: space-between; align-items: baseline; padding-bottom: 14px; border-bottom: 1px solid #c8e4dc; }
.result-main span { font-weight: 700; color: #36564e; }
.result-main strong { color: var(--green); font-size: 1.8rem; }
.result-details { display: grid; grid-template-columns: repeat(2,1fr); gap: 12px; padding-top: 14px; }
.annual-projection { margin-top:22px; padding-top:20px; border-top:1px solid #c8e4dc; }
.annual-projection h3 { margin:0 0 14px; font-size:1.05rem; color:var(--navy); }
.projection-chart { padding:12px; margin-bottom:14px; border:1px solid #d8e5e1; border-radius:8px; background:#fff; }
.projection-chart svg { display:block; width:100%; height:auto; min-height:180px; overflow:visible; }
.projection-chart text { fill:var(--muted); font-size:13px; }
.chart-axis { stroke:#aebbc3; stroke-width:1; }
.chart-legend { display:flex; flex-wrap:wrap; gap:12px 18px; font-size:.82rem; color:#425466; }
.chart-legend span { display:inline-flex; align-items:center; gap:7px; }
.chart-legend i { display:inline-block; width:20px; height:4px; border-radius:2px; }
.projection-table-wrap { max-height:430px; overflow:auto; border:1px solid #d8e5e1; border-radius:8px; background:#fff; }
.projection-table-wrap table { width:100%; border-collapse:collapse; min-width:680px; font-variant-numeric:tabular-nums; }
.projection-table-wrap th,.projection-table-wrap td { padding:10px 12px; text-align:right; border-bottom:1px solid #e6ecef; white-space:nowrap; }
.projection-table-wrap th:first-child,.projection-table-wrap td:first-child { text-align:left; position:sticky; left:0; background:#fff; }
.projection-table-wrap thead th { position:sticky; top:0; z-index:2; background:#eef5f7; color:#334e5c; font-size:.78rem; }
.projection-table-wrap tbody th { font-weight:750; color:var(--navy); }
.projection-table-wrap tbody tr:last-child th,.projection-table-wrap tbody tr:last-child td { border-bottom:0; }
.result-actions { display: flex; gap: 8px; margin-top: 16px; }
.result-actions button { border: 1px solid #9fc7bc; background: white; color: var(--green); border-radius: 7px; padding: 8px 12px; cursor: pointer; font-weight: 700; }
.result-detail small { display: block; color: var(--muted); }
.result-detail strong { color: var(--ink); }
.formula-note { color: var(--muted); font-size: .78rem; margin: 18px 0 0; }
#toast { position: fixed; bottom: 22px; left: 50%; transform: translate(-50%, 20px); background: var(--ink); color: white; padding: 11px 17px; border-radius: 8px; opacity: 0; pointer-events: none; transition: .2s; z-index: 10; }
#toast.show { opacity: 1; transform: translate(-50%, 0); }
@media (max-width: 900px) {
  .layout { grid-template-columns: 1fr; }
  .ad-placeholder { height: 100px; position: static; }
  .calculator-group-grid, .resource-grid, .guide-grid { grid-template-columns: repeat(2,1fr); }
}
@media (max-width: 600px) {
  .site-header { padding: 0 16px; }
  .brand span:last-child { font-size: .92rem; }
  .site-header nav { display: none; }
  .intro { padding: 36px 16px 24px; }
  .global-settings label, .global-settings select { width: 100%; }
  .trust-strip { display: grid; grid-template-columns: 1fr 1fr; }
  .layout { padding: 10px 16px 52px; }
  .calculator-group-grid, .resource-grid, .guide-grid { grid-template-columns: 1fr; }
  .filter-row { display:block; }
  .filter-row > span { display:block; width:auto; padding:0 0 7px; }
  .inline-calculator-head,.download-panel { align-items:stretch; flex-direction:column; }
  .related-links,.hub-grid { grid-template-columns:1fr; }
  .calculator-card { min-height: 126px; }
  .resources { padding: 44px 16px 52px; }
  footer { padding: 32px 16px; grid-template-columns: 1fr; }
  .disclaimer { grid-column: auto; }
  dialog { padding: 20px; }
  .field-grid, .result-details, .location-controls { grid-template-columns: 1fr; }
  .projection-chart { padding:8px; }
  .projection-chart svg { min-height:150px; }
  .content-list { columns: 1; }
}
.embed-tool { margin: 1.5rem 0; border: 1px solid var(--border); border-radius: 10px; padding: 1rem; background: var(--surface); }
.embed-tool summary { cursor: pointer; font-weight: 700; }
.embed-tool pre { overflow: auto; padding: 1rem; border-radius: 8px; background: #101827; color: #f8fafc; font-size: .85rem; white-space: pre-wrap; overflow-wrap: anywhere; }
.review-date { color: var(--muted); font-size: .875rem; }
@media print {
  body > *:not(dialog) { display: none !important; }
  dialog { display: block; position: static; width: 100%; max-height: none; box-shadow: none; padding: 0; }
  dialog::backdrop, .icon-button, #calculator-form, .result-actions, .formula-note { display: none !important; }
  .result-panel { border: 1px solid #999; background: white; }
}
