:root {
  --bg: #f5f1ea;
  --bg-card: #fdfbf6;
  --ink: #1c2e2a;
  --ink-soft: #4a5d57;
  --accent: #2d5d50;
  --accent-warm: #b8552e;
  --line: #d9d1c2;
  --highlight: #ede5d3;
  --shadow: 0 1px 2px rgba(28,46,42,0.04), 0 8px 24px rgba(28,46,42,0.06);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Public Sans', -apple-system, system-ui, sans-serif;
  font-size: 17px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

.wrap { max-width: 720px; margin: 0 auto; padding: 32px 20px 80px; }
.wrap-wide { max-width: 960px; margin: 0 auto; padding: 32px 20px 80px; }

/* Header */
header.site-header { padding: 8px 0 32px; border-bottom: 1px solid var(--line); margin-bottom: 40px; }
.brand-link { text-decoration: none; display: inline-block; }
.brand { font-family: 'Fraunces', Georgia, serif; font-size: 20px; font-weight: 700; letter-spacing: -0.01em; color: var(--accent); }
.brand-sub { font-size: 13px; color: var(--ink-soft); margin-top: 2px; }
nav.site-nav { margin-top: 16px; display: flex; gap: 20px; flex-wrap: wrap; }
nav.site-nav a { color: var(--ink-soft); text-decoration: none; font-size: 14px; font-weight: 500; }
nav.site-nav a:hover { color: var(--accent); }

/* Typography */
h1 { font-family: 'Fraunces', Georgia, serif; font-size: clamp(32px, 6vw, 44px); font-weight: 600; line-height: 1.15; letter-spacing: -0.02em; margin-bottom: 16px; color: var(--ink); }
h2 { font-family: 'Fraunces', Georgia, serif; font-size: 26px; font-weight: 600; letter-spacing: -0.01em; margin: 56px 0 16px; color: var(--ink); }
h3 { font-family: 'Fraunces', Georgia, serif; font-size: 19px; font-weight: 600; margin: 24px 0 8px; color: var(--ink); }
p { margin-bottom: 16px; color: var(--ink-soft); }
a { color: var(--accent); }
ul, ol { margin: 0 0 16px 20px; color: var(--ink-soft); }
li { margin-bottom: 6px; }

.intro { font-size: 18px; color: var(--ink-soft); margin-bottom: 8px; max-width: 60ch; }
.year-tag { display: inline-block; font-size: 13px; padding: 4px 10px; background: var(--highlight); color: var(--accent); border-radius: 999px; font-weight: 500; margin-bottom: 20px; }

/* Calculator */
.calc { background: var(--bg-card); border: 1px solid var(--line); border-radius: 8px; padding: 28px; margin-top: 32px; box-shadow: var(--shadow); }
@media (max-width: 480px) { .calc { padding: 20px; } }

.field { margin-bottom: 20px; }
label { display: block; font-size: 14px; font-weight: 600; color: var(--ink); margin-bottom: 6px; letter-spacing: 0.01em; }
label .hint { font-weight: 400; color: var(--ink-soft); font-size: 13px; }

select, input[type="number"], input[type="text"], input[type="email"], textarea {
  width: 100%; padding: 12px 14px; font-family: inherit; font-size: 16px;
  border: 1px solid var(--line); border-radius: 6px; background: #fff; color: var(--ink);
  transition: border-color 0.15s, box-shadow 0.15s;
  -webkit-appearance: none; appearance: none;
}
select {
  background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3e%3cpath fill='%234a5d57' d='M6 8L0 0h12z'/%3e%3c/svg%3e");
  background-repeat: no-repeat; background-position: right 14px center; padding-right: 36px;
}
select:focus, input:focus, textarea:focus {
  outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(45, 93, 80, 0.15);
}

/* Results */
.results { margin-top: 28px; padding-top: 28px; border-top: 1px solid var(--line); }
.result-row { display: flex; justify-content: space-between; align-items: baseline; padding: 10px 0; border-bottom: 1px dashed var(--line); }
.result-row:last-child { border-bottom: none; }
.result-label { font-size: 15px; color: var(--ink-soft); }
.result-value { font-family: 'Fraunces', serif; font-size: 22px; font-weight: 600; color: var(--ink); }
.result-headline { background: var(--highlight); padding: 18px 20px; border-radius: 6px; margin-bottom: 16px; }
.result-headline .result-label { font-size: 13px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--accent); margin-bottom: 4px; }
.result-headline .result-value { font-size: 32px; color: var(--accent); display: block; }

