:root {
  --bg: #f3f1ec;
  --surface: #fffdfa;
  --text: #222222;
  --muted: #6a6862;
  --line: #d8d4cc;
  --accent: #245c4d;
  --accent-soft: #e8efec;
  --result-bg: #eef3f0;
  --result-line: #245c4d;
  font-family: Arial, Helvetica, sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  line-height: 1.55;
}

button, input, select { font: inherit; }

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

.site-header {
  border-bottom: 1px solid var(--line);
  background: var(--bg);
}

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

.brand {
  color: var(--text);
  font-size: 0.98rem;
  font-weight: 700;
  text-decoration: none;
}

.header-note {
  color: var(--muted);
  font-size: 0.84rem;
}

.main-content { padding: 52px 0 68px; }

.hero {
  max-width: 690px;
  margin: 0 0 30px;
}

h1 {
  margin: 0;
  max-width: 650px;
  font-size: clamp(2rem, 5vw, 3.25rem);
  line-height: 1.08;
  letter-spacing: -0.035em;
  font-weight: 760;
}

.intro {
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 1.04rem;
}

.calculator-card,
.section-block {
  background: var(--surface);
  border: 1px solid var(--line);
}

.calculator-card {
  max-width: 860px;
}

.mode-switch {
  display: flex;
  gap: 28px;
  padding: 0 26px;
  border-bottom: 1px solid var(--line);
  overflow-x: auto;
}

.mode-button {
  position: relative;
  padding: 18px 0 15px;
  border: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-weight: 700;
  text-align: left;
  white-space: nowrap;
}

.mode-button::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 2px;
  background: transparent;
}

.mode-button.active { color: var(--text); }
.mode-button.active::after { background: var(--accent); }

.calculator-body { padding: 26px 26px 20px; }

.fields-grid {
  display: grid;
  gap: 18px;
  margin-bottom: 18px;
}

.two-cols { grid-template-columns: 1fr 1fr; }

.field span {
  display: block;
  margin-bottom: 7px;
  color: #3e3c38;
  font-size: 0.91rem;
  font-weight: 700;
}

.field select,
.field input {
  width: 100%;
  min-height: 48px;
  padding: 10px 12px;
  border: 1px solid #bdb8ae;
  border-radius: 4px;
  background: #ffffff;
  color: var(--text);
  outline: none;
}

.field select:focus,
.field input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-soft);
}

.advanced {
  margin-top: 4px;
  border-top: 1px solid var(--line);
  padding-top: 16px;
}

.advanced summary {
  cursor: pointer;
  color: var(--accent);
  font-size: 0.93rem;
  font-weight: 700;
}

.advanced-body {
  max-width: 430px;
  padding-top: 16px;
}

.advanced-body p,
.estimate-note,
.section-heading p,
.info-grid p {
  color: var(--muted);
}

.advanced-body p {
  margin: 8px 0 0;
  font-size: 0.86rem;
}

.result-box {
  margin: 0 26px;
  padding: 20px 22px 21px;
  border-left: 4px solid var(--result-line);
  background: var(--result-bg);
}

.result-label {
  margin: 0 0 2px;
  color: #4f5e58;
  font-size: 0.88rem;
  font-weight: 700;
}

.result-main {
  margin: 0;
  font-size: clamp(2.15rem, 7vw, 3.2rem);
  line-height: 1.08;
  font-weight: 750;
  letter-spacing: -0.035em;
}

.result-detail {
  margin: 7px 0 0;
  color: #58615d;
  font-size: 0.91rem;
}

.estimate-note {
  margin: 13px 26px 23px;
  font-size: 0.84rem;
}

.section-block {
  max-width: 860px;
  margin-top: 26px;
  padding: 24px 26px;
}

.section-heading {
  margin-bottom: 12px;
}

.section-block h2 {
  margin: 0 0 4px;
  font-size: 1.1rem;
}

.section-heading p { margin: 0; }

.table-wrap { overflow-x: auto; }

table {
  width: 100%;
  border-collapse: collapse;
}

th, td {
  padding: 11px 4px;
  border-bottom: 1px solid var(--line);
  text-align: left;
}

th {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.035em;
}

td:last-child, th:last-child { text-align: right; }

.info-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 38px;
}

.info-grid article h2 { margin-top: 0; }
.info-grid article p { margin: 0; font-size: 0.93rem; }

.hidden { display: none !important; }

.site-footer {
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.82rem;
}

.site-footer .wrap { padding: 20px 0 28px; }
.site-footer p { margin: 0; }

@media (max-width: 640px) {
  .header-note { display: none; }
  .main-content { padding-top: 34px; }
  .hero { margin-bottom: 22px; }
  .two-cols, .info-grid { grid-template-columns: 1fr; }
  .mode-switch { gap: 22px; padding: 0 18px; }
  .mode-button { font-size: 0.89rem; }
  .calculator-body { padding: 22px 18px 17px; }
  .result-box { margin: 0 18px; }
  .estimate-note { margin: 12px 18px 20px; }
  .section-block { padding: 22px 20px; }
}
