.branding-fields {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 12rem), 1fr));
  gap: .75rem 1rem;
  align-items: end;
}
.branding-fields label { min-width: 0; }
.branding-fields output { margin-left: .3rem; }
.branding-fields label[hidden] { display: none; }
.brand-settings-example, .document-preview {
  container-type: inline-size;
  background: #fff;
  border: 1px solid #d5ded8;
  border-radius: .6rem;
  padding: clamp(.85rem, 3vw, 1.6rem);
  color: #1a262b;
  overflow-wrap: anywhere;
}
.brand-image-box { display: flex; padding-block: .35rem; }
.brand-align-left { justify-content: flex-start; }
.brand-align-center { justify-content: center; }
.brand-align-right { justify-content: flex-end; }
.brand-image-box img {
  display: block;
  width: var(--brand-width);
  max-width: 100%;
  height: auto;
  max-height: var(--brand-height);
  object-fit: contain;
  opacity: var(--brand-opacity);
}
.brand-align-left img { object-position: left center; }
.brand-align-right img { object-position: right center; }
.document-preview-heading { border-bottom: 1px solid #ced6d1; margin-bottom: .6rem; padding-bottom: .5rem; }
.document-preview-heading h3 { margin: .2rem 0 0; font-size: clamp(1.3rem, 5vw, 2rem); }
.document-preview-heading small, .document-parties h4 { color: #1e503f; font-weight: 700; }
.document-parties { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .8rem; margin-top: .8rem; }
.document-parties h4 { margin: 0 0 .25rem; }
.document-parties > div { white-space: pre-line; }
.document-meta, .document-sums { display: grid; gap: .25rem .75rem; margin-block: .85rem; }
.document-meta { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.document-meta > div, .document-sums > div { min-width: 0; }
.document-meta dd, .document-sums dd { margin: 0; }
.document-meta dt { font-weight: 650; }
.document-subject { margin: .95rem 0 .4rem; }
.document-table-shell { overflow-x: auto; }
.document-table { width: 100%; border-collapse: collapse; table-layout: auto; font-size: clamp(.75rem, 2vw, .95rem); }
.document-table th, .document-table td { text-align: left; vertical-align: top; padding: .35rem .25rem; border-bottom: 1px solid #d5ded8; }
.document-table th { background: #edf4ee; color: #1e503f; }
.document-table :is(th,td):nth-child(n+3) { text-align: right; }
.document-table td:nth-child(3), .document-table td:last-child { white-space: nowrap; }
.document-sums { margin-inline-start: auto; max-width: 27rem; }
.document-sums > div { display: grid; grid-template-columns: minmax(0, 1fr) max-content; gap: .5rem; }
.document-sums > div:last-child { font-weight: 750; }
.document-signature { max-width: 8rem; max-height: 4rem; }
@media (max-width: 420px) {
  .document-table th, .document-table td { padding-inline: .18rem; }
}
