:root {
  --ink: #1a1a1a;
  --ink-soft: #4a4a4a;
  --ink-faint: #8a8a8a;
  --rule: #dcdcdc;
  --rule-faint: #efefef;
  --paper: #ffffff;
  --profit: #c1440e;
  --green: #5a7a1f;
  --green-soft: #eef3e6;
  --warn-soft: #fbf1ec;
}

* { box-sizing: border-box; }

html {
  background-color: var(--paper);
  background-image: radial-gradient(circle, rgba(0, 0, 0, 0.1) 1px, transparent 1px);
  background-size: 22px 22px;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  font-family: "Geist", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}

button,
input {
  font: inherit;
}

.be-page {
  width: min(1120px, calc(100vw - 48px));
  margin: 0 auto;
  padding: 34px 0 70px;
}

.be-print-header {
  display: none;
}

.be-back {
  display: inline-block;
  margin-bottom: 34px;
  color: var(--ink-faint);
  text-decoration: none;
  border-bottom: 1px solid var(--rule);
  font-size: 14px;
  font-weight: 500;
}

.be-back:hover {
  color: var(--profit);
  border-color: var(--profit);
}

.be-hero {
  padding: 0 0 34px;
  border-bottom: 1px solid var(--ink);
}

.be-kicker {
  margin: 0 0 12px;
  color: var(--profit);
  font-size: 13px;
  line-height: 1.2;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  font-weight: 600;
}

h1,
h2,
h3 {
  margin: 0;
  color: var(--ink);
  font-weight: 600;
  letter-spacing: 0;
}

h1 {
  max-width: 850px;
  font-size: clamp(38px, 6vw, 72px);
  line-height: 0.98;
}

.be-dek {
  max-width: 790px;
  margin: 22px 0 0;
  color: var(--ink-soft);
  font-size: 20px;
  line-height: 1.52;
}

.be-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 28px;
}

.be-btn,
.be-mini-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  border: 1px solid var(--ink);
  border-radius: 999px;
  background: var(--ink);
  color: #fff;
  padding: 9px 18px;
  text-decoration: none;
  cursor: pointer;
  font-weight: 600;
  transition: background 0.12s, border-color 0.12s, color 0.12s;
}

.be-btn:hover,
.be-mini-btn:hover {
  background: var(--profit);
  border-color: var(--profit);
}

.be-btn--ghost,
.be-mini-btn {
  background: transparent;
  color: var(--ink);
  border-color: var(--rule);
}

.be-btn--ghost:hover,
.be-mini-btn:hover {
  background: transparent;
  color: var(--profit);
  border-color: var(--profit);
}

.be-mini-btn {
  min-height: 32px;
  padding: 6px 12px;
  font-size: 13px;
}

.be-note {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 14px;
  margin: 24px 0 28px;
  padding: 14px 0;
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  color: var(--ink-soft);
  font-size: 15px;
  line-height: 1.5;
}

.be-note strong {
  color: var(--ink);
  white-space: nowrap;
}

.be-calculator {
  display: grid;
  grid-template-columns: minmax(0, 1.12fr) minmax(360px, 0.88fr);
  gap: 34px;
  align-items: start;
}

.be-form,
.be-results,
.be-explain,
.be-cta {
  background: rgba(255, 255, 255, 0.82);
}

.be-form-head,
.be-results-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--rule);
}

.be-form-head h2,
.be-results-head h2,
.be-explain h2,
.be-cta h2 {
  font-size: 26px;
  line-height: 1.15;
}

.be-form-head p,
.be-results-head p {
  margin: 7px 0 0;
  color: var(--ink-faint);
  font-size: 14px;
  line-height: 1.45;
}

.be-form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
  flex-shrink: 0;
}

.be-fieldset {
  margin: 20px 0 0;
  padding: 20px;
  border: 1px solid var(--rule);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.86);
}

