html, body {
  margin: 0;
  padding: 0;
}

:root {
  font-family: Montserrat;
  font-size: 1.2rem;
  --color-primary: #283a54;
}

.flex {
  display: flex;
}

.row {
  flex-direction: row;
}

.content {
  display: contents;
}

.page-container {
  width: 100%;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
}

.page-body {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.main {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 3.2rem 3.2rem 0 3.2rem;
}

.letter-content {
  margin-bottom: 1rem;
}

p {
  margin-top: 0;
  line-height: 1.5;
  text-align: justify;
}

.appendix-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--color-primary);
  text-align: center;
  margin-bottom: 1.25rem;
  letter-spacing: 0.02em;
}

.appendix-start {
  margin-top: 0.5rem;
}

#content-outlet {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.field-line {
  text-align: left;
  margin-bottom: 0.75rem;
  display: flex;
  align-items: baseline;
  gap: 0.4rem;
}

.fee-adjustment-lines {
  margin-top: 0.25rem;
}

.fee-line {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.fee-label {
  flex: 0 0 30rem;
}

.fee-amount {
  display: flex;
  align-items: baseline;
  gap: 0.15rem;
  flex-shrink: 0;
}

.fee-amount .fill-line.med:not(:empty) {
  width: auto;
  min-width: 8rem;
}

.fill-line {
  display: inline-block;
  border-bottom: 1px solid #000;
  height: 1.1rem;
}

.fill-line.short { width: 16rem; }
.fill-line.med   { width: 18rem; }
.fill-line.grow  { flex: 1; }

.fill-line:not(:empty) {
  border-bottom: none;
  height: auto;
}

p.fill-line.full:not(:empty) {
  border-bottom: none;
  margin-bottom: 0.75rem;
}

p.fill-line.full {
  display: block;
  width: 100%;
  border-bottom: 1px solid #000;
}

.signature-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  column-gap: 2.5rem;
  row-gap: 0.75rem;
  margin-top: 1rem;
}

.sig-party {
  font-weight: 600;
  margin: 0 0 0.25rem;
}

.signature-group-fill-in {
  display: flex;
  align-items: flex-end;
  gap: 0.5rem;
  height: 100%;
}

.sig-label {
  flex: 0 0 5.75rem;
  padding-bottom: 0.1rem;
}

.signature-group-fill-in .fill-in,
.signature-group-fill-in .signature-line {
  flex: 1;
  min-height: 1.25rem;
  font-size: 1.2rem;
  line-height: 1.25rem;
}

.signature-group-fill-in .signature-line {
  font-size: 2rem;
  line-height: 2rem;
}

.signature-row-signature {
  min-height: 3rem;
}

.signature-row-signature .fill-in,
.signature-row-signature .signature-line {
  display: flex;
  align-items: flex-end;
}

.show-fill-lines .fill-in,
.show-fill-lines .signature-line {
  border-bottom: 1px solid #000;
}

.signature-row-signature.show-fill-lines .fill-in,
.signature-row-signature.show-fill-lines .signature-line {
  border-bottom: 1.5px solid #000;
}

.signature-row-signature img {
  height: 3rem;
  display: block;
}

footer {
  margin-top: auto;
  page-break-before: auto;
  page-break-inside: avoid;
}

.footer-container {
  padding-left: 5%;
  padding-right: 5%;
  padding-bottom: 2%;
}

.footer-left {
  justify-content: left;
  align-items: center;
  min-width: 50%;
  padding-top: 0.5rem;
  padding-bottom: 0.5rem;
}

.footer-right {
  justify-content: right;
  align-items: center;
  min-width: 50%;
  padding-top: 0.5rem;
  padding-bottom: 0.5rem;
}

.csa-logo-container {
  display: flex;
  flex-direction: column;
  align-items: end;
}

.csa-cpy-txt {
  font-size: .665rem;
  margin-top: -0.3rem;
}

/* ======================================================================================================================
   Exhibit mode (payload carries `exhibit`; app.js adds body.exhibit-mode). One 816 x 1054 u sheet, 1u = 1/816 of the page
   width, rendered with ?fit=chrome. Letter text, footer and signature rules as on the Contract (Task 4); the Change Order
   body (.co-meta, .co-box, .co-fee) and .accept/.sigcols from the 1245x engagement letter's Change Order; the navy header
   band and exhibit call-out as on the Summary of Benefits / Add-On Services exhibits. Everything above stays the rework
   change order's, untouched; everything below applies only under .exhibit-mode.
   ====================================================================================================================== */
.exhibit-mode {
  --u: calc(100vw / 816);
  --ink-1: #002e5b; --ink-2: #283a54; --ink-3: #5a6b7c; --ink-deep: #002e5b;
  --blue-1: #2381bf; --on-dark-3: #a9c2d6;
  --letter-ink: #1d1d1f;
  --f-letter: Montserrat, Helvetica, Arial, sans-serif;
  --f-display: "League Spartan", Poppins, Helvetica, Arial, sans-serif;
  background: #fff;
}
.exhibit-mode * { -webkit-print-color-adjust: exact; print-color-adjust: exact; box-sizing: border-box; }

.exhibit-mode .sheet { position: relative; width: 100vw; height: calc(1054 * var(--u)); overflow: hidden; display: flex; flex-direction: column; overflow-wrap: anywhere; }
.exhibit-mode .letter { font-family: var(--f-letter); font-weight: 400; color: var(--letter-ink); font-size: calc(12.4 * var(--u)); line-height: 1.32; }
.exhibit-mode .letter p { margin: 0 0 calc(12 * var(--u)); line-height: 1.32; text-align: justify; }
.exhibit-mode .letter p.l { text-align: left; }
.exhibit-mode .letter b { font-weight: 700; }

