:root {
  --bg: #f6f7f4;
  --surface: #ffffff;
  --ink: #17211b;
  --muted: #667168;
  --line: #d9ded7;
  --green: #1d7f58;
  --green-dark: #105d41;
  --blue: #245a8d;
  --amber: #f0b84b;
  --shadow: 0 18px 45px rgba(23, 33, 27, 0.1);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.5;
}

a {
  color: inherit;
  text-decoration: none;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 18px clamp(20px, 5vw, 72px);
  background: rgba(246, 247, 244, 0.92);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(12px);
}

.brand {
  font-weight: 800;
  font-size: 20px;
}

.nav {
  display: flex;
  gap: 18px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 650;
}

.nav a:hover {
  color: var(--ink);
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(280px, 0.6fr);
  gap: 32px;
  align-items: stretch;
  padding: clamp(48px, 8vw, 96px) clamp(20px, 5vw, 72px) 40px;
}

.hero-copy,
.section {
  max-width: 1180px;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--green-dark);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  max-width: 900px;
  margin-bottom: 22px;
  font-size: clamp(42px, 7vw, 76px);
  line-height: 0.98;
}

h2 {
  margin-bottom: 12px;
  font-size: clamp(28px, 4vw, 44px);
  line-height: 1.08;
}

h3 {
  margin-bottom: 10px;
  font-size: 19px;
}

.lead {
  max-width: 720px;
  color: var(--muted);
  font-size: 20px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 28px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-weight: 800;
}

.button.primary {
  background: var(--green);
  color: #fff;
  border-color: var(--green);
}

.button.secondary {
  background: var(--surface);
}

.hero-panel {
  display: grid;
  gap: 14px;
  align-self: center;
  padding: 22px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.hero-panel div {
  padding: 16px;
  background: #f8faf8;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.metric {
  display: block;
  font-size: 34px;
  font-weight: 850;
}

.label,
.section-heading p,
.tool-card p,
.split p,
.callout p,
.site-footer {
  color: var(--muted);
}

.section {
  margin: 0 auto;
  padding: 48px clamp(20px, 5vw, 72px);
}

.section-heading {
  max-width: 760px;
  margin-bottom: 22px;
}

.calculator {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 0.75fr);
  gap: 20px;
}

.calc-form,
.results,
.tool-card,
.callout {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 10px 28px rgba(23, 33, 27, 0.06);
}

.calc-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  padding: 22px;
}

label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 750;
}

input,
textarea,
select {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  color: var(--ink);
  background: #fbfcfb;
  border: 1px solid var(--line);
  border-radius: 8px;
  font: inherit;
}

textarea {
  min-height: 104px;
  resize: vertical;
}

input:focus,
textarea:focus,
select:focus {
  outline: 3px solid rgba(29, 127, 88, 0.18);
  border-color: var(--green);
}

.results {
  display: grid;
  gap: 12px;
  padding: 22px;
}

.results div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 54px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}

.results div:last-child {
  border-bottom: 0;
}

.results span {
  color: var(--muted);
  font-weight: 700;
}

.results strong {
  font-size: 24px;
}

.tool-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.tool-card {
  padding: 20px;
}

.tool-card a {
  display: inline-flex;
  margin-top: 8px;
  color: var(--green-dark);
  font-weight: 800;
}

.tool-card::before {
  display: block;
  width: 36px;
  height: 4px;
  margin-bottom: 18px;
  background: linear-gradient(90deg, var(--green), var(--blue), var(--amber));
  border-radius: 999px;
  content: "";
}

.split {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(280px, 1fr);
  gap: 28px;
  align-items: start;
}

.checklist {
  display: grid;
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.checklist li {
  padding: 14px 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  font-weight: 700;
}

.callout {
  overflow: hidden;
  margin-bottom: 40px;
  padding: 26px;
}

.article-body {
  max-width: 920px;
}

.article-body p {
  color: var(--muted);
  font-size: 17px;
}

.result-note {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  font-weight: 650;
}

.insight-card {
  display: grid;
  align-items: start;
  justify-content: stretch;
  gap: 6px;
  margin-top: 4px;
  padding: 16px;
  background: #f4f8f6;
  border: 1px solid rgba(29, 127, 88, 0.22);
  border-radius: 8px;
}

.insight-card[data-tone="warn"] {
  background: #fff9ea;
  border-color: rgba(240, 184, 75, 0.55);
}

.insight-card[data-tone="bad"] {
  background: #fff1ee;
  border-color: rgba(190, 72, 52, 0.28);
}

.insight-card .insight-label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.insight-card strong {
  font-size: 19px;
}

.insight-card p {
  margin: 0;
  color: var(--muted);
  font-weight: 650;
}

.tool-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}

.mini-button {
  min-height: 40px;
  padding: 0 14px;
  color: #fff;
  background: var(--blue);
  border: 0;
  border-radius: 8px;
  cursor: pointer;
  font: inherit;
  font-weight: 800;
}

.mini-button:hover {
  background: #17466f;
}

.saved-scenarios {
  margin-top: 14px;
  padding: 18px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.saved-scenarios h3 {
  margin-bottom: 12px;
  font-size: 16px;
}

.saved-scenarios ul {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.saved-scenarios li {
  display: grid;
  gap: 3px;
  padding: 12px;
  background: #f8faf8;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
}

.saved-scenarios li strong {
  color: var(--ink);
}

.generator-meta {
  margin-bottom: 14px;
  color: var(--green-dark);
  font-weight: 800;
}

.output-list {
  display: grid;
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.output-list li {
  padding: 14px 16px;
  background: #f8faf8;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-weight: 750;
}

.formula-box {
  margin-top: 18px;
  padding: 18px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.guide-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 26px;
}

.guide-grid a {
  display: flex;
  align-items: center;
  min-height: 58px;
  padding: 14px 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  font-weight: 800;
  box-shadow: 0 8px 18px rgba(23, 33, 27, 0.04);
}

.guide-grid a:hover {
  border-color: rgba(29, 127, 88, 0.45);
  color: var(--green-dark);
}

pre {
  overflow-x: auto;
  margin: 18px 0 0;
  padding: 16px;
  background: #17211b;
  color: #eef6ef;
  border-radius: 8px;
}

.site-footer {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  padding: 28px clamp(20px, 5vw, 72px);
  border-top: 1px solid var(--line);
}

.site-footer div {
  display: flex;
  gap: 14px;
}

@media (max-width: 820px) {
  .site-header,
  .site-footer {
    align-items: flex-start;
    flex-direction: column;
  }

  .nav {
    flex-wrap: wrap;
  }

  .hero,
  .calculator,
  .split {
    grid-template-columns: 1fr;
  }

  .tool-grid,
  .calc-form,
  .guide-grid {
    grid-template-columns: 1fr;
  }
}
