/* Generated from doc-page.css.ts DOC_CSS. Do not edit by hand. */

/* Self-sufficiency reset.
 *
 * In the app this document sits under a global `* { margin:0; padding:0;
 * box-sizing:border-box }`; in the bare capture and print iframes it does not,
 * and the difference is visible. Under content-box a `width:100%` totals bar
 * with padding overhangs the page edge and `tb-boxed`'s bordered table runs 2px
 * wide - in the download only. Restating the reset here is what lets DOC_CSS
 * be the complete definition of the page in every context that renders it.
 *
 * :where() zeroes the specificity so every rule below still wins, including the
 * single-class ones that set their own margins.
 */
:where(.doc), :where(.doc) :where(*), :where(.doc) :where(*)::before, :where(.doc) :where(*)::after {
  box-sizing: border-box;
}
:where(.doc) :where(p, table, thead, tbody, tr, th, td, ul, ol, li, figure, h1, h2, h3, h4, h5, h6) {
  margin: 0;
  padding: 0;
  font-family: inherit;
  font-size: inherit;
  font-weight: inherit;
}

.doc {
  --bg: #ffffff;
  --primary: #4f46e5;
  --secondary: #e0e7ff;
  --accent: #f97316;
  --text: #1e1b4b;
  --muted: #6b7280;
  --line: #e5e7eb;
  --body-font: Inter, Arial, sans-serif;
  --head-font: Inter, Arial, sans-serif;
  --head-weight: 700;
  --head-track: -0.2px;
  --label-track: 0.9px;
  --pad-t: 48px; --pad-r: 56px; --pad-b: 48px; --pad-l: 56px;
  --page-w: 794px; --page-h: 1123px;

  width: var(--page-w);
  min-height: var(--page-h);
  box-sizing: border-box;
  padding: var(--pad-t) var(--pad-r) var(--pad-b) var(--pad-l);
  background: var(--bg);
  color: var(--text);
  font-family: var(--body-font);
  font-size: 14px;
  line-height: 1.5;
  position: relative;
  -webkit-font-smoothing: antialiased;
}

/* Decoration layer. Clipped to the page so a frame can never bleed outside it,
   while the content layer above stays unclipped and free to overflow onto a
   second page. */
.doc-deco { position: absolute; top: 0; right: 0; bottom: 0; left: 0; overflow: hidden; pointer-events: none; }
.doc-deco > span { position: absolute; display: none; }
.doc-wm { display: none; }
.doc-body { position: relative; z-index: 1; }

/* â”€â”€ Header â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.doc-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 24px; margin-bottom: 30px; }
.doc-ident { min-width: 0; }
.doc-mark { flex-shrink: 0; }
.doc-eyebrow { display: none; font-size: 10px; font-weight: 700; line-height: 1.2; letter-spacing: 1.4px; text-transform: uppercase; color: var(--muted); margin: 0 0 4px; }
.doc-logo { max-height: 60px; max-width: 200px; object-fit: contain; display: block; margin-bottom: 10px; }
.doc-biz { font-family: var(--head-font); font-size: 22px; font-weight: var(--head-weight); letter-spacing: var(--head-track); margin: 0; color: var(--text); line-height: 1.2; }
.doc-sub { color: var(--muted); white-space: pre-line; margin: 4px 0 0; font-size: 12.5px; line-height: 1.5; }

/* NEVER centre text by giving a box a fixed height and a matching line-height.
 *
 * That trick leaves a large "half-leading" - here (34 - 15) / 2 = 9.5px of
 * empty space the browser splits above and below the glyphs - and the browser
 * and the rasteriser do not agree on it: the browser measures the baseline
 * from the glyph box, the rasteriser from the line box. The text then lands
 * ~9px lower in the export than in the preview, which is the "INVOICE is not
 * in the middle, it's at the bottom" bug. Padding produces the same look with
 * no leading to disagree over, so both renderers place the glyphs identically.
 * The extra 1px on top optically centres all-caps text, whose cap height sits
 * above the baseline with descender space left empty below.
 */
.doc-badge {
  font-family: var(--head-font);
  font-size: 15px; font-weight: 700; letter-spacing: 3px; line-height: 1.15;
  color: var(--primary); border: 2px solid var(--primary); border-radius: 8px;
  display: inline-block; box-sizing: border-box; white-space: nowrap;
  padding: 11px 16px 10px; text-align: center;
}
.doc-badge-no { display: none; margin: 6px 0 0; font-size: 13px; font-weight: 700; line-height: 1.25; color: var(--muted); text-align: right; letter-spacing: 0.4px; }

/* â”€â”€ Meta (bill-to + facts) â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.doc-meta { display: flex; justify-content: space-between; align-items: flex-start; gap: 28px; margin-bottom: 26px; }
.doc-party { min-width: 0; overflow-wrap: break-word; }
.doc-label { display: block; font-size: 10px; font-weight: 700; line-height: 1.2; color: var(--muted); text-transform: uppercase; letter-spacing: var(--label-track); margin-bottom: 5px; }
.doc-strong { font-family: var(--head-font); font-weight: 700; font-size: 15px; margin: 0; color: var(--text); line-height: 1.25; }
.doc-facts { flex-shrink: 0; min-width: 190px; }
.doc-fact { display: table; width: 100%; margin: 0 0 6px; font-size: 13px; line-height: 1.25; }
.doc-fact-k { display: table-cell; text-align: left; color: var(--muted); font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: var(--label-track); padding-right: 14px; white-space: nowrap; vertical-align: middle; }
.doc-fact-v { display: table-cell; text-align: right; color: var(--text); font-weight: 600; white-space: nowrap; vertical-align: middle; font-variant-numeric: tabular-nums; }

/* â”€â”€ Items table â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.doc-table { width: 100%; border-collapse: collapse; margin-bottom: 22px; }
.doc-table th {
  text-align: left; font-family: var(--head-font); font-size: 10.5px; font-weight: 700;
  text-transform: uppercase; letter-spacing: var(--label-track); color: var(--muted);
  border-bottom: 2px solid var(--line); padding: 11px 8px 10px; line-height: 1.25; vertical-align: middle;
}
.doc-table th:first-child { padding-left: 0; }
.doc-table th:last-child { padding-right: 0; }
.doc-table td { padding: 12px 8px 11px; border-bottom: 1px solid var(--line); vertical-align: middle; line-height: 1.35; color: var(--text); font-size: 13.5px; }
.doc-table td:first-child { padding-left: 0; }
.doc-table td:last-child { padding-right: 0; }
.doc-table .r { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.doc-item-note { display: block; font-size: 11.5px; color: var(--muted); margin-top: 3px; line-height: 1.4; }

/* â”€â”€ Footer: payment details + totals â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
/* The two gaps are variables so a tool can expose them: an invoice with three
   line items wants the totals close under the table, one that fills the page
   wants them pushed down. Default 0 keeps every existing template exactly as
   it was - the table's own margin-bottom is still what separates them. */
.doc-foot { display: flex; justify-content: space-between; align-items: flex-start; gap: 36px;
  margin-top: var(--foot-gap-t, 0px); margin-bottom: var(--foot-gap-b, 0px); }
.doc-pay { flex: 1 1 auto; max-width: 330px; font-size: 12.5px; color: var(--muted); white-space: pre-line; line-height: 1.55; }
.doc-pay .doc-label { margin-bottom: 6px; }
.doc-pay-body { white-space: pre-line; }
.doc-pay-qr { margin-top: 10px; display: flex; flex-direction: column; align-items: flex-start; gap: 4px; white-space: normal; }
.doc-pay-qr img { width: 88px; height: 88px; display: block; border-radius: 4px; }
.doc-pay-qr-caption { font-size: 10px; color: var(--muted); letter-spacing: 0.3px; }

/* Totals use display:table rows rather than flex: the rasteriser lays flex
   rows out from their own text metrics and overlaps a long label with its
   value, where table cells stay in their columns. */
.doc-totals { width: 300px; flex: 0 0 auto; margin-left: auto; box-sizing: border-box; }
.doc-total-row { display: table; width: 100%; table-layout: fixed; margin: 0 0 9px; color: var(--muted); font-size: 13.5px; line-height: 1.25; }
.doc-total-label { display: table-cell; text-align: left; vertical-align: middle; padding: 0 12px 0 0; }
.doc-total-val { display: table-cell; text-align: right; vertical-align: middle; white-space: nowrap; width: 46%; font-variant-numeric: tabular-nums; color: var(--text); }
.doc-grand { font-family: var(--head-font); font-weight: 700; color: var(--text); font-size: 18px; line-height: 1.2; border-top: 2px solid var(--line); padding-top: 12px; margin-top: 4px; margin-bottom: 0; }
.doc-grand .doc-total-label, .doc-grand .doc-total-val { color: var(--text); font-weight: 700; font-size: 18px; }