/* header band (Summary of Benefits / Add-On Services exhibits) */
.exhibit-mode .head { flex-shrink: 0; background: var(--ink-deep); color: #fff; padding: calc(13 * var(--u)) calc(48 * var(--u)) calc(11 * var(--u)); display: flex; align-items: flex-end; justify-content: space-between; gap: calc(24 * var(--u)); }
.exhibit-mode .head > div:first-child { flex-shrink: 0; }
.exhibit-mode .head-title { font-family: var(--f-display); font-weight: 800; letter-spacing: -0.02em; font-size: calc(26 * var(--u)); line-height: 1.05; }
.exhibit-mode .head-exhibit { margin-top: calc(5 * var(--u)); font-family: var(--f-letter); font-weight: 700; font-size: calc(10 * var(--u)); letter-spacing: 0.24em; line-height: 1.3; color: #fff; text-transform: uppercase; }
.exhibit-mode .head-stamp { min-width: 0; max-width: 62%; font-family: var(--f-letter); font-weight: 700; font-size: calc(8.5 * var(--u)); letter-spacing: 0.28em; line-height: 1.4; color: var(--on-dark-3); text-transform: uppercase; text-align: right; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }

/* body: inside the 48 u side margins, clear of the footer (its logo top is about 70 u above the sheet bottom) */
.exhibit-mode .co-body { flex: 1 1 auto; min-height: 0; position: relative; margin: calc(22 * var(--u)) calc(48 * var(--u)) calc(84 * var(--u)); overflow: hidden; }

/* Change Order (1245x letter) */
.exhibit-mode .co-meta { display: grid; grid-template-columns: calc(220 * var(--u)) minmax(0, 1fr); row-gap: calc(8 * var(--u)); margin-bottom: calc(16 * var(--u)); max-width: calc(560 * var(--u)); }
.exhibit-mode .co-meta .fill { border-bottom: 1px solid var(--letter-ink); min-height: 1.3em; }
.exhibit-mode .co-box { border: 1px solid #9aa4ae; min-height: calc(110 * var(--u)); margin: calc(4 * var(--u)) 0 calc(14 * var(--u)); }
.exhibit-mode .co-box.sm { min-height: calc(54 * var(--u)); }
.exhibit-mode .co-fee { display: grid; grid-template-columns: minmax(0, 1fr) calc(170 * var(--u)); row-gap: calc(6 * var(--u)); column-gap: calc(12 * var(--u)); margin: calc(4 * var(--u)) 0 calc(14 * var(--u)) calc(24 * var(--u)); }
.exhibit-mode .co-fee .fill { border-bottom: 1px solid var(--letter-ink); text-align: right; padding-right: calc(4 * var(--u)); min-height: 1.3em; }
.exhibit-mode .co-fee .fill.money:empty::before { content: "$"; float: left; }
.exhibit-mode .co-fee .strong { font-weight: 700; }

/* signature block (Contract / 1245x letter); every row is a hand-fill line here */
.exhibit-mode .accept { margin-top: calc(10 * var(--u)); }
.exhibit-mode .accept-h { font-weight: 700; margin-bottom: calc(12 * var(--u)); }
.exhibit-mode .sigcols { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: calc(40 * var(--u)); }
.exhibit-mode .sigcol { min-width: 0; }
.exhibit-mode .sigcol .who { font-weight: 700; margin-bottom: calc(10 * var(--u)); }
.exhibit-mode .sigrow { display: grid; grid-template-columns: calc(70 * var(--u)) minmax(0, 1fr); align-items: end; min-height: calc(32 * var(--u)); border-bottom: 1px solid transparent; margin-bottom: calc(10 * var(--u)); padding-bottom: calc(3 * var(--u)); }
.exhibit-mode .sigcol.show-fill-lines .sigrow { border-bottom-color: var(--letter-ink); }

/* footer (Contract): CSA logo, empty centre for the join's page number, copyright */
.exhibit-mode .lfoot { position: absolute; left: calc(48 * var(--u)); right: calc(48 * var(--u)); bottom: calc(26 * var(--u)); display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; font-family: var(--f-letter); font-size: calc(12.4 * var(--u)); color: var(--letter-ink); }
.exhibit-mode .lfoot img { width: calc(188 * var(--u)); display: block; }
.exhibit-mode .lfoot .pg { text-align: center; }
.exhibit-mode .lfoot .copy { text-align: right; font-size: calc(9 * var(--u)); display: flex; flex-direction: column; align-items: flex-end; gap: calc(6 * var(--u)); }
.exhibit-mode .lfoot .copy img.partner { width: auto; height: calc(36 * var(--u)); }

/* a long company name: the writing boxes give way first, then the spacing (app.js fitExhibitSheet) */
.exhibit-mode .sheet.tight-1 .co-box { min-height: calc(80 * var(--u)); }
.exhibit-mode .sheet.tight-1 .co-box.sm { min-height: calc(40 * var(--u)); }
.exhibit-mode .sheet.tight-2 .sigrow { min-height: calc(28 * var(--u)); margin-bottom: calc(6 * var(--u)); }
.exhibit-mode .sheet.tight-2 .letter p, .exhibit-mode .sheet.tight-2 p { margin-bottom: calc(8 * var(--u)); }
.exhibit-mode .fill-line.short { display: inline-block; width: calc(150 * var(--u)); height: 1.1em; border-bottom: 1px solid var(--letter-ink); }
