/* The quote document: white paper, same on screen, in PDF and in print */
.doc {
  position: relative; overflow: hidden; background: var(--paper); color: var(--text-paper); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-1); padding: 0 0 36px; font-size: 14.5px; line-height: 1.5; font-family: var(--f-body);
}
.d-water {
  position: absolute; top: 46%; left: 50%; transform: translate(-50%, -50%) rotate(-24deg); pointer-events: none; z-index: 0;
  font-family: var(--f-display); font-weight: 900; text-transform: uppercase; font-size: clamp(56px, 12vw, 128px); letter-spacing: .04em;
  color: rgba(215, 150, 50, .09); white-space: nowrap; border: 8px solid rgba(215, 150, 50, .08); padding: 0 .3em;
}
.doc > * { position: relative; z-index: 1; }
.d-head { display: flex; justify-content: space-between; gap: 24px; background: var(--teal); color: var(--white); padding: 26px 36px; flex-wrap: wrap; }
.d-brand { display: flex; gap: 18px; align-items: center; }
.d-logo { width: 112px; height: auto; }
.d-loc { display: flex; flex-direction: column; font-size: 13px; color: #d4eced; line-height: 1.45; }
.d-loc strong { color: var(--white); font-family: var(--f-display); font-weight: 800; font-size: 15px; }
.d-title { text-align: right; }
.d-title h3 { margin: 0 0 6px; font-family: var(--f-display); font-weight: 900; text-transform: uppercase; font-size: 26px; letter-spacing: .01em; }
.d-title dl { margin: 10px 0 0; display: grid; gap: 2px; font-size: 13px; }
.d-title dl div { display: flex; justify-content: flex-end; gap: 10px; }
.d-title dt { color: #bfe2e3; }
.d-title dd { margin: 0; font-weight: 700; font-variant-numeric: tabular-nums; }
.d-chip { display: inline-block; font-family: var(--f-display); font-weight: 800; text-transform: uppercase; font-size: 11px; letter-spacing: .06em; padding: 4px 9px; border: 2px solid var(--gold); color: var(--gold-light); }
.d-chip.pre { background: rgba(0, 0, 0, .18); }
.d-chip.ok { border-color: #7fe07b; color: #b6f5b3; }
.d-prelim { margin: 0; padding: 12px 36px; background: #fff6e6; color: #6b4a12; font-size: 13.5px; border-bottom: 1px solid #f1dfbd; }
.d-meta { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; padding: 26px 36px 8px; }
.d-meta h4, .d-block h4 { margin: 0 0 6px; font-family: var(--f-display); font-weight: 800; font-size: 12.5px; text-transform: uppercase; letter-spacing: .05em; color: var(--teal); }
.d-meta p { margin: 0; color: var(--text-paper-2); }
.d-meta strong { color: var(--text-paper); }
.d-table { width: calc(100% - 72px); margin: 18px 36px 0; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.d-table thead th { text-align: left; font-family: var(--f-display); font-weight: 700; font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--text-paper-2); padding: 0 8px 8px 0; border-bottom: 2px solid var(--text-paper); }
.d-table th.d-amt, .d-table td.d-amt { text-align: right; padding-right: 0; }
.d-cat th { text-align: left; font-family: var(--f-display); font-weight: 800; font-size: 13px; color: var(--teal); padding: 16px 0 4px; border-bottom: 1px solid var(--line-paper); }
.d-line td { padding: 10px 10px 10px 0; border-bottom: 1px solid var(--line-paper); vertical-align: top; }
.d-name { display: block; font-weight: 500; color: var(--text-paper); }
.d-sub { display: block; font-size: 12.5px; color: var(--text-paper-2); margin-top: 2px; }
.d-taxed { display: inline-block; font-size: 10.5px; text-transform: uppercase; letter-spacing: .05em; color: var(--text-paper-2); border: 1px solid var(--line-paper); padding: 0 5px; border-radius: 3px; margin-top: 4px; }
.d-qty { white-space: nowrap; color: var(--text-paper-2); }
.d-unit { white-space: nowrap; }
.d-per, .d-fee { display: block; font-size: 12px; color: var(--text-paper-2); }
.d-amt { font-family: var(--f-display); font-weight: 700; white-space: nowrap; }
.d-tbd { color: var(--gold-deep); font-weight: 600; }
.d-none { padding: 22px 0; color: var(--text-paper-2); }
.d-totals { margin: 18px 36px 0 auto; max-width: 420px; padding: 0 36px 0 0; width: 100%; font-variant-numeric: tabular-nums; }
.d-tr { display: flex; justify-content: space-between; gap: 16px; padding: 4px 0; color: var(--text-paper-2); }
.d-grand { border-top: 2px solid var(--text-paper); margin-top: 8px; padding-top: 12px; color: var(--text-paper); align-items: baseline; }
.d-grand span { font-family: var(--f-display); font-weight: 800; text-transform: uppercase; font-size: 13px; }
.d-grand strong { font-family: var(--f-display); font-weight: 900; font-size: 26px; }
.d-paid { color: #2f7d2b; }
.d-bal strong { font-family: var(--f-display); font-weight: 900; font-size: 18px; color: var(--text-paper); }
.d-tnote { margin: 4px 0 0; font-size: 12.5px; color: var(--text-paper-2); text-align: right; }
.d-block { padding: 22px 36px 0; }
.d-block p { margin: 0; color: var(--text-paper); max-width: 72ch; }
.d-block ul { margin: 0; padding-left: 18px; color: var(--text-paper-2); display: grid; gap: 3px; max-width: 76ch; }
.d-sign { display: flex; flex-direction: column; padding: 26px 36px 0; color: var(--text-paper-2); font-size: 14px; }
.d-sign strong { font-family: var(--f-display); font-weight: 800; color: var(--text-paper); font-size: 16px; margin-top: 2px; }

@media (max-width: 680px) {
  .doc { font-size: 14px; }
  .d-head { padding: 20px; }
  .d-title { text-align: left; }
  .d-title dl div { justify-content: flex-start; }
  .d-prelim, .d-block, .d-sign { padding-left: 20px; padding-right: 20px; }
  .d-meta { grid-template-columns: 1fr; padding: 20px 20px 4px; gap: 14px; }
  .d-table { width: calc(100% - 40px); margin: 14px 20px 0; }
  .d-table thead { display: none; }
  .d-line { display: grid; grid-template-columns: 1fr auto; border-bottom: 1px solid var(--line-paper); padding: 10px 0; }
  .d-line td { border: 0; padding: 0; }
  .d-line .d-item { grid-column: 1 / -1; }
  .d-line .d-qty { grid-column: 1; font-size: 13px; }
  .d-line .d-unit { grid-column: 1; font-size: 13px; }
  .d-line .d-unit .d-per, .d-line .d-unit .d-fee { display: inline; margin-left: 4px; }
  .d-line .d-amt { grid-column: 2; grid-row: 2 / span 2; align-self: center; }
  .d-totals { margin: 16px 0 0; padding: 0 20px; max-width: none; }
}

@media print {
  body { background: #fff !important; }
  .doc { box-shadow: none; border-radius: 0; }
}
