:root {
  --bg: #f7faf7;
  --surface: #ffffff;
  --surface-2: #eef5ef;
  --ink: #162116;
  --muted: #5d6b5f;
  --line: #d9e3db;
  --brand: #2f6f4f;
  --brand-dark: #255a40;
  --accent: #f7c948;
  --good: #15803d;
  --warn: #b7791f;
  --bad: #b91c1c;
  --shadow: 0 18px 45px rgba(22, 33, 22, 0.08);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

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;
}

.container {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(247, 250, 247, 0.94);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(14px);
}

.header-inner {
  min-height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  white-space: nowrap;
}

.brand-mark {
  width: 42px;
  height: 42px;
  display: inline-grid;
  place-items: center;
  flex-shrink: 0;
  border-radius: 50%;
  overflow: hidden;
  background: transparent;
  box-shadow: 0 8px 18px rgba(25, 50, 32, 0.18);
}

.brand-mark svg {
  width: 100%;
  height: 100%;
  display: block;
}

.nav {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.nav-item,
.nav a,
.nav-tools-btn {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 13px;
  border-radius: 8px;
  border: 0;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.nav-item.active,
.nav a:hover,
.nav-tools.open .nav-tools-btn,
.nav-tools-btn:hover {
  background: var(--surface-2);
  color: var(--brand-dark);
}

.nav-tools {
  position: relative;
}

.tools-dropdown {
  position: absolute;
  top: calc(100% + 12px);
  right: 0;
  width: min(720px, calc(100vw - 32px));
  min-width: 300px;
  display: none;
  grid-template-columns: 210px 1fr;
  gap: 10px;
  padding: 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: var(--shadow);
}

.nav-tools.open .tools-dropdown {
  display: grid;
}

.tools-menu-note {
  grid-column: 1 / -1;
  color: var(--muted);
  font-size: 0.92rem;
}

.tools-subgroup {
  display: contents;
}

.tools-subgroup-btn {
  min-height: 42px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
  color: var(--ink);
  font: inherit;
  font-weight: 800;
  text-align: left;
  cursor: pointer;
}

.tools-subgroup.active .tools-subgroup-btn {
  background: var(--brand);
  color: #fff;
  border-color: var(--brand);
}

.tools-subgroup-links {
  display: none;
  flex-wrap: wrap;
  gap: 8px;
  align-content: flex-start;
}

.tools-subgroup.active .tools-subgroup-links {
  display: flex;
}

.tools-subgroup-links a {
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  font-size: 0.92rem;
  font-weight: 700;
}

.tools-subgroup-links a:hover,
.tools-subgroup-links a.active {
  border-color: var(--brand);
  color: var(--brand-dark);
}

.main {
  padding: 26px 0 48px;
}

.breadcrumbs {
  margin-bottom: 14px;
  color: var(--muted);
  font-size: 0.92rem;
}

.breadcrumbs a {
  color: var(--brand-dark);
  font-weight: 700;
}

.hero,
.content-band,
.tool-group,
.tool-insights {
  margin-top: 16px;
}

.hero {
  padding: 34px;
  border: 1px solid var(--line);
  border-left: 5px solid var(--accent);
  border-radius: 10px;
  background: linear-gradient(135deg, #ffffff 0%, #f2f7f2 100%);
}

.hero h1 {
  max-width: 860px;
  margin: 10px 0;
  font-size: clamp(2rem, 4vw, 3.4rem);
  line-height: 1.05;
  letter-spacing: 0;
}

.hero p {
  max-width: 820px;
  margin: 0;
  color: var(--muted);
  font-size: 1.08rem;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 6px 10px;
  border-radius: 999px;
  background: #fff7d1;
  color: #654d03;
  font-weight: 800;
  font-size: 0.85rem;
}

.hero-actions,
.static-link-list,
.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.hero-actions {
  margin-top: 22px;
}

.btn-link,
button,
.text-link {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 14px;
  border: 1px solid var(--brand);
  border-radius: 8px;
  background: var(--brand);
  color: #fff;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

button.secondary,
.btn-link.secondary {
  background: #fff;
  color: var(--brand-dark);
}

.text-link {
  min-height: auto;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--brand-dark);
}

.hero-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 22px;
}

.stat-item,
.card,
.feature-panel,
.tool-card,
.insight-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.stat-item {
  padding: 14px;
}

.stat-item strong {
  display: block;
  font-size: 1.35rem;
}

.muted {
  color: var(--muted);
}

.content-band {
  padding: 24px 0;
}

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

.feature-panel,
.tool-card {
  padding: 18px;
}

.tool-card {
  min-height: 220px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 14px;
}

.tool-card h3,
.feature-panel h3 {
  margin: 0 0 8px;
}

.tool-card p,
.feature-panel p {
  margin: 0 0 10px;
}

.static-link-list a {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 7px 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
  color: var(--brand-dark);
  font-weight: 800;
  font-size: 0.92rem;
}

.group-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 12px;
}

.group-heading h2 {
  margin: 0;
}

.grid {
  display: grid;
  gap: 16px;
}

.grid-2 {
  grid-template-columns: minmax(0, 1.05fr) minmax(320px, 0.95fr);
  align-items: start;
}

.card {
  padding: 20px;
  box-shadow: 0 12px 30px rgba(22, 33, 22, 0.04);
}

.card h2,
.card h3 {
  margin-top: 0;
}

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

.field label {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 800;
}

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

input:focus,
select:focus,
textarea:focus {
  outline: 3px solid rgba(47, 111, 79, 0.18);
  border-color: var(--brand);
}

.result-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.result {
  min-height: 92px;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
}

.result .label {
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 800;
}

.result .value {
  margin-top: 6px;
  font-size: 1.35rem;
  font-weight: 900;
  word-break: break-word;
}

.verdict {
  margin-top: 12px;
  padding: 11px 12px;
  border-radius: 8px;
  font-weight: 900;
}

.verdict.good {
  background: #dcfce7;
  color: var(--good);
}

.verdict.warn {
  background: #fef3c7;
  color: var(--warn);
}

.verdict.bad {
  background: #fee2e2;
  color: var(--bad);
}

.note {
  margin-top: 12px;
  color: var(--muted);
}

.tool-context ul {
  padding-left: 20px;
}

.tool-insights {
  display: block;
}

.insight-panel {
  padding: 20px;
}

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

.insight-grid article {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
}

.faq details {
  padding: 12px 0;
  border-top: 1px solid var(--line);
}

.faq summary {
  cursor: pointer;
  font-weight: 900;
}

.site-footer {
  border-top: 1px solid var(--line);
  background: #101710;
  color: #f7faf7;
}

.footer-inner {
  min-height: 110px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 24px 0;
}

.footer-inner nav {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.footer-inner a {
  color: #d7f4dd;
}

body.tools-menu-open {
  overflow: hidden;
}

@media (max-width: 900px) {
  .header-inner {
    flex-direction: column;
    align-items: stretch;
    padding: 12px 0;
  }

  .nav {
    justify-content: stretch;
  }

  .tools-dropdown {
    left: 0;
    right: auto;
    width: 100%;
    min-width: 100%;
    max-height: calc(100vh - 130px);
    overflow-y: auto;
  }

  .grid-2,
  .feature-grid,
  .card-grid,
  .insight-grid {
    grid-template-columns: 1fr;
  }

  .hero-stats {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .container {
    width: min(100% - 20px, 1120px);
  }

  .nav {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 6px;
  }

  .nav > * {
    min-width: 0;
    flex: 1;
  }

  .nav-item,
  .nav a,
  .nav-tools-btn {
    width: 100%;
    min-height: 38px;
    padding: 8px 6px;
    border-radius: 8px;
    font-size: 0.9rem;
  }

  .tools-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: auto;
    grid-template-columns: 1fr;
    max-height: calc(100vh - 150px);
  }

  .tools-subgroup {
    display: block;
  }

  .tools-subgroup-btn {
    width: 100%;
    margin-top: 8px;
  }

  .tools-subgroup.active .tools-subgroup-links {
    display: grid;
    grid-template-columns: 1fr;
    margin-top: 8px;
  }

  .hero {
    padding: 22px;
  }

  .hero h1 {
    font-size: 2rem;
  }

  .fields,
  .result-grid {
    grid-template-columns: 1fr;
  }

  .result {
    min-height: 78px;
  }

  .footer-inner {
    flex-direction: column;
    align-items: flex-start;
  }
}


/* Finished-site additions */
.brand-mark {
  box-shadow: 0 8px 18px rgba(25, 50, 32, 0.18);
}

.nav-dropdown {
  position: relative;
}

.nav-dropdown.open .tools-dropdown {
  display: grid;
}

.tools-all-link {
  grid-column: 1 / -1;
  display: inline-flex;
  width: max-content;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--brand-dark);
  font-weight: 800;
}

.calculator-layout {
  align-items: start;
}

.calculator-actions {
  margin-top: 14px;
}

.calculator-actions button {
  min-width: 118px;
}

.result-card {
  position: sticky;
  top: 92px;
}

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

.saved-list {
  display: grid;
  gap: 8px;
}

.saved-scenario {
  justify-content: flex-start;
  min-height: 36px;
  padding: 8px 10px;
  background: var(--surface-2);
  border-color: var(--line);
  color: var(--ink);
}

.input-guide,
.quote-checks {
  display: grid;
  gap: 10px;
  margin: 12px 0 0;
  padding-left: 22px;
}

.input-guide li,
.quote-checks li {
  color: var(--muted);
}

.input-guide strong {
  color: var(--ink);
}

.split-links {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.resource-group {
  margin-top: 18px;
}

.resource-group h3 {
  margin-bottom: 10px;
}

.content-band p {
  max-width: 900px;
}

@media (max-width: 900px) {
  .result-card {
    position: static;
  }

  .split-links {
    grid-template-columns: 1fr;
  }
}

@media print {
  .site-header,
  .site-footer,
  .hero-actions,
  .calculator-actions,
  .saved-scenarios {
    display: none !important;
  }

  body {
    background: #fff;
  }

  .card,
  .content-band,
  .tool-insights {
    box-shadow: none;
    break-inside: avoid;
  }
}