.status { margin-top: 16px; padding: 14px 16px; border-radius: 6px; font-size: 15px; border-left: 3px solid var(--accent); background: #fff; }
.status strong { color: var(--ink); }

.disclaimer { margin-top: 32px; padding: 16px; background: rgba(184, 85, 46, 0.06); border: 1px solid rgba(184, 85, 46, 0.2); border-radius: 6px; font-size: 14px; color: var(--ink-soft); }
.disclaimer strong { color: var(--accent-warm); }

/* FAQ */
details { border-bottom: 1px solid var(--line); padding: 16px 0; }
details summary { cursor: pointer; font-weight: 600; color: var(--ink); font-size: 17px; list-style: none; display: flex; justify-content: space-between; align-items: center; }
details summary::-webkit-details-marker { display: none; }
details summary::after { content: '+'; font-family: 'Fraunces', serif; font-size: 24px; font-weight: 400; color: var(--accent); transition: transform 0.2s; }
details[open] summary::after { transform: rotate(45deg); }
details p { margin-top: 12px; }

/* Tool grid (homepage) */
.tool-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; margin-top: 32px; }
.tool-card { background: var(--bg-card); border: 1px solid var(--line); border-radius: 8px; padding: 24px; text-decoration: none; color: var(--ink); display: block; transition: transform 0.15s, box-shadow 0.15s; }
.tool-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.tool-card.coming { opacity: 0.55; pointer-events: none; }
.tool-card h3 { margin-top: 0; margin-bottom: 8px; }
.tool-card p { font-size: 14px; margin-bottom: 0; }
.tool-tag { display: inline-block; font-size: 11px; padding: 2px 8px; background: var(--highlight); color: var(--accent); border-radius: 999px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 12px; }

/* Related tools block */
.related { margin-top: 56px; padding: 24px; background: var(--bg-card); border-radius: 8px; border: 1px solid var(--line); }
.related h3 { margin-top: 0; }
.related ul { list-style: none; padding: 0; margin: 0; }
.related li { padding: 8px 0; border-bottom: 1px solid var(--line); }
.related li:last-child { border-bottom: none; }
.related a { color: var(--accent); text-decoration: none; font-weight: 500; }
.related a:hover { text-decoration: underline; }

/* Footer */
footer.site-footer { margin-top: 80px; padding-top: 32px; border-top: 1px solid var(--line); font-size: 13px; color: var(--ink-soft); }
footer.site-footer a { color: var(--accent); text-decoration: none; }
footer.site-footer a:hover { text-decoration: underline; }
.footer-links { margin-top: 8px; }
.footer-links a { margin-right: 16px; }

/* AdSense placeholders */
.ad-slot { margin: 32px 0; min-height: 90px; display: flex; align-items: center; justify-content: center; background: rgba(0,0,0,0.02); border: 1px dashed var(--line); border-radius: 6px; font-size: 12px; color: var(--ink-soft); text-transform: uppercase; letter-spacing: 0.08em; }