.be-fieldset:last-child {
  margin-bottom: 0;
}

.be-fieldset legend {
  width: auto;
  margin: 0;
  padding: 0 8px;
  color: var(--profit);
  font-size: 13px;
  line-height: 1.2;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  font-weight: 600;
}

.be-fieldset--stress {
  background: var(--warn-soft);
}

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

.be-field {
  display: block;
  min-width: 0;
}

.be-field span {
  display: block;
  margin: 0 0 7px 2px;
  color: var(--ink-faint);
  font-size: 12px;
  line-height: 1.25;
  letter-spacing: 0.055em;
  text-transform: uppercase;
  font-weight: 600;
}

.be-field input {
  width: 100%;
  min-height: 46px;
  padding: 9px 12px 10px;
  border: 1px solid var(--rule);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  font-size: 18px;
  line-height: 1.3;
  font-variant-numeric: tabular-nums;
  outline: none;
  box-shadow: inset 0 1px 0 rgba(0, 0, 0, 0.02);
  transition: border-color 0.12s, box-shadow 0.12s, background 0.12s;
}

.be-field input:hover {
  border-color: var(--ink-faint);
}

.be-field input:focus {
  border-color: var(--profit);
  box-shadow: 0 0 0 3px rgba(193, 68, 14, 0.12);
}

.be-field-note {
  margin: 14px 0 0;
  color: var(--ink-faint);
  font-size: 13px;
  line-height: 1.45;
}

.be-results {
  position: sticky;
  top: 18px;
  padding: 22px;
  border: 1px solid var(--rule);
  border-radius: 6px;
}

.be-kpis {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  margin-top: 20px;
  border-top: 1px solid var(--rule);
  border-left: 1px solid var(--rule);
}

.be-kpi {
  min-height: 118px;
  padding: 16px;
  border-right: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
}

.be-kpi--main {
  grid-column: 1 / -1;
  min-height: 128px;
  background: var(--warn-soft);
}

.be-kpi-label {
  display: block;
  margin-bottom: 10px;
  color: var(--ink-faint);
  font-size: 12px;
  line-height: 1.3;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  font-weight: 600;
}

.be-kpi strong {
  display: block;
  color: var(--ink);
  font-size: 32px;
  line-height: 1.05;
  font-variant-numeric: tabular-nums;
}

.be-kpi--main strong {
  color: var(--profit);
  font-size: 54px;
}

.be-table-wrap {
  margin-top: 20px;
}

.be-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 15px;
}

.be-table th,
.be-table td {
  padding: 10px 0;
  border-bottom: 1px solid var(--rule-faint);
  text-align: left;
}

.be-table th {
  color: var(--ink-soft);
  font-weight: 500;
}

.be-table td {
  color: var(--ink);
  text-align: right;
  font-family: "Geist Mono", monospace;
  font-variant-numeric: tabular-nums;
}

.be-table td.is-good {
  color: var(--green);
}

.be-table td.is-bad {
  color: var(--profit);
}

.be-stress,
.be-summary-box {
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--rule);
}

.be-stress h3,
.be-summary-box h3 {
  margin-bottom: 8px;
  color: var(--profit);
  font-size: 14px;
  line-height: 1.2;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.be-stress p,
.be-summary-box p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 15px;
  line-height: 1.5;
}

.be-stress-number {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: baseline;
  margin-top: 14px;
  font-size: 14px;
  color: var(--ink-faint);
}

.be-stress-number strong {
  color: var(--profit);
  font-family: "Geist Mono", monospace;
  font-size: 22px;
  font-variant-numeric: tabular-nums;
}

.be-meter {
  height: 8px;
  margin-top: 12px;
  border-radius: 999px;
  background: var(--rule-faint);
  overflow: hidden;
}

.be-meter span {
  display: block;
  width: 0%;
  height: 100%;
  background: var(--profit);
  transition: width 0.16s;
}