.doc-notes { color: var(--muted); font-size: 12px; border-top: 1px solid var(--line); padding-top: 14px; white-space: pre-line; margin: 28px 0 0; line-height: 1.55; }
.doc-sign { display: none; margin-top: 34px; text-align: right; }
/* Hooks only some layouts show (Modern & Bold member sheets): the amount due
   next to the facts, a thank-you + signature row, and a one-line contact strip. */
.doc-due, .doc-end, .doc-strip { display: none; }
/* An added signature shows the thank-you + signature row on EVERY layout, with
   the image standing on the rule above "Authorised signature". The row's
   defaults are zero-specificity (:where), so a layout that styles .doc-end /
   .doc-end-sign itself keeps its own look. */
:where(.doc.has-sign) .doc-end { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; margin-top: 30px; }
:where(.doc.has-sign) .doc-end-sign { display: flex; flex-direction: column; align-items: center; flex: 0 0 auto; margin-inline-start: auto; }
:where(.doc.has-sign) .doc-end-line { display: block; width: 180px; height: 0; border-top: 1.5px solid var(--text); margin: 0 0 7px; }
:where(.doc.has-sign) .doc-end-label { font-size: 10px; font-weight: 700; letter-spacing: 1.4px; text-transform: uppercase; color: var(--muted); }
/* Closing line or signature label removed in the editor: the slot stays (so a
   space-between row keeps the signature on the right) but shows nothing. */
.doc-thanks.is-empty, .doc-end-label.is-empty { visibility: hidden; }
.doc-end-sig { position: relative; z-index: 1; display: block; width: auto; max-width: 260px; object-fit: contain; margin: 0 auto -8px; }
.doc-sign-line { display: inline-block; width: 210px; border-top: 1px solid var(--line); padding-top: 6px; font-size: 11px; color: var(--muted); letter-spacing: var(--label-track); text-transform: uppercase; font-weight: 700; }

/* Typography systems */
.ty-sans      { --head-font: Inter, Arial, sans-serif; --body-font: Inter, Arial, sans-serif; --head-weight: 700; --head-track: -0.3px; --label-track: 0.9px; }
.ty-grotesk   { --head-font: "Space Grotesk", Inter, sans-serif; --body-font: Inter, Arial, sans-serif; --head-weight: 700; --head-track: -0.1px; --label-track: 1.6px; }
.ty-serifhead { --head-font: "Playfair Display", Georgia, serif; --body-font: Inter, Arial, sans-serif; --head-weight: 700; --head-track: 0; --label-track: 1.2px; }
.ty-editorial { --head-font: "Playfair Display", Georgia, serif; --body-font: Lora, Georgia, serif; --head-weight: 600; --head-track: 0; --label-track: 1.4px; }
.ty-mono      { --head-font: "IBM Plex Mono", "Courier New", monospace; --body-font: Inter, Arial, sans-serif; --head-weight: 600; --head-track: -0.4px; --label-track: 1.5px; }
.ty-geo       { --head-font: Poppins, Inter, sans-serif; --body-font: Poppins, Inter, sans-serif; --head-weight: 800; --head-track: -0.5px; --label-track: 1px; }

.ty-mono .doc-fact-v, .ty-mono .doc-total-val, .ty-mono .doc-table .r { font-family: "IBM Plex Mono", "Courier New", monospace; }
.ty-editorial .doc-biz { font-size: 25px; }
.ty-geo .doc-biz { font-size: 21px; }
.ty-grotesk .doc-biz { font-size: 21px; }

/* Frames - everything that touches the page edge */

/* fr-plain: deliberately nothing. */

.fr-topbar { padding-top: calc(var(--pad-t) + 6px); }
.fr-topbar .d1 { display: block; top: 0; left: 0; right: 0; height: 12px; background: var(--primary); }

.fr-gradbar { padding-top: calc(var(--pad-t) + 4px); }
.fr-gradbar .d1 { display: block; top: 0; left: 0; right: 0; height: 8px; background: linear-gradient(90deg, var(--primary) 0%, var(--accent) 100%); }

.fr-leftrail { padding-left: calc(var(--pad-l) + 18px); }
.fr-leftrail .d1 { display: block; top: 0; bottom: 0; left: 0; width: 14px; background: var(--primary); }

.fr-rightrule { padding-right: calc(var(--pad-r) + 14px); }
.fr-rightrule .d1 { display: block; top: 40px; bottom: 40px; right: 22px; width: 3px; background: var(--accent); }
.fr-rightrule .d2 { display: block; top: 40px; right: 18px; width: 11px; height: 11px; border-radius: 50%; background: var(--accent); }

.fr-hairline { padding: calc(var(--pad-t) + 14px) calc(var(--pad-r) + 14px) calc(var(--pad-b) + 14px) calc(var(--pad-l) + 14px); }
.fr-hairline .d1 { display: block; top: 16px; right: 16px; bottom: 16px; left: 16px; border: 1px solid var(--primary); }

/* The quarter-circle is --secondary, never --primary: it sits under the badge,
   and every palette's secondary is a low-contrast tint of its own background,
   so header text stays legible on light and dark palettes alike. */
.fr-corner .d1 { display: block; top: 0; right: 0; width: 152px; height: 152px; background: var(--secondary); border-radius: 0 0 0 152px; }
.fr-corner .d2 { display: block; top: 0; right: 0; width: 58px; height: 10px; background: var(--primary); }
.fr-corner .d3 { display: block; left: 0; bottom: 0; width: 58px; height: 58px; background: var(--secondary); border-radius: 0 58px 0 0; }

.fr-brackets { padding: calc(var(--pad-t) + 10px) calc(var(--pad-r) + 10px) calc(var(--pad-b) + 10px) calc(var(--pad-l) + 10px); }
.fr-brackets .d1 { display: block; top: 20px; left: 20px; width: 54px; height: 54px; border-top: 3px solid var(--primary); border-left: 3px solid var(--primary); }
.fr-brackets .d2 { display: block; top: 20px; right: 20px; width: 54px; height: 54px; border-top: 3px solid var(--primary); border-right: 3px solid var(--primary); }
.fr-brackets .d3 { display: block; bottom: 20px; left: 20px; width: 54px; height: 54px; border-bottom: 3px solid var(--primary); border-left: 3px solid var(--primary); }
.fr-brackets .d4 { display: block; bottom: 20px; right: 20px; width: 54px; height: 54px; border-bottom: 3px solid var(--primary); border-right: 3px solid var(--primary); }

/* The three --primary bands set only geometry here; their text/badge contrast
   overrides live in the "coloured band" block at the very end of this file,
   where they can outrank the .bd-* badge rules. */
.fr-headband .doc-head {
  background: var(--primary);
  margin: calc(-1 * var(--pad-t)) calc(-1 * var(--pad-r)) 32px calc(-1 * var(--pad-l));
  padding: 34px var(--pad-r) 32px var(--pad-l);
}

.fr-headtint .doc-head {
  background: var(--secondary);
  margin: calc(-1 * var(--pad-t)) calc(-1 * var(--pad-r)) 32px calc(-1 * var(--pad-l));
  padding: 34px var(--pad-r) 32px var(--pad-l);
}

.fr-arch .doc-head {
  background: var(--primary);
  margin: calc(-1 * var(--pad-t)) calc(-1 * var(--pad-r)) 34px calc(-1 * var(--pad-l));
  padding: 34px var(--pad-r) 36px var(--pad-l);
  border-radius: 0 0 0 88px;
}

.fr-diagonal .doc-head {
  background: linear-gradient(174deg, var(--primary) 0%, var(--primary) 84%, transparent 84.2%);
  margin: calc(-1 * var(--pad-t)) calc(-1 * var(--pad-r)) 26px calc(-1 * var(--pad-l));
  padding: 34px var(--pad-r) 58px var(--pad-l);
}

.fr-sidepanel { padding-left: calc(var(--pad-l) + 74px); }
.fr-sidepanel .d1 { display: block; top: 0; bottom: 0; left: 0; width: 62px; background: var(--secondary); }
.fr-sidepanel .d2 { display: block; top: 0; bottom: 0; left: 62px; width: 2px; background: var(--primary); }

.fr-spine { padding-left: calc(var(--pad-l) + 30px); }
.fr-spine .d1 { display: block; top: 0; bottom: 0; left: 0; width: 26px; background: var(--primary); }
.fr-spine .d2 { display: block; top: 46px; left: 6px; width: 14px; height: 14px; border-radius: 50%; background: var(--bg); }

