:root {
  color-scheme: light;
  --ink: #291b15;
  --paper: #fbf6ed;
  --rule: #cdbfaf;
  --rust: #99451e;
  --umber: #352018;
  --wash: #eee5d7;
  --quiet: #625347;
  --display: "Crimson Text", "Palatino Linotype", Palatino, Georgia, serif;
  --body: "Source Sans 3", "Segoe UI", Arial, sans-serif;
  font: 16px/1.5 var(--body);
  color: var(--ink);
  background: var(--paper);
  scroll-padding-top: 54px;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
}
h1,
h2,
h3,
p {
  margin: 0;
}
h1,
h2,
h3,
.brand,
nav,
.summary,
.cost-table thead,
.total,
.button,
button,
summary {
  font-family: var(--display);
}
h1,
h2,
h3 {
  line-height: 1.12;
  text-wrap: balance;
}
h1 {
  font-size: clamp(2.7rem, 5vw, 4.35rem);
  letter-spacing: -0.035em;
}
h2 {
  font-size: clamp(1.8rem, 3.2vw, 2.5rem);
  letter-spacing: -0.03em;
}
h3 {
  font-size: 1.45rem;
}
a {
  color: var(--rust);
  text-underline-offset: 0.18em;
}
button,
.button {
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  color: white;
  background: var(--rust);
  font-size: 1.12rem;
  font-weight: 700;
  border: 1px solid var(--rust);
  border-radius: 5px;
  padding: 9px 19px;
  min-height: 44px;
  text-decoration: none;
}
button:hover,
.button:hover {
  background: #703011;
  color: white;
}
button.secondary {
  background: transparent;
  color: var(--ink);
  border-color: #8d7967;
}
button.secondary:hover {
  background: var(--wash);
}
:focus-visible {
  outline: 3px solid #026375;
  outline-offset: 3px;
}
::selection {
  background: #e9c7ab;
  color: #25160e;
}
header {
  border-bottom: 1px solid var(--rule);
}
.mast,
main,
footer {
  max-width: 1300px;
  margin: auto;
  padding-inline: clamp(16px, 3.6vw, 54px);
}
.mast {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  min-height: 69px;
}
.brand {
  display: flex;
  align-items: center;
  color: var(--ink);
  font-size: clamp(1.3rem, 2.3vw, 2.07rem);
  font-weight: bold;
  letter-spacing: -0.035em;
  text-decoration: none;
  line-height: 1;
}
.brand img {
  object-fit: contain;
  margin-right: 17px;
}
.brand span {
  border-left: 1px solid #a68f79;
  padding-left: 17px;
}
nav {
  display: flex;
  align-items: center;
  gap: 30px;
}
nav a {
  color: var(--ink);
  font-size: 1.18rem;
  font-weight: bold;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  height: 50px;
  border-bottom: 3px solid transparent;
}
nav a[aria-current],
nav a:hover {
  color: var(--rust);
  border-bottom-color: var(--rust);
}
.unitbar {
  position: sticky;
  top: 0;
  z-index: 3;
  padding: 3px 4vw;
  background: #f4ede2;
  border-bottom: 1px solid #ded2c3;
  text-align: right;
  font-size: 0.77rem;
  font-weight: 600;
  color: #544336;
  letter-spacing: 0.025em;
}
.unitbar span {
  padding-inline: 7px;
}
.intro {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  margin: 29px 0 25px;
}
.intro p,
.lede {
  font: 1.27rem/1.45 var(--display);
  margin-top: 4px;
}
.picker {
  display: grid;
  gap: 6px;
  width: min(32%, 370px);
  font: 700 1.12rem var(--display);
}
select,
input:not([type="radio"]) {
  font: 1rem/1.4 var(--body);
  color: var(--ink);
  background: #fdf9f3;
  padding: 8px 11px;
  min-width: 0;
  width: 100%;
  border: 1px solid #9b8978;
  border-radius: 4px;
  min-height: 41px;
  caret-color: var(--rust);
}
select {
  cursor: pointer;
}
.picker select {
  font: 1.14rem var(--display);
  height: 44px;
}
.summary {
  display: grid;
  grid-template-columns: 42% 1fr;
  align-items: center;
  padding: 23px clamp(18px, 2.6vw, 37px);
  gap: clamp(16px, 3vw, 44px);
  color: #fff7eb;
  background: var(--umber);
  border: 1px solid #281911;
  border-radius: 7px;
}
.summary-title {
  border-right: 1px solid #917663;
  min-width: 0;
  padding-right: 18px;
}
.summary-title > span {
  color: #ebcfb8;
  font-size: 1.03rem;
}
.summary-title h2 {
  font-size: clamp(2rem, 3.55vw, 3.15rem);
  margin: 4px 0 5px;
  overflow-wrap: anywhere;
}
.summary-title p {
  font-size: 1.13rem;
  overflow-wrap: anywhere;
}
.bars {
  display: grid;
  gap: 9px;
  min-width: 0;
}
.bar {
  display: grid;
  grid-template-columns: max-content minmax(87px, max-content) 1fr;
  align-items: center;
  gap: clamp(12px, 2vw, 30px);
  font-size: 1.18rem;
}
.bar strong {
  font-size: clamp(1.2rem, 2.3vw, 2.05rem);
  font-variant-numeric: tabular-nums;
  line-height: 1.25;
  overflow-wrap: anywhere;
}
.bar progress {
  display: block;
  width: 100%;
  min-width: 0;
  height: 15px;
  appearance: none;
  border: none;
  border-radius: 2px;
  background: #634c3e;
  color: #cb865b;
}
.bar progress::-webkit-progress-bar {
  background: #634c3e;
  border-radius: 2px;
}
.bar progress::-webkit-progress-value {
  background: #cb865b;
  border-radius: 2px;
}
.bar progress::-moz-progress-bar {
  background: #cb865b;
}
.bar:nth-child(2) progress::-webkit-progress-value {
  background: #e3c7a7;
}
.bar:nth-child(2) progress::-moz-progress-bar {
  background: #e3c7a7;
}
.workspace {
  display: grid;
  grid-template-columns: minmax(0, 1.32fr) minmax(0, 1fr);
  gap: clamp(24px, 3vw, 46px);
  align-items: start;
  margin: 28px 0 44px;
}
.editor > section + section {
  margin-top: 29px;
}
.ruled {
  border-bottom: 2px solid var(--rust);
  padding-bottom: 9px;
  margin-bottom: 16px;
}
.field {
  display: grid;
  grid-template-columns: minmax(110px, 32%) minmax(0, 1fr);
  align-items: start;
  gap: 12px;
  margin-bottom: 10px;
}
.field > label,
.field > legend {
  font: 600 1.08rem/1.25 var(--display);
  padding-top: 10px;
}
.input-wrap {
  display: flex;
}
.input-wrap:has(.suffix) > input {
  border-radius: 4px 0 0 4px;
}
.suffix {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  padding: 0 8px;
  border: 1px solid #9b8978;
  border-left: 0;
  border-radius: 0 4px 4px 0;
  background: #f3ebdf;
  font-size: 0.85rem;
  color: #48382c;
}
.error:not(:empty) {
  display: block;
  color: #923010;
  font-size: 0.86rem;
  margin: 4px 0;
}
input[aria-invalid="true"] {
  border-color: #a03618;
}
input:disabled {
  color: #716558;
  background: #ede6dc;
}
.help,
.hint,
.export-note,
#save-status,
.open-total {
  font-size: 0.9rem;
  color: var(--quiet);
  line-height: 1.45;
}
.help,
.hint {
  margin: 0 0 13px;
}
.row-help {
  margin-left: calc(32% + 12px);
  margin-top: -4px;
}
.hint {
  padding: 10px 12px;
  background: var(--wash);
}
fieldset {
  border: 0;
  padding: 0;
  min-width: 0;
}
fieldset.modes {
  display: block;
  margin: 12px 0;
}
.modes legend {
  float: left;
  width: 32%;
  margin-right: 12px;
}
.segments,
.dealer-switch {
  display: flex;
}
.segments label,
.dealer-switch label {
  flex: 1;
  min-width: 0;
  position: relative;
}
.segments input,
.dealer-switch input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
}
.segments span,
.dealer-switch span {
  cursor: pointer;
  display: block;
  text-align: center;
  padding: 8px 5px;
  border: 1px solid #9b8978;
  font: 600 1.07rem/1.35 var(--display);
  min-height: 41px;
}
.segments label + label span,
.dealer-switch label + label span {
  border-left: 0;
}
.segments label:first-child span,
.dealer-switch label:first-of-type span {
  border-radius: 4px 0 0 4px;
}
.segments label:last-child span,
.dealer-switch label:last-child span {
  border-radius: 0 4px 4px 0;
}
.segments input:checked + span,
.dealer-switch input:checked + span {
  background: var(--rust);
  color: white;
  border-color: var(--rust);
}
input:focus-visible + span {
  outline: 3px solid #026375;
  outline-offset: 2px;
}
.dealer-switch {
  margin: 0 0 18px;
}
.cost-edit {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(95px, 27%);
  gap: 9px;
}
.cost-edit > .field:first-child {
  grid-template-columns: minmax(90px, 45%) minmax(0, 1fr);
}
.cost-edit > .field:nth-child(2) {
  display: block;
}
.cost-edit > .field:nth-child(2) > label,
.sr {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
.receipt {
  min-width: 0;
  border: 1px solid #a4927e;
  border-radius: 7px;
  padding: clamp(17px, 1.9vw, 28px);
  background: #fffaf2;
}
.cost-table {
  width: 100%;
  border-collapse: collapse;
  font-variant-numeric: tabular-nums;
  font-size: 0.98rem;
  line-height: 1.3;
}
.cost-table th,
.cost-table td {
  border-bottom: 1px solid var(--rule);
  padding: 9px 6px;
  text-align: right;
  overflow-wrap: anywhere;
}
.cost-table th:first-child {
  text-align: left;
}
.cost-table th[scope="row"] {
  font-weight: 500;
}
.cost-table thead th,
.cost-table .total th,
.cost-table .total td {
  background: var(--wash);
  font-weight: bold;
}
.cost-table thead th {
  font-size: 1.05rem;
}
.cost-table small {
  display: block;
  color: var(--quiet);
  font-size: 0.73rem;
}
.cost-table b {
  font-weight: 500;
}
.cost-table .total {
  font-size: 1.19rem;
}
.comparison {
  font: 600 1.13rem/1.35 var(--display);
  margin: 14px 0;
}
.open-total {
  margin: 10px 0;
}
details {
  border-block: 1px solid var(--rule);
}
summary {
  cursor: pointer;
  font-weight: 700;
  padding: 10px 3px;
  font-size: 1.04rem;
}
details[open] > summary {
  margin-bottom: 6px;
}
.diff-list {
  font-size: 0.88rem;
  padding-left: 20px;
  overflow-wrap: anywhere;
}
.diff-list li {
  margin-bottom: 6px;
}
.actions {
  display: flex;
  gap: 9px;
  flex-wrap: wrap;
  margin: 10px 0;
}
.sheet-actions {
  margin-top: 22px;
}
.sheet-actions button {
  flex: 1;
  padding: 9px 7px;
  white-space: nowrap;
}
.sheet-actions svg {
  flex: none;
  width: 18px;
  height: 18px;
}
.export-note {
  margin-bottom: 0;
}
.article {
  padding-block: 45px 70px;
  max-width: 860px;
}
.article h2 {
  margin: 31px 0 10px;
  font-size: 1.9rem;
}
.article p {
  margin-bottom: 1em;
}
.article .button {
  margin-top: 16px;
}
footer {
  border-top: 1px solid var(--rule);
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 21px;
  padding-block: 20px;
  color: var(--quiet);
  font-size: 0.9rem;
}
footer div {
  flex: 1;
  font: 700 1.17rem var(--display);
}
footer a {
  padding-block: 5px;
}
.skip {
  position: absolute;
  left: 12px;
  top: -100px;
  z-index: 9;
  background: var(--paper);
  padding: 10px;
}
.skip:focus {
  top: 8px;
}
.print-sheet {
  display: none;
}
@media (max-width: 800px) {
  .workspace {
    grid-template-columns: minmax(0, 1.08fr) minmax(0, 1fr);
    gap: 20px;
  }
  .cost-edit {
    display: block;
  }
  .cost-edit > .field:first-child {
    grid-template-columns: minmax(110px, 32%) 1fr;
  }
  .cost-edit > .field:nth-child(2) {
    margin-left: calc(32% + 12px);
  }
  .bar {
    gap: 10px;
  }
  .mast,
  main,
  footer {
    padding-inline: 20px;
  }
  .row-help {
    margin-left: 0;
  }
}
@media (max-width: 700px) {
  .mast {
    flex-wrap: wrap;
    gap: 1px;
    justify-content: flex-start;
    padding-top: 12px;
  }
  .brand img {
    width: 36px;
    margin-right: 11px;
  }
  .brand span {
    padding-left: 11px;
  }
  .brand {
    font-size: 1.52rem;
  }
  nav {
    width: 100%;
    gap: 25px;
  }
  nav a {
    height: 41px;
    font-size: 1.05rem;
  }
  .unitbar {
    text-align: left;
    padding-inline: 20px;
  }
  .intro {
    display: block;
    margin: 23px 0 17px;
  }
  .intro p {
    font-size: 1.13rem;
  }
  .picker {
    width: 100%;
    margin-top: 15px;
  }
  .summary {
    grid-template-columns: 1fr;
    gap: 14px;
  }
  .summary-title {
    border: 0;
    padding: 0;
  }
  .bars {
    border-top: 1px solid #846855;
    padding-top: 12px;
  }
  .bar {
    grid-template-columns: 62px minmax(78px, max-content) 1fr;
  }
  .workspace {
    display: flex;
    flex-direction: column;
    gap: 23px;
    margin-top: 24px;
  }
  .editor,
  .receipt {
    width: 100%;
  }
  .editor {
    display: contents;
  }
  .editor > section + section {
    margin-top: 0;
  }
  .receipt {
    order: 3;
  }
  .editor > section:last-child {
    order: 4;
  }
  .field,
  .cost-edit > .field:first-child {
    grid-template-columns: minmax(94px, 32%) minmax(0, 1fr);
    gap: 8px;
  }
  .modes legend {
    margin-right: 8px;
  }
  .row-help {
    margin-left: 0;
  }
  .cost-edit {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 105px;
    gap: 6px;
  }
  .cost-edit > .field:first-child {
    grid-template-columns: 1fr;
    gap: 3px;
  }
  .cost-edit > .field:nth-child(2) {
    margin: 0;
    align-self: end;
    padding-bottom: 10px;
  }
  .cost-edit select {
    padding-inline: 4px;
  }
  .actions {
    gap: 7px;
  }
  footer div {
    flex-basis: 100%;
  }
  .sheet-actions {
    margin-top: 18px;
  }
  .article a {
    overflow-wrap: anywhere;
  }
}
@media (max-width: 370px) {
  .mast,
  main,
  footer {
    padding-inline: 13px;
  }
  .brand {
    font-size: 1.38rem;
  }
  .summary {
    padding: 15px;
  }
  .receipt {
    padding: 12px;
  }
  .field,
  .cost-edit > .field:first-child {
    grid-template-columns: 1fr;
    gap: 3px;
  }
  .modes legend {
    float: none;
    width: auto;
    padding: 0;
    margin: 0 0 5px;
  }
  .field > label {
    padding: 0;
  }
  .cost-edit > .field:nth-child(2) {
    padding-bottom: 10px;
  }
  .cost-table {
    font-size: 0.89rem;
  }
  .bar progress {
    height: 11px;
  }
}
.mast,
main:not(.article),
footer {
  max-width: 1520px;
}
.bar > span {
  white-space: nowrap;
}
.bars {
  grid-template-columns: max-content minmax(0, max-content) minmax(16px, 1fr);
  column-gap: clamp(8px, 2vw, 28px);
}
.bar {
  grid-column: 1/-1;
  grid-template-columns: subgrid;
  column-gap: inherit;
}
.jump-result {
  display: none;
}
@media (max-width: 700px) {
  .editor > section:last-child {
    order: 2;
  }
  .jump-result {
    display: inline-block;
    margin-top: 13px;
    font-size: 0.93rem;
  }
  .summary {
    padding-block: 17px;
  }
  .bars {
    gap: 6px 12px;
  }
}
@page {
  margin: 14mm;
}
@media print {
  body {
    background: white;
    color: black;
    font:
      10pt/1.35 Georgia,
      serif;
  }
  body:has(.print-sheet) > :not(.print-sheet),
  header,
  .skip,
  footer,
  .unitbar,
  .article .button {
    display: none !important;
  }
  .print-sheet {
    display: block;
    overflow-wrap: anywhere;
  }
  .print-sheet h1 {
    font-size: 25pt;
  }
  .print-sheet h2 {
    font-size: 19pt;
    margin: 12pt 0 4pt;
  }
  .print-sheet h3 {
    font-size: 13pt;
  }
  .print-sheet p {
    margin: 5pt 0;
  }
  .print-dealers {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8mm;
    margin: 7mm 0;
  }
  .print-sheet tr,
  .print-dealers section {
    break-inside: avoid;
  }
  .cost-table th,
  .cost-table td {
    padding: 4pt;
    color: black;
    border-color: #888;
  }
  .print-sheet .cost-table {
    font-size: 10pt;
  }
  .print-sheet small,
  .print-sheet .open-total {
    color: #333;
  }
  .print-sheet .total {
    font-size: 12pt;
  }
  .article {
    padding: 0;
    max-width: none;
  }
}
