:root {
  --ink: #1f2430;
  --muted: #647084;
  --line: #d8ddca;
  --line-strong: #c6ccb2;
  --surface: #ffffff;
  --paper: #fffdf7;
  --ledger: #f6f1e3;
  --olive: #617034;
  --olive-dark: #455123;
  --amber: #b66b1c;
  --amber-soft: #fff2dc;
  --green-soft: #eef5e4;
  --red-soft: #fff0ec;
  --shadow: 0 18px 42px rgba(45, 47, 34, 0.09);
  --radius: 8px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  overflow-x: hidden;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 15px;
  letter-spacing: 0;
  overflow-x: hidden;
}

button,
input,
select {
  font: inherit;
}

button,
summary {
  cursor: pointer;
}

a {
  color: var(--olive-dark);
  font-weight: 700;
  text-decoration: none;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 58px;
  padding: 10px 34px;
  border-bottom: 1px solid rgba(216, 221, 202, 0.88);
  background: rgba(255, 253, 247, 0.94);
  backdrop-filter: blur(12px);
}

.brand,
.main-nav {
  display: flex;
  align-items: center;
}

.brand {
  gap: 10px;
  color: var(--ink);
  font-size: 20px;
  font-weight: 800;
  white-space: nowrap;
}

.brand-mark {
  display: grid;
  width: 31px;
  height: 31px;
  place-items: center;
  border-radius: 7px;
  background: var(--olive);
  color: #fff;
}

.main-nav {
  gap: 26px;
}

.page-shell {
  width: min(1360px, calc(100vw - 56px));
  margin: 0 auto;
  padding: 28px 0 42px;
}

.hero {
  max-width: 860px;
  margin-bottom: 22px;
}

.eyebrow {
  margin: 0 0 7px;
  color: var(--olive-dark);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

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

h1 {
  margin-bottom: 10px;
  font-size: clamp(38px, 5vw, 58px);
  line-height: 1.02;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 14px;
  font-size: 20px;
  line-height: 1.25;
}

h3 {
  margin-bottom: 8px;
  font-size: 16px;
}

p,
li {
  color: var(--muted);
  line-height: 1.62;
}

.calculator-shell {
  display: grid;
  grid-template-columns: minmax(390px, 0.82fr) minmax(560px, 1.18fr);
  gap: 18px;
  align-items: stretch;
}

.input-panel,
.result-panel,
.content-grid article,
.examples-section,
.faq-section {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.input-panel,
.result-panel {
  padding: 22px;
}

.panel-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 18px;
}

.panel-heading h2 {
  margin-bottom: 0;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: var(--green-soft);
  color: var(--olive-dark);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.field-row {
  display: grid;
  grid-template-columns: minmax(170px, 1fr) minmax(190px, 0.95fr);
  align-items: center;
  gap: 16px;
  margin-bottom: 11px;
  color: var(--ink);
  font-weight: 750;
}

.field-row input,
.field-row select {
  width: 100%;
  min-height: 40px;
  padding: 0 12px;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  background: #fffefb;
  color: var(--ink);
}

.money-input {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  background: #fffefb;
}

.money-input span {
  display: grid;
  place-items: center;
  border-right: 1px solid var(--line);
  color: var(--olive-dark);
  font-weight: 900;
}

.money-input input {
  border: 0;
  border-radius: 0;
}

.check-row {
  display: grid;
  grid-template-columns: 18px 1fr;
  gap: 10px;
  margin: 12px 0;
  color: var(--muted);
  line-height: 1.5;
}

.check-row input {
  width: 18px;
  height: 18px;
  margin-top: 2px;
  accent-color: var(--olive);
}

.action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 18px 0 12px;
}

.primary-button,
.secondary-button,
.ghost-button {
  min-height: 42px;
  padding: 0 15px;
  border-radius: 7px;
  border: 1px solid transparent;
  font-weight: 850;
}

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

.primary-button:hover {
  background: var(--olive-dark);
}

.secondary-button {
  border-color: var(--olive);
  background: #fff;
  color: var(--olive-dark);
}

.ghost-button {
  border-color: var(--line-strong);
  background: transparent;
  color: var(--muted);
}

.fine-print {
  margin: 0;
  font-size: 13px;
}

.result-total {
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--ledger);
}

.result-total span {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-weight: 800;
}

.result-total strong {
  display: block;
  color: var(--olive-dark);
  font-size: clamp(36px, 5vw, 56px);
  line-height: 1;
}

.result-total p {
  max-width: 640px;
  margin: 10px 0 0;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin: 12px 0;
}

.metric-grid article {
  min-height: 95px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fffefb;
}

.metric-grid span {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.metric-grid strong {
  color: var(--ink);
  font-size: 19px;
  line-height: 1.2;
}

.formula-box,
.review-box {
  padding: 16px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
}

.formula-box {
  margin-bottom: 12px;
  background: #fffefb;
}

.review-box {
  background: var(--amber-soft);
}

.review-box ul,
.content-grid ol,
.check-list {
  margin-bottom: 0;
  padding-left: 20px;
}

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

.content-grid article,
.examples-section,
.faq-section {
  padding: 24px;
}

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

.example-grid article {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fffefb;
}

.faq-list {
  display: grid;
  gap: 10px;
}

details {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fffefb;
}

summary {
  min-height: 44px;
  padding: 13px 15px;
  color: var(--ink);
  font-weight: 850;
}

details p {
  margin: 0;
  padding: 0 15px 15px;
}

.site-footer {
  padding: 26px;
  border-top: 1px solid var(--line);
  text-align: center;
}

.site-footer p {
  margin: 0;
  font-size: 13px;
}

:focus-visible {
  outline: 3px solid rgba(182, 107, 28, 0.38);
  outline-offset: 2px;
}

@media (max-width: 980px) {
  .site-header,
  .main-nav {
    align-items: flex-start;
  }

  .site-header {
    flex-direction: column;
    gap: 10px;
    padding: 12px 20px;
  }

  .main-nav {
    width: 100%;
    gap: 14px;
    overflow-x: auto;
    padding-bottom: 3px;
  }

  .page-shell {
    width: min(100vw - 28px, 760px);
    padding-top: 20px;
  }

  .calculator-shell,
  .content-grid,
  .example-grid {
    grid-template-columns: 1fr;
  }

  .metric-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 560px) {
  body {
    font-size: 14px;
  }

  .field-row {
    grid-template-columns: 1fr;
    gap: 7px;
  }

  .input-panel,
  .result-panel,
  .content-grid article,
  .examples-section,
  .faq-section {
    padding: 17px;
  }

  .metric-grid {
    grid-template-columns: 1fr;
  }

  .result-total strong {
    font-size: 34px;
  }
}