.fr-footerbar { padding-bottom: calc(var(--pad-b) + 22px); }
.fr-footerbar .d1 { display: block; left: 0; right: 0; bottom: 0; height: 16px; background: var(--primary); }
.fr-footerbar .d2 { display: block; left: 0; right: 60%; bottom: 16px; height: 4px; background: var(--accent); }

.fr-watermark .doc-wm {
  display: block; position: absolute; top: 96px; right: -26px;
  font-family: var(--head-font); font-size: 132px; font-weight: 800; line-height: 1;
  letter-spacing: -6px; color: var(--secondary);
}

.fr-dotgrid .d1 {
  display: block; top: 0; right: 0; bottom: 0; left: 0;
  background-image: radial-gradient(var(--secondary) 1.4px, transparent 1.4px);
  background-size: 20px 20px; background-position: 0 0;
}

.fr-stripecorner .d1 {
  display: block; top: 0; right: 0; width: 230px; height: 150px;
  background-image: repeating-linear-gradient(135deg, var(--secondary) 0px, var(--secondary) 7px, transparent 7px, transparent 16px);
}

.fr-tabtop { padding-top: calc(var(--pad-t) + 14px); }
.fr-tabtop .d1 { display: block; top: 0; left: 44px; width: 118px; height: 22px; background: var(--primary); border-radius: 0 0 10px 10px; }
.fr-tabtop .d2 { display: block; top: 0; left: 0; right: 0; height: 3px; background: var(--secondary); }

.fr-halo { padding-top: calc(var(--pad-t) + 4px); }
.fr-halo .d1 { display: block; top: 0; left: 0; right: 0; height: 5px; background: var(--primary); }
.fr-halo .d2 { display: block; top: -110px; right: -110px; width: 340px; height: 340px; border-radius: 50%; background: var(--secondary); }

/* Header arrangements */

/* hd-split is the base rule above. */

.hd-splitmid .doc-head { align-items: center; }

.hd-mirror .doc-head { flex-direction: row-reverse; }
.hd-mirror .doc-ident { text-align: right; }
.hd-mirror .doc-logo { margin-left: auto; }

.hd-center .doc-head { flex-direction: column; align-items: center; text-align: center; gap: 16px; }
.hd-center .doc-logo { margin-left: auto; margin-right: auto; }
.hd-center .doc-badge-no { text-align: center; }

.hd-stackbadge .doc-head { flex-direction: column; align-items: flex-start; gap: 16px; }
.hd-stackbadge .doc-mark { order: -1; }
.hd-stackbadge .doc-badge-no { text-align: left; }

.hd-mega .doc-biz { font-size: 34px; line-height: 1.1; }
.hd-mega .doc-head { align-items: flex-end; }
.hd-mega .doc-badge { font-size: 12px; padding: 9px 12px 8px; letter-spacing: 2px; }

.hd-eyebrow .doc-eyebrow { display: block; }

.hd-tight .doc-head { align-items: center; margin-bottom: 22px; }
.hd-tight .doc-biz { font-size: 18px; }
.hd-tight .doc-logo { max-height: 40px; margin-bottom: 6px; }
.hd-tight .doc-badge { font-size: 13px; padding: 9px 13px 8px; }

.hd-underline .doc-head { border-bottom: 3px solid var(--primary); padding-bottom: 18px; }

.hd-boxed .doc-head { border: 1px solid var(--line); border-radius: 12px; padding: 22px 24px; }

/* Table treatments */

/* tb-rule is the base rule above, with a primary-coloured head rule. */
.tb-rule .doc-table th { border-bottom-color: var(--primary); color: var(--primary); }

