/* Invoice presentation follows www/css/documents.css and the phone's ivc cards.
   Data and amounts remain the bounded, verified read contract. */
.mary-web-account #invoiceList { display: flex; flex-direction: column; gap: 9px; }
.mary-web-account .phone-invoice-card { grid-template-columns: minmax(0,1fr) auto; cursor: default; }
.mary-web-account .phone-invoice-card .invoice-row-heading { margin: 0 0 3px; white-space: normal; overflow-wrap: anywhere; }
.mary-web-account .phone-invoice-card .ivc-meta { align-items: start; }
.mary-web-account .phone-invoice-card .ivc-meta bdi { overflow-wrap: anywhere; }
.mary-web-account .phone-invoice-card .ivchip { justify-self: start; }
.mary-web-account .phone-invoice-card .invoice-open { justify-self: end; margin: 0; min-height: 44px; }
.mary-web-account .phone-invoice-card-amounts { margin: 0; min-width: 0; max-width: 250px; overflow-wrap: anywhere; }
.mary-web-account .phone-invoice-card-amounts dt { font-size: 11.5px; color: var(--muted); }
.mary-web-account .phone-invoice-card-amounts dd { margin: 0; font-size: 15px; font-weight: 800; font-variant-numeric: tabular-nums; }
.mary-web-account .phone-invoice-card-amounts > div + div { margin-top: 4px; }
.mary-web-account #invoiceDetail { border: 0; padding: 0; }
.mary-web-account #invoiceArea[data-invoice-view="detail"] > h2,
.mary-web-account #invoiceArea[data-invoice-view="detail"] #invoiceFilters,
.mary-web-account #invoiceArea[data-invoice-view="detail"] #invoiceBrowser > .login-scope,
.mary-web-account #invoiceArea[data-invoice-view="detail"] .invoice-pagination { display: none; }
.phone-invoice-actions { display: flex; justify-content: end; gap: 10px; margin: 12px 0; }
.phone-invoice-actions .btn { min-height: 44px; }
.phone-invoice-document { --mary-invoice-print-ready: 1; color: #152238; }
.phone-invoice-document .doc-head-pro { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); align-items: start; gap: 18px; border-bottom: 3px solid var(--ink,#082b59); padding-bottom: 16px; margin-bottom: 16px; }
.phone-invoice-document .doc-company-name { color: var(--ink,#082b59); font-size: 24px; letter-spacing: .08em; }
.phone-invoice-document .doc-title { margin: 0 0 10px; color: var(--ink,#082b59); font-size: 19px; overflow-wrap: anywhere; line-height: 1.5; }
.phone-invoice-document .doc-info-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; margin-bottom: 16px; }
.phone-invoice-document .doc-info-card { padding: 12px; margin: 0; border: 1px solid var(--line,#dce5f0); border-radius: 10px; overflow-wrap: anywhere; }
.phone-invoice-document .doc-info-card h4 { font-size: 12.5px; color: #526174; font-weight: 500; margin: 0 0 5px; }
.phone-invoice-document .doc-info-card > bdi { font-weight: 700; }
.phone-invoice-document .doc-facts > div { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 12px; font-size: 12px; }
.phone-invoice-document .doc-facts dt { color: #526174; }
.phone-invoice-document .doc-facts dd { margin: 0; font-weight: 700; }
.phone-invoice-document .phone-invoice-table-wrap { max-width: 100%; overflow-x: auto; }
.phone-invoice-document .phone-invoice-table-wrap:focus-visible { outline: 2px solid var(--focus,#0d6fae); outline-offset: 3px; }
.phone-invoice-scroll-hint { display: none; }
.phone-invoice-document table { width: 100%; table-layout: fixed; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.phone-invoice-document caption { text-align: start; padding-bottom: 8px; font-size: 14px; font-weight: 700; }
.phone-invoice-document th, .phone-invoice-document td { padding: 10px 8px; text-align: start; overflow-wrap: anywhere; vertical-align: top; }
.phone-invoice-document thead th { color: #fff; background: var(--ink,#082b59); font-size: 12px; }
.phone-invoice-document tbody th, .phone-invoice-document tbody td { border-bottom: 1px solid var(--line,#dce5f0); font-size: 13px; font-weight: 400; }
.phone-invoice-document table th:first-child { width: 38%; }
.phone-invoice-document .inv-summary { max-width: 100%; }
.phone-invoice-document .inv-summary .r { gap: 16px; align-items: baseline; }
.phone-invoice-document .inv-summary bdi { font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.phone-invoice-document .inv-summary .grand { border-top: 2px solid var(--ink,#082b59); margin-top: 6px; padding-top: 10px; font-weight: 800; }
.phone-invoice-copy-note, .phone-invoice-empty { color: #526174; line-height: 1.7; font-size: 12px; margin: 20px 0 0; }
.phone-invoice-payments { margin-top: 24px; }
.phone-invoice-payments h3 { font-size: 17px; margin: 0 0 12px; }
.phone-invoice-payments .ivsum { grid-template-columns: repeat(3,minmax(0,1fr)); gap: 12px; background: var(--surface,#fff); border-radius: 12px; padding: 14px; border: 0; }
.phone-invoice-payments dt { font-size: 12px; color: var(--muted,#526174); }
.phone-invoice-payments dd { margin: 4px 0 0; font-size: 14px; font-weight: 700; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
@media (max-width: 640px) {
  .mary-web-account .phone-invoice-card { grid-template-columns: minmax(0,1fr); }
  .mary-web-account .phone-invoice-card-amounts { display: flex; gap: 14px; max-width: none; text-align: start; }
  .mary-web-account .phone-invoice-card-amounts > div { flex: 1; min-width: 0; }
  .mary-web-account .phone-invoice-card-amounts > div + div { margin-top: 0; }
  .phone-invoice-document .doc-head-pro, .phone-invoice-document .doc-info-grid { gap: 10px; }
  .phone-invoice-document .doc-head-pro { grid-template-columns: minmax(0,1fr); }
  .phone-invoice-document .doc-info-grid { grid-template-columns: minmax(0,1fr); }
  .phone-invoice-document .doc-company { display: flex; flex-wrap: wrap; align-items: baseline; gap: 10px; }
  .phone-invoice-document table { min-width: 430px; table-layout: fixed; }
  .phone-invoice-document tbody th, .phone-invoice-document tbody td { white-space: normal; }
  .phone-invoice-scroll-hint { display: block; margin: 12px 0 4px; color: #526174; font-size: 12px; }
  .phone-invoice-payments .ivsum { grid-template-columns: minmax(0,.7fr) minmax(0,1fr) minmax(0,1.25fr); gap: 8px; padding: 12px; }
}
@media print {
  body.mary-invoice-print > :not(#phoneAccountApp):not(#userMain),
  body.mary-invoice-print #phoneAccountApp > :not(#phoneAccountMain),
  body.mary-invoice-print #phoneAccountMain > :not(#view),
  body.mary-invoice-print #view > :not(#userAccountPanel),
  body.mary-invoice-print #userMain > :not(#userAccountPanel),
  body.mary-invoice-print #userAccountPanel > :not(#invoiceArea),
  body.mary-invoice-print #invoiceArea > :not(#invoiceBrowser),
  body.mary-invoice-print #invoiceBrowser > :not(#invoiceDetail),
  body.mary-invoice-print #invoiceDetail > :not(#invoiceDetailContent),
  body.mary-invoice-print #invoiceDetailContent > :not(#invoicePrintDocument) { display: none !important; }
  body.mary-invoice-print, body.mary-invoice-print #phoneAccountApp, body.mary-invoice-print #phoneAccountMain,
  body.mary-invoice-print #view, body.mary-invoice-print #userMain, body.mary-invoice-print #userAccountPanel,
  body.mary-invoice-print #invoiceArea, body.mary-invoice-print #invoiceBrowser, body.mary-invoice-print #invoiceDetail,
  body.mary-invoice-print #invoiceDetailContent { margin: 0; padding: 0; width: 100%; max-width: none; min-height: 0; border: 0; box-shadow: none; background: #fff; }
  body.mary-invoice-print #phoneAccountApp { display: block; }
  body.mary-invoice-print #invoicePrintDocument { max-width: none; border: 0; border-radius: 0; padding: 0; box-shadow: none; overflow: visible; }
  body.mary-invoice-print #invoicePrintDocument .doc-head-pro, body.mary-invoice-print #invoicePrintDocument .doc-info-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  body.mary-invoice-print #invoicePrintDocument .doc-tscroll { overflow: visible; }
  body.mary-invoice-print #invoicePrintDocument .phone-invoice-scroll-hint { display: none; }
  body.mary-invoice-print #invoicePrintDocument table { min-width: 0; width: 100%; }
  body.mary-invoice-print #invoicePrintDocument thead { display: table-header-group; }
  body.mary-invoice-print #invoicePrintDocument tr, body.mary-invoice-print #invoicePrintDocument .inv-summary { break-inside: avoid; }
}
