/* Export is a separate document, rendered at 3x when canvas capacity allows. */
.bill-capture { position: absolute; top: 0; left: -10000px; width: 720px; pointer-events: none; }
.bill {
  position: relative;
  isolation: isolate;
  box-sizing: border-box;
  width: 720px;
  padding: 24px;
  background: var(--j-bg, #fbfff4);
  color: var(--j-ink, #414e3d);
  font: 24px/1.5 var(--j-font, sans-serif);
  font-synthesis: none;
  font-variant-numeric: tabular-nums;
}
.bill *, .bill *::before, .bill *::after { box-sizing: border-box; margin: 0; padding: 0; }
.bill-paper { position: relative; z-index: 1; padding: 28px 28px 24px; border: 1px solid var(--j-line, #e1e7d5); border-radius: 26px; background: var(--j-paper, #fffffb); }
.bill-header { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding-bottom: 24px; border-bottom: 1px solid var(--j-line, #e1e7d5); }
.bill h1 { color: var(--j-green-dark, #4d653e); font-family: var(--j-heading-font); font-size: 43px; font-weight: 400; letter-spacing: 2px; line-height: 1.35; }
.bill-date { display: block; margin-top: 8px; color: var(--j-muted, #687361); font-size: 18px; letter-spacing: 1px; }
.bill-header-art { display: block; width: 100px; height: auto; max-width: none; }

.bill-section { margin-top: 24px; }
.bill-section-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 14px; margin-bottom: 16px; }
.bill-section-heading h2 { display: flex; align-items: baseline; gap: 10px; color: var(--j-ink, #414e3d); font-family: var(--j-heading-font); font-size: 28px; font-weight: 400; letter-spacing: .6px; }
.bill-section-heading h2 i { color: var(--j-muted, #687361); font: 400 18px/1.5 "Melody Rounded", sans-serif; letter-spacing: 1px; }
.bill-section-heading > span { color: var(--j-muted, #687361); font-size: 20px; }
.bill-section-heading > span b { color: var(--j-green-dark, #4d653e); font-weight: 600; }
.bill-record { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-bottom: 14px; color: var(--j-muted, #687361); font-size: 20px; }
.bill-record b { color: var(--j-green, #71875b); font-weight: 600; }

.bill-medals { width: 100%; border-collapse: separate; border-spacing: 0; table-layout: fixed; text-align: center; }
.bill-medals th, .bill-medals td { padding: 6px 5px; font-size: 24px; line-height: 1.45; font-weight: 400; }
.bill-medals thead { color: var(--j-muted, #687361); }
.bill-medals thead th { font-size: 20px; padding-block: 9px; background: var(--j-field, #f4f6ed); }
.bill-medals thead th:first-child { border-radius: 11px 0 0 11px; }
.bill-medals thead th:last-child { border-radius: 0 11px 11px 0; }
.bill-medals th:first-child { text-align: left; padding-left: 13px; }
.bill-medals tbody tr + tr > * { border-top: 1px solid var(--j-soft-line, #edf0e5); }
.bill-medals .bill-stars { color: var(--j-green-dark, #4d653e); font-weight: 600; }
.bill-coefficients { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 15px; padding-top: 10px; margin-top: 2px; border-top: 1px solid var(--j-line, #e1e7d5); color: var(--j-muted, #687361); font-size: 18px; }
.bill-coefficients > span { white-space: nowrap; }
.bill-coefficients b { font-weight: 400; }

.bill-payments { margin-top: 26px; }
.bill-payments .bill-section-heading { margin-bottom: 16px; }
.bill-payment-list { display: grid; gap: 16px; }
.bill-payment { min-width: 0; padding: 16px; border: 1px solid var(--j-line, #e1e7d5); border-radius: 17px; background: var(--j-paper, #fffffb); }
.bill-pay-row { display: grid; grid-template-columns: minmax(0,.8fr) minmax(0,1.4fr) minmax(0,1.25fr); align-items: center; gap: 12px; }
.bill-pay-person { display: flex; align-items: center; gap: 9px; min-width: 0; }
.bill-pay-name { min-width: 0; color: var(--j-ink, #414e3d); font-size: 26px; line-height: 1.35; font-weight: 400; }
.bill-pay-name small { display: block; font-size: 16px; color: var(--j-muted, #687361); font-weight: 400; white-space: nowrap; }
.bill-pay-meta { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; font-size: 18px; color: var(--j-muted, #687361); line-height: 1.45; }
.bill-pay-meta span { display: flex; flex-direction: column; align-items: center; min-width: 0; text-align: center; }
.bill-pay-meta b { color: var(--j-amount-ink, #52604a); font-size: 22px; font-weight: 400; overflow-wrap: anywhere; }
.bill-balance { display: inline-flex; flex-wrap: wrap; align-items: baseline; justify-content: center; gap: 0 6px; min-width: 0; padding: 8px 10px; border-radius: 12px; text-align: center; }
.bill-balance small { font-size: 21px; }
.bill-balance b { min-width: 0; font-size: 34px; font-weight: 600; line-height: 1.35; overflow-wrap: anywhere; }
.bill-balance i { font-size: 19px; margin-right: 3px; font-style: normal; font-weight: 400; }
.bill-balance.refund { color: #526f3e; background: #edf3e4; }
.bill-balance.payin { color: #8a5e3e; background: #f7eee3; }
.bill-balance.even { color: var(--j-muted, #687361); background: var(--j-field, #f4f6ed); font-size: 23px; }

/* One deposit and balance per role, followed by its own calculation. */
.bill-calculation { margin-top: 12px; padding: 10px 12px; border-radius: 10px; background: var(--j-detail-bg, #f8faf4); }
.bill-calc-heading { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 3px 12px; font-size: 18px; color: var(--j-detail-ink, #626f59); }
.bill-calc-heading strong { font-size: 18px; font-weight: 400; color: var(--j-detail-ink, #626f59); }
.bill-quote-line { display: grid; grid-template-columns: repeat(var(--bill-players),minmax(0,1fr)); gap: 5px 12px; }
.bill-calc-heading + .bill-quote-line { margin-top: 5px; }
.bill-quote-line > span { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 7px; min-width: 0; }
.bill-quote-line small { color: var(--j-detail-ink, #626f59); font-size: 19px; white-space: nowrap; }
.bill-quote-line b { color: var(--j-amount-ink, #52604a); font-size: 21px; font-weight: 400; overflow-wrap: anywhere; }
.bill-formula { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 3px 10px; margin-top: 5px; color: var(--j-detail-ink, #626f59); font-size: 19px; line-height: 1.6; }
.bill-formula > span { overflow-wrap: anywhere; }
.bill-formula b { color: var(--j-amount-ink, #52604a); font-size: 19px; font-weight: 400; white-space: nowrap; }

.bill-income { padding: 22px; border: 1px solid var(--j-line, #e1e7d5); border-radius: 19px; background: var(--j-green-soft, #edf2e2); }
.bill-income .bill-section-heading { margin-bottom: 16px; }
.bill-income h2 { color: var(--j-green-dark, #4d653e); }
.bill-income-people { display: grid; grid-template-columns: repeat(var(--bill-players),minmax(0,1fr)); gap: 17px; }
.bill-income-people > div { min-width: 0; }
.bill-income-people > div + div { padding-left: 15px; border-left: 1px solid var(--j-accent-line, #d3dec2); }
.bill-income-people span { display: block; font-size: 22px; color: var(--j-muted, #687361); }
.bill-income-people strong { display: block; margin-top: 6px; color: var(--j-green-dark, #4d653e); font-size: 36px; line-height: 1.35; font-weight: 600; overflow-wrap: anywhere; }
.bill-income-people strong small { font-size: 19px; margin-right: 3px; font-weight: 400; }
.bill[data-car="41"] .bill-income-people { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px 23px; }
.bill[data-car="41"] .bill-income-people > div { display: flex; align-items: baseline; justify-content: space-between; gap: 11px; padding-left: 0; border: 0; }
.bill[data-car="41"] .bill-income-people strong { margin-top: 0; }
.bill-footer { display: flex; flex-direction: column; align-items: center; justify-content: center; padding-top: 24px; color: var(--j-muted, #687361); font-family: var(--j-font); font-size: 18px; letter-spacing: .6px; }
.bill-footer::before { content: ''; width: 2.8em; height: 1px; margin-bottom: 10px; background: var(--j-accent-line, #d3dec2); }