.be-explain {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
  margin-top: 76px;
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
}

.be-explain > div {
  padding: 24px 26px 28px 0;
  border-right: 1px solid var(--rule);
}

.be-explain > div + div {
  padding-left: 26px;
}

.be-explain > div:last-child {
  border-right: 0;
}

.be-explain h2 {
  margin-bottom: 12px;
  font-size: 22px;
}

.be-explain p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 16px;
  line-height: 1.55;
}

.be-source-panel {
  margin-top: 28px;
  padding: 22px 0 0;
  border-top: 1px solid var(--rule);
}

.be-source-panel h2 {
  margin: 0 0 8px;
  color: var(--ink);
  font-size: 20px;
  line-height: 1.2;
}

.be-source-panel p {
  max-width: 860px;
  margin: 0;
  color: var(--ink-soft);
  font-size: 15px;
  line-height: 1.55;
}

.be-source-panel a {
  color: var(--ink);
  text-decoration: none;
  border-bottom: 1px solid var(--rule);
}

.be-source-panel a:hover {
  color: var(--profit);
  border-color: var(--profit);
}

.be-cta {
  margin-top: 74px;
  padding: 36px 0;
  border-top: 1px solid var(--ink);
  border-bottom: 1px solid var(--ink);
}

.be-cta h2 {
  max-width: 740px;
  font-size: 36px;
}

.be-cta p {
  max-width: 720px;
  margin: 14px 0 24px;
  color: var(--ink-soft);
  font-size: 18px;
  line-height: 1.55;
}

.be-footer {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  margin-top: 28px;
  padding-top: 20px;
  border-top: 1px solid var(--rule);
  color: var(--ink-faint);
  font-size: 12px;
  line-height: 1.45;
  letter-spacing: 0.03em;
}

.be-footer a {
  color: inherit;
  text-decoration: none;
  border-bottom: 1px solid var(--rule);
}

.be-footer a:hover {
  color: var(--profit);
  border-color: var(--profit);
}

@media (max-width: 940px) {
  .be-calculator {
    grid-template-columns: 1fr;
  }

  .be-results {
    position: static;
  }

  .be-explain {
    grid-template-columns: 1fr;
  }

  .be-explain > div,
  .be-explain > div + div {
    padding: 22px 0;
    border-right: 0;
    border-bottom: 1px solid var(--rule);
  }

  .be-explain > div:last-child {
    border-bottom: 0;
  }
}

@media (max-width: 820px) {
  .be-grid {
    grid-template-columns: 1fr;
  }

  .be-fieldset {
    padding: 18px;
  }
}

@media (max-width: 640px) {
  .be-page {
    width: min(100vw - 32px, 1120px);
    padding-top: 24px;
  }

  .be-dek {
    font-size: 18px;
  }

  .be-note,
  .be-form-head,
  .be-results-head,
  .be-footer {
    display: block;
  }

  .be-note strong {
    display: block;
    margin-bottom: 6px;
  }

  .be-form-actions {
    justify-content: flex-start;
    margin-top: 16px;
  }

  .be-kpis {
    grid-template-columns: 1fr;
  }

  .be-kpi--main {
    grid-column: auto;
  }

  .be-kpi--main strong {
    font-size: 42px;
  }

  .be-results {
    padding: 18px;
  }

  .be-cta h2 {
    font-size: 28px;
  }

  .be-footer span {
    display: block;
    margin-bottom: 8px;
  }
}

