.legacy-receipt-dialog { box-sizing:border-box; width:min(860px,calc(100vw - 32px)); max-height:calc(100dvh - 32px); padding:22px; overflow-x:hidden; overflow-y:auto; border:1px solid var(--light-gray); border-radius:18px; background:var(--surface); color:var(--dark); box-shadow:var(--dialog-shadow); }
.legacy-receipt-dialog::backdrop { background:color-mix(in srgb,var(--dark) 40%,transparent); }
.legacy-receipt-detail-dialog { width:min(800px,calc(100vw - 32px)); }
.legacy-receipt-header { display:flex; align-items:center; justify-content:space-between; gap:12px; margin-bottom:18px; }
.legacy-receipt-header h2 { margin:0; font-size:22px; line-height:1.4; }
.legacy-receipt-header > .content-heading > .content-icon { color:var(--primary); }
.legacy-receipt-header .button { min-height:34px; padding:7px 12px; font-size:12px; }
.legacy-receipt-filters { display:grid; grid-template-columns:minmax(130px,1fr) auto minmax(190px,1.2fr) minmax(130px,.8fr); align-items:end; gap:10px; margin-bottom:16px; }
.legacy-receipt-dialog label { display:flex; flex-direction:column; gap:6px; margin:0; min-width:0; font-size:12px; }
.legacy-receipt-filters > button { min-height:44px; padding:10px 12px; }
.legacy-receipt-summary { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:10px; margin-bottom:16px; }
.legacy-receipt-summary > div { min-width:0; padding:12px 14px; border:1px solid var(--light-gray); border-radius:10px; background:var(--canvas); }
.legacy-receipt-summary span,.legacy-receipt-summary small { display:block; color:var(--muted); font-size:11px; overflow-wrap:anywhere; }
.legacy-receipt-summary strong { display:block; margin:3px 0; font-size:18px; }
.legacy-receipt-summary > :nth-child(2) { background:var(--soft-blue); }
.legacy-receipt-list { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:10px; }
.legacy-receipt-list-card .record-card-top { margin-bottom:6px; }
.legacy-receipt-list-card .record-card-meta { margin:0; font-size:12px; }
.legacy-receipt-source-button { padding:0; border:0; background:transparent; color:var(--primary); font-size:13px; font-weight:600; line-height:1.6; text-align:left; overflow-wrap:anywhere; }
.legacy-receipt-state { padding:2px 7px; border:1px solid var(--light-gray); border-radius:6px; background:var(--canvas); color:var(--muted); font-size:10px; white-space:nowrap; }
.legacy-receipt-pagination { display:flex; align-items:center; justify-content:center; gap:14px; margin-top:18px; font-size:12px; color:var(--muted); }
.legacy-receipt-pagination .button { min-height:34px; padding:7px 12px; font-size:12px; }
.legacy-receipt-source-card h3 { margin:0; font-size:14px; }
.legacy-receipt-source-card > .record-card-stats { margin-top:10px; }
.legacy-receipt-readonly { margin:12px 0 0; padding:10px 12px; border:1px solid var(--light-gray); border-radius:10px; background:var(--soft-blue); font-size:12px; line-height:1.7; overflow-wrap:anywhere; }
.legacy-receipt-readonly:empty { display:none; }
.legacy-receipt-form { display:grid; gap:14px; margin:18px 0; }
.legacy-receipt-form > .content-heading { flex-wrap:wrap; font-size:13px; font-weight:600; }
.legacy-receipt-form > .content-heading select { width:auto; min-width:0; flex:1 1 220px; margin-left:6px; }
.legacy-receipt-form > .content-heading .button { min-height:32px; padding:6px 10px; margin-left:auto; font-size:11px; }
.legacy-receipt-form > .content-heading .context-help-button { order:1; }
.legacy-receipt-allocations { display:grid; gap:10px; }
.legacy-receipt-allocation { display:grid; grid-template-columns:minmax(160px,1fr) minmax(110px,.65fr) minmax(210px,1.1fr) auto; gap:10px; align-items:end; padding:12px; }
.legacy-receipt-allocation > button { min-height:44px; padding:8px; font-size:11px; }
.legacy-receipt-allocation select,.legacy-receipt-allocation input { padding:0 10px; font-size:12px; }
.legacy-receipt-totals { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:10px; padding:12px; border:1px solid var(--light-gray); border-radius:10px; background:var(--canvas); }
.legacy-receipt-totals span { display:block; font-size:11px; color:var(--muted); }
.legacy-receipt-totals strong { display:block; margin-top:4px; font-size:16px; font-variant-numeric:tabular-nums; overflow-wrap:anywhere; }
.legacy-receipt-totals > :last-child strong { color:var(--primary); }
.legacy-receipt-dialog input:disabled,.legacy-receipt-dialog select:disabled,.legacy-receipt-dialog textarea:disabled { background:var(--canvas); color:var(--muted); }
.legacy-receipt-form textarea { min-height:64px; height:64px; padding:10px 12px; }
.legacy-receipt-form .legacy-receipt-reviewed { flex-direction:row; align-items:flex-start; gap:9px; line-height:1.7; font-weight:500; }
.legacy-receipt-reviewed input { width:18px; height:18px; flex:0 0 18px; padding:0; margin:2px 0 0; order:-1; accent-color:var(--primary); }
.legacy-receipt-actions { display:flex; justify-content:flex-end; flex-wrap:wrap; gap:8px; }
.legacy-receipt-actions .button { min-height:38px; padding:9px 12px; font-size:12px; }
.legacy-receipt-dialog > .content-heading h3 { margin:0; font-size:14px; }
.legacy-receipt-history { display:grid; gap:10px; margin-top:10px; }
.legacy-receipt-history h4 { margin:0; font-size:13px; }
.legacy-receipt-history-allocations { display:grid; gap:7px; }
.legacy-receipt-history-allocation { display:grid; grid-template-columns:90px 120px minmax(0,1fr); gap:8px; font-size:12px; }
.legacy-receipt-history-allocation span { color:var(--muted); }
.opening-reviewed-receipts { display:grid; gap:10px; margin-bottom:14px; }
.opening-reviewed-receipts h3,.opening-reviewed-receipts h4 { margin:0; font-size:13px; }
.opening-reviewed-receipts .record-card-meta { margin:8px 0; }
.opening-reviewed-receipts .legacy-receipt-history-allocation { grid-template-columns:85px 110px minmax(0,1fr); }
@media(max-width:720px) {
  .legacy-receipt-filters { grid-template-columns:minmax(0,1fr) auto; }
  .legacy-receipt-filters > label:nth-last-child(-n+2) { grid-column:span 1; }
  .legacy-receipt-allocation { grid-template-columns:minmax(0,1fr) minmax(100px,.7fr); }
  .legacy-receipt-allocation > label:nth-child(3) { grid-column:1; }
}
@media(max-width:550px) {
  .legacy-receipt-dialog,.legacy-receipt-detail-dialog { width:calc(100vw - 24px); max-height:calc(100dvh - 24px); padding:16px; border-radius:16px; }
  .legacy-receipt-header h2 { font-size:19px; }
  .legacy-receipt-list { grid-template-columns:minmax(0,1fr); }
  .legacy-receipt-summary { gap:7px; }
  .legacy-receipt-summary > div { padding:10px; }
  .legacy-receipt-summary strong { font-size:16px; }
  .legacy-receipt-filters > label:last-child { grid-column:1/-1; }
  .legacy-receipt-dialog input,.legacy-receipt-dialog select,.legacy-receipt-dialog textarea { font-size:16px; }
  .legacy-receipt-allocation { grid-template-columns:minmax(0,1fr); }
  .legacy-receipt-allocation > button { justify-self:end; min-height:32px; }
  .legacy-receipt-totals { gap:7px; padding:10px; }
  .legacy-receipt-totals strong { font-size:14px; }
  .legacy-receipt-history-allocation,.opening-reviewed-receipts .legacy-receipt-history-allocation { grid-template-columns:minmax(0,1fr) minmax(0,1fr); }
  .legacy-receipt-history-allocation span { grid-column:1/-1; overflow-wrap:anywhere; }
}