/* Cookie banner */
.cookie-banner {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 1000;
  background: var(--ink); color: #fdfbf6; padding: 20px;
  display: none; box-shadow: 0 -4px 24px rgba(0,0,0,0.15);
}
.cookie-banner.show { display: block; }
.cookie-banner-inner { max-width: 960px; margin: 0 auto; display: flex; gap: 20px; align-items: center; flex-wrap: wrap; }
.cookie-banner p { color: #fdfbf6; margin: 0; font-size: 14px; flex: 1; min-width: 240px; }
.cookie-banner p a { color: #fdfbf6; text-decoration: underline; }
.cookie-actions { display: flex; gap: 8px; }
.cookie-btn {
  padding: 10px 18px; border: none; border-radius: 6px; font-family: inherit; font-size: 14px;
  font-weight: 600; cursor: pointer; white-space: nowrap;
}
.cookie-btn.accept { background: var(--accent); color: #fff; }
.cookie-btn.reject { background: transparent; color: #fdfbf6; border: 1px solid #fdfbf6; }
.cookie-btn:hover { opacity: 0.9; }

/* Buttons */
.btn { display: inline-block; padding: 12px 22px; background: var(--accent); color: #fff; text-decoration: none; border-radius: 6px; font-weight: 600; border: none; cursor: pointer; font-family: inherit; font-size: 16px; }
.btn:hover { background: #234a40; }

.last-updated { font-size: 13px; color: var(--ink-soft); font-style: italic; margin-top: 24px; }

/* Popular tools footer block (sitewide) */
.popular-tools-footer { margin-bottom: 32px; padding: 20px 24px; background: var(--bg-card); border: 1px solid var(--line); border-radius: 8px; }
.popular-tools-footer h4 { font-family: 'Fraunces', Georgia, serif; font-size: 16px; font-weight: 600; margin: 0 0 12px; color: var(--ink); }
.popular-tools-footer ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 10px 24px; }
.popular-tools-footer li { margin: 0; font-size: 14px; }
.popular-tools-footer a { color: var(--accent); text-decoration: none; font-weight: 500; }
.popular-tools-footer a:hover { text-decoration: underline; }
.popular-tools-footer .pt-coming { color: var(--ink-soft); font-style: italic; }

/* Why trust this calculator block */
.trust-block { margin: 40px 0 16px; padding: 18px 20px; background: var(--highlight); border-left: 3px solid var(--accent); border-radius: 6px; font-size: 15px; color: var(--ink-soft); }
.trust-block strong { display: block; font-family: 'Fraunces', Georgia, serif; color: var(--ink); font-size: 17px; margin-bottom: 6px; font-weight: 600; }
.trust-block p { color: var(--ink-soft); margin: 0 0 8px; }
.trust-block p:last-child { margin-bottom: 0; }

/* Reviewed-by panel */
.reviewed-by { margin-top: 32px; padding: 16px 20px; background: var(--bg-card); border: 1px solid var(--line); border-radius: 6px; font-size: 14px; color: var(--ink-soft); }
.reviewed-by .reviewer-name { color: var(--ink); font-weight: 600; }
.reviewed-by .review-dates { margin-top: 4px; font-size: 13px; color: var(--ink-soft); }

/* Worked example callout */
.worked-example { margin: 24px 0; padding: 20px 22px; background: #fff; border: 1px solid var(--line); border-left: 3px solid var(--accent-warm); border-radius: 6px; }
.worked-example h4 { font-family: 'Fraunces', Georgia, serif; font-size: 17px; font-weight: 600; color: var(--ink); margin: 0 0 10px; }
.worked-example p { margin-bottom: 10px; }
.worked-example p:last-child { margin-bottom: 0; }
.worked-example .we-result { margin-top: 12px; padding: 10px 14px; background: var(--highlight); border-radius: 4px; font-size: 14px; color: var(--ink); }

/* Methodology / how-to / what's-not-included sections */
.methodology { margin-top: 24px; padding: 20px 22px; background: var(--bg-card); border: 1px solid var(--line); border-radius: 6px; }
.methodology h3 { margin-top: 0; }
.methodology ol, .methodology ul { padding-left: 22px; }

/* Inline source citation links (subtle, lighter colour) */
.body-cite { color: var(--accent); text-decoration: underline; text-decoration-color: rgba(45,93,80,0.35); text-underline-offset: 2px; }
.body-cite:hover { text-decoration-color: var(--accent); }
