.trade-address { white-space: pre-line; }
.trade-customer { border: 1px solid var(--line, #d4dde1); border-radius: .5rem; margin-bottom: .65rem; padding: 0; }
.trade-customer > summary { min-height: 44px; padding: .75rem; overflow-wrap: anywhere; }
.trade-customer > summary::marker { color: var(--accent, #13557c); }
.trade-follow-up { display: inline-block; margin-left: .55rem; padding: .18rem .46rem; border-radius: .4rem; background: #edf3f7; color: #24435b; font-size: .82rem; }
.trade-follow-up.is-due { background: #ffefd9; color: #623a10; }
.trade-customer-body { padding: 0 .75rem; overflow-wrap: anywhere; }
.trade-customer-body details > summary { min-height: 42px; }
.trade-customer-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 9rem), 1fr)); gap: .55rem .9rem; margin: .35rem 0 .75rem; }
.trade-customer-facts dt, .trade-contact-history span { color: var(--muted, #52636d); font-size: .86rem; }
.trade-customer-facts dd { margin: 0; }
.trade-contact-history { display: grid; gap: .45rem; padding: 0; margin: .35rem 0; list-style: none; }
.trade-contact-history li { border-bottom: 1px solid var(--line, #d4dde1); padding: .45rem 0; }
.trade-contact-history p { white-space: pre-wrap; margin: .25rem 0; }
.trade-contact-history span { display: block; margin-top: .15rem; }
[data-trade-line] {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 11rem), 1fr));
  align-items: end;
  gap: .65rem;
  margin-bottom: .6rem;
  padding: .75rem;
  border: 1px solid #cbd8e5;
  border-radius: .5rem;
  min-width: 0;
}
[data-trade-line] legend { margin-left: .18rem; padding: 0 .35rem; font-weight: 680; }
[data-trade-line] [hidden], [data-trade-rental][hidden], #trade-invoice-print { display: none; }
[data-trade-lines], [data-trade-rental] { flex-basis: 100%; min-width: 0; }
[data-trade-rental] { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .6rem; }
[data-trade-rental] p { grid-column: 1 / -1; }
.trade-invoice-paper {
  display: grid;
  gap: .9rem;
  padding: 1rem;
  border: 1px solid #cbd8e5;
  border-radius: .55rem;
  background: #fff;
  color: #142335;
}
.trade-invoice-paper header { display: flex; justify-content: space-between; align-items: baseline; gap: .75rem; flex-wrap: wrap; }
.trade-invoice-label { font-size: .78rem; font-weight: 700; letter-spacing: .04em; color: #345777; }
.trade-invoice-badge { padding: .2rem .5rem; border: 1px solid #d6b9a0; border-radius: .3rem; color: #744017; background: #fff4e9; }
.trade-invoice-paper h2, .trade-invoice-paper h3, .trade-invoice-paper p { margin: 0; }
.trade-invoice-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(8rem, 1fr)); gap: .65rem; margin: 0; }
.trade-invoice-facts dt { color: #425d74; font-size: .85rem; }
.trade-invoice-facts dd { margin: 0; }
.trade-vat-totals { display: grid; gap: .25rem; min-width: min(100%, 13rem); padding-top: .55rem; border-top: 1px solid #cbd8e5; margin: .5rem 0; }
.trade-vat-totals > div { display: flex; justify-content: space-between; gap: .5rem; }
.trade-vat-totals dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; }
.trade-vat-totals > div:last-child { font-weight: 700; }
@media print {
  body:has(#trade-invoice-print) > :not(#trade-invoice-print) { display: none !important; }
  #trade-invoice-print { display: grid; border: 0; color: #000; padding: 0; }
  #trade-invoice-print .scroll { overflow: visible; }
  #trade-invoice-print tr { break-inside: avoid; }
}
