@font-face {
  font-family: "Playfair Display";
  src: url("../fonts/Playfair.ttf") format("truetype");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Montserrat";
  src: url("../fonts/Montserrat.ttf") format("truetype");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  --ink: #222;
  --ivory: #fdfbf6;
  --cream: #f7f1e4;
  --gold: #b8995e;
  --gold-2: #8a6a2c;
  --line: #e6dcc4;
  --paper: #fff;
  color-scheme: light;
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

html { font-size: 18px; }

body {
  margin: 0;
  background: var(--ivory);
  color: var(--ink);
  font-family: "Montserrat", "Segoe UI", Helvetica, Arial, sans-serif;
  font-size: 1rem;
  line-height: 1.5;
  font-variant-numeric: lining-nums tabular-nums;
  font-feature-settings: "lnum" 1, "tnum" 1;
}

img { max-width: 100%; }

button, input, select { font: inherit; color: inherit; }

.skip {
  position: absolute;
  left: 12px;
  top: -120px;
  z-index: 5;
  background: var(--paper);
  color: var(--ink);
  padding: 10px 14px;
  border: 2px solid var(--ink);
}

.skip:focus { top: 12px; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.wrap {
  max-width: 880px;
  margin: 0 auto;
  padding: 18px 12px 56px;
}

.sheet {
  position: relative;
  background: var(--ivory);
  padding: 32px 22px 24px;
}

.sheet::before,
.sheet::after {
  content: "";
  position: absolute;
  border: 1px solid var(--gold);
  pointer-events: none;
}

.sheet::before { inset: 8px; border-width: 1.5px; }
.sheet::after { inset: 12px; border-width: 1px; }

.wm {
  position: absolute;
  z-index: 0;
  left: 50%;
  top: 58%;
  width: min(280px, 55%);
  transform: translate(-50%, -50%);
  opacity: 0.03;
  pointer-events: none;
}

.sheet > *:not(.wm) { position: relative; z-index: 1; }

.hdr {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 12px 20px;
  padding-bottom: 12px;
  border-bottom: 1.5px solid var(--gold);
}

.logo {
  display: block;
  height: 58px;
  width: auto;
  max-width: min(420px, 100%);
}

.titles { margin-left: auto; text-align: right; max-width: 100%; }

h1, h2, legend {
  font-family: "Playfair Display", Georgia, "Times New Roman", serif;
  font-weight: 600;
  line-height: 1.15;
}

h1 {
  margin: 0;
  font-size: clamp(32px, 6vw, 46px);
}

.est {
  margin: 6px 0 0;
  font-size: 17px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold-2);
}

.info {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  margin-top: 16px;
}

.info .spacer { display: none; }

.info .row {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  min-width: 0;
}

.info b { font-weight: 600; flex: none; white-space: nowrap; }

.info .ln {
  flex: 1;
  min-width: 48px;
  min-height: 1.4em;
  border-bottom: 1px solid #444;
  padding: 0 4px 1px;
}

.hero {
  margin: 26px 6px 4px;
  padding: 18px 14px 16px;
  text-align: center;
  background: var(--cream);
  border: 1.5px solid var(--gold);
  box-shadow: 0 0 0 3px var(--ivory), 0 0 0 4.5px var(--gold);
}

.kicker {
  margin: 0;
  font-size: clamp(20px, 4vw, 24px);
  font-weight: 600;
  line-height: 1.3;
}

.net {
  margin: 2px 0 0;
  font-family: "Playfair Display", Georgia, serif;
  font-weight: 700;
  font-size: clamp(46px, 12vw, 76px);
  line-height: 1.05;
  color: var(--gold-2);
  overflow-wrap: anywhere;
}

.eq {
  margin: 8px 0 0;
  font-size: 18px;
  line-height: 1.4;
}

.shortfall {
  margin: 12px auto 0;
  max-width: 36em;
  font-size: 17px;
  line-height: 1.45;
}

h2 {
  margin: 26px 0 8px;
  font-size: clamp(28px, 5vw, 36px);
}

.lede, .print-hint, .help, .disc, .foot, .status, .consent {
  font-size: 17px;
}

.lede { margin: 0 0 14px; }

.editor, .lead {
  margin-top: 22px;
  padding: 16px 14px 8px;
  background: var(--paper);
  border: 1px solid var(--gold);
}

.editor h2, .lead h2 { margin-top: 4px; }

fieldset {
  border: 0;
  margin: 0 0 6px;
  padding: 0;
}

legend {
  margin: 10px 0 12px;
  padding: 0;
  font-size: 24px;
}

.fields {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0 16px;
}

.field { margin: 0 0 16px; min-width: 0; }

.field label {
  display: block;
  margin-bottom: 6px;
  font-weight: 600;
}

.field.primary input {
  min-height: 68px;
  font-size: 26px;
  font-weight: 600;
}

input, select {
  width: 100%;
  min-height: 56px;
  padding: 10px 12px;
  background: var(--paper);
  border: 2px solid var(--ink);
  border-radius: 0;
}

select {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 44px;
  background-image: linear-gradient(45deg, transparent 50%, var(--ink) 50%),
    linear-gradient(135deg, var(--ink) 50%, transparent 50%);
  background-position: calc(100% - 22px) calc(50% - 3px), calc(100% - 14px) calc(50% - 3px);
  background-size: 8px 8px, 8px 8px;
  background-repeat: no-repeat;
}

::placeholder { color: #555; opacity: 1; }

.with-suffix { display: flex; align-items: stretch; min-width: 0; }

.with-suffix input { min-width: 0; }

.with-suffix .suffix {
  display: flex;
  align-items: center;
  padding: 0 14px;
  border: 2px solid var(--ink);
  border-left: 0;
  background: var(--cream);
  font-weight: 700;
  font-size: 20px;
}

.with-suffix:focus-within {
  outline: 3px solid var(--gold-2);
  outline-offset: 2px;
}

.with-suffix input:focus { outline: none; }

input:focus-visible,
select:focus-visible,
button:focus-visible,
a:focus-visible {
  outline: 3px solid var(--gold-2);
  outline-offset: 2px;
}

.help { margin: 8px 0 0; line-height: 1.45; }

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

th, td {
  padding: 4px 2px;
  vertical-align: baseline;
  text-align: left;
  font-weight: 400;
}

td.amt {
  width: 1%;
  padding-left: 16px;
  text-align: right;
  white-space: nowrap;
  font-variant-numeric: lining-nums tabular-nums;
}

tr.sale th,
tr.sale td {
  padding-bottom: 8px;
  border-bottom: 2px solid var(--ink);
  font-size: 22px;
  font-weight: 700;
}

tr.g th,
tr.g td {
  padding-top: 14px;
  border-top: 1px solid var(--line);
  font-size: 20px;
  font-weight: 700;
}

tr.sale + tr.g th,
tr.sale + tr.g td { border-top: 0; }

tr.g .note { font-size: 17px; font-weight: 500; }

tr.i th,
tr.i td {
  padding-top: 3px;
  padding-bottom: 3px;
  font-size: 18px;
}

tr.i th { padding-left: 18px; }

tr.tot th,
tr.tot td {
  padding-top: 12px;
  border-top: 2px solid var(--ink);
  font-size: 22px;
  font-weight: 700;
}

tr.net th,
tr.net td {
  padding: 10px 8px;
  background: var(--cream);
  border-top: 1.5px solid var(--gold);
  border-bottom: 1.5px solid var(--gold);
  font-family: "Playfair Display", Georgia, serif;
  font-size: clamp(24px, 4.5vw, 34px);
  font-weight: 700;
}

tr.net th { color: var(--ink); }
tr.net td { color: var(--gold-2); }

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

.btn {
  display: inline-flex;
  flex: 1 1 220px;
  align-items: center;
  justify-content: center;
  min-height: 56px;
  padding: 12px 18px;
  border: 2px solid var(--ink);
  background: var(--ink);
  color: var(--ivory);
  font-weight: 600;
  font-size: 18px;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
}

.btn.ghost { background: transparent; color: var(--ink); }

.btn:hover { background: #3a3a3a; color: var(--ivory); }
.btn.ghost:hover { background: var(--cream); color: var(--ink); }
.btn:disabled { opacity: 0.65; cursor: wait; }

.print-hint { margin: 10px 0 0; }

.lead p { margin: 0 0 14px; }

.consent {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  margin: 4px 0 16px;
  line-height: 1.45;
  cursor: pointer;
}

.consent input {
  width: 32px;
  height: 32px;
  min-height: 32px;
  margin-top: 2px;
  flex: none;
  accent-color: var(--gold-2);
}

.lead .btn { width: 100%; flex-basis: auto; }

.status {
  margin: 0 0 14px;
  padding: 12px 14px;
  background: var(--cream);
  border: 1px solid var(--gold);
  line-height: 1.45;
}

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

.disc {
  margin: 22px 8px 0;
  text-align: center;
  line-height: 1.45;
}

.foot {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px 18px;
  margin-top: 18px;
  padding-top: 10px;
  border-top: 1.5px solid var(--gold);
}

.foot p { margin: 0; }

.tag {
  font-family: "Playfair Display", Georgia, serif;
  font-style: italic;
  font-size: 20px;
  color: var(--gold-2);
}

.noscript {
  margin: 0 0 16px;
  padding: 12px;
  border: 2px solid var(--ink);
  background: var(--paper);
}

.intro {
  margin: 18px 0 0;
  font-size: 18px;
}

.followup {
  margin: 16px 6px 0;
  padding: 14px 16px;
  background: var(--cream);
  border: 1px solid var(--gold);
  font-size: 18px;
  font-weight: 600;
  line-height: 1.45;
  text-align: center;
}

.form-note {
  margin: 0 0 14px;
  font-size: 17px;
  line-height: 1.45;
}

.editor .btn,
.lead .btn,
#see-net {
  width: 100%;
}

.custom-row {
  margin: 0 0 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
}

.custom-row .btn {
  width: auto;
  min-height: 48px;
  margin-bottom: 12px;
}

#add-cost {
  width: auto;
  min-height: 48px;
  margin: 4px 0 12px;
}

.gate {
  max-width: 520px;
  margin: 32px auto;
  padding: 28px 20px;
  background: var(--ivory);
  border: 1.5px solid var(--gold);
  box-shadow: 0 0 0 4px var(--ivory), 0 0 0 5px var(--gold);
}

.gate h1 { font-size: clamp(32px, 6vw, 42px); }

.gate p { font-size: 18px; }

.gate-error {
  margin: 0 0 12px;
  font-weight: 600;
}

.gate .btn { width: 100%; }

body.page-agent .wrap { max-width: 880px; }

@media (min-width: 1040px) {
  body.page-agent .wrap { max-width: 1180px; }
  body.page-agent .sheet {
    display: grid;
    grid-template-columns: minmax(300px, 390px) minmax(0, 1fr);
    column-gap: 22px;
    align-items: start;
  }
  body.page-agent .hdr,
  body.page-agent .info,
  body.page-agent .hero,
  body.page-agent .breakdown,
  body.page-agent .actions,
  body.page-agent .print-hint,
  body.page-agent .disc,
  body.page-agent .foot {
    grid-column: 2;
  }
  body.page-agent .editor {
    grid-column: 1;
    grid-row: 1 / span 10;
    align-self: start;
    margin-top: 0;
  }
}

@media (max-width: 640px) {
  .wrap { padding: 10px 8px 40px; }
  .sheet { padding: 26px 14px 18px; }
  .sheet::before { inset: 6px; }
  .sheet::after { inset: 9px; }
  .hdr { flex-direction: column; align-items: flex-start; }
  .titles { margin-left: 0; text-align: left; }
  .logo { height: 46px; }
  .hero { margin-left: 4px; margin-right: 4px; }
  tr.sale th, tr.sale td,
  tr.tot th, tr.tot td { font-size: 19px; }
  tr.g th, tr.g td { font-size: 18px; }
}

@media (max-width: 699px) {
  .info .row { display: block; }
  .info b { display: block; margin-bottom: 2px; }
  .info .ln { display: block; width: 100%; min-height: 1.6em; }
}

@media (min-width: 700px) {
  .sheet { padding: 40px 36px 28px; }
  .sheet::before { inset: 12px; }
  .sheet::after { inset: 16px; }
  .info {
    grid-template-columns: 1.45fr 0.8fr;
    column-gap: 28px;
    row-gap: 10px;
  }
  .info .spacer { display: block; }
  .info .r b { width: 4.6rem; }
  .fields.two { grid-template-columns: 1fr 1fr; }
  .editor, .lead { padding: 20px 20px 10px; }
}

@page { size: letter; margin: 0; }

@media print {
  .no-print { display: none !important; }
  html, body { background: var(--ivory); }
  .wrap { max-width: none; margin: 0; padding: 0; }
  .sheet {
    display: flex;
    flex-direction: column;
    width: 8.5in;
    height: 11in;
    padding: 0.5in 0.62in 0.55in;
    overflow: hidden;
  }
  .sheet::before { inset: 0.28in; border-width: 0.8pt; }
  .sheet::after { inset: 0.33in; border-width: 0.4pt; }
  .wm { top: 5.7in; width: 3.4in; opacity: 0.04; }
  .logo { height: 48px; max-width: 46%; }
  .hdr {
    flex-direction: row;
    align-items: center;
    padding-bottom: 8px;
    border-bottom-width: 1pt;
  }
  .titles { margin-left: auto; text-align: right; }
  h1 { font-size: 28pt; }
  .est { margin-top: 3px; font-size: 10pt; letter-spacing: 2px; }
  .info {
    display: grid;
    grid-template-columns: 1.4fr 1fr;
    gap: 6px 22px;
    margin-top: 12px;
    font-size: 11pt;
  }
  .info .spacer { display: block; }
  .info b { width: auto; white-space: nowrap; font-size: 11pt; }
  .info .r b { width: auto; }
  .hero {
    margin: 14px 2px 0;
    padding: 12px 18px 12px;
    box-shadow: 0 0 0 3px var(--ivory), 0 0 0 3.6px var(--gold);
  }
  .kicker { font-size: 13pt; }
  .net { font-size: 42pt; }
  .eq { font-size: 12.5pt; }
  h2 { margin: 14px 0 4px; font-size: 16pt; }
  th, td { padding: 3px 2px; }
  tr.sale th, tr.sale td { font-size: 13.5pt; padding-bottom: 5px; }
  tr.g th, tr.g td { font-size: 13pt; padding-top: 7px; }
  tr.g .note { font-size: 11pt; }
  tr.i th, tr.i td { font-size: 11.5pt; padding-top: 1px; padding-bottom: 1px; }
  tr.i th { padding-left: 18px; }
  tr.tot th, tr.tot td { font-size: 13.5pt; padding-top: 6px; }
  tr.net th, tr.net td { font-size: 19pt; padding: 5px 4px; }
  .disc { margin-top: 12px; font-size: 9.5pt; line-height: 1.4; }
  .foot {
    margin-top: auto;
    padding-top: 6px;
    border-top-width: 1pt;
    font-size: 10pt;
    flex-wrap: nowrap;
  }
  .tag { font-size: 11.5pt; }
  body.is-compact .hero { margin-top: 10px; padding: 8px 16px; }
  body.is-compact .net { font-size: 34pt; }
  body.is-compact h2 { margin: 8px 0 2px; font-size: 14pt; }
  body.is-compact tr.g th,
  body.is-compact tr.g td { padding-top: 4px; font-size: 12pt; }
  body.is-compact tr.i th,
  body.is-compact tr.i td { font-size: 10.5pt; padding-top: 0; padding-bottom: 0; }
  body.is-compact tr.net th,
  body.is-compact tr.net td { font-size: 16pt; padding: 3px 4px; }
  body.is-compact .disc { margin-top: 8px; font-size: 9pt; }
  body.page-agent .wrap { max-width: none; padding: 0; }
  body.page-agent .sheet {
    display: flex;
    grid-template-columns: none;
    width: 8.5in;
    height: 11in;
    max-height: 11in;
  }
  body.page-agent .hdr,
  body.page-agent .info,
  body.page-agent .hero,
  body.page-agent .breakdown,
  body.page-agent .disc,
  body.page-agent .foot {
    grid-column: auto;
  }
  body.page-agent .editor { display: none !important; position: static; max-height: none; overflow: visible; }
  * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