@media print {
  @page {
    size: A4 landscape;
    margin: 8mm;
  }

  html {
    background: #fff;
  }

  body {
    background: #fff;
    color: #111;
    font-size: 9.5pt;
    line-height: 1.25;
    print-color-adjust: exact;
    -webkit-print-color-adjust: exact;
  }

  .be-back,
  .be-hero,
  .be-note,
  .be-actions,
  .be-form-actions,
  #copy-summary,
  .be-explain,
  .be-source-panel,
  .be-cta,
  .be-footer {
    display: none !important;
  }

  .be-page {
    width: 100%;
    padding: 0;
  }

  .be-print-header {
    display: block;
    margin: 0 0 4mm;
    padding: 0 0 2.5mm;
    border-bottom: 1px solid #111;
  }

  .be-print-header h1 {
    margin: 0 0 1mm;
    font-size: 16pt;
    line-height: 1.1;
  }

  .be-print-header p {
    margin: 0;
    color: #555;
    font-size: 8.5pt;
  }

  .be-calculator {
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) minmax(88mm, 0.85fr);
    gap: 5mm;
    align-items: start;
  }

  .be-results {
    order: 2;
  }

  .be-form {
    order: 1;
  }

  .be-form,
  .be-results {
    position: static;
    break-inside: avoid;
    background: #fff;
  }

  .be-results {
    padding: 3mm;
    border: 1px solid #cfcfcf;
    border-radius: 0;
  }

  .be-results-head,
  .be-form-head {
    display: block;
    padding-bottom: 2mm;
    border-bottom: 1px solid #cfcfcf;
  }

  .be-results-head h2,
  .be-form-head h2 {
    font-size: 12pt;
    line-height: 1.1;
  }

  .be-results-head p,
  .be-form-head p {
    margin-top: 0.8mm;
    font-size: 7.7pt;
  }

  .be-kpis {
    grid-template-columns: repeat(2, 1fr);
    margin-top: 2.5mm;
    border-color: #d8d8d8;
  }

  .be-kpi,
  .be-kpi--main {
    grid-column: auto;
    min-height: auto;
    padding: 2.3mm;
    border-color: #d8d8d8;
    background: #fff;
  }

  .be-kpi--main {
    background: #fbf1ec;
  }

  .be-kpi-label {
    margin-bottom: 1mm;
    font-size: 6.3pt;
    line-height: 1.15;
  }

  .be-kpi strong,
  .be-kpi--main strong {
    font-size: 13pt;
    line-height: 1.05;
  }

  .be-table-wrap {
    margin-top: 2.5mm;
  }

  .be-table {
    font-size: 7.8pt;
  }

  .be-table th,
  .be-table td {
    padding: 1.15mm 0;
  }

  .be-stress,
  .be-summary-box {
    margin-top: 2.5mm;
    padding-top: 2mm;
  }

  .be-stress h3,
  .be-summary-box h3 {
    margin-bottom: 1mm;
    font-size: 6.8pt;
  }

  .be-stress p,
  .be-summary-box p {
    font-size: 7.6pt;
    line-height: 1.3;
  }

  .be-stress-number {
    margin-top: 1.5mm;
  }

  .be-stress-number strong {
    font-size: 10.5pt;
  }

  .be-meter {
    display: none;
  }

  .be-fieldset {
    margin: 2.5mm 0 0;
    padding: 2.4mm;
    border: 1px solid #d8d8d8;
    border-radius: 0;
    background: #fff;
    break-inside: avoid;
  }

  .be-fieldset legend {
    padding: 0 1.2mm;
    color: #111;
    font-size: 6.9pt;
    letter-spacing: 0.05em;
  }

  .be-grid {
    grid-template-columns: repeat(4, 1fr);
    gap: 2mm;
  }

  .be-field span {
    margin-bottom: 0.8mm;
    color: #555;
    font-size: 6.1pt;
    line-height: 1.15;
  }

  .be-field input {
    min-height: 7mm;
    padding: 1mm 1.5mm;
    border: 1px solid #d8d8d8;
    border-radius: 0;
    box-shadow: none;
    font-size: 10pt;
    line-height: 1.1;
  }

  .be-field-note {
    margin-top: 1.6mm;
    font-size: 6.8pt;
    line-height: 1.25;
  }

  .be-fieldset--stress {
    background: #fbf1ec;
  }
}
