.legacy-content:has(> #page-purchase.active) { display:flex; flex-direction:column; overflow:hidden; }
.legacy-content:has(> #page-purchase.active) > #message { flex:0 0 auto; }
.legacy-content > #page-purchase.active { flex:1 1 0; height:auto; min-height:0; }
#page-purchase.active #purchaseEditorView:not(.hidden) { grid-template-rows: auto auto auto minmax(0, 1fr) auto auto auto; min-width:0; }
#purchaseEditorView .purchase-header-grid { grid-template-columns:minmax(130px,.8fr) minmax(180px,1.1fr) minmax(165px,1fr) minmax(220px,1.25fr) minmax(315px,1.85fr); }
#purchaseEditorView > .legacy-toolbar { min-width:0; overflow-x:auto; }
[data-purchase-receipts] { min-width:0; padding:6px 10px; border-bottom:1px solid #9ec0d4; background:#f0f9ff; color:#244d67; }
[data-purchase-receipts] .pr-heading { display:flex; gap:9px; align-items:center; flex-wrap:wrap; }
[data-purchase-receipts] .pr-heading button { padding:4px 10px; }
[data-purchase-receipts] .pr-heading-actions { display:flex; flex-wrap:wrap; gap:9px; }
[data-purchase-receipts] [hidden] { display:none !important; }
[data-purchase-receipts] .pr-toggle { margin-left:auto; flex:none; min-height:32px; font-size:15px; }
[data-purchase-receipts] .pr-toggle:focus-visible { outline:2px solid #147baf; outline-offset:2px; }
[data-purchase-receipts] .pr-summary { font-size:13px; }
.pr-document { font-size:12px; color:#557185; }
.pr-drop { margin-top:5px; border:2px dashed #81aec5; padding:7px 10px; border-radius:4px; text-align:center; cursor:pointer; }
.pr-drop[aria-disabled=true] { opacity:.65; cursor:default; }
.pr-dragover .pr-drop { border-color:#148cae; background:#d5f0fa; }
.pr-thumbnails { display:flex; gap:8px; max-width:100%; overflow-x:auto; }
.pr-card { flex:0 0 120px; width:120px; display:grid; grid-template-columns:1fr auto; gap:2px; margin-top:5px; }
.pr-card > button:first-child { grid-column:1 / -1; padding:2px; height:64px; background:white; }
.pr-card img { width:100%; height:58px; object-fit:contain; }
.pr-card > span { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; font-size:11px; }
.pr-card > button:last-child:not(:first-child) { padding:0 3px; font-size:11px; }
.pr-status { font-size:12px; padding-top:3px; min-height:16px; }
.pr-error { color:#b33127; }
#purchaseReceiptPreview { width:min(1100px,94vw); max-width:94vw; height:min(900px,92vh); max-height:92vh; box-sizing:border-box; border:1px solid #6197b8; padding:12px; color:#244d67; background:#f6fbfe; }
#purchaseReceiptPreview[open] { display:flex; flex-direction:column; overflow:hidden; }
#purchaseReceiptPreview::backdrop { background:rgba(0,0,0,.55); }
#purchaseReceiptPreview .pr-preview-heading { display:flex; justify-content:space-between; align-items:center; gap:15px; flex:none; }
#purchaseReceiptPreview strong { min-width:0; overflow-wrap:anywhere; display:-webkit-box; -webkit-box-orient:vertical; -webkit-line-clamp:2; overflow:hidden; }
#purchaseReceiptPreview button { flex:none; min-height:36px; padding:6px 12px; border:1px solid #9bbdd1; border-radius:4px; color:#244d67; background:#fff; font:inherit; }
#purchaseReceiptPreview button:focus-visible { outline:2px solid #147baf; outline-offset:2px; }
#purchaseReceiptPreview button:disabled { opacity:.55; cursor:default; }
#purchaseReceiptPreview .pr-preview-toolbar { display:flex; align-items:center; flex-wrap:wrap; gap:8px; padding:10px 0; flex:none; }
#purchaseReceiptPreview .pr-preview-toolbar small { color:#627b8b; font-size:12px; }
#purchaseReceiptPreview .pr-preview-direction { color:#426a83; font-size:13px; min-width:110px; }
#purchaseReceiptPreview .pr-preview-stage { position:relative; flex:1 1 auto; min-height:0; width:100%; overflow:hidden; background:#e4edf3; border-radius:3px; }
#purchaseReceiptPreview .pr-preview-stage img { position:absolute; left:50%; top:50%; display:block; max-width:none; max-height:none; margin:0; object-fit:contain; transform-origin:center; visibility:hidden; }
[data-purchase-receipts="gold-in"] { margin:8px 0; }
#purchaseReceiptPanel { width:min(1100px,94vw); max-width:94vw; max-height:88vh; box-sizing:border-box; padding:0; border:1px solid #6197b8; border-radius:6px; color:#244d67; background:#f0f9ff; }
#purchaseReceiptPanel[open] { display:flex; flex-direction:column; }
#purchaseReceiptPanel::backdrop { background:rgba(0,0,0,.45); }
#purchaseReceiptPanel .pr-panel-heading { display:flex; justify-content:space-between; align-items:center; gap:16px; flex:none; padding:12px 16px; color:#fff; background:#215d86; }
#purchaseReceiptPanel .pr-panel-heading strong { font-size:20px; }
#purchaseReceiptPanel .pr-panel-heading button { min-height:36px; padding:6px 18px; color:#244d67; background:#fff; border:1px solid #b4cbd8; border-radius:4px; }
#purchaseReceiptPanel .pr-panel-body { min-height:0; overflow:auto; padding:12px; }
#purchaseReceiptPanel [data-purchase-receipts] { margin:0; padding:8px; border:0; }
#purchaseReceiptPanel .pr-heading { gap:12px; }
#purchaseReceiptPanel .pr-heading button { min-height:36px; font-size:16px; }
#purchaseReceiptPanel .pr-drop { display:flex; align-items:center; justify-content:center; min-height:110px; padding:20px; margin:12px 0; font-size:17px; }
#purchaseReceiptPanel .pr-thumbnails { flex-wrap:wrap; }
#purchaseReceiptPanel .pr-card { flex-basis:180px; width:180px; }
#purchaseReceiptPanel .pr-card > button:first-child { height:120px; }
#purchaseReceiptPanel .pr-card img { height:112px; }
#purchaseReceiptPanel .pr-card > span, #purchaseReceiptPanel .pr-card > button:last-child:not(:first-child) { font-size:13px; }
#purchaseReceiptPanel .pr-status { font-size:14px; padding-top:10px; }
