:root {
    --ink: #17312c;
    --muted: #65756f;
    --green-950: #0c3028;
    --green-900: #123f35;
    --green-700: #1d6b53;
    --green-500: #2f9d72;
    --mint: #e8f5ef;
    --mint-soft: #f4faf7;
    --cream: #fbfaf6;
    --gold: #e4b957;
    --line: #dce7e2;
    --white: #ffffff;
    --danger: #a53e3e;
    --warning: #9a6812;
    --shadow: 0 18px 50px rgba(22, 56, 47, .09);
    --radius: 18px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; color: var(--ink); background: var(--white); font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; line-height: 1.6; -webkit-font-smoothing: antialiased; }
a { color: var(--green-700); text-underline-offset: 3px; }
a:hover { color: var(--green-900); }
.site-shell { max-width: 1080px; }
.skip-link { position: fixed; top: 8px; left: 8px; z-index: 999; transform: translateY(-140%); background: var(--white); color: var(--green-900); padding: .7rem 1rem; border-radius: 8px; box-shadow: var(--shadow); }
.skip-link:focus { transform: translateY(0); }

.site-header { position: relative; z-index: 20; background: var(--green-950); color: var(--white); border-bottom: 1px solid rgba(255,255,255,.1); }
.site-header .site-shell { min-height: 76px; display: flex; align-items: center; justify-content: space-between; gap: 1.5rem; }
.brand { display: inline-flex; align-items: center; gap: .72rem; color: inherit; text-decoration: none; line-height: 1.1; }
.brand:hover { color: inherit; }
.brand-mark { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 12px; background: var(--gold); color: var(--green-950); font-weight: 900; letter-spacing: -.04em; }
.brand strong { display: block; font-size: 1rem; letter-spacing: -.015em; }
.brand small { display: block; margin-top: .25rem; color: rgba(255,255,255,.62); font-size: .7rem; letter-spacing: .02em; }
.main-nav { display: flex; align-items: center; gap: 1.6rem; }
.main-nav a { color: rgba(255,255,255,.78); text-decoration: none; font-size: .9rem; font-weight: 650; }
.main-nav a:hover { color: var(--white); }