.tb-fill .doc-table th { background: var(--primary); color: var(--on-primary, #ffffff); border: none; padding: 11px 10px; }
.tb-fill .doc-table th:first-child { padding-left: 14px; }
.tb-fill .doc-table th:last-child { padding-right: 14px; }
.tb-fill .doc-table td:first-child { padding-left: 14px; }
.tb-fill .doc-table td:last-child { padding-right: 14px; }

.tb-tint .doc-table th { background: var(--secondary); color: var(--text); border: none; padding: 11px 10px; }
.tb-tint .doc-table th:first-child { padding-left: 14px; }
.tb-tint .doc-table th:last-child { padding-right: 14px; }
.tb-tint .doc-table td:first-child { padding-left: 14px; }
.tb-tint .doc-table td:last-child { padding-right: 14px; }

.tb-pill .doc-table { border-collapse: separate; border-spacing: 0; }
.tb-pill .doc-table th { background: var(--primary); color: var(--on-primary, #ffffff); border: none; padding: 11px 10px; }
.tb-pill .doc-table th:first-child { border-radius: 10px 0 0 10px; padding-left: 16px; }
.tb-pill .doc-table th:last-child { border-radius: 0 10px 10px 0; padding-right: 16px; }
.tb-pill .doc-table td { border-bottom: 1px solid var(--line); }
.tb-pill .doc-table td:first-child { padding-left: 16px; }
.tb-pill .doc-table td:last-child { padding-right: 16px; }

.tb-zebra .doc-table th { border-bottom: none; padding-bottom: 8px; }
.tb-zebra .doc-table td { border-bottom: none; padding: 12px 10px; }
.tb-zebra .doc-table tbody tr:nth-child(odd) td { background: var(--secondary); }
.tb-zebra .doc-table td:first-child { padding-left: 14px; }
.tb-zebra .doc-table td:last-child { padding-right: 14px; }

.tb-open .doc-table th { border-bottom: none; letter-spacing: 2.2px; font-size: 10px; padding-bottom: 4px; }
.tb-open .doc-table td { border-bottom: none; padding: 8px 8px; }
.tb-open .doc-table { margin-bottom: 26px; }

.tb-boxed .doc-table { border: 1px solid var(--line); }
.tb-boxed .doc-table th { border: 1px solid var(--line); border-bottom-width: 2px; padding: 10px 10px; background: var(--bg); }
.tb-boxed .doc-table td { border: 1px solid var(--line); padding: 10px 10px; }
.tb-boxed .doc-table th:first-child, .tb-boxed .doc-table td:first-child { padding-left: 12px; }
.tb-boxed .doc-table th:last-child, .tb-boxed .doc-table td:last-child { padding-right: 12px; }

.tb-dashed .doc-table th { border-bottom: 2px dashed var(--primary); }
.tb-dashed .doc-table td { border-bottom: 1px dashed var(--line); }

.tb-rails .doc-table { border-top: 3px solid var(--text); border-bottom: 3px solid var(--text); }
.tb-rails .doc-table th { border-bottom: 1px solid var(--line); padding-top: 12px; }
.tb-rails .doc-table td { border-bottom: none; }
.tb-rails .doc-table tbody tr:last-child td { padding-bottom: 14px; }

.tb-caps .doc-table th { font-size: 11px; letter-spacing: 2.6px; color: var(--primary); border-bottom: 1px solid var(--text); padding-bottom: 12px; }
.tb-caps .doc-table td { border-bottom: 1px solid var(--line); }

/*
 * Section heading rows inside the items table (DEMOLITION / FLOORING / TRIM ...).
 * A heading is a real <tr> so it keeps the table's column grid. These rules
 * come after the tb-* treatments so a heading wins over a zebra stripe.
 */

/* 1  Crimson Mast - split navy / brand mast, pill table, stacked totals. */
.doc.fr-mastpill { padding-bottom: calc(var(--pad-b) + 52px); }
.doc.fr-mastpill .d6 { display: block; top: 0; left: 0; width: 40%; height: 132px; background: var(--text); }
.doc.fr-mastpill .d7 {
  display: block; top: 0; right: 0; width: 64%; height: 188px;
  background: var(--primary); border-radius: 0 0 0 52px;
}
.doc.fr-mastpill .d1 {
  display: block; top: 148px; right: 48px; width: 268px; height: 46px;
  background: var(--text); border-radius: 999px;
}
.doc.fr-mastpill .d2 { display: block; left: 0; right: 0; bottom: 0; height: 58px; background: var(--text); }
.doc.fr-mastpill .d3 { display: block; left: 28px; bottom: 20px; width: 10px; height: 10px; border-radius: 50%; background: var(--primary); }
.doc.fr-mastpill .d4 { display: block; left: 46px; bottom: 20px; width: 10px; height: 10px; border-radius: 50%; background: var(--primary); }
.doc.fr-mastpill .d5 { display: block; left: 64px; bottom: 20px; width: 10px; height: 10px; border-radius: 50%; background: var(--primary); }
.doc.fr-mastpill .doc-head {
  flex-direction: row; justify-content: space-between; align-items: flex-start;
  background: transparent;
  margin: calc(-1 * var(--pad-t)) calc(-1 * var(--pad-r)) 40px calc(-1 * var(--pad-l));
  padding: 30px var(--pad-r) 56px var(--pad-l);
  border: none; border-radius: 0;
}
.doc.fr-mastpill .doc-ident { max-width: 36%; }
.doc.fr-mastpill .doc-biz, .doc.fr-mastpill .doc-eyebrow { color: var(--on-text, #ffffff); }
.doc.fr-mastpill .doc-head .doc-sub { color: var(--on-text, #ffffff); opacity: .84; }
.doc.fr-mastpill .doc-badge-no { color: var(--on-primary, #ffffff); opacity: .84; }
.doc.fr-mastpill .doc-badge {
  background: transparent; border: none; border-radius: 0; color: var(--on-primary, #ffffff);
  font-size: 34px; font-weight: 800; letter-spacing: 2px; padding: 0; line-height: 1.05;
}
.doc.fr-mastpill .doc-badge-no { display: block; text-align: right; }
.doc.fr-mastpill .doc-strong { color: var(--primary); font-size: 22px; }
.doc.fr-mastpill .doc-table { border-collapse: separate; border-spacing: 0; }
.doc.fr-mastpill .doc-table th {
  background: var(--text); color: var(--on-text, #ffffff); border: none; padding: 12px 12px;
}
.doc.fr-mastpill .doc-table th:first-child { border-radius: 999px 0 0 999px; padding-left: 18px; }
.doc.fr-mastpill .doc-table th:last-child { background: var(--primary); border-radius: 999px; padding-right: 18px; }
.doc.fr-mastpill .doc-table td { border-bottom: none; }
.doc.fr-mastpill .doc-table tbody tr:nth-child(even) td { background: var(--secondary); }
.doc.fr-mastpill .doc-table td:first-child { padding-left: 18px; }
.doc.fr-mastpill .doc-table td:last-child { padding-right: 18px; }
.doc.fr-mastpill .doc-totals {
  background: var(--text); border: none; border-radius: 14px 14px 0 0;
  padding: 16px 18px 0; width: 300px;
}
.doc.fr-mastpill .doc-total-label, .doc.fr-mastpill .doc-total-val { color: var(--on-text, #ffffff); }
.doc.fr-mastpill .doc-grand {
  background: var(--primary); border: none; border-radius: 0 0 14px 14px;
  margin: 8px -18px 0; padding: 14px 18px;
}
.doc.fr-mastpill .doc-grand .doc-total-label, .doc.fr-mastpill .doc-grand .doc-total-val { color: var(--on-primary, #ffffff); }

/* 2  Gold Beam - corner flags, gold rule, full-width total bar. */
.doc.fr-goldbeam { padding-bottom: calc(var(--pad-b) + 28px); }
.doc.fr-goldbeam .d1 {
  display: block; top: 0; left: 0; width: 0; height: 0;
  border-top: 96px solid var(--text); border-right: 110px solid transparent;
}
.doc.fr-goldbeam .d2 {
  display: block; top: 0; left: 0; width: 0; height: 0;
  border-top: 52px solid var(--accent); border-right: 60px solid transparent;
}
.doc.fr-goldbeam .d3 {
  display: block; bottom: 0; right: 0; width: 0; height: 0;
  border-bottom: 90px solid var(--text); border-left: 110px solid transparent;
}
.doc.fr-goldbeam .d4 {
  display: block; bottom: 0; right: 0; width: 0; height: 0;
  border-bottom: 48px solid var(--accent); border-left: 58px solid transparent;
}
.doc.fr-goldbeam .doc-head {
  flex-direction: row; align-items: flex-end;
  border: none; border-bottom: 3px solid var(--accent); padding-bottom: 16px; margin-bottom: 26px;
}
.doc.fr-goldbeam .doc-badge {
  background: transparent; border: none; border-radius: 0; color: var(--text);
  font-size: 32px; font-weight: 800; letter-spacing: 1px; padding: 0;
}
.doc.fr-goldbeam .doc-table th { background: var(--text); color: var(--on-text, #ffffff); border: none; padding: 12px 12px; }
.doc.fr-goldbeam .doc-table th:first-child { padding-left: 14px; }
.doc.fr-goldbeam .doc-table th:last-child { padding-right: 14px; }
.doc.fr-goldbeam .doc-table td { border-bottom: none; }
.doc.fr-goldbeam .doc-table tbody tr:nth-child(odd) td { background: var(--secondary); }
.doc.fr-goldbeam .doc-foot { flex-wrap: wrap; }
.doc.fr-goldbeam .doc-totals { width: 100%; }
.doc.fr-goldbeam .doc-grand {
  background: var(--accent); border: none; border-radius: 0;
  margin: 12px calc(-1 * var(--pad-r)) 0 calc(-1 * var(--pad-l));
  padding: 14px var(--pad-r) 14px var(--pad-l);
}
.doc.fr-goldbeam .doc-grand .doc-total-label, .doc.fr-goldbeam .doc-grand .doc-total-val { color: var(--text); }

/* 3  Dual Chip - overlapping title chip, two-tone table head. */
.doc.fr-dualchip .doc-head { flex-direction: row; align-items: flex-start; border: none; }
.doc.fr-dualchip .doc-mark { position: relative; padding: 6px 0 0 10px; }
.doc.fr-dualchip .doc-mark::before {
  content: ''; display: block; position: absolute; right: -16px; top: 22px;
  width: 118px; height: 34px; background: var(--accent); border-radius: 999px;
}
.doc.fr-dualchip .doc-badge {
  position: relative; z-index: 1;
  background: var(--text); color: var(--on-text, #ffffff); border: none; border-radius: 16px;
  font-size: 20px; letter-spacing: 3px; padding: 16px 26px 14px;
}
.doc.fr-dualchip .doc-badge-no { display: block; color: var(--muted); }
.doc.fr-dualchip .doc-table { border-collapse: separate; border-spacing: 0; }
.doc.fr-dualchip .doc-table th { background: var(--accent); color: var(--on-accent, #ffffff); border: none; padding: 12px 12px; }
.doc.fr-dualchip .doc-table th:first-child { background: var(--text); color: var(--on-text, #ffffff); border-radius: 12px 0 0 12px; padding-left: 16px; }
.doc.fr-dualchip .doc-table th:last-child { border-radius: 0 12px 12px 0; padding-right: 16px; }
.doc.fr-dualchip .doc-table td { border-bottom-color: var(--line); }
.doc.fr-dualchip .doc-totals { border: none; }
.doc.fr-dualchip .doc-grand { border-top: 2px solid var(--text); }

/* 4  Mono Form - typewriter sheet, hatch cap, boxed total. */
.doc.fr-monoform { --head-font: "IBM Plex Mono", "Courier New", monospace; --body-font: "IBM Plex Mono", "Courier New", monospace; }
.doc.fr-monoform .d1 {
  display: block; top: 0; left: 0; right: 0; height: 26px;
  background-image: repeating-linear-gradient(-45deg, var(--text) 0, var(--text) 1px, transparent 1px, transparent 7px);
}
.doc.fr-monoform .d2 { display: block; top: 28px; right: 36px; width: 54px; height: 54px; border-radius: 50%; background: var(--secondary); }
.doc.fr-monoform .doc-head { flex-direction: row; align-items: flex-start; border: none; }
.doc.fr-monoform .doc-badge {
  background: transparent; border: none; border-radius: 0; color: var(--text);
  font-size: 42px; font-weight: 700; letter-spacing: -1px; padding: 0;
  text-transform: lowercase;
}
.doc.fr-monoform .doc-table th { border-bottom: 1px solid var(--text); color: var(--text); background: transparent; }
.doc.fr-monoform .doc-table td { border-bottom: 1px solid var(--line); }
.doc.fr-monoform .doc-grand {
  border: 3px solid var(--text); border-radius: 0; padding: 12px 14px; margin-top: 10px;
}
.doc.fr-monoform .doc-grand .doc-total-label, .doc.fr-monoform .doc-grand .doc-total-val { font-size: 20px; }

/* 5  Wave Column - stacked organic discs on the left rail. */
.doc.fr-wavecolumn { padding-left: calc(var(--pad-l) + 40px); }
.doc.fr-wavecolumn .d1 {
  display: block; top: -70px; left: -120px; width: 200px; height: 360px;
  background: var(--secondary); border-radius: 50%;
}
.doc.fr-wavecolumn .d2 {
  display: block; top: 160px; left: -150px; width: 220px; height: 320px;
  background: var(--primary); border-radius: 50%;
}
.doc.fr-wavecolumn .d3 {
  display: block; bottom: -40px; left: -130px; width: 200px; height: 280px;
  background: var(--accent); border-radius: 50%;
}
.doc.fr-wavecolumn .d4 {
  display: block; top: 80px; left: -80px; width: 130px; height: 180px;
  background: var(--secondary); border-radius: 50%;
}
.doc.fr-wavecolumn .doc-head { flex-direction: row; align-items: flex-end; border: none; }
.doc.fr-wavecolumn .doc-badge {
  background: transparent; border: none; border-radius: 0; color: var(--primary);
  font-size: 36px; font-weight: 800; letter-spacing: 1px; padding: 0;
}
.doc.fr-wavecolumn .doc-label, .doc.fr-wavecolumn .doc-fact-k, .doc.fr-wavecolumn .doc-table th { color: var(--primary); }
.doc.fr-wavecolumn .doc-table th { border-bottom: 2px solid var(--primary); background: transparent; }
.doc.fr-wavecolumn .doc-grand .doc-total-label, .doc.fr-wavecolumn .doc-grand .doc-total-val { color: var(--primary); font-size: 22px; }

/* 6  Spine Mark - vertical title on a brand rail. */
.doc.fr-spineid { padding-left: calc(var(--pad-l) + 42px); }
.doc.fr-spineid .d1 { display: block; top: 0; bottom: 0; left: 0; width: 46px; background: var(--secondary); }
.doc.fr-spineid .d2 { display: block; top: 0; bottom: 0; left: 46px; width: 4px; background: var(--primary); }
.doc.fr-spineid .doc-wm {
  display: block; top: 340px; left: -70px; width: 180px; right: auto; bottom: auto;
  font-size: 14px; font-weight: 800; letter-spacing: 4px; line-height: 1;
  color: var(--primary); text-align: center; transform: rotate(-90deg);
}
.doc.fr-spineid .doc-head { flex-direction: row; border: none; }
.doc.fr-spineid .doc-badge {
  background: transparent; border: none; border-bottom: 3px solid var(--primary);
  border-radius: 0; color: var(--text); font-size: 18px; letter-spacing: 4px; padding: 0 2px 6px;
}
.doc.fr-spineid .doc-table th { background: var(--primary); color: var(--on-primary, #ffffff); border: none; padding: 12px 12px; }
.doc.fr-spineid .doc-table th:first-child { padding-left: 14px; }
.doc.fr-spineid .doc-table th:last-child { padding-right: 14px; }
.doc.fr-spineid .doc-notes { border-top-color: var(--primary); }

/* 7  Stencil Yard - centred stencil title, dashed rules, slab table. */
.doc.fr-stencil .d1 { display: block; top: 32px; left: 72px; width: 14px; height: 14px; background: var(--primary); transform: rotate(45deg); }
.doc.fr-stencil .d2 { display: block; top: 32px; right: 72px; width: 14px; height: 14px; background: var(--primary); transform: rotate(45deg); }
.doc.fr-stencil .d3 { display: block; top: 86px; left: 48px; width: 36px; height: 10px; background: var(--primary); }
.doc.fr-stencil .d4 { display: block; top: 86px; right: 48px; width: 36px; height: 10px; background: var(--primary); }
.doc.fr-stencil .doc-head {
  flex-direction: column; align-items: center; text-align: center; gap: 10px;
  border: none; border-bottom: 2px dashed var(--primary); padding-bottom: 18px;
}
.doc.fr-stencil .doc-logo { margin-left: auto; margin-right: auto; }
.doc.fr-stencil .doc-biz { color: var(--primary); }
.doc.fr-stencil .doc-badge {
  background: transparent; border: none; border-radius: 0; color: var(--text);
  font-size: 38px; font-weight: 800; letter-spacing: 8px; padding: 0;
}
.doc.fr-stencil .doc-badge-no { text-align: center; }
.doc.fr-stencil .doc-table th { background: var(--primary); color: var(--on-primary, #ffffff); border: none; padding: 12px 12px; }
.doc.fr-stencil .doc-grand { border: none; }
.doc.fr-stencil .doc-grand .doc-total-label, .doc.fr-stencil .doc-grand .doc-total-val { color: var(--primary); font-size: 24px; }
.doc.fr-stencil .doc-notes { border-top: 2px dashed var(--primary); }

/* 8  Word Mark - oversized title, stacked wave footer. */
.doc.fr-wordmark { padding-bottom: calc(var(--pad-b) + 72px); }
.doc.fr-wordmark .d1 { display: block; left: -40px; right: -40px; bottom: -30px; height: 120px; background: var(--text); border-radius: 50% 50% 0 0 / 48px 48px 0 0; }
.doc.fr-wordmark .d2 { display: block; left: -20px; right: -20px; bottom: -24px; height: 86px; background: var(--primary); border-radius: 50% 50% 0 0 / 36px 36px 0 0; }
.doc.fr-wordmark .d3 { display: block; left: 0; right: 0; bottom: 0; height: 52px; background: var(--accent); border-radius: 50% 50% 0 0 / 24px 24px 0 0; }
.doc.fr-wordmark .doc-head { flex-direction: column; align-items: flex-start; gap: 8px; border: none; }
.doc.fr-wordmark .doc-badge {
  background: transparent; border: none; border-radius: 0; color: var(--text);
  font-size: 64px; font-weight: 800; letter-spacing: -2px; padding: 0; line-height: 0.9;
}
.doc.fr-wordmark .doc-table th { background: var(--secondary); color: var(--text); border: none; padding: 12px 12px; }
.doc.fr-wordmark .doc-grand { border-top-color: var(--text); }

/* 9  Gable Peak - stacked corner triangles, maroon table, dark totals. */
.doc.fr-gable .d1 {
  display: block; top: 0; right: 0; width: 0; height: 0;
  border-top: 168px solid var(--text); border-left: 210px solid transparent;
}
.doc.fr-gable .d2 {
  display: block; top: 0; right: 0; width: 0; height: 0;
  border-top: 96px solid var(--primary); border-left: 118px solid transparent;
}
.doc.fr-gable .doc-head { flex-direction: row; align-items: flex-start; border: none; }
.doc.fr-gable .doc-badge {
  background: transparent; border: none; border-radius: 0; color: var(--primary);
  font-size: 34px; font-weight: 800; letter-spacing: 2px; padding: 0;
}
.doc.fr-gable .doc-table th { background: var(--primary); color: var(--on-primary, #ffffff); border: none; padding: 12px 12px; }
.doc.fr-gable .doc-table td { border-bottom-color: var(--primary); }
.doc.fr-gable .doc-totals { background: var(--text); border: none; border-radius: 0; padding: 16px 18px; width: 300px; }
.doc.fr-gable .doc-total-label, .doc.fr-gable .doc-total-val { color: var(--on-text, #ffffff); }
.doc.fr-gable .doc-grand { border-top-color: var(--primary); }
.doc.fr-gable .doc-grand .doc-total-label, .doc.fr-gable .doc-grand .doc-total-val { color: var(--on-text, #ffffff); }

/* 10  Band Side - three diagonal colour bands, dark lower-left dock. */
.doc.fr-bandside { padding-left: calc(var(--pad-l) + 54px); padding-bottom: calc(var(--pad-b) + 16px); }
.doc.fr-bandside .d1 {
  display: block; top: -120px; left: -160px; width: 210px; height: 780px;
  background: var(--text); transform: rotate(22deg);
}
.doc.fr-bandside .d2 {
  display: block; top: -120px; left: -36px; width: 64px; height: 780px;
  background: var(--primary); transform: rotate(22deg);
}
.doc.fr-bandside .d3 {
  display: block; top: -120px; left: 22px; width: 28px; height: 780px;
  background: var(--accent); transform: rotate(22deg);
}
.doc.fr-bandside .d4 {
  display: block; bottom: 0; left: 0; width: 0; height: 0;
  border-bottom: 88px solid var(--text); border-right: 120px solid transparent;
}
.doc.fr-bandside .doc-wm {
  display: block; top: 36px; left: 14px; font-size: 18px; font-weight: 800;
  letter-spacing: 3px; line-height: 1.15; color: var(--on-text, #ffffff);
}
.doc.fr-bandside .doc-head { flex-direction: row; border: none; }
.doc.fr-bandside .doc-badge {
  background: transparent; border: 2px solid var(--text); color: var(--text);
  border-radius: 0; letter-spacing: 3px;
}
.doc.fr-bandside .doc-table th { border-bottom: 2px solid var(--text); color: var(--text); background: transparent; }
.doc.fr-bandside .doc-grand { border-top-color: var(--primary); }

/* 11  Tide Head - swept header curve, matching dock at the foot. */
.doc.fr-tidehead { padding-bottom: calc(var(--pad-b) + 88px); }
.doc.fr-tidehead .doc-head {
  flex-direction: row; align-items: flex-start;
  background: var(--primary);
  margin: calc(-1 * var(--pad-t)) calc(-1 * var(--pad-r)) 36px calc(-1 * var(--pad-l));
  padding: 34px var(--pad-r) 64px var(--pad-l);
  border: none; border-radius: 0 0 58% 18% / 0 0 86px 42px;
}
.doc.fr-tidehead .d1 {
  display: block; bottom: 0; left: 0; width: 58%; height: 118px;
  background: var(--primary); border-radius: 0 120px 0 0;
}
.doc.fr-tidehead .d2 {
  display: block; bottom: -20px; left: 40%; width: 150px; height: 90px;
  background: var(--primary); border-radius: 50%;
}
.doc.fr-tidehead .doc-table th { background: var(--primary); color: var(--on-primary, #ffffff); border: none; padding: 12px 12px; }
.doc.fr-tidehead .doc-table tbody tr:nth-child(even) td { background: var(--secondary); }
.doc.fr-tidehead .doc-table td { border-bottom: none; }
.doc.fr-tidehead .doc-totals { background: var(--secondary); border-radius: 10px; padding: 14px 16px; }
.doc.fr-tidehead .doc-grand { background: var(--primary); border: none; border-radius: 8px; padding: 12px 14px; margin-top: 8px; }
.doc.fr-tidehead .doc-grand .doc-total-label, .doc.fr-tidehead .doc-grand .doc-total-val { color: var(--on-primary, #ffffff); }

/* 12  Split Deck - dark identity column, light working sheet. */
.doc.fr-splitdeck { padding-left: calc(var(--pad-l) + 216px); }
.doc.fr-splitdeck .d1 { display: block; top: 0; bottom: 0; left: 0; width: 248px; background: var(--text); }
.doc.fr-splitdeck .d2 { display: block; top: 0; left: 248px; width: 6px; bottom: 0; background: var(--primary); }
.doc.fr-splitdeck .doc-ident {
  position: absolute; top: 8px; width: 188px;
  left: calc(-1 * (var(--pad-l) + 216px) + 28px);
}
.doc.fr-splitdeck .doc-head { flex-direction: row; justify-content: flex-end; border: none; margin-bottom: 22px; }
.doc.fr-splitdeck .doc-biz, .doc.fr-splitdeck .doc-eyebrow { color: var(--on-text, #ffffff); }
.doc.fr-splitdeck .doc-ident .doc-sub { color: var(--on-text, #ffffff); opacity: .78; }
.doc.fr-splitdeck .doc-badge {
  background: var(--primary); color: var(--on-primary, #ffffff); border: none; border-radius: 8px;
  letter-spacing: 3px; padding: 12px 16px 11px;
}
.doc.fr-splitdeck .doc-table th { background: var(--text); color: var(--on-text, #ffffff); border: none; padding: 12px 12px; }
.doc.fr-splitdeck .doc-grand { background: var(--primary); border: none; border-radius: 8px; padding: 12px 14px; }
.doc.fr-splitdeck .doc-grand .doc-total-label, .doc.fr-splitdeck .doc-grand .doc-total-val { color: var(--on-primary, #ffffff); }

/* 13  Flag Head - hanging brand flag, accent notch in the opposite corner. */
.doc.fr-flaghead .doc-head {
  flex-direction: row; align-items: flex-start;
  background: var(--primary);
  margin: calc(-1 * var(--pad-t)) 72px 32px calc(-1 * var(--pad-l));
  padding: 32px 36px 30px var(--pad-l);
  border: none; border-radius: 0 0 36px 0;
}
.doc.fr-flaghead .d1 { display: block; top: 0; right: 0; width: 78px; height: 78px; background: var(--accent); }
.doc.fr-flaghead .d2 { display: block; bottom: 0; left: 0; width: 78px; height: 8px; background: var(--primary); }
.doc.fr-flaghead .doc-table { border-collapse: separate; border-spacing: 0; }
.doc.fr-flaghead .doc-table th { background: var(--primary); color: var(--on-primary, #ffffff); border: none; padding: 12px 12px; }
.doc.fr-flaghead .doc-table th:first-child { border-radius: 10px 0 0 10px; padding-left: 16px; }
.doc.fr-flaghead .doc-table th:last-child { border-radius: 0 10px 10px 0; padding-right: 16px; }
.doc.fr-flaghead .doc-grand { background: var(--primary); border: none; border-radius: 8px; padding: 12px 16px; }
.doc.fr-flaghead .doc-grand .doc-total-label, .doc.fr-flaghead .doc-grand .doc-total-val { color: var(--on-primary, #ffffff); }

/* 14  Block Field - Mondrian colour field across the top. */
.doc.fr-mondrian { padding-top: calc(var(--pad-t) + 78px); }
.doc.fr-mondrian .d1 { display: block; top: 0; left: 0; width: 30%; height: 118px; background: var(--primary); }
.doc.fr-mondrian .d2 { display: block; top: 0; left: 30%; width: 16%; height: 118px; background: var(--text); }
.doc.fr-mondrian .d3 { display: block; top: 0; left: 46%; right: 0; height: 62px; background: var(--accent); }
.doc.fr-mondrian .d4 { display: block; top: 62px; left: 46%; right: 0; height: 56px; background: var(--secondary); }
.doc.fr-mondrian .doc-head { flex-direction: row; border: none; }
.doc.fr-mondrian .doc-badge {
  background: var(--text); color: var(--on-text, #ffffff); border: none; border-radius: 0;
  letter-spacing: 4px; padding: 10px 14px 9px;
}
.doc.fr-mondrian .doc-table { border: 2px solid var(--text); }
.doc.fr-mondrian .doc-table th { background: var(--text); color: var(--on-text, #ffffff); border: none; padding: 12px 12px; }
.doc.fr-mondrian .doc-table td { border-bottom: 1px solid var(--text); }
.doc.fr-mondrian .doc-grand { border-top: 4px solid var(--primary); }

/* 15  Orbit Ring - overlapping discs behind the title chip. */
.doc.fr-orbit .d1 {
  display: block; top: -90px; right: -70px; width: 300px; height: 300px;
  border-radius: 50%; background: var(--primary);
}
.doc.fr-orbit .d2 {
  display: block; top: 36px; right: 140px; width: 150px; height: 150px;
  border-radius: 50%; background: var(--accent);
}
.doc.fr-orbit .d3 {
  display: block; top: -10px; right: 230px; width: 84px; height: 84px;
  border-radius: 50%; background: var(--secondary);
}
.doc.fr-orbit .doc-head { flex-direction: row; align-items: flex-start; border: none; }
.doc.fr-orbit .doc-badge {
  background: var(--text); color: var(--on-text, #ffffff); border: none; border-radius: 999px;
  letter-spacing: 3px; padding: 12px 22px 11px;
}
.doc.fr-orbit .doc-table { border-collapse: separate; border-spacing: 0; }
.doc.fr-orbit .doc-table th { background: var(--primary); color: var(--on-primary, #ffffff); border: none; padding: 12px 12px; }
.doc.fr-orbit .doc-table th:first-child { border-radius: 999px 0 0 999px; padding-left: 18px; }
.doc.fr-orbit .doc-table th:last-child { border-radius: 0 999px 999px 0; padding-right: 18px; }
.doc.fr-orbit .doc-grand { background: var(--primary); border: none; border-radius: 999px; padding: 12px 20px; }
.doc.fr-orbit .doc-grand .doc-total-label, .doc.fr-orbit .doc-grand .doc-total-val { color: var(--on-primary, #ffffff); }

/* 16  Step Well - descending colour steps from the top-right. */
.doc.fr-stepwell { padding-top: calc(var(--pad-t) + 36px); }
.doc.fr-stepwell .d1 { display: block; top: 0; right: 0; width: 300px; height: 68px; background: var(--primary); }
.doc.fr-stepwell .d2 { display: block; top: 68px; right: 0; width: 210px; height: 50px; background: var(--text); }
.doc.fr-stepwell .d3 { display: block; top: 118px; right: 0; width: 132px; height: 38px; background: var(--accent); }
.doc.fr-stepwell .d4 { display: block; bottom: 0; left: 0; width: 150px; height: 46px; background: var(--primary); }
.doc.fr-stepwell .doc-head { flex-direction: row; align-items: center; border: none; }
.doc.fr-stepwell .doc-badge {
  background: transparent; border: none; border-radius: 0; color: var(--text);
  font-size: 28px; font-weight: 800; letter-spacing: 2px; padding: 0;
}
.doc.fr-stepwell .doc-table th { background: var(--primary); color: var(--on-primary, #ffffff); border: none; padding: 12px 12px; }
.doc.fr-stepwell .doc-grand { border-top: 4px solid var(--text); }
.doc.fr-stepwell .doc-grand .doc-total-label, .doc.fr-stepwell .doc-grand .doc-total-val { font-size: 22px; }

/* 17  Capsule Mast - header and bill-to share one rounded colour pod. */
.doc.fr-capsule .doc-head {
  flex-direction: row; align-items: flex-start;
  background: var(--primary);
  margin: 0; padding: 28px 32px 18px; border: none; border-radius: 32px 32px 0 0;
}
.doc.fr-capsule .doc-meta {
  background: var(--primary); margin: 0 0 28px; padding: 4px 32px 26px;
  border-radius: 0 0 32px 32px;
}
.doc.fr-capsule .doc-label, .doc.fr-capsule .doc-strong, .doc.fr-capsule .doc-fact-k, .doc.fr-capsule .doc-fact-v {
  color: var(--on-primary, #ffffff);
}
.doc.fr-capsule .doc-party .doc-sub { color: var(--on-primary, #ffffff); opacity: .8; }
.doc.fr-capsule .doc-table { border-collapse: separate; border-spacing: 0; }
.doc.fr-capsule .doc-table th { background: var(--primary); color: var(--on-primary, #ffffff); border: none; padding: 12px 12px; }
.doc.fr-capsule .doc-table th:first-child { border-radius: 14px 0 0 14px; padding-left: 16px; }
.doc.fr-capsule .doc-table th:last-child { border-radius: 0 14px 14px 0; padding-right: 16px; }
.doc.fr-capsule .doc-totals { background: var(--secondary); border-radius: 16px; padding: 16px 18px; }
.doc.fr-capsule .doc-grand { border-top-color: var(--primary); }

/* 18  Ledger Cut - oversized mark, heavy rules, editorial numbers. */
.doc.fr-ledger .d1 { display: block; top: 0; left: 0; right: 0; height: 10px; background: var(--text); }
.doc.fr-ledger .d2 { display: block; bottom: 0; left: 0; right: 0; height: 10px; background: var(--text); }
.doc.fr-ledger .doc-head {
  flex-direction: row; align-items: flex-end;
  border: none; border-bottom: 8px solid var(--text); padding-bottom: 18px;
}
.doc.fr-ledger .doc-badge {
  background: transparent; border: none; border-radius: 0; color: var(--text);
  font-size: 52px; font-weight: 800; letter-spacing: -2px; padding: 0; line-height: 0.95;
}
.doc.fr-ledger .doc-table th {
  background: transparent; color: var(--text); border: none;
  border-bottom: 4px solid var(--text); padding: 10px 8px 12px;
}
.doc.fr-ledger .doc-table td { border-bottom: 1px solid var(--line); }
.doc.fr-ledger .doc-grand { border-top: 8px solid var(--primary); padding-top: 14px; }
.doc.fr-ledger .doc-grand .doc-total-label, .doc.fr-ledger .doc-grand .doc-total-val { font-size: 26px; }

/* 19  Neon Rail - L-shaped brand rail, filled table, pill total. */
.doc.fr-neonrail { padding-top: calc(var(--pad-t) + 8px); padding-left: calc(var(--pad-l) + 12px); }
.doc.fr-neonrail .d1 { display: block; top: 0; left: 0; width: 12px; bottom: 0; background: var(--primary); }
.doc.fr-neonrail .d2 { display: block; top: 0; left: 0; right: 0; height: 12px; background: var(--primary); }
.doc.fr-neonrail .d3 { display: block; top: 12px; left: 12px; width: 28px; height: 28px; background: var(--accent); }
.doc.fr-neonrail .doc-head { flex-direction: row; align-items: center; border: none; }
.doc.fr-neonrail .doc-badge {
  background: var(--primary); color: var(--on-primary, #ffffff); border: none; border-radius: 0;
  letter-spacing: 4px; padding: 10px 16px 9px;
}
.doc.fr-neonrail .doc-table th { background: var(--primary); color: var(--on-primary, #ffffff); border: none; padding: 12px 12px; letter-spacing: 2px; }
.doc.fr-neonrail .doc-grand { background: var(--primary); border: none; border-radius: 0; padding: 14px 16px; }
.doc.fr-neonrail .doc-grand .doc-total-label, .doc.fr-neonrail .doc-grand .doc-total-val { color: var(--on-primary, #ffffff); }

/* 20  Offset Slab - inset colour frame, accent corner, dark totals plate. */
.doc.fr-offsetslab { padding: calc(var(--pad-t) + 18px) calc(var(--pad-r) + 18px) calc(var(--pad-b) + 18px) calc(var(--pad-l) + 18px); }
.doc.fr-offsetslab .d1 { display: block; top: 18px; right: 18px; bottom: 18px; left: 18px; border: 12px solid var(--primary); }
.doc.fr-offsetslab .d2 { display: block; top: 0; right: 0; width: 112px; height: 112px; background: var(--accent); }
.doc.fr-offsetslab .d3 { display: block; bottom: 0; left: 0; width: 72px; height: 72px; background: var(--primary); }
.doc.fr-offsetslab .doc-head { flex-direction: row; border: none; }
.doc.fr-offsetslab .doc-badge {
  background: var(--text); color: var(--on-text, #ffffff); border: none; border-radius: 4px;
  letter-spacing: 3px; padding: 11px 16px 10px;
}
.doc.fr-offsetslab .doc-table th { border-bottom: none; padding-bottom: 8px; color: var(--text); background: transparent; }
.doc.fr-offsetslab .doc-table td { border-bottom: none; }
.doc.fr-offsetslab .doc-table tbody tr:nth-child(odd) td { background: var(--secondary); }
.doc.fr-offsetslab .doc-totals { background: var(--text); border: none; border-radius: 6px; padding: 18px 20px; width: 300px; }
.doc.fr-offsetslab .doc-total-label, .doc.fr-offsetslab .doc-total-val { color: var(--on-text, #ffffff); }
.doc.fr-offsetslab .doc-grand { border-top-color: var(--primary); }
.doc.fr-offsetslab .doc-grand .doc-total-label, .doc.fr-offsetslab .doc-grand .doc-total-val { color: var(--on-text, #ffffff); }

.doc .doc-table tbody tr.doc-section td {
  background: transparent;
  border-bottom: 1px solid var(--line);
  padding-top: 17px; padding-bottom: 7px;
}
/* No stack of empty space above a heading that opens the table. */
.doc .doc-table tbody tr.doc-section:first-child td { padding-top: 4px; }
.doc-section-title {
  font-family: var(--head-font); font-size: 11px; font-weight: 700;
  text-transform: uppercase; letter-spacing: var(--label-track); color: var(--primary);
  line-height: 1.3;
}

/* Totals treatments */

/* tt-plain is the base rule above. */

.tt-card .doc-totals { background: var(--secondary); border-radius: 12px; padding: 16px 18px; width: 316px; }
.tt-card .doc-grand { border-top-color: var(--primary); }

.tt-outline .doc-totals { border: 2px solid var(--primary); border-radius: 10px; padding: 16px 18px; width: 316px; }
.tt-outline .doc-grand { border-top-color: var(--primary); }

.tt-bar .doc-grand { background: var(--primary); border-top: none; border-radius: 8px; padding: 12px 16px; margin-top: 10px; }
.tt-bar .doc-grand .doc-total-label, .tt-bar .doc-grand .doc-total-val { color: var(--on-primary, #ffffff); }

.tt-heavy .doc-grand { border-top: 3px solid var(--primary); font-size: 22px; line-height: 1.2; padding-top: 14px; }
.tt-heavy .doc-grand .doc-total-label, .tt-heavy .doc-grand .doc-total-val { font-size: 22px; }

.tt-dashed .doc-total-row { border-bottom: 1px dashed var(--line); padding-bottom: 8px; }
.tt-dashed .doc-grand { border-top: 2px dashed var(--primary); border-bottom: none; }

.tt-wide .doc-totals { width: 360px; }
.tt-wide .doc-grand { font-size: 26px; line-height: 1.2; border-top-width: 1px; padding-top: 14px; }
.tt-wide .doc-grand .doc-total-label { font-size: 13px; text-transform: uppercase; letter-spacing: var(--label-track); color: var(--muted); }
.tt-wide .doc-grand .doc-total-val { font-size: 26px; }

.tt-tintrow .doc-grand { background: var(--secondary); border-top: none; padding: 12px 16px; border-radius: 6px; margin-top: 10px; }

/* Badge treatments */

/* bd-outline is the base rule above. */

.bd-solid .doc-badge { background: var(--primary); color: var(--on-primary, #ffffff); border-color: var(--primary); }

.bd-soft .doc-badge { background: var(--secondary); color: var(--primary); border-color: var(--secondary); border-radius: 999px; padding: 11px 22px 10px; }

.bd-slab .doc-badge { background: var(--primary); color: var(--on-primary, #ffffff); border-color: var(--primary); border-radius: 0; letter-spacing: 4px; }

.bd-plain .doc-badge { border: none; border-radius: 0; padding: 0; line-height: 1.1; font-size: 30px; font-weight: 300; letter-spacing: 9px; color: var(--text); }

.bd-underline .doc-badge { border: none; border-bottom: 3px solid var(--primary); border-radius: 0; padding: 0 2px 6px; line-height: 1.15; font-size: 20px; letter-spacing: 5px; }

.bd-serif .doc-badge { font-family: "Playfair Display", Georgia, serif; border: none; border-radius: 0; padding: 0; line-height: 1.15; font-size: 30px; font-weight: 400; letter-spacing: 4px; color: var(--text); text-transform: none; }

.bd-dot .doc-badge { border: none; border-radius: 0; padding: 0; line-height: 1.2; font-size: 15px; letter-spacing: 3px; }
.bd-dot .doc-mark { display: flex; align-items: center; gap: 9px; }
.bd-dot .doc-mark::before { content: ''; display: block; width: 13px; height: 13px; border-radius: 50%; background: var(--accent); flex-shrink: 0; }

.bd-bracket .doc-badge { border-width: 0 3px; border-radius: 0; padding: 5px 12px 4px; line-height: 1.25; font-size: 17px; letter-spacing: 4px; }

.bd-stack .doc-badge { border: none; border-radius: 0; padding: 0; line-height: 1.15; font-size: 22px; letter-spacing: 5px; }
.bd-stack .doc-badge-no { display: block; }

/* Full-bleed header bands.
   Four frames run the header out to the page edge with negative margins. The
   .hd-* arrangements above are free to set their own padding on .doc-head
   (hd-boxed does), and a shorthand there wipes the band's - pulling the
   header's content back inside the negative margins and clipping it clean off
   the page. So the bleed geometry is restated here, carrying an extra .doc to
   outrank them (0,3,0 vs 0,2,0). Only the left/right/top borders are cleared,
   which leaves hd-underline's bottom rule intact. */
.doc.fr-headband .doc-head, .doc.fr-headtint .doc-head,
.doc.fr-arch .doc-head, .doc.fr-diagonal .doc-head {
  margin-top: calc(-1 * var(--pad-t));
  margin-right: calc(-1 * var(--pad-r));
  margin-left: calc(-1 * var(--pad-l));
  padding-top: 34px;
  padding-right: var(--pad-r);
  padding-left: var(--pad-l);
  border-top: none; border-right: none; border-left: none;
  border-radius: 0;
}
.doc.fr-headband .doc-head, .doc.fr-headtint .doc-head { padding-bottom: 32px; }
.doc.fr-arch .doc-head { padding-bottom: 36px; border-radius: 0 0 0 88px; }
.doc.fr-diagonal .doc-head { padding-bottom: 58px; }

/* Contrast on coloured header bands.
   Industry frames that paint the header in --primary, plus the Modern
   frames that do the same (tide, flag, capsule). Mastpill and splitdeck
   solve their own contrast because they sit on two colours at once. */
.doc.fr-headband .doc-biz, .doc.fr-arch .doc-biz, .doc.fr-diagonal .doc-biz,
.doc.fr-tidehead .doc-biz, .doc.fr-flaghead .doc-biz, .doc.fr-capsule .doc-biz,
.doc.fr-tidehead .doc-eyebrow, .doc.fr-flaghead .doc-eyebrow, .doc.fr-capsule .doc-eyebrow,
.doc.fr-headband .doc-eyebrow, .doc.fr-arch .doc-eyebrow, .doc.fr-diagonal .doc-eyebrow {
  color: var(--on-primary, #ffffff);
}
/* .doc-head .doc-sub, never bare .doc-sub: only the header sits on the band.
   Unscoped, this also turned the Bill-to address under it white on white. */
.doc.fr-headband .doc-head .doc-sub, .doc.fr-arch .doc-head .doc-sub, .doc.fr-diagonal .doc-head .doc-sub,
.doc.fr-tidehead .doc-head .doc-sub, .doc.fr-flaghead .doc-head .doc-sub, .doc.fr-capsule .doc-sub,
.doc.fr-tidehead .doc-badge-no, .doc.fr-flaghead .doc-badge-no, .doc.fr-capsule .doc-badge-no,
.doc.fr-headband .doc-badge-no, .doc.fr-arch .doc-badge-no, .doc.fr-diagonal .doc-badge-no {
  color: var(--on-primary, #ffffff);
  opacity: .84;
}
.doc.fr-tidehead .doc-badge, .doc.fr-flaghead .doc-badge, .doc.fr-capsule .doc-badge,
.doc.fr-headband .doc-badge, .doc.fr-arch .doc-badge, .doc.fr-diagonal .doc-badge {
  color: var(--on-primary, #ffffff);
  border-color: rgba(255, 255, 255, 0.75);
  background: transparent;
}
.doc.fr-tidehead .doc-mark::before, .doc.fr-flaghead .doc-mark::before, .doc.fr-capsule .doc-mark::before,
.doc.fr-headband .doc-mark::before, .doc.fr-arch .doc-mark::before, .doc.fr-diagonal .doc-mark::before {
  background: #ffffff;
}
.doc.fr-headband .doc-head, .doc.fr-arch .doc-head, .doc.fr-diagonal .doc-head,
.doc.fr-tidehead .doc-head, .doc.fr-flaghead .doc-head,
.doc.fr-capsule .doc-head { border-color: rgba(255, 255, 255, 0.35); }

/* Modern frames restated after table/totals/badge traits, so a later
   :first-child rule cannot flatten a split head or a pill total. */
.doc.fr-mastpill .doc-table th:first-child { border-radius: 999px 0 0 999px; padding-left: 18px; background: var(--text); }
.doc.fr-mastpill .doc-table th:last-child { background: var(--primary); border-radius: 999px; padding-right: 18px; }
.doc.fr-dualchip .doc-table th:first-child { background: var(--text); color: var(--on-text, #ffffff); border-radius: 12px 0 0 12px; padding-left: 16px; }
.doc.fr-dualchip .doc-table th:last-child { border-radius: 0 12px 12px 0; padding-right: 16px; }
.doc.fr-flaghead .doc-table th:first-child { border-radius: 10px 0 0 10px; padding-left: 16px; }
.doc.fr-flaghead .doc-table th:last-child { border-radius: 0 10px 10px 0; padding-right: 16px; }
.doc.fr-orbit .doc-table th:first-child { border-radius: 999px 0 0 999px; padding-left: 18px; }
.doc.fr-orbit .doc-table th:last-child { border-radius: 0 999px 999px 0; padding-right: 18px; }
.doc.fr-capsule .doc-table th:first-child { border-radius: 14px 0 0 14px; padding-left: 16px; }
.doc.fr-capsule .doc-table th:last-child { border-radius: 0 14px 14px 0; padding-right: 16px; }
.doc.fr-capsule .doc-badge {
  background: #ffffff; color: var(--primary); border: none; border-radius: 999px;
  padding: 10px 18px 9px; letter-spacing: 3px;
}
.doc.fr-spineid .doc-wm {
  display: block; top: 340px; left: -70px; width: 180px;
  font-size: 14px; font-weight: 800; letter-spacing: 4px; line-height: 1;
  color: var(--primary); text-align: center; transform: rotate(-90deg);
}

/* Print */
@media print {
  .doc { margin: 0; }
}
/* User corner style ("Corner style" in the editor). Off unless .r-set is on the
 * page; then every boxed part takes --doc-r and the template's own corners give
 * way. Decoration (circles, pills, waves in .doc-deco) and the logo are left
 * alone - rounding those would change the artwork, not the boxes. */
.doc.r-set :is(.doc-head, .doc-badge, .doc-party, .doc-facts, .doc-due, .doc-totals, .doc-grand, .doc-notes, .doc-pay, .doc-pay-qr, .doc-chip) {
  border-radius: var(--doc-r, 0px) !important;
}
/* Collapsed table cells ignore corner radii when painting their backgrounds. */
.doc.r-set .doc-table { border-collapse: separate !important; border-spacing: 0 !important; }
.doc.r-set .doc-table thead th { border-radius: 0 !important; }
.doc.r-set .doc-table thead th:first-child {
  border-start-start-radius: var(--doc-r, 0px) !important;
  border-end-start-radius: var(--doc-r, 0px) !important;
}
.doc.r-set .doc-table thead th:last-child {
  border-start-end-radius: var(--doc-r, 0px) !important;
  border-end-end-radius: var(--doc-r, 0px) !important;
}
/* ...and the page itself: its outer corners take the same radius, in the
 * editor, the full preview and the PNG/PDF export alike. The decoration layer
 * already clips to the page, so it follows the curve. */
.doc.r-set { border-radius: var(--doc-r, 0px); }
.doc.r-set .doc-deco { border-radius: inherit; }

