:root {
  --green: #1f7a4d;
  --green-dark: #155c39;
  --green-soft: #e8f4ee;
  --ink: #17211b;
  --muted: #5b6a61;
  --line: #dfe7e2;
  --bg: #f7faf8;
  --card: #ffffff;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(16, 40, 28, .06), 0 6px 20px rgba(16, 40, 28, .06);
}
@media (prefers-color-scheme: dark) {
  :root {
    --green: #3fb67a;
    --green-dark: #5ccb92;
    --green-soft: #183326;
    --ink: #e8efe9;
    --muted: #a3b3a9;
    --line: #2a3a31;
    --bg: #0f1612;
    --card: #16201a;
    --shadow: none;
  }
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 16px/1.6 system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}
a { color: var(--green); }
h1, h2, h3 { line-height: 1.25; }
.wrap { max-width: 1040px; margin: 0 auto; padding: 0 16px; }
.wrap.narrow { max-width: 760px; }

/* header */
.site-header { background: var(--card); border-bottom: 1px solid var(--line); }
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 64px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); }
.brand span { display: flex; flex-direction: column; line-height: 1.15; }
.brand small { color: var(--muted); font-size: 12px; }
.logo-mark { width: 34px; height: 34px; color: var(--green); flex: none; }
.brand.small .logo-mark { width: 26px; height: 26px; }
.site-header nav { display: flex; gap: 18px; }
.site-header nav a { color: var(--ink); text-decoration: none; font-weight: 500; font-size: 15px; }
.site-header nav a:hover { color: var(--green); }
@media (max-width: 560px) { .brand small { display: none; } .site-header nav { gap: 12px; } }

/* hero + home */
.hero { background: linear-gradient(180deg, var(--green-soft), var(--bg)); padding: 56px 0 36px; }
.hero h1 { font-size: clamp(30px, 5vw, 46px); margin: 0 0 12px; max-width: 760px; }
.lede { font-size: 18px; color: var(--muted); max-width: 720px; margin: 0 0 18px; }
.pills { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.pills li { background: var(--card); border: 1px solid var(--line); border-radius: 999px; padding: 4px 12px; font-size: 14px; font-weight: 500; }
.section-title { margin: 36px 0 16px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; }
.card { display: flex; flex-direction: column; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; text-decoration: none; color: var(--ink); box-shadow: var(--shadow); transition: transform .12s, border-color .12s; }
.card:hover { transform: translateY(-2px); border-color: var(--green); }
.card .icon { font-size: 28px; }
.card h3 { margin: 8px 0 4px; font-size: 18px; }
.card p { margin: 0 0 12px; color: var(--muted); font-size: 14px; flex: 1; }
.card .go { color: var(--green); font-weight: 600; font-size: 14px; }
.why { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 18px; margin: 44px 0; }
.why h3 { margin: 0 0 6px; font-size: 17px; }
.why p { margin: 0; color: var(--muted); font-size: 15px; }

/* calculator page */
.crumbs { font-size: 14px; color: var(--muted); margin: 20px 0 4px; }
.crumbs a { color: var(--muted); }
.crumbs span { margin: 0 4px; }
h1 { font-size: clamp(28px, 4.5vw, 38px); margin: 6px 0 10px; }
.h1-icon { margin-right: 10px; }
.calc { display: grid; grid-template-columns: 1.25fr 1fr; gap: 16px; margin: 20px 0 28px; align-items: start; }
@media (max-width: 800px) { .calc { grid-template-columns: 1fr; } .result { position: static; } }
@media (max-width: 560px) { .fields { grid-template-columns: 1fr 1fr; gap: 12px; } .field input, .field select { font-size: 16px; } .calc-form, .result { padding: 16px; } }
.calc-form, .result { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); }
.fields { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 14px; }
.field label { display: block; font-size: 14px; font-weight: 600; margin-bottom: 5px; }
.input-wrap { position: relative; display: flex; align-items: center; }
.field input, .field select {
  width: 100%; font: inherit; font-size: 17px; color: var(--ink); background: var(--bg);
  border: 1.5px solid var(--line); border-radius: 10px; padding: 10px 12px; min-height: 46px;
}
.input-wrap input { padding-right: 52px; }
.input-wrap.has-pre input { padding-left: 26px; padding-right: 12px; }
.affix { position: absolute; right: 12px; color: var(--muted); font-size: 14px; pointer-events: none; }
.has-pre .affix { left: 11px; right: auto; }
.field input:focus, .field select:focus { outline: none; border-color: var(--green); box-shadow: 0 0 0 3px var(--green-soft); }
.advanced { margin-top: 16px; border-top: 1px solid var(--line); padding-top: 12px; }
.advanced summary { cursor: pointer; font-weight: 600; margin-bottom: 12px; }
.advanced summary small { font-weight: 400; color: var(--muted); }

