.receipt.filing-body { max-width: none; }
.receipt-copy { margin-top: 24px; }
.receipt-overview { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: 18px; margin-bottom: 18px; }
.receipt-panel, .receipt-card { border: 1px solid var(--line); border-radius: 8px; padding: 20px; background: #fff; min-width: 0; }
.receipt-panel { margin-bottom: 18px; }
.receipt-overview .receipt-panel { margin-bottom: 0; }
.receipt-panel h2 { margin: 0 0 4px; font-size: 1.5rem; }
.receipt-card { border-top: 4px solid var(--primary); }
.receipt-number-label { display: block; font-size: .75rem; letter-spacing: .06em; color: var(--muted); font-weight: 600; text-transform: uppercase; }
.receipt-card h2 .receipt-number { font-size: 2rem; }
.receipt-quote, .receipt-reference { color: var(--muted); font-size: .925rem; }
.receipt-stamp { border-top: 1px solid var(--line); padding-top: 16px; }
.receipt-payment-box { padding: 16px; border-radius: 6px; background: var(--surface); font-size: .925rem; }
.receipt-payment-box p:first-child { margin-top: 0; }
.receipt-payment-box p:last-child { margin-bottom: 0; }
.receipt-as-of { margin: 0 0 20px; font-size: .875rem; color: var(--muted); }
.receipt-timeline { display: flex; flex-direction: column; }
.receipt-about { margin: auto 0 0; padding-top: 16px; border-top: 1px solid var(--line); font-size: .875rem; color: var(--muted); }
.receipt .step-note { margin: 4px 0 0; font-size: .875rem; }
.receipt ol.timeline .step-when { display: block; }
.receipt-record-grid { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 3fr) minmax(0, 3fr); gap: 24px; }
/* On a tablet the details take the full width and the copy links and private link share the row below,
   so the private link shows whole and the CSV link is not squeezed to four lines (polish30b). */
@media screen and (min-width: 768px) and (max-width: 1099.98px) {
  .receipt-record-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .receipt-record-grid > .terms { grid-column: 1 / -1; }
}
.receipt-record-grid .terms { grid-template-columns: minmax(0, 2fr) minmax(0, 3fr); }
.receipt-record-grid h3 { margin-top: 0; }
/* The reference and the print button share a wrapping row: the button drops below the h2 whenever the
   whole reference does not fit beside it, so it never sits on the reference at any width (C7 P2-1). */