.hero { overflow: hidden; color: var(--white); background: radial-gradient(circle at 80% 20%, rgba(55,158,113,.28), transparent 30%), linear-gradient(135deg, var(--green-950), #164d3f); }
.hero-grid { display: grid; grid-template-columns: 1.24fr .76fr; gap: 5rem; align-items: center; min-height: 590px; padding-top: 5.5rem; padding-bottom: 5.7rem; }
.eyebrow { display: inline-block; margin-bottom: 1rem; color: var(--green-700); font-size: .76rem; font-weight: 800; letter-spacing: .13em; text-transform: uppercase; }
.hero .eyebrow, .source-band .eyebrow { color: #9de1c7; }
.hero h1 { margin: 0; max-width: 700px; font-size: clamp(2.65rem, 6vw, 4.65rem); line-height: .99; letter-spacing: -.055em; font-weight: 780; }
.hero h1 span { color: #a7e5cd; }
.hero-copy > p { max-width: 650px; margin: 1.7rem 0 2rem; color: rgba(255,255,255,.74); font-size: 1.12rem; line-height: 1.75; }
.hero-actions { display: flex; align-items: center; gap: 1.35rem; flex-wrap: wrap; }
.btn { border-radius: 10px; font-weight: 760; }
.btn-primary { --bs-btn-bg: var(--gold); --bs-btn-border-color: var(--gold); --bs-btn-color: var(--green-950); --bs-btn-hover-bg: #efc96f; --bs-btn-hover-border-color: #efc96f; --bs-btn-hover-color: var(--green-950); --bs-btn-active-bg: #d9a93a; --bs-btn-active-border-color: #d9a93a; padding-inline: 1.35rem; }
.text-link { color: var(--white); font-weight: 750; text-decoration: none; }
.text-link:hover { color: #b8ead7; }
.trust-list { display: flex; flex-wrap: wrap; gap: .8rem 1.45rem; margin-top: 2.3rem; color: rgba(255,255,255,.68); font-size: .79rem; }
.trust-list b { color: #99e1c4; margin-right: .3rem; }
.hero-panel { position: relative; }
.hero-panel::before { content: ""; position: absolute; inset: -45px -80px; border: 1px solid rgba(255,255,255,.08); border-radius: 50%; transform: rotate(-18deg); }
.mini-card { position: relative; padding: 1.3rem; border: 1px solid rgba(255,255,255,.12); border-radius: 15px; background: rgba(255,255,255,.07); backdrop-filter: blur(7px); }
.mini-card-main { margin-left: 1.6rem; margin-bottom: 1rem; padding: 1.55rem; }
.mini-card-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.mini-card strong { display: block; margin: .3rem 0; color: var(--white); font-size: 2.3rem; line-height: 1; }
.mini-label { color: #a6dfc8; font-size: .72rem; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; }
.mini-card p { margin: .55rem 0 0; color: rgba(255,255,255,.64); font-size: .78rem; line-height: 1.45; }

.section { padding: 6rem 0; }
.section-heading { display: flex; justify-content: space-between; gap: 3rem; align-items: end; margin-bottom: 2.5rem; }
.section-heading h2, .how-section h2 { margin: 0; font-size: clamp(2rem, 4vw, 3.15rem); letter-spacing: -.045em; line-height: 1.06; }
.section-heading > p { max-width: 420px; margin: 0; color: var(--muted); }
.calculators-section { background: var(--cream); }
.calculator-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }
.calculator-card { display: flex; flex-direction: column; min-height: 270px; padding: 1.55rem; border: 1px solid #e4e8e3; border-radius: var(--radius); background: var(--white); transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease; }
.calculator-card:hover { transform: translateY(-4px); border-color: #c8dbd2; box-shadow: var(--shadow); }
.card-icon { display: grid; place-items: center; width: 44px; height: 44px; margin-bottom: 1.35rem; border-radius: 12px; background: var(--mint); color: var(--green-700); font-size: 1.25rem; font-weight: 900; }
.calculator-card h3 { margin: 0 0 .65rem; font-size: 1.14rem; letter-spacing: -.02em; }
.calculator-card h3 a { color: var(--ink); text-decoration: none; }
.calculator-card p { margin: 0; color: var(--muted); font-size: .9rem; line-height: 1.65; }
.card-link { display: flex; justify-content: space-between; margin-top: auto; padding-top: 1.2rem; border-top: 1px solid #edf1ee; color: var(--green-700); font-size: .85rem; font-weight: 780; text-decoration: none; }
.how-grid { display: grid; grid-template-columns: .9fr 1.1fr; gap: 5rem; align-items: start; }
.how-grid > div > p { max-width: 440px; color: var(--muted); }
.steps-list { margin: 0; padding: 0; list-style: none; }
.steps-list li { display: flex; gap: 1.25rem; padding: 1.3rem 0; border-bottom: 1px solid var(--line); }
.steps-list li > span { color: var(--green-500); font-size: .78rem; font-weight: 850; letter-spacing: .08em; }
.steps-list strong { font-size: 1.02rem; }
.steps-list p { margin: .25rem 0 0; color: var(--muted); font-size: .9rem; }
.source-band { padding: 3.2rem 0; color: var(--white); background: var(--green-900); }
.source-band-inner, .source-band-inner > div { display: flex; align-items: center; justify-content: space-between; gap: 1.5rem; }
.source-mark { display: grid; flex: 0 0 auto; place-items: center; width: 48px; height: 48px; border: 1px solid rgba(255,255,255,.3); border-radius: 50%; font-family: Georgia, serif; font-size: 1.3rem; font-style: italic; }
.source-band h2 { margin: 0; font-size: 1.25rem; }
.source-band p { margin: .3rem 0 0; color: rgba(255,255,255,.67); font-size: .88rem; }
.btn-outline-light { padding-inline: 1.2rem; }

.page-hero { padding: 2rem 0 3rem; background: var(--mint-soft); border-bottom: 1px solid var(--line); }
.breadcrumbs { display: flex; gap: .55rem; align-items: center; margin-bottom: 2.15rem; color: var(--muted); font-size: .78rem; }
.breadcrumbs a { color: var(--green-700); text-decoration: none; }
.page-title-wrap { display: flex; gap: 1.25rem; align-items: flex-start; }
.page-icon { display: grid; flex: 0 0 auto; place-items: center; width: 52px; height: 52px; border-radius: 15px; color: var(--green-900); background: #d5eee3; font-size: 1.3rem; font-weight: 900; }
.page-title-wrap h1 { margin: 0; font-size: clamp(2.05rem, 5vw, 3.45rem); line-height: 1.05; letter-spacing: -.05em; }
.page-title-wrap p { max-width: 700px; margin: .85rem 0 0; color: var(--muted); font-size: 1.02rem; }
.calculator-layout { display: grid; grid-template-columns: minmax(0, 730px) 280px; gap: 2rem; align-items: start; padding-top: 3rem; padding-bottom: 5rem; }
.calculator-box { border: 1px solid var(--line); border-radius: var(--radius); background: var(--white); box-shadow: 0 12px 36px rgba(23,49,44,.06); overflow: hidden; }
.calculator-box-head { display: flex; justify-content: space-between; gap: 1rem; align-items: center; padding: 1.4rem 1.6rem; color: var(--white); background: var(--green-900); }
.calculator-box-head h2 { display: inline; margin: 0 0 0 .6rem; font-size: 1.15rem; }
.step-chip { display: inline-block; padding: .25rem .5rem; border-radius: 20px; color: var(--green-900); background: #a7e3cc; font-size: .67rem; font-weight: 850; text-transform: uppercase; letter-spacing: .07em; }
.secure-note { color: rgba(255,255,255,.62); font-size: .72rem; white-space: nowrap; }
.calculator-form { display: grid; gap: 1.5rem; padding: 1.7rem; }
.calculator-form fieldset { min-width: 0; margin: 0; padding: 0; border: 0; }
.calculator-form legend, .form-label { margin-bottom: .65rem; color: var(--ink); font-size: .86rem; font-weight: 780; }
.form-label { display: block; }
.form-label > span, .calculator-form fieldset > small { display: block; margin: .18rem 0 .52rem; color: var(--muted); font-size: .73rem; font-weight: 500; }
.form-label em { color: var(--muted); font-size: .72rem; font-weight: 500; font-style: normal; }
.form-control, .form-select { min-height: 48px; border-color: #ccd9d4; border-radius: 9px; color: var(--ink); }
.form-control:focus, .form-select:focus { border-color: var(--green-500); box-shadow: 0 0 0 .2rem rgba(47,157,114,.14); }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.compact-grid { align-items: end; }
.choice-grid { display: grid; grid-template-columns: 1fr 1fr; gap: .75rem; }
.choice-card { position: relative; cursor: pointer; }
.choice-card input { position: absolute; opacity: 0; pointer-events: none; }
.choice-card span { display: block; min-height: 82px; padding: 1rem 1rem 1rem 2.8rem; border: 1px solid #ccd9d4; border-radius: 11px; background: var(--white); }
.choice-card span::before { content: ""; position: absolute; left: 1rem; top: 1.22rem; width: 17px; height: 17px; border: 2px solid #9eb3aa; border-radius: 50%; }
.choice-card input:checked + span { border-color: var(--green-500); background: var(--mint-soft); box-shadow: inset 0 0 0 1px var(--green-500); }
.choice-card input:checked + span::before { border: 5px solid var(--green-700); }
.choice-card input:focus-visible + span { outline: 3px solid rgba(47,157,114,.25); outline-offset: 2px; }
.choice-card b, .choice-card small { display: block; }
.choice-card b { font-size: .85rem; }
.choice-card small { margin-top: .2rem; color: var(--muted); font-size: .7rem; }
.segmented { display: grid; grid-template-columns: 1fr 1fr; padding: 4px; border-radius: 10px; background: #eff4f1; }
.segmented label { position: relative; cursor: pointer; }
.segmented input { position: absolute; opacity: 0; }
.segmented span { display: block; padding: .55rem; border-radius: 7px; text-align: center; font-size: .82rem; }
.segmented input:checked + span { color: var(--green-900); background: var(--white); box-shadow: 0 2px 8px rgba(20,57,47,.1); font-weight: 750; }
.inline-fields { display: grid; grid-template-columns: 1fr 1.25fr; gap: .75rem; max-width: 430px; }
.check-list { display: grid; gap: .65rem; }
.check-list label { display: flex; align-items: center; gap: .8rem; padding: .85rem 1rem; border: 1px solid var(--line); border-radius: 10px; cursor: pointer; }
.check-list input { flex: 0 0 auto; }
.check-list b, .check-list small { display: block; }
.check-list b { font-size: .84rem; }
.check-list small { color: var(--muted); font-size: .7rem; }
.form-check-input:checked { background-color: var(--green-700); border-color: var(--green-700); }
.calculate-button { display: flex; justify-content: space-between; align-items: center; width: 100%; margin-top: .2rem; padding: .9rem 1.2rem; font-size: .95rem; }
.alert { margin: 1.5rem 1.7rem 0; border-radius: 10px; font-size: .86rem; }
.alert ul { margin: .45rem 0 0; }
.result-card { margin-top: 1.25rem; padding: 2rem; border-radius: var(--radius); color: var(--white); background: linear-gradient(135deg, var(--green-900), #1f6b55); box-shadow: var(--shadow); }
.result-warning { background: linear-gradient(135deg, #6e4b10, #9a6812); }
.result-kicker { color: #a9e5ce; font-size: .7rem; font-weight: 850; letter-spacing: .12em; text-transform: uppercase; }
.result-card h2 { margin: .45rem 0; font-size: 1.65rem; }
.result-summary { margin: 0 0 1.35rem; color: rgba(255,255,255,.82); font-size: 1.05rem; }
.result-metrics { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1px; margin-bottom: 1.25rem; overflow: hidden; border: 1px solid rgba(255,255,255,.17); border-radius: 12px; background: rgba(255,255,255,.17); }
.result-metrics > div { padding: .9rem 1rem; background: rgba(8,39,31,.35); }
.result-metrics span, .result-metrics strong { display: block; }
.result-metrics span { color: rgba(255,255,255,.65); font-size: .68rem; }
.result-metrics strong { margin-top: .22rem; font-size: .95rem; }
.formula-box { padding: 1rem; border-radius: 10px; color: var(--ink); background: rgba(255,255,255,.93); }
.formula-box strong { font-size: .78rem; }
.formula-box p { margin: .25rem 0 0; font-size: .85rem; }
.result-detail { margin: 1rem 0; color: rgba(255,255,255,.72); font-size: .82rem; }
.print-button { color: var(--green-900); font-weight: 750; }
.sidebar { position: sticky; top: 1rem; display: grid; gap: 1rem; }
.sidebar-card { padding: 1.25rem; border: 1px solid var(--line); border-radius: 14px; background: var(--mint-soft); }
.sidebar-card h2 { margin: 0 0 .5rem; font-size: .92rem; }
.sidebar-card p { margin: 0; color: var(--muted); font-size: .78rem; }
.sidebar-icon { display: grid; place-items: center; width: 28px; height: 28px; margin-bottom: .75rem; border-radius: 50%; color: var(--white); background: var(--green-500); font-size: .7rem; font-weight: 900; }
.related-link { display: grid; grid-template-columns: 27px 1fr auto; gap: .55rem; align-items: center; padding: .7rem 0; border-top: 1px solid var(--line); color: var(--ink); text-decoration: none; }
.related-link span { display: grid; place-items: center; width: 27px; height: 27px; border-radius: 8px; color: var(--green-700); background: var(--mint); font-size: .75rem; font-weight: 850; }
.related-link b { font-size: .75rem; }
.related-link i { color: var(--green-500); font-style: normal; }
.ad-slot { display: block; max-width: 1080px; margin: 1.5rem auto; overflow: hidden; text-align: center; }
.ad-slot-in-content { margin: 2rem 0; }
.ad-slot iframe, .ad-slot img { max-width: 100%; }
.content-section { display: grid; grid-template-columns: 34px 1fr; gap: 1.15rem; padding: 2.3rem 0; border-bottom: 1px solid var(--line); }
.section-number { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; color: var(--green-700); background: var(--mint); font-size: .65rem; font-weight: 850; }
.content-section h2 { margin: 0 0 1rem; font-size: 1.4rem; letter-spacing: -.025em; }
.content-section p, .plain-steps { color: var(--muted); font-size: .92rem; }
.plain-steps { margin: 0; padding-left: 1.15rem; }
.plain-steps li + li { margin-top: .55rem; }
.example-box { padding: 1.1rem 1.25rem; border-left: 3px solid var(--gold); border-radius: 0 10px 10px 0; background: var(--cream); }
.example-box p { margin: 0; color: var(--ink); }
.disclaimer { display: flex; gap: 1rem; margin-top: 1.2rem; padding: 1rem; border-radius: 10px; background: var(--mint-soft); }
.disclaimer strong { flex: 0 0 auto; color: var(--green-700); font-size: .78rem; }
.disclaimer p { margin: 0; font-size: .78rem; }
.faq-section details { border-top: 1px solid var(--line); }
.faq-section details:last-child { border-bottom: 1px solid var(--line); }
.faq-section summary { cursor: pointer; padding: 1rem 2rem 1rem 0; font-size: .9rem; font-weight: 750; }
.faq-section details p { margin: -.25rem 0 1rem; }
.sources-section ul { margin: .8rem 0 0; padding-left: 1.1rem; }
.sources-section li + li { margin-top: .45rem; }
.sources-section a { font-size: .9rem; }

.content-page, .empty-state { min-height: 55vh; padding: 5rem 0; background: var(--cream); }
.narrow-content { max-width: 760px; }
.content-page h1, .empty-state h1 { margin: 0 0 1.3rem; font-size: clamp(2.3rem, 5vw, 4rem); letter-spacing: -.055em; line-height: 1.05; }
.content-page .lead { color: var(--muted); }
.content-page h2 { margin-top: 2rem; font-size: 1.25rem; }

.site-footer { padding: 4rem 0 1.5rem; color: rgba(255,255,255,.68); background: #0a2922; }
.footer-grid { display: grid; grid-template-columns: 1.5fr 1fr 1fr; gap: 4rem; }
.brand-footer { color: var(--white); }
.footer-grid > div > p { max-width: 350px; margin-top: 1rem; font-size: .82rem; }
.footer-grid h2 { color: var(--white); font-size: .76rem; letter-spacing: .08em; text-transform: uppercase; }
.footer-grid > div > a:not(.brand) { display: block; margin-top: .55rem; color: rgba(255,255,255,.66); font-size: .8rem; text-decoration: none; }
.footer-grid > div > a:hover { color: var(--white); }
.footer-bottom { margin-top: 3rem; padding-top: 1.2rem; border-top: 1px solid rgba(255,255,255,.1); }
.footer-bottom p { margin: 0; font-size: .7rem; }

.admin-body { min-height: 100vh; background: #f2f6f4; }
.admin-shell { max-width: 1100px; margin: 0 auto; padding: 0 1rem; }
.admin-header { color: var(--white); background: var(--green-950); }
.admin-header .admin-shell { min-height: 68px; display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.admin-nav { display: flex; flex-wrap: wrap; align-items: center; gap: .65rem 1rem; }
.admin-nav a, .admin-nav button { color: rgba(255,255,255,.75); background: none; border: 0; text-decoration: none; font-size: .82rem; }
.admin-main { padding: 2.5rem 1rem 4rem; }
.admin-title { display: flex; align-items: end; justify-content: space-between; gap: 1rem; margin-bottom: 1.5rem; }
.admin-title h1 { margin: 0; font-size: 2rem; letter-spacing: -.04em; }
.admin-card { padding: 1.4rem; border: 1px solid var(--line); border-radius: 14px; background: var(--white); box-shadow: 0 10px 28px rgba(20,58,48,.05); }
.admin-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }
.stat-number { display: block; font-size: 2rem; }
.admin-table { margin: 0; font-size: .82rem; }
.admin-form { display: grid; gap: 1rem; }
.ad-admin-grid { display: grid; gap: 1rem; }
.ad-admin-card { display: grid; grid-template-columns: minmax(180px, .35fr) minmax(0, 1fr); gap: 1.5rem; }
.ad-admin-meta h2 { margin: 0 0 .35rem; font-size: 1.1rem; }
.ad-admin-meta code { display: inline-block; margin-bottom: .7rem; color: var(--green-700); }
.ad-code-input { min-height: 210px; font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: .78rem; line-height: 1.45; white-space: pre; }
.ad-status { display: inline-flex; align-items: center; gap: .35rem; margin-top: .8rem; font-size: .75rem; font-weight: 750; }
.admin-login { display: grid; place-items: center; min-height: 100vh; padding: 1rem; background: var(--green-950); }
.login-card { width: min(100%, 420px); padding: 2rem; border-radius: 18px; background: var(--white); }
.login-card h1 { margin-top: 1.2rem; font-size: 1.65rem; }

@media (max-width: 900px) {
    .hero-grid { grid-template-columns: 1fr; gap: 3rem; min-height: 0; }
    .hero-panel { max-width: 500px; }
    .calculator-grid { grid-template-columns: repeat(2, 1fr); }
    .calculator-layout { grid-template-columns: 1fr; }
    .sidebar { position: static; grid-template-columns: 1fr 1fr; }
    .footer-grid { gap: 2rem; }
}

@media (max-width: 680px) {
    .site-header .site-shell { min-height: 68px; }
    .main-nav { max-width: 48%; overflow-x: auto; gap: 1rem; white-space: nowrap; }
    .main-nav a { font-size: .75rem; }
    .main-nav a:nth-child(n+2) { display: none; }
    .brand small { display: none; }
    .hero-grid { padding-top: 4rem; padding-bottom: 4rem; }
    .hero h1 { font-size: 3rem; }
    .hero-copy > p { font-size: 1rem; }
    .mini-card-main { margin-left: 0; }
    .section { padding: 4.2rem 0; }
    .section-heading, .source-band-inner { display: block; }
    .section-heading > p { margin-top: 1rem; }
    .calculator-grid { grid-template-columns: 1fr; }
    .calculator-card { min-height: 235px; }
    .how-grid { grid-template-columns: 1fr; gap: 2rem; }
    .source-band-inner > .btn { margin-top: 1.2rem; }
    .page-title-wrap { display: block; }
    .page-icon { margin-bottom: 1rem; }
    .calculator-layout { padding-top: 1.2rem; }
    .calculator-box-head { align-items: flex-start; }
    .secure-note { display: none; }
    .calculator-form { padding: 1.25rem; }
    .form-grid, .choice-grid, .compact-grid, .result-metrics, .sidebar { grid-template-columns: 1fr; }
    .choice-card span { min-height: 72px; }
    .result-card { padding: 1.35rem; }
    .content-section { grid-template-columns: 1fr; gap: .65rem; }
    .footer-grid { grid-template-columns: 1fr; }
    .admin-header .admin-shell, .admin-title { align-items: flex-start; flex-direction: column; padding-top: .8rem; padding-bottom: .8rem; }
    .admin-grid { grid-template-columns: 1fr; }
    .ad-admin-card { grid-template-columns: 1fr; }
}

@media print {
    .site-header, .site-footer, .page-hero, .calculator-box, .sidebar, .content-section, .ad-slot, .print-button { display: none !important; }
    .calculator-layout { display: block; padding: 0; }
    .result-card { color: #000; background: #fff; box-shadow: none; border: 1px solid #aaa; }
    .result-metrics > div, .formula-box { color: #000; background: #fff; border: 1px solid #ddd; }
    .result-card * { color: #000 !important; }
}