.result { background: var(--green); color: #fff; border-color: var(--green); position: sticky; top: 12px; }
@media (prefers-color-scheme: dark) { .result { background: #14432c; border-color: #1f6b45; } }
.primary { display: flex; flex-direction: column; padding-bottom: 12px; border-bottom: 1px solid rgba(255,255,255,.25); margin-bottom: 8px; }
.primary .big { font-size: 46px; font-weight: 800; line-height: 1.05; letter-spacing: -.5px; }
.primary .label { font-size: 16px; opacity: .9; }
.rows .row { display: flex; justify-content: space-between; gap: 12px; padding: 7px 0; border-bottom: 1px solid rgba(255,255,255,.14); font-size: 15px; }
.rows .row span { opacity: .9; }
.rows .row strong { text-align: right; }
.note { font-size: 13.5px; opacity: .92; margin: 12px 0; }
.btn-copy { font: inherit; font-size: 14px; font-weight: 600; background: rgba(255,255,255,.16); color: #fff; border: 1px solid rgba(255,255,255,.35); border-radius: 999px; padding: 7px 14px; cursor: pointer; }
.btn-copy:hover { background: rgba(255,255,255,.26); }
.tip-jar { margin: 14px 0 0; padding-top: 12px; border-top: 1px solid rgba(255,255,255,.2); font-size: 14px; }
.tip-jar a { white-space: nowrap; color: #fff; font-weight: 700; text-underline-offset: 3px; }

.shop { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; margin-bottom: 28px; }
.shop h2 { margin: 0 0 10px; font-size: 20px; }
.shop-list { list-style: none; margin: 0; padding: 0; }
.shop-list li { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; padding: 9px 0; border-bottom: 1px solid var(--line); }
.shop-list li:last-child { border-bottom: 0; }
.shop-btns { display: flex; gap: 8px; flex-wrap: wrap; }
.btn-shop { font-size: 14px; font-weight: 700; text-decoration: none; border-radius: 8px; padding: 7px 14px; min-width: 112px; text-align: center; transition: filter .12s, transform .12s; }
.btn-shop:hover { filter: brightness(1.08); transform: translateY(-1px); }
/* store brand colors */
.btn-hd { background: #f96302; color: #fff; }
.btn-lowes { background: #004990; color: #fff; }
.btn-amazon { background: #ff9900; color: #131921; }
@media (prefers-color-scheme: dark) { .btn-lowes { background: #0a5cb0; } }
.disclosure { font-size: 12.5px; color: var(--muted); margin: 10px 0 0; }

.content { max-width: 760px; }
.content h2 { margin-top: 32px; font-size: 23px; }
.content ol { padding-left: 22px; }
.content li { margin-bottom: 6px; }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; background: var(--card); }
table { width: 100%; border-collapse: collapse; font-size: 15px; }
th, td { padding: 10px 14px; text-align: left; border-bottom: 1px solid var(--line); white-space: nowrap; }
thead th { background: var(--green-soft); font-size: 13.5px; }
tbody tr:last-child th, tbody tr:last-child td { border-bottom: 0; }
tbody th { font-weight: 600; }
.faq details { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 12px 16px; margin-bottom: 10px; }
.faq summary { cursor: pointer; font-weight: 600; }
.faq p { margin: 8px 0 0; color: var(--muted); }
.fine { font-size: 13.5px; color: var(--muted); }

.related { margin: 40px 0 48px; }
.mini-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 10px; }
.mini-card { display: flex; gap: 12px; align-items: flex-start; background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; text-decoration: none; color: var(--ink); }
.mini-card:hover { border-color: var(--green); }
.mini-card .icon { font-size: 22px; }
.mini-card span { display: flex; flex-direction: column; }
.mini-card small { color: var(--muted); font-size: 13px; line-height: 1.4; }

/* footer */
.site-footer { background: var(--card); border-top: 1px solid var(--line); padding: 28px 0 22px; margin-top: 20px; font-size: 14px; }
.footer-top { display: flex; justify-content: space-between; gap: 24px; flex-wrap: wrap; }
.footer-top p { color: var(--muted); max-width: 340px; margin: 8px 0 0; }
.footer-links { display: grid; grid-template-columns: repeat(2, minmax(150px, auto)); gap: 4px 24px; }
.footer-links a { color: var(--ink); text-decoration: none; }
.footer-links a:hover { color: var(--green); }
.footer-bottom { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; border-top: 1px solid var(--line); margin-top: 20px; padding-top: 16px; color: var(--muted); }
.footer-bottom a { color: var(--muted); }
.donate { background: var(--green); color: #fff !important; text-decoration: none; padding: 7px 14px; border-radius: 999px; font-weight: 600; }

/* calculator icons (SVG in a soft tile) */
.card .icon, .mini-card .icon, .h1-icon {
  display: inline-flex; align-items: center; justify-content: center; flex: none;
  background: var(--green-soft); color: var(--green); border-radius: 12px;
}
.card .icon { width: 46px; height: 46px; font-size: 0; }
.card .icon .ico { width: 26px; height: 26px; }
.mini-card .icon { width: 38px; height: 38px; border-radius: 10px; font-size: 0; }
.mini-card .icon .ico { width: 21px; height: 21px; }
.h1-icon { width: 1.25em; height: 1.25em; vertical-align: -0.28em; margin-right: 12px; border-radius: 12px; }
.h1-icon .ico { width: 62%; height: 62%; }
.card:hover .icon { background: var(--green); color: #fff; }