.receipt-card-head { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 12px; }
.receipt-card-head h2 { flex: 1 1 auto; min-width: 0; max-width: 100%; }
.receipt-card-head .button { flex: 0 0 auto; }
.receipt-card-head .button { padding: 9px 10px; white-space: nowrap; font-size: .875rem; }
.receipt-card h2 { margin: 0; font-size: 1.5rem; }
.receipt-number { user-select: text; white-space: nowrap; display: inline-block; font-variant-numeric: tabular-nums; }
.receipt-stamp { margin: 12px 0 20px; }
.receipt-time { white-space: nowrap; }
.receipt-figures { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px 16px; margin: 0 0 16px; }
.receipt-figures dt { color: var(--muted); }
.receipt-figures dd { margin: 0; text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; }
.receipt-card h3 { font-size: .75rem; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); margin: 20px 0 6px; }
.receipt-next { margin-bottom: 0; }
.receipt-payment { font-size: .925rem; }
.receipt-controls { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 16px; }
.receipt-filed-head { display: flex; justify-content: space-between; align-items: start; gap: 16px; }
.receipt .timeline li.done::before { background: #237847; border-color: #237847; }
.receipt .timeline li.todo::before { content: "\25cb"; border-color: var(--line); font-size: .65rem; }
.receipt .timeline li.done::after { background: #237847; }
.receipt .timeline li.done .step-state { color: #237847; }
.receipt-controls[hidden], [data-receipt-print][hidden] { display: none; }
.receipt-step { border: 1px solid var(--line); border-radius: 6px; margin-bottom: 12px; background: #fff; }
.receipt-step > summary { display: grid; grid-template-columns: minmax(0, 1fr) 12px; gap: 4px 16px; min-height: 44px; padding: 14px 16px; list-style: none; cursor: pointer; }
.receipt-step > summary::-webkit-details-marker { display: none; }
.receipt-step > summary::after { content: ""; grid-column: 2; grid-row: 1 / span 2; align-self: center; width: 8px; height: 8px; border-right: 2px solid var(--primary); border-bottom: 2px solid var(--primary); transform: rotate(45deg); }
.receipt-step[open] > summary::after { transform: rotate(225deg); }
.receipt-step > summary:hover { background: var(--surface); }
.receipt-step > summary:focus-visible { outline: 3px solid var(--primary); outline-offset: 3px; }
.receipt-step-name { font-weight: 700; color: var(--ink); }
.receipt-step-number { color: var(--primary); }
.receipt-digest { grid-column: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--muted); font-size: .875rem; }
.receipt-step-content { border-top: 1px solid var(--line); padding: 20px 16px 0; }
/* On a narrow phone the cards nested in "What you filed" give their text and tables the width back (polish30b). */
@media screen and (max-width: 479.98px) {
  .receipt-panel { padding: 16px 12px; }
  .receipt-step > summary { padding: 12px 10px; }
  .receipt-step-content { padding: 14px 8px 0; }
  .receipt-step-content .answers-grid table.data th, .receipt-step-content .answers-grid table.data td { padding: 5px 3px; }
}
.receipt-step-content .section-tight { margin-bottom: 24px; }
.receipt-answer-block, .receipt-answer { display: contents; }
.receipt [aria-labelledby="allocation-receipt-h"] { margin-top: 24px; }
.receipt-step-content .terms { grid-template-columns: minmax(0, 2fr) minmax(0, 3fr); max-width: none; }
.receipt-fee-total span { white-space: nowrap; }
.receipt-file { padding: 12px 0; border-bottom: 1px solid var(--line); }
.receipt-file-inline { padding: 0; border-bottom: 0; }
.receipt-file h4, .receipt-file p { margin: 0 0 6px; }
.receipt-fingerprint { font-size: .75rem; }
/* A hash wraps inside its cell at every width, never clipped (C7 P2-2); balance keeps a last line from holding one character. */
.receipt-fingerprint .sha256 { display: block; max-width: 100%; white-space: normal; overflow-wrap: anywhere; word-break: break-all; text-wrap: balance; }
@media screen and (max-width: 767.98px) {
  .receipt .stack-wrap .stack .receipt-fee-total { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; font-variant-numeric: tabular-nums; }
  .receipt .stack-wrap .stack .receipt-fee-total th, .receipt .stack-wrap .stack .receipt-fee-total td { display: block; border-bottom: 0; }
  .receipt .stack .receipt-fee-total th::before, .receipt .stack .receipt-fee-total td::before { display: none; }
  .receipt .stack-wrap .stack .receipt-fee-total td.num { text-align: right; }
  .receipt .stack-wrap .stack .receipt-fee-total .receipt-fee-citation { display: none; }
  .receipt-overview, .receipt-record-grid { display: block; }
  .receipt-overview .receipt-timeline { margin-top: 18px; }
  .receipt-panel { padding: 20px; }
  .receipt-filed-head { display: block; }
  .receipt-card { padding: 18px 16px; }
  .receipt-card h2 { font-size: 1.3rem; }
  .receipt-card-head .button { min-height: 44px; box-sizing: border-box; }
  .receipt-controls .button { min-height: 44px; box-sizing: border-box; }
  .receipt-step > summary { min-height: 44px; }
  .receipt-digest { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; white-space: normal; }
  .receipt-step-content .terms { display: block; }
  .receipt-step-content .terms dt { margin-top: 14px; }
  .receipt-step-content .terms dd { margin: 4px 0 0; }
  .receipt-record-grid .terms { display: block; }
  .receipt-record-grid .terms dt { margin-top: 14px; }
  .receipt-record-grid .terms dd { margin: 4px 0 0; }
}
@media print {
  /* Only the receipt template loads this sheet; wide published tables keep their own page size. */
  @page { size: letter portrait; margin: 14mm; }
  .receipt { font-size: 9pt; line-height: 1.3; }
  .receipt-overview { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); }
  .receipt-panel { border: 0; padding: 0; }
  .receipt-panel { break-inside: auto; }
  .receipt-step-content .answers { break-inside: avoid; }
  .receipt-overview > *, .receipt-record, .receipt-file { break-inside: avoid; }
  .receipt h2, .receipt-panel h2 { font-size: 12pt; }
  .receipt h3 { font-size: 10pt; margin: 0 0 6px; }
  .receipt h2, .receipt h3, .receipt h4, .receipt h5 { break-inside: avoid; break-after: avoid; }
  .receipt .terms { max-width: none; gap: 4px 12px; }
  .receipt-step-content .terms { display: block; }
  .receipt-answer-block { display: block; break-inside: avoid; }
  .receipt .receipt-answer { display: block; margin: 0; padding-bottom: 8px; break-inside: avoid; }
  .receipt .receipt-answer > dt { break-after: auto; }
  .receipt .receipt-answer > dd { break-inside: auto; margin-top: 4px; }
  .receipt-step-content .terms { grid-template-columns: minmax(0, 2fr) minmax(0, 3fr); }
  .receipt .receipt-step-content .section-tight { margin: 0 0 12px; }
  .receipt-card h2 .receipt-number { font-size: 18pt; }
  .receipt-number-label, .receipt-quote, .receipt-reference, .receipt-as-of, .receipt-about,
  .receipt ol.timeline .step-state, .receipt ol.timeline .step-when, .receipt ol.timeline .step-note { font-size: 8pt; }
  .receipt-payment-box, .receipt-payment { font-size: 8pt; line-height: 1.3; }
  .receipt-stamp { padding-top: 8px; margin: 8px 0 10px; }
  .receipt .timeline li { padding-bottom: 12px; }
  .receipt .receipt-step-name { font-size: 9pt; }
  .receipt-record-grid { display: block; }
  .receipt-filed-head { break-after: avoid; }
  .receipt-record, .receipt .demo-note, .demo-banner, .site-footer { display: none !important; }
  .receipt-step:last-of-type, .receipt-step:last-of-type .receipt-step-content,
  .receipt .receipt-about-record, .receipt .receipt-certification { break-inside: avoid; }
  .receipt-about-record { break-after: avoid; }
  .receipt .no-print, .receipt-controls { display: none !important; }
  .receipt-card { border: 1px solid #000; padding: 12px; max-width: 40rem; break-inside: avoid; }
  .receipt-step { border: 0; border-radius: 0; }
  .receipt-step > summary { padding: 8px 0; min-height: 0; break-after: avoid; }
  .receipt-step > summary::after { display: none; }
  .receipt-digest { display: none; }
  .receipt-step-content { padding: 12px 0 0; }
  .receipt-fingerprint .sha256 { font-size: 8pt; overflow: visible; white-space: normal; overflow-wrap: anywhere; word-break: break-all; }
  .receipt details::details-content { display: block !important; content-visibility: visible !important; }
  .receipt details > :not(summary) { display: block !important; }
}
@media screen and (max-width: 479.98px) {
  .receipt-card h2 .receipt-number { font-size: 1.25rem; white-space: nowrap; }
  .receipt-reference .receipt-number { white-space: nowrap; overflow-wrap: normal; }
}
