/* Compact invoice workbench: retained row controls, two-line scan and one item panel. */
html body #invoice #invoiceQueueReviewPanel { padding:18px; }
html body #invoice #invoiceQueueReviewPanel > .panel-header { margin-bottom:10px; }
html body:has(#invoice.is-visible[data-intake-stage=review]) #mainContent .page-heading { display:none !important; }
html body #invoice[data-intake-stage=review] #invoiceGuidedFlow { padding:6px 12px !important; min-height:40px !important; margin-bottom:8px !important; }
html body #invoice[data-intake-stage=review] #invoiceGuidedFlow { display:none !important; }
html body #invoice #invoiceQueueReviewPanel > .panel-header .panel-actions,
html body #invoice #invoiceQueueReviewPanel > .panel-header .invoice-guided-actions { display:flex; flex-wrap:wrap; gap:5px; align-items:center; }
html body #invoice #invoiceQueueReviewPanel > .panel-header button { min-height:30px; padding:4px 8px; font-size:11px; }
html body #invoice #invoiceQueueReviewPanel > .invoice-review-bar:not(:has(.invoice-balance-status:not([hidden]))):not(:has(#invoiceSaveBlocker:not([hidden]))) { display:none !important; }
html body #invoice #invoiceQueueReviewPanel > .panel-header { padding:0 !important; margin:0 0 8px !important; background:transparent !important; border:0 !important; min-height:0 !important; }
html body #invoice #invoiceQueueReviewPanel > .panel-header h2 { font-size:20px !important; margin:0 !important; line-height:1.2; }
html body #invoice #invoiceQueueReviewPanel > .panel-header .hint { display:none; }
html body #invoice #invoiceQueueReviewPanel .invoice-header-grid { gap:10px; margin:8px 0 10px; }
html body #invoice #invoiceQueueReviewPanel .invoice-header-grid input { min-height:34px; padding:5px 8px; }
html body #invoice #invoiceQueueReviewPanel #invoiceReviewSummary { margin:6px 0; padding:0; }
html body #invoice #invoiceQueueReviewPanel .invoice-review-bar { margin:2px 0 !important; padding:0 !important; min-height:0 !important; border:0 !important; background:transparent !important; }
html body #invoice #invoiceQueueReviewPanel .invoice-review-bar .line-toolbar { min-height:0; }
html body #invoice #invoiceQueueReviewPanel #invoiceInlineChecks { margin:2px 0 !important; gap:4px; }
html body #invoice #invoiceQueueReviewPanel #invoiceInlineChecks summary { padding:4px 8px; font-size:11px; }
html body #invoice #invoiceQueueReviewPanel #invoiceReviewSummary { margin:2px 0 !important; padding:0 !important; }
html body #invoice #invoiceQueueReviewPanel .invoice-line-filter-bar { margin:6px 0; padding:6px 0; }
html body #invoice #invoiceQueueReviewPanel .invoice-line-filter-bar > small { display:none; }
html body #invoice #invoiceQueueReviewPanel .invoice-compact-workspace { display:grid !important; grid-template-columns:minmax(0,1fr) 350px !important; gap:20px; position:relative; align-items:start; }
html body #invoice #invoiceQueueReviewPanel .invoice-compact-workspace:has(#invoiceLineReference[hidden]) { grid-template-columns:minmax(0,1fr) 350px !important; }
html body #invoice #invoiceQueueReviewPanel .invoice-compact-workspace { grid-template-areas:none !important; padding:0; }
html body #invoice #invoiceQueueReviewPanel .invoice-compact-workspace > .table-wrap { grid-column:1 !important; grid-row:auto !important; order:0 !important; padding:0; }
html body #invoice #invoiceQueueReviewPanel .invoice-compact-workspace > #invoiceLineReference[hidden] { display:none !important; }
html body #invoice #invoiceQueueReviewPanel .invoice-compact-workspace > #invoiceLineReference:not([hidden]) { grid-column:1/-1 !important; grid-row:auto !important; order:0 !important; }
html body #invoice #invoiceQueueReviewPanel .invoice-review-table-wrap { min-width:0; overflow:visible; position:static; width:100%; }
html body #invoice #invoiceQueueReviewPanel .invoice-line-reference:not([hidden]) { grid-column:1/-1; width:100%; max-width:none; max-height:420px; }
html body #invoice #invoiceQueueReviewPanel .invoice-line-table { width:100%; min-width:0 !important; table-layout:fixed; display:table; }
html body #invoice #invoiceQueueReviewPanel .invoice-line-table thead,
html body #invoice #invoiceQueueReviewPanel .invoice-line-table colgroup { display:none; }
html body #invoice #invoiceQueueReviewPanel .invoice-line-grid-header,
html body #invoice #invoiceQueueReviewPanel .invoice-dense-row { display:grid !important; grid-template-columns:minmax(0,1fr) 110px 85px 80px 68px !important; gap:10px; align-items:center; min-width:0 !important; }
html body #invoice #invoiceQueueReviewPanel .invoice-line-grid-header { padding:10px 12px; font-size:10px; text-transform:uppercase; letter-spacing:.035em; border-bottom:1px solid var(--line); position:static; }
html body #invoice #invoiceQueueReviewPanel .invoice-line-grid-header { grid-template-areas:none !important; grid-template-rows:auto !important; }
html body #invoice #invoiceQueueReviewPanel .invoice-line-grid-header span:nth-child(3),
html body #invoice #invoiceQueueReviewPanel .invoice-line-grid-header span:nth-child(4) { text-align:right; }
html body #invoice #invoiceQueueReviewPanel #invoiceLineRows > .invoice-compact-row { display:table-row !important; background:transparent !important; }
html body #invoice #invoiceQueueReviewPanel #invoiceLineRows > .invoice-compact-row[hidden] { display:none !important; }
html body #invoice #invoiceQueueReviewPanel #invoiceLineRows > .invoice-compact-row,
html body #invoice #invoiceQueueReviewPanel #invoiceLineRows > .invoice-compact-row > td { backdrop-filter:none !important; isolation:auto !important; transform:none !important; contain:none !important; will-change:auto !important; }
html body #invoice #invoiceQueueReviewPanel #invoiceLineRows > .invoice-compact-row > td { display:table-cell !important; padding:0 !important; border:0 !important; position:static; width:auto; }
html body #invoice #invoiceQueueReviewPanel #invoiceLineRows .invoice-dense-row { width:100%; min-height:64px; padding:10px 12px; margin:0; border:0; border-bottom:1px solid var(--line); border-radius:0; text-align:left; background:var(--paper); color:var(--ink); font-size:12px; line-height:1.35; cursor:pointer; font-variant-numeric:tabular-nums; }
html body #invoice #invoiceQueueReviewPanel #invoiceLineRows .invoice-dense-row:hover { background:var(--soft); }
html body #invoice #invoiceQueueReviewPanel #invoiceLineRows .is-definition-open .invoice-dense-row { background:#eef1e6; box-shadow:inset 4px 0 var(--accent); }
html body #invoice #invoiceQueueReviewPanel #invoiceLineRows .invoice-dense-row:focus-visible { outline:2px solid var(--accent); outline-offset:-2px; }
html body #invoice #invoiceQueueReviewPanel .invoice-dense-item { display:flex; flex-direction:column; gap:5px; min-width:0; }
html body #invoice #invoiceQueueReviewPanel .invoice-dense-item > span { display:flex; align-items:baseline; gap:8px; min-width:0; }
html body #invoice #invoiceQueueReviewPanel .invoice-dense-item strong { font-size:13px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
html body #invoice #invoiceQueueReviewPanel .invoice-dense-item small { font-size:10px; color:var(--muted); }
html body #invoice #invoiceQueueReviewPanel [data-dense-sku] { white-space:nowrap; }
html body #invoice #invoiceQueueReviewPanel [data-dense-breakdown] { white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
html body #invoice #invoiceQueueReviewPanel [data-dense-breakdown] { white-space:normal; overflow:visible; text-overflow:clip; }
html body #invoice #invoiceQueueReviewPanel .invoice-dense-rate { display:flex; flex-direction:column; align-items:flex-end; }
html body #invoice #invoiceQueueReviewPanel .invoice-dense-total { text-align:right; font-size:13px; }
html body #invoice #invoiceQueueReviewPanel .invoice-dense-marker { font-size:10px; text-align:right; color:var(--muted); }
html body #invoice #invoiceQueueReviewPanel .invoice-dense-marker[data-state=required] { color:#8b5e18; font-weight:600; }
html body #invoice #invoiceQueueReviewPanel .invoice-compact-empty { grid-column:2; min-height:200px; position:sticky; top:100px; border:1px solid var(--line); border-radius:8px; padding:20px; background:var(--paper); font-size:13px; color:var(--muted); }
html body #invoice #invoiceQueueReviewPanel .invoice-compact-empty h3 { color:var(--ink); font-size:18px; }
html body #invoice #invoiceQueueReviewPanel .invoice-compact-empty[hidden] { display:block !important; visibility:hidden; }
html body #invoice #invoiceQueueReviewPanel #invoiceLineRows .invoice-compact-row .invoice-definition-disclosure:not([hidden]) { display:flex !important; flex-direction:column; gap:12px; position:fixed !important; left:var(--compact-panel-left); top:var(--compact-panel-top,120px); bottom:112px; width:var(--compact-panel-width,350px); max-height:none !important; min-width:0; overflow:auto; padding:16px !important; margin:0 !important; border:1px solid var(--line); border-radius:8px; background:var(--paper); z-index:45; box-shadow:0 8px 20px #0001; }
html body #invoice #invoiceQueueReviewPanel #invoiceLineRows .invoice-definition-disclosure[hidden] { display:none !important; }
html body #invoice #invoiceQueueReviewPanel #invoiceLineRows .invoice-compact-row .invoice-definition-disclosure:not([hidden]) { bottom:var(--compact-panel-bottom,112px) !important; z-index:1101; }
html body #invoice #invoiceQueueReviewPanel .invoice-compact-panel-header { display:flex; flex-direction:column; align-items:flex-start; gap:5px; }
html body #invoice #invoiceQueueReviewPanel .invoice-compact-panel-header > div { width:100%; display:flex; align-items:center; justify-content:space-between; gap:8px; font-size:11px; color:var(--muted); }
html body #invoice #invoiceQueueReviewPanel .invoice-compact-panel-header h3 { font-size:21px; line-height:1.2; margin:8px 0 0; }
html body #invoice #invoiceQueueReviewPanel .invoice-compact-panel-header small { color:var(--muted); }
html body #invoice #invoiceQueueReviewPanel .invoice-compact-panel-header button { min-height:30px; padding:4px 0; font-size:12px; }
html body #invoice #invoiceQueueReviewPanel .invoice-compact-row .package-review-overview { padding:10px 0; margin:0; border:0; border-top:1px solid var(--line); border-bottom:1px solid var(--line); background:transparent; border-radius:0; font-size:12px; }
html body #invoice #invoiceQueueReviewPanel .invoice-compact-row .package-review-overview > strong { font-size:11px; color:var(--muted); }
html body #invoice #invoiceQueueReviewPanel .invoice-compact-row .package-review-overview dl { display:grid; grid-template-columns:1fr; gap:8px; margin:8px 0; }
html body #invoice #invoiceQueueReviewPanel .invoice-compact-row .package-review-overview dl { display:none; }
html body #invoice #invoiceQueueReviewPanel [data-compact-overview] > div { display:flex; justify-content:space-between; gap:10px; margin:12px 0; font-size:13px; }
html body #invoice #invoiceQueueReviewPanel [data-compact-overview] p { font-size:12px; line-height:1.6; }
html body #invoice #invoiceQueueReviewPanel .invoice-compact-row .package-review-overview dl > div { padding:0; background:transparent; border:0; }
html body #invoice #invoiceQueueReviewPanel .invoice-compact-row .package-review-overview dd { margin:2px 0; }
html body #invoice #invoiceQueueReviewPanel .invoice-compact-row .package-review-overview dt { color:var(--muted); font-size:10px; text-transform:uppercase; }
html body #invoice #invoiceQueueReviewPanel .invoice-compact-row [data-package-guidance] { display:none !important; }
html body #invoice #invoiceQueueReviewPanel .invoice-compact-edit-fields { display:flex; flex-wrap:wrap; gap:5px; }
html body #invoice #invoiceQueueReviewPanel .invoice-compact-edit-fields button { padding:5px 8px; min-height:30px; font-size:11px; border:1px solid var(--line); border-radius:5px; background:var(--paper); }
html body #invoice #invoiceQueueReviewPanel .invoice-compact-full-details { border-top:1px solid var(--line); padding-top:10px; font-size:12px; }
html body #invoice #invoiceQueueReviewPanel .invoice-compact-full-details > summary { cursor:pointer; color:var(--muted); }
html body #invoice #invoiceQueueReviewPanel .invoice-compact-full-details > *:not(summary) { margin-top:10px; }
html body #invoice #invoiceQueueReviewPanel #invoiceLineRows .invoice-compact-full-details .invoice-nine-grid { display:grid !important; grid-template-columns:1fr 1fr !important; min-width:0 !important; gap:8px !important; }
html body #invoice #invoiceQueueReviewPanel #invoiceLineRows .invoice-compact-full-details .item-cell { grid-column:1/-1 !important; }
html body #invoice #invoiceQueueReviewPanel #invoiceLineRows .invoice-compact-full-details .item-cell .packaging-lab-note,
html body #invoice #invoiceQueueReviewPanel #invoiceLineRows .invoice-compact-full-details .item-cell .nine-details-cell { display:none !important; }
html body #invoice #invoiceQueueReviewPanel #invoiceLineRows .invoice-compact-row .invoice-line-details { display:block !important; }
html body #invoice #invoiceQueueReviewPanel #invoiceLineRows .invoice-compact-row .invoice-package-tools,
html body #invoice #invoiceQueueReviewPanel #invoiceLineRows .invoice-compact-row .invoice-receiving-exception-fields { display:flex !important; flex-wrap:wrap; gap:8px; }
html body #invoice #invoiceQueueReviewPanel #invoiceLineRows .invoice-compact-row .invoice-package-tools > *,
html body #invoice #invoiceQueueReviewPanel #invoiceLineRows .invoice-compact-row .invoice-receiving-exception-fields > * { min-width:0 !important; width:auto; flex:1 1 120px; }
html body #invoice #invoiceQueueReviewPanel #invoiceLineRows .invoice-compact-row .packaging-lab-editor { min-width:0 !important; }
html body #invoice #invoiceQueueReviewPanel #invoiceLineRows .invoice-compact-row .invoice-intake-question { position:static !important; display:block; width:100%; max-width:none; padding:0; margin:0; border:0; border-radius:0; background:transparent; box-shadow:none; overflow:visible; }
html body #invoice #invoiceQueueReviewPanel #invoiceLineRows .invoice-intake-question .canonical-package-dialog-header { padding:0; border:0; }
html body #invoice #invoiceQueueReviewPanel #invoiceLineRows .invoice-intake-question .canonical-package-dialog-header { margin:0; background:transparent; gap:8px; }
html body #invoice #invoiceQueueReviewPanel #invoiceLineRows .invoice-intake-question h2 { font-size:16px; line-height:1.3; margin:0; }
html body #invoice #invoiceQueueReviewPanel #invoiceLineRows .invoice-intake-question [data-intake-question] { gap:8px; margin:10px 0; }
html body #invoice #invoiceQueueReviewPanel #invoiceLineRows .invoice-intake-question [data-intake-question] p { font-size:12px; margin:0; }
html body #invoice #invoiceQueueReviewPanel #invoiceLineRows .invoice-intake-question .invoice-question-evidence { max-height:90px; overflow:auto; padding:8px; }
html body #invoice #invoiceQueueReviewPanel #invoiceLineRows .invoice-intake-question [name=answer],
html body #invoice #invoiceQueueReviewPanel #invoiceLineRows .invoice-intake-question [name=measure] { display:block !important; width:100%; min-height:40px; }
html body #invoice #invoiceQueueReviewPanel #invoiceLineRows .invoice-intake-question .modal-actions { display:flex; flex-wrap:wrap; gap:6px; margin-top:8px; }
html body #invoice #invoiceQueueReviewPanel #invoiceLineRows .invoice-intake-question .modal-actions button { flex:1; min-height:36px; padding:6px 8px; font-size:12px; }
html body #invoice #invoiceQueueReviewPanel .invoice-compact-question-note { color:var(--muted); font-size:11px; }
html body #invoice #invoiceQueueReviewPanel .invoice-stage-footer { padding:10px 14px; min-height:56px; }
@media(max-width:1099px) {
  html body #invoice #invoiceQueueReviewPanel .invoice-compact-workspace { grid-template-columns:minmax(0,1fr) !important; }
  html body #invoice #invoiceQueueReviewPanel .invoice-compact-workspace:has(#invoiceLineReference[hidden]) { grid-template-columns:minmax(0,1fr) !important; }
  html body #invoice #invoiceQueueReviewPanel .invoice-compact-empty,
  html body #invoice #invoiceQueueReviewPanel .invoice-compact-empty[hidden] { display:none !important; }
  html body #invoice #invoiceQueueReviewPanel #invoiceLineRows .invoice-compact-row .invoice-definition-disclosure:not([hidden]) { left:auto; right:16px; top:90px; width:min(370px,calc(100vw - 32px)); bottom:105px; box-shadow:0 5px 40px #0004; }
}

/* Give the source, list and editor distinct space. Keep the editor in the
   selected row when three usable columns do not fit; phones use a drawer. */
html body #invoice #invoiceQueueReviewPanel { padding-bottom:96px; }
html body #invoice #invoiceQueueReviewPanel .invoice-compact-workspace { gap:14px; }
html body #invoice #invoiceQueueReviewPanel .invoice-compact-workspace.has-reference { grid-template-columns:minmax(300px,.7fr) minmax(0,1fr) !important; }
html body #invoice #invoiceQueueReviewPanel .invoice-compact-workspace.has-reference > #invoiceLineReference:not([hidden]) { grid-column:1 !important; grid-row:1 !important; position:sticky !important; top:84px !important; align-self:start; height:var(--compact-source-height,calc(100dvh - 190px)); max-height:none !important; min-height:0; overflow:hidden; width:100%; box-sizing:border-box; z-index:1; margin:0; }
html body #invoice #invoiceQueueReviewPanel .invoice-compact-workspace.has-reference > .table-wrap { grid-column:2 !important; grid-row:1 !important; overflow:visible !important; }
html body #invoice #invoiceQueueReviewPanel .invoice-compact-workspace.has-reference > .invoice-compact-empty { display:none !important; }
html body #invoice #invoiceQueueReviewPanel .reference-header { display:flex; flex-wrap:wrap; gap:8px; }
html body #invoice #invoiceQueueReviewPanel .reference-zoom-toolbar { display:flex; flex-wrap:wrap; justify-content:flex-start; gap:4px; }
html body #invoice #invoiceQueueReviewPanel .reference-zoom-toolbar button { min-height:30px; padding:5px 8px; font-size:11px; }
html body #invoice #invoiceQueueReviewPanel .reference-preview { overflow:auto; min-height:0; }
html body #invoice #invoiceQueueReviewPanel .invoice-review-table-wrap { container-type:normal; }
html body #invoice #invoiceQueueReviewPanel .invoice-dense-item > span { flex-wrap:wrap; gap:2px 7px; }
html body #invoice #invoiceQueueReviewPanel [data-dense-sku] { max-width:100%; overflow-wrap:anywhere; white-space:normal; }
html body #invoice #invoiceQueueReviewPanel .invoice-compact-panel-header h3,
html body #invoice #invoiceQueueReviewPanel [data-compact-breakdown],
html body #invoice #invoiceQueueReviewPanel .invoice-intake-question p { overflow-wrap:anywhere; }
html body #invoice #invoiceQueueReviewPanel #invoiceLineRows .invoice-compact-row .invoice-definition-disclosure:not([hidden]) { box-sizing:border-box; z-index:40; overscroll-behavior:contain; scroll-padding:12px; }
html body #invoice #invoiceQueueReviewPanel [data-compact-panel-mode=inline] #invoiceLineRows .invoice-definition-disclosure:not([hidden]) { position:relative !important; inset:auto !important; width:100% !important; max-height:none !important; overflow:visible; margin:8px 0 12px !important; box-shadow:none; }
html body #invoice #invoiceQueueReviewPanel .invoice-review-more-actions > div { z-index:70; min-width:0; width:min(240px,calc(100vw - 48px)); max-height:calc(100dvh - 160px); overflow:auto; }
html body #invoice #invoiceQueueReviewPanel #invoiceLineRows .invoice-compact-full-details input,
html body #invoice #invoiceQueueReviewPanel #invoiceLineRows .invoice-compact-full-details select { min-width:0 !important; max-width:100%; width:100%; box-sizing:border-box; }
html body #invoice #invoiceQueueReviewPanel #invoiceLineRows .invoice-compact-full-details label { min-width:0; }
html body #invoice #invoiceQueueReviewPanel .invoice-package-tools,
html body #invoice #invoiceQueueReviewPanel .invoice-intake-question button { overflow-wrap:anywhere; white-space:normal; }
[data-compact-backdrop] { position:fixed; inset:0; z-index:1090; background:#152e294d; }
html body #invoice #invoiceQueueReviewPanel .invoice-review-table-wrap:not([data-compact-list-size=wide]) .invoice-line-grid-header,
  html body #invoice #invoiceQueueReviewPanel .invoice-review-table-wrap:not([data-compact-list-size=wide]) #invoiceLineRows .invoice-dense-row { grid-template-columns:minmax(0,1fr) 74px 68px 65px !important; gap:6px; }
  html body #invoice #invoiceQueueReviewPanel .invoice-review-table-wrap:not([data-compact-list-size=wide]) .invoice-dense-marker { grid-column:1; text-align:left; font-size:9px; }
  html body #invoice #invoiceQueueReviewPanel .invoice-review-table-wrap:not([data-compact-list-size=wide]) .invoice-dense-marker[data-state=ready] { display:none; }
  html body #invoice #invoiceQueueReviewPanel .invoice-review-table-wrap:not([data-compact-list-size=wide]) .invoice-line-grid-header span:last-child { display:none; }

html body #invoice #invoiceQueueReviewPanel .invoice-review-table-wrap[data-compact-list-size=narrow] .invoice-line-grid-header { display:none !important; }
  html body #invoice #invoiceQueueReviewPanel .invoice-review-table-wrap[data-compact-list-size=narrow] #invoiceLineRows .invoice-dense-row { grid-template-columns:minmax(0,1fr) 78px 75px !important; padding:8px 10px; }
  html body #invoice #invoiceQueueReviewPanel .invoice-review-table-wrap[data-compact-list-size=narrow] .invoice-dense-item { grid-column:1/-1; }
  html body #invoice #invoiceQueueReviewPanel .invoice-review-table-wrap[data-compact-list-size=narrow] .invoice-dense-item > span { display:flex; }
  html body #invoice #invoiceQueueReviewPanel .invoice-review-table-wrap[data-compact-list-size=narrow] .invoice-dense-item strong { white-space:normal; }
  html body #invoice #invoiceQueueReviewPanel .invoice-review-table-wrap[data-compact-list-size=narrow] .invoice-dense-quantity { grid-column:1; }
  html body #invoice #invoiceQueueReviewPanel .invoice-review-table-wrap[data-compact-list-size=narrow] .invoice-dense-rate { grid-column:2; }
  html body #invoice #invoiceQueueReviewPanel .invoice-review-table-wrap[data-compact-list-size=narrow] .invoice-dense-total { grid-column:3; }
  html body #invoice #invoiceQueueReviewPanel .invoice-review-table-wrap[data-compact-list-size=narrow] .invoice-dense-marker { grid-column:1/-1; }

@media(min-width:1500px) {
  html body #invoice #invoiceQueueReviewPanel .invoice-compact-workspace.has-reference { grid-template-columns:minmax(320px,.65fr) minmax(0,1fr) 330px !important; }
  html body #invoice #invoiceQueueReviewPanel .invoice-compact-workspace.has-reference > .invoice-compact-empty { grid-column:3; grid-row:1; display:block !important; }
}
@media(min-width:700px) and (max-width:1099px) {
  html body #invoice #invoiceQueueReviewPanel .invoice-compact-workspace > .table-wrap { grid-row:1 !important; }
}
@media(max-width:899px) {
  html body #invoice #invoiceQueueReviewPanel .invoice-compact-workspace.has-reference { grid-template-columns:minmax(0,1fr) !important; }
  html body #invoice #invoiceQueueReviewPanel .invoice-compact-workspace.has-reference > #invoiceLineReference:not([hidden]) { grid-column:1 !important; grid-row:1 !important; position:relative !important; top:auto !important; height:360px; }
  html body #invoice #invoiceQueueReviewPanel .invoice-compact-workspace.has-reference > .table-wrap { grid-column:1 !important; grid-row:2 !important; }
}
@media(max-width:699px) {
  html body #invoice #invoiceQueueReviewPanel { padding-bottom:170px; }
  html body #invoice #invoiceQueueReviewPanel #invoiceLineRows .invoice-compact-row .invoice-definition-disclosure:not([hidden]) { top:68px !important; bottom:var(--compact-panel-bottom,160px) !important; z-index:1101; }
  html body #invoice #invoiceQueueReviewPanel .invoice-compact-full-details .invoice-nine-grid { grid-template-columns:1fr !important; }
}
@media(max-width:700px) {
  html body #invoice #invoiceQueueReviewPanel { padding:10px; }
  html body #invoice #invoiceQueueReviewPanel .invoice-line-grid-header,
  html body #invoice #invoiceQueueReviewPanel #invoiceLineRows .invoice-dense-row { grid-template-columns:minmax(0,1fr) 76px 65px 65px !important; gap:5px; }
  html body #invoice #invoiceQueueReviewPanel #invoiceLineRows .invoice-dense-row { min-height:76px; padding:8px 7px; font-size:11px; }
  html body #invoice #invoiceQueueReviewPanel .invoice-dense-marker { grid-column:1; grid-row:2; text-align:left; }
  html body #invoice #invoiceQueueReviewPanel .invoice-dense-item strong { white-space:normal; font-size:12px; }
  html body #invoice #invoiceQueueReviewPanel .invoice-dense-item > span { display:block; }
  html body #invoice #invoiceQueueReviewPanel [data-dense-sku] { display:block; }
  html body #invoice #invoiceQueueReviewPanel [data-dense-breakdown] { white-space:normal; font-size:10px; }
  html body #invoice #invoiceQueueReviewPanel .invoice-dense-total { font-size:12px; }
  html body #invoice #invoiceQueueReviewPanel #invoiceLineRows .invoice-compact-row .invoice-definition-disclosure:not([hidden]) { left:8px; right:8px; width:auto; top:68px; bottom:95px; }
  html body #invoice #invoiceQueueReviewPanel .invoice-header-grid { grid-template-columns:1fr 1fr; }
  html body #invoice #invoiceQueueReviewPanel .invoice-stage-footer { padding:8px; }
  html body #invoice #invoiceQueueReviewPanel #invoiceLineRows { display:table-row-group !important; padding:0 !important; }
  html body #invoice #invoiceQueueReviewPanel #invoiceLineRows > .invoice-compact-row,
  html body #invoice #invoiceQueueReviewPanel #invoiceLineRows > .invoice-compact-row > td { position:static !important; transform:none !important; filter:none !important; backdrop-filter:none !important; perspective:none !important; contain:none !important; will-change:auto !important; content-visibility:visible !important; container-type:normal !important; overflow:visible !important; margin:0 !important; padding:0 !important; border:0 !important; border-radius:0 !important; }
  html body #invoice #invoiceQueueReviewPanel #invoiceLineRows .invoice-dense-row { grid-template-columns:minmax(0,1fr) 86px 72px !important; min-height:90px; }
  html body #invoice #invoiceQueueReviewPanel .invoice-dense-item { grid-column:1/-1; }
  html body #invoice #invoiceQueueReviewPanel .invoice-dense-item > span { display:flex; }
  html body #invoice #invoiceQueueReviewPanel .invoice-dense-marker { grid-column:1/-1; grid-row:auto; }
  html body #invoice #invoiceQueueReviewPanel .invoice-dense-quantity { grid-column:1; }
  html body #invoice #invoiceQueueReviewPanel .invoice-dense-rate { grid-column:2; }
  html body #invoice #invoiceQueueReviewPanel .invoice-dense-total { grid-column:3; }
  html body #invoice #invoiceQueueReviewPanel #invoiceReviewFooterNote { max-width:150px; }
  html body #invoice #invoiceQueueReviewPanel .invoice-line-grid-header { display:none !important; }
  html body #invoice #invoiceQueueReviewPanel #invoiceReviewFooterNote { font-size:10px; }
}
/* Purchase facts, optional contents and unit costing share one draft editor. */
.invoice-compact-pricing { display:flex; flex-direction:column; gap:7px; padding:10px 0; font-size:12px; }
.invoice-compact-pricing > strong { font-size:17px; }
.invoice-compact-pricing > span { color:var(--muted); }
.invoice-compact-pricing > div { display:flex; flex-wrap:wrap; gap:8px; }
.invoice-purchase-editor fieldset { border:0; padding:10px 0; margin:0; border-bottom:1px solid var(--line); }
.invoice-purchase-editor legend { font-weight:700; font-size:13px; }
.invoice-purchase-fields { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:9px; }
.invoice-purchase-fields label { min-width:0; }
.invoice-purchase-fields input,.invoice-purchase-fields select { width:100%; min-width:0; box-sizing:border-box; }
.invoice-purchase-editor [data-purchase-pricing-preview] { padding:10px; border-radius:6px; background:var(--soft); font-size:13px; }
.invoice-purchase-editor [data-purchase-pricing-preview][data-ready=false] { color:#8b5e18; }
.invoice-purchase-editor [hidden] { display:none !important; }

/* Long contents/conversion editors scroll inside the panel without overlapping actions. */
html body #invoice #invoiceQueueReviewPanel #invoiceLineRows .invoice-compact-row .invoice-definition-disclosure > * { flex-shrink:0; }

html body #invoice #invoiceQueueReviewPanel #invoiceLineRows .invoice-compact-row .invoice-intake-question { max-height:none !important; }

/* Selected item details: one retained editor, with no empty placeholder column. */
html body #invoice #invoiceQueueReviewPanel .invoice-compact-empty[hidden] { display:none !important; }
html body #invoice #invoiceQueueReviewPanel .invoice-compact-empty:not([hidden]) { visibility:hidden; padding:0; border:0; min-height:1px; }
html body #invoice #invoiceQueueReviewPanel .invoice-compact-workspace:has([data-compact-empty][hidden]) { grid-template-columns:minmax(0,1fr) !important; }
html body #invoice #invoiceQueueReviewPanel .invoice-compact-workspace.has-reference:has([data-compact-empty][hidden]) { grid-template-columns:minmax(300px,.7fr) minmax(0,1fr) !important; }
html body #invoice #invoiceQueueReviewPanel .invoice-compact-panel-header > div,
html body #invoice #invoiceQueueReviewPanel .invoice-compact-panel-header h3,
html body #invoice #invoiceQueueReviewPanel .invoice-compact-panel-header small,
html body #invoice #invoiceQueueReviewPanel .invoice-compact-panel-header > button,
html body #invoice #invoiceQueueReviewPanel .invoice-definition-disclosure > .package-review-overview,
html body #invoice #invoiceQueueReviewPanel .invoice-definition-disclosure > .invoice-compact-pricing,
html body #invoice #invoiceQueueReviewPanel .invoice-definition-disclosure > [data-intake-questions],
html body #invoice #invoiceQueueReviewPanel .invoice-compact-edit-fields { display:none !important; }
html body #invoice #invoiceQueueReviewPanel .invoice-compact-panel-header { display:none; }
html body #invoice #invoiceQueueReviewPanel .invoice-purchase-editor form { display:block; }
html body #invoice #invoiceQueueReviewPanel .invoice-purchase-editor .canonical-package-dialog-header { display:flex; gap:8px; align-items:center; margin-bottom:8px; }
html body #invoice #invoiceQueueReviewPanel .invoice-conversation-name { flex:1; min-width:0; font-size:21px; font-weight:700; padding:5px; border:1px solid transparent; background:transparent; }
html body #invoice #invoiceQueueReviewPanel .invoice-conversation-name:focus { border-color:var(--accent); }
html body #invoice #invoiceQueueReviewPanel .invoice-conversation-identity { display:grid; grid-template-columns:minmax(0,1fr) minmax(0,1fr); gap:8px; margin-bottom:12px; }
html body #invoice #invoiceQueueReviewPanel .invoice-conversation-identity label { font-size:11px; color:var(--muted); }
html body #invoice #invoiceQueueReviewPanel .invoice-conversation-identity input,
html body #invoice #invoiceQueueReviewPanel .invoice-conversation-identity select { width:100%; min-width:0; min-height:36px; font-size:12px; }
html body #invoice #invoiceQueueReviewPanel #invoiceLineRows .invoice-purchase-editor .invoice-conversation-sentence { display:block; font-size:15px; line-height:2.8; margin:0 0 10px; }
html body #invoice #invoiceQueueReviewPanel #invoiceLineRows .invoice-conversation-sentence input,
html body #invoice #invoiceQueueReviewPanel #invoiceLineRows .invoice-conversation-sentence select { display:inline-block !important; width:var(--conversation-width,6ch); max-width:100%; min-width:0; min-height:38px; padding:5px 6px; font-size:15px; border:1px solid #bfc7ad; border-radius:5px; background:#f5f6ee; vertical-align:middle; }
html body #invoice #invoiceQueueReviewPanel #invoiceLineRows .invoice-conversation-sentence input::-webkit-inner-spin-button { appearance:none; margin:0; }
.invoice-conversation-money { display:inline-flex; align-items:center; gap:2px; }
html body #invoice #invoiceQueueReviewPanel .invoice-purchase-editor [data-purchase-pricing-preview] { background:#edf0e4; color:#53613e; font-weight:700; font-size:16px; padding:12px; line-height:1.5; }
html body #invoice #invoiceQueueReviewPanel .invoice-conversation-total { display:flex; justify-content:space-between; gap:12px; padding:8px 0; font-size:14px; color:var(--muted); }
.invoice-conversation-total strong { color:var(--ink); }
html body #invoice #invoiceQueueReviewPanel .invoice-purchase-editor .modal-actions [value=cancel] { display:none; }
html body #invoice #invoiceQueueReviewPanel .invoice-purchase-editor .modal-actions [value=accept] { width:100%; min-height:44px; font-size:15px; }
html body #invoice #invoiceQueueReviewPanel .invoice-conversation-save-status { font-size:12px; text-align:center; margin:6px 0 0; min-height:18px; color:var(--muted); }
html body #invoice #invoiceQueueReviewPanel .invoice-conversation-save-status[data-state=saved] { color:var(--accent); font-weight:700; }
html body #invoice #invoiceQueueReviewPanel .invoice-conversation-save-status[data-state=error] { color:#8b5e18; }
html body #invoice #invoiceQueueReviewPanel .invoice-purchase-editor [role=alert]:empty { display:none; }
html body #invoice #invoiceQueueReviewPanel .invoice-conversation-options { font-size:12px; margin-top:8px; }
html body #invoice #invoiceQueueReviewPanel .invoice-conversation-options > summary { color:var(--muted); cursor:pointer; }
html body #invoice #invoiceQueueReviewPanel .invoice-dense-line { position:relative; }
html body #invoice #invoiceQueueReviewPanel .invoice-dense-category { position:absolute; right:12px; bottom:7px; font-size:10px; color:var(--muted); pointer-events:none; }
html body #invoice #invoiceQueueReviewPanel .invoice-dense-category[data-uncategorized=true] { color:#8b5e18; }
html body #invoice #invoiceQueueReviewPanel #invoiceLineRows .invoice-dense-row { padding-bottom:24px; }
html body #invoice #invoiceQueueReviewPanel .invoice-original-toolbar { display:flex; justify-content:flex-end; margin:0 0 7px; }
html body #invoice #invoiceQueueReviewPanel .invoice-original-toolbar button,
html body #invoice #invoiceQueueReviewPanel [data-compact-hide-original] { min-height:36px; font-size:12px; }
html body #invoice #invoiceQueueReviewPanel [data-compact-hide-original] { float:right; margin-bottom:6px; }
@media(max-width:699px) {
 html body #invoice #invoiceQueueReviewPanel .invoice-compact-workspace.has-reference:has([data-compact-empty][hidden]) { grid-template-columns:minmax(0,1fr) !important; }
 html body #invoice #invoiceQueueReviewPanel .invoice-conversation-identity { grid-template-columns:minmax(0,1fr) minmax(0,1fr); }
}
html body #invoice #invoiceQueueReviewPanel #invoiceLineRows .invoice-purchase-editor .canonical-package-dialog-header { position:static !important; inset:auto !important; padding:0; }
html body #invoice #invoiceQueueReviewPanel #invoiceLineRows .invoice-purchase-editor .invoice-conversation-sentence [name=measure] { width:calc(var(--conversation-width,6ch) + 30px) !important; }

html body #invoice #invoiceQueueReviewPanel #invoiceLineRows .invoice-purchase-editor .modal-actions [value=accept] { min-height:44px !important; height:auto !important; font-size:15px !important; line-height:1.4 !important; color:#fff !important; padding:10px 12px !important; }
html body #invoice #invoiceQueueReviewPanel #invoiceLineRows .invoice-purchase-editor .invoice-conversation-sentence input,
html body #invoice #invoiceQueueReviewPanel #invoiceLineRows .invoice-purchase-editor .invoice-conversation-sentence select { width:calc(var(--conversation-width,6ch) + 18px) !important; min-height:38px !important; font-size:15px !important; padding:5px 6px !important; }
html body #invoice #invoiceQueueReviewPanel #invoiceLineRows .invoice-purchase-editor .invoice-conversation-sentence { font-size:15px !important; line-height:2.8 !important; }

/* Keep numbers centered and controls on one baseline in Safari and narrow panels. */
html body #invoice #invoiceQueueReviewPanel #invoiceLineRows .invoice-purchase-editor .invoice-conversation-sentence {
 display:flex !important; flex-wrap:wrap; align-items:center; gap:5px; line-height:1.5 !important;
}
html body #invoice #invoiceQueueReviewPanel #invoiceLineRows .invoice-purchase-editor .invoice-conversation-sentence input,
html body #invoice #invoiceQueueReviewPanel #invoiceLineRows .invoice-purchase-editor .invoice-conversation-sentence select {
 box-sizing:border-box; height:38px !important; line-height:1.3 !important; margin:0 !important; vertical-align:middle; text-align:center !important; text-align-last:center;
}
html body #invoice #invoiceQueueReviewPanel #invoiceLineRows .invoice-purchase-editor .invoice-conversation-sentence [data-conversation-amount],
html body #invoice #invoiceQueueReviewPanel #invoiceLineRows .invoice-purchase-editor .invoice-conversation-sentence [data-conversation-count] {
 display:inline-flex; align-items:center; gap:5px; max-width:100%;
}
html body #invoice #invoiceQueueReviewPanel .invoice-purchase-editor .invoice-package-mode { display:block; font-size:12px; margin:8px 0; }
html body #invoice #invoiceQueueReviewPanel .invoice-purchase-editor .invoice-package-mode select { width:100%; min-height:36px; }
html body #invoice #invoiceQueueReviewPanel .invoice-purchase-editor .invoice-conversation-commit-note { font-size:11px; line-height:1.4; color:var(--muted); }
html body #invoice #invoiceQueueReviewPanel #invoiceLineRows .invoice-purchase-editor .modal-actions {
 display:grid !important; grid-template-columns:minmax(0,1fr) minmax(0,1fr); gap:6px; position:static; padding:8px 0; background:var(--paper);
}
html body #invoice #invoiceQueueReviewPanel #invoiceLineRows .invoice-purchase-editor .modal-actions [data-overwrite-standard],
html body #invoice #invoiceQueueReviewPanel #invoiceLineRows .invoice-purchase-editor .modal-actions [data-mark-ready] { color:var(--ink) !important; background:var(--paper); border:1px solid var(--line); }
html body #invoice #invoiceQueueReviewPanel .invoice-compact-full-details[hidden] { display:none !important; }
html body #invoice #invoiceQueueReviewPanel #invoiceLineRows .invoice-purchase-editor .modal-actions [data-mark-ready] { grid-column:1/-1; min-height:32px !important; padding:5px !important; }
html body #invoice #invoiceQueueReviewPanel #invoiceLineRows .invoice-purchase-editor .modal-actions [data-mark-ready] { grid-column:auto; order:2; }
html body #invoice #invoiceQueueReviewPanel #invoiceLineRows .invoice-purchase-editor .modal-actions [data-overwrite-standard] { grid-column:1/-1; order:3; }

/* Invoice controls: visible editable fields and distinct action emphasis. */
.invoice-purchase-editor .invoice-conversation-name {
  border: 1px solid #64748b; border-radius: 6px; background: #fff;
  color: #172033; padding: 8px 10px; min-height: 44px; width: 100%; box-sizing: border-box;
}
.invoice-purchase-editor input:not([type="hidden"]),
.invoice-purchase-editor select { min-height: 44px !important; height: 44px !important; border: 1px solid #64748b; color: #172033; background: #fff; }
.invoice-purchase-editor .invoice-conversation-sentence input { min-width: 72px; }
.invoice-purchase-editor .invoice-conversation-sentence [name="unitPrice"] { min-width: 96px; }
.invoice-purchase-editor .invoice-conversation-sentence select { min-width: 90px; max-width: 100%; }
.invoice-purchase-editor button { min-height: 44px; }
.invoice-purchase-editor [value="accept"].secondary-button,
.invoice-purchase-editor [value="accept"].quiet-button {
  background: #f1f5f9 !important; color: #172033 !important; border: 1px solid #64748b;
}
.invoice-purchase-editor :is(input,select,button):focus-visible {
  outline: 3px solid #2563eb; outline-offset: 3px;
}
.invoice-conversation-commit-note { color: #334155; line-height: 1.5; }
html body #invoice #invoiceQueueReviewPanel #invoiceLineRows .invoice-purchase-editor .invoice-conversation-sentence :is(input,select) {
 height:44px !important; min-height:44px !important; min-width:72px !important;
}
html body #invoice #invoiceQueueReviewPanel #invoiceLineRows .invoice-purchase-editor .invoice-conversation-sentence [name="unitPrice"] { min-width:96px !important; }
html body #invoice #invoiceQueueReviewPanel :is(.invoice-panel-header button,.invoice-header-fields input,.invoice-header-fields select) { min-height:44px; }
html body #invoice #invoiceQueueReviewPanel .panel-header button,
html body #invoice #invoiceQueueReviewPanel .invoice-header-grid :is(input,select) { min-height:44px !important; }
html body #invoice #invoiceQueueReviewPanel [data-dense-reason] { color:#854d0e; white-space:normal; line-height:1.4; margin-top:4px; }
html body #invoice #invoiceQueueReviewPanel #deleteEditedInvoice { margin-right:12px; }

/* Source confirmations stay outside collapsed learning and item details. */
html body #invoice .invoice-source-questions { width:100%; display:block; padding:12px; box-sizing:border-box; }
html body #invoice .invoice-editor-source-check { display:block; padding:8px; border:1px solid var(--accent,#476b63); }

/* Compact audit indicators preserve the existing invoice grid and editor. */
html body #invoice .invoice-audit-indicator { margin:4px 0; border:0; background:transparent; min-width:0; }
html body #invoice .invoice-audit-indicator[hidden] { display:none!important; }
html body #invoice .invoice-audit-indicator > summary { display:inline-flex; align-items:center; gap:5px; min-height:32px; padding:2px 9px; border:1px solid #b98a35; border-radius:16px; color:#79520d; background:#fff8e8; font-size:11px; font-weight:600; cursor:pointer; list-style:none; }
html body #invoice .invoice-audit-indicator > summary::before { content:'•'; }
html body #invoice .invoice-audit-indicator > summary::after { content:'▾'; font-size:10px; }
html body #invoice .invoice-audit-indicator[open] > summary::after { content:'▴'; }
html body #invoice .invoice-audit-indicator > summary::-webkit-details-marker { display:none; }
html body #invoice .invoice-audit-indicator > summary:focus-visible { outline:3px solid var(--accent); outline-offset:3px; }
html body #invoice .invoice-audit-body { margin:6px 0; padding:10px 12px; border:1px solid var(--line); border-radius:8px; background:var(--paper); font-size:12px; line-height:1.5; overflow-wrap:anywhere; }
html body #invoice .invoice-audit-body p { margin:4px 0 8px; white-space:normal; }
html body #invoice .invoice-audit-body button,html body #invoice .invoice-audit-body select { min-height:44px; margin:4px 0; max-width:100%; white-space:normal; }
html body #invoice .invoice-audit-confirm { display:flex; align-items:center; gap:8px; min-height:44px; font-size:12px; text-transform:none; letter-spacing:normal; }
html body #invoice .invoice-audit-confirm input { width:18px; height:18px; flex:none; }
html body #invoice #invoiceQueueReviewPanel .invoice-audit-body #invoiceDateVerification { display:block; padding:0!important; margin:0!important; }
html body #invoice #invoiceQueueReviewPanel .invoice-audit-body #invoiceDateVerification[hidden] { display:none!important; }
html body #invoice #invoiceQueueReviewPanel .invoice-audit-body #invoiceDateVerification p { display:block!important; }
html body #invoice #invoiceQueueReviewPanel .invoice-audit-body #invoiceDateVerificationStatus { display:block!important; position:absolute; width:1px; height:1px; overflow:hidden; clip-path:inset(50%); }
html body #invoice #invoiceQueueReviewPanel .invoice-audit-body #invoiceDateVerification label { display:flex; align-items:center; gap:8px; min-height:44px; text-transform:none; letter-spacing:normal; }
html body #invoice .has-inline-audit :is([data-dense-status],[data-dense-reason]) { display:none!important; }
@media(max-width:700px) {
 html body #invoice .invoice-audit-indicator > summary { min-height:44px; }
 html body #invoice .has-inline-audit .invoice-dense-category { right:82px!important; }
}
html body #invoice .invoice-audit-pending { border-color:#b98a35; }
html body #invoice #invoiceQueueReviewPanel .invoice-audit-body #invoiceDateVerification { border:0; background:transparent; }
html body #invoice #invoiceQueueReviewPanel .invoice-audit-body #confirmInvoiceDateOutsideCurrentMonth { appearance:auto; width:18px!important; height:18px!important; min-height:18px!important; flex:none; margin:0; padding:0; }
html body #invoice .invoice-audit-confirm input[type=checkbox] { width:18px!important; height:18px!important; min-height:18px!important; padding:0!important; }
html body #invoice .invoice-audit-body :is(.invoice-balance-status,.line-count-status,.invoice-vendor-suggestion) { display:block; border:0; padding:0; background:transparent; color:inherit; font-weight:400; white-space:normal; overflow:visible; }
html body #invoice .invoice-audit-body .invoice-vendor-suggestion[hidden] { display:none; }

html body #invoice .invoice-item-review { position:absolute; right:10px; top:7px; min-height:36px; padding:2px 12px; border:1px solid #b98a35; border-radius:16px; color:#79520d; background:#fff8e8; font-size:11px; cursor:pointer; }
html body #invoice .invoice-item-review[data-state=ready] { color:#285e47; border-color:#5d8d75; background:#edf5ef; }
html body #invoice .invoice-item-review:focus-visible { outline:3px solid var(--accent); outline-offset:3px; }
.invoice-source-resolution { max-width:min(640px,calc(100vw - 24px)); max-height:85dvh; overflow:auto; }
.invoice-source-resolution button { min-height:44px; margin:6px; }
.invoice-source-resolution article { border-top:1px solid var(--line); padding:8px; }
.invoice-editor-source-check .invoice-audit-confirm { display:flex; align-items:center; gap:8px; min-height:44px; }
.invoice-editor-source-check input[type=checkbox] { width:18px; height:18px; min-height:18px; }
@media(max-width:700px) { html body #invoice .invoice-item-review { top:auto; bottom:1px; min-height:44px; } }

html body #invoice #invoiceLineActions { display:flex; align-items:center; justify-content:space-between; gap:12px; padding:8px 0; margin:8px 0; }
html body #invoice #invoiceLineActions #addLine { min-height:44px!important; height:auto!important; min-width:108px; width:auto!important; }
html body #invoice .invoice-removed-line { display:flex; align-items:center; flex-wrap:wrap; gap:8px; }
html body #invoice .invoice-removed-line button { min-height:44px; }

html body #invoice #invoiceRemovedItemsReview { margin:8px 0; padding:8px; border:1px solid var(--line); border-radius:8px; }
html body #invoice #invoiceRemovedItemsReview summary { min-height:44px; cursor:pointer; display:flex; align-items:center; }
html body #invoice #invoiceRemovedItemsReview > div { display:flex; align-items:center; justify-content:space-between; gap:8px; flex-wrap:wrap; padding:6px 0; }
html body #invoice #invoiceRemovedItemsReview button { min-height:44px; }

html body .invoice-purchase-editor [data-purchase-remove-row] { min-height:44px!important; }
html body #invoice .invoice-removed-line button,html body #invoice #invoiceRemovedItemsReview button { min-height:44px!important; max-width:100%; white-space:normal; }

/* Integrated review frames: original, permanent item list, permanent details. */
html body #invoice #invoiceQueueReviewPanel .invoice-compact-workspace[data-review-layout=frames] { display:grid!important; grid-template-columns:minmax(230px,.85fr) minmax(320px,1.2fr) minmax(330px,1fr)!important; gap:12px!important; align-items:stretch; }
html body #invoice #invoiceQueueReviewPanel .invoice-compact-workspace[data-review-layout=frames][data-source-visible=false] { grid-template-columns:minmax(320px,1.5fr) minmax(330px,1fr)!important; }
html body #invoice #invoiceQueueReviewPanel .invoice-frame { min-width:0; width:auto!important; grid-column:auto!important; grid-row:auto!important; border:1px solid #aebdb5; border-radius:8px; background:var(--paper,#fbfaf4); height:max(440px,calc(100dvh - 290px)); display:flex; flex-direction:column; overflow:hidden; }
html body #invoice #invoiceQueueReviewPanel .invoice-frame[hidden] { display:none!important; }
html body #invoice #invoiceQueueReviewPanel .invoice-frame-heading,html body #invoice #invoiceQueueReviewPanel #invoiceLineActions { display:flex; align-items:center; justify-content:space-between; gap:10px; flex-wrap:wrap; padding:12px!important; margin:0!important; border-bottom:1px solid var(--line); min-height:58px; box-sizing:border-box; background:var(--paper); }
html body #invoice #invoiceQueueReviewPanel .invoice-frame-heading h3,html body #invoice #invoiceQueueReviewPanel #invoiceLineActions strong { font-family:inherit; font-size:13px; line-height:1.4; font-weight:700; color:var(--accent,#315c50); margin:0; }
html body #invoice #invoiceQueueReviewPanel .invoice-frame button { min-height:44px!important; border-radius:6px!important; font-family:inherit; font-size:12px; font-weight:600; line-height:1.35; padding:7px 10px; }
html body #invoice #invoiceQueueReviewPanel #invoiceLineActions #addLine { min-width:90px; }
html body #invoice #invoiceQueueReviewPanel .invoice-items-frame .invoice-line-filter-bar { padding:8px!important; margin:0!important; }
html body #invoice #invoiceQueueReviewPanel .invoice-items-frame .invoice-review-table-wrap { flex:1; min-height:0; overflow:auto!important; border:0; border-radius:0; }
html body #invoice #invoiceQueueReviewPanel .invoice-source-frame #invoiceLineReference { position:static!important; flex:1; min-height:0; width:100%!important; max-width:100%!important; max-height:none!important; padding:10px!important; border:0!important; border-radius:0; overflow:auto; }
html body #invoice #invoiceQueueReviewPanel .invoice-details-frame #invoiceItemDetailsBody { flex:1; min-height:0; overflow:auto; padding:0; }
html body #invoice #invoiceQueueReviewPanel [data-details-placeholder] { padding:22px; color:var(--muted); font-size:13px; }
html body #invoice #invoiceQueueReviewPanel .invoice-details-back { display:none; }
html body #invoice #invoiceQueueReviewPanel .invoice-details-frame .invoice-integrated-editor { position:static!important; inset:auto!important; transform:none!important; display:block!important; width:100%!important; max-width:100%!important; height:auto!important; max-height:none!important; box-sizing:border-box; padding:14px!important; margin:0!important; border:0!important; border-radius:0!important; box-shadow:none!important; background:transparent; overflow:visible!important; z-index:auto!important; }
html body #invoice #invoiceQueueReviewPanel .invoice-details-frame .invoice-integrated-editor form { display:block; min-width:0; margin:0; }
html body #invoice #invoiceQueueReviewPanel .invoice-details-frame .canonical-package-dialog-header h2,html body #invoice #invoiceQueueReviewPanel .invoice-details-frame .canonical-package-dialog-close,html body #invoice #invoiceQueueReviewPanel .invoice-details-frame .modal-actions [value=cancel],html body #invoice #invoiceQueueReviewPanel .invoice-details-frame .invoice-conversation-total { display:none!important; }
html body #invoice #invoiceQueueReviewPanel .invoice-details-frame .canonical-package-dialog-header { display:flex; justify-content:flex-end; padding:0 0 10px; }
html body #invoice #invoiceQueueReviewPanel .invoice-details-frame [data-purchase-remove-row] { background:#fff9f6!important; border-color:#ad453b!important; color:#a1322a!important; min-height:44px!important; }
html body #invoice #invoiceQueueReviewPanel .invoice-details-frame .invoice-conversation-identity,html body #invoice #invoiceQueueReviewPanel .invoice-details-frame .larder-purchase-fields { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:10px; }
html body #invoice #invoiceQueueReviewPanel .invoice-details-frame label { display:flex; flex-direction:column; gap:5px; font-size:11px; line-height:1.4; color:var(--muted); margin:0 0 10px; }
html body #invoice #invoiceQueueReviewPanel .invoice-details-frame input,html body #invoice #invoiceQueueReviewPanel .invoice-details-frame select { box-sizing:border-box; max-width:100%; min-width:0; width:100%; min-height:44px; font-size:13px; border-radius:6px; }
html body #invoice #invoiceQueueReviewPanel .invoice-details-frame .invoice-audit-confirm { flex-direction:row; align-items:center; }
html body #invoice #invoiceQueueReviewPanel .invoice-details-frame .invoice-audit-confirm input { width:18px!important; min-height:18px!important; }
html body #invoice #invoiceQueueReviewPanel .invoice-details-frame .invoice-conversation-sentence { font-size:13px; line-height:2; white-space:normal; }
html body #invoice #invoiceQueueReviewPanel .invoice-details-frame .invoice-conversation-sentence input,html body #invoice #invoiceQueueReviewPanel .invoice-details-frame .invoice-conversation-sentence select { width:auto; max-width:100%; }
html body #invoice #invoiceQueueReviewPanel .invoice-details-frame .invoice-editor-footer { position:static!important; background:var(--paper); margin:12px -2px -2px; padding:10px 0; border-top:1px solid var(--line); }
html body #invoice #invoiceQueueReviewPanel .invoice-details-frame .modal-actions { display:flex!important; flex-wrap:wrap; gap:8px; }
html body #invoice #invoiceQueueReviewPanel .invoice-details-frame .modal-actions button { flex:1 1 110px; margin:0; }
html body #invoice #invoiceQueueReviewPanel .invoice-items-frame #invoiceRemovedItemsReview,html body #invoice #invoiceQueueReviewPanel .invoice-items-frame .invoice-removed-line { margin:6px!important; }
html body #invoice #invoiceQueueReviewPanel .invoice-items-frame .invoice-dense-row { grid-template-columns:minmax(0,1fr) 65px 64px!important; grid-template-areas:'item item item' 'qty rate total'!important; gap:5px 8px!important; padding:10px 12px 22px!important; }
html body #invoice #invoiceQueueReviewPanel .invoice-items-frame .invoice-dense-item { grid-area:item; padding-right:82px; }
html body #invoice #invoiceQueueReviewPanel .invoice-items-frame .invoice-dense-quantity { grid-area:qty; }
html body #invoice #invoiceQueueReviewPanel .invoice-items-frame .invoice-dense-rate { grid-area:rate; }
html body #invoice #invoiceQueueReviewPanel .invoice-items-frame .invoice-dense-total { grid-area:total; }
html body #invoice #invoiceQueueReviewPanel .invoice-items-frame .invoice-line-grid-header { display:none!important; }
html body #invoice #invoiceQueueReviewPanel .invoice-items-frame .invoice-dense-item strong { white-space:normal; }
html body #invoice #invoiceQueueReviewPanel .invoice-items-frame .invoice-item-review { top:8px; bottom:auto; min-height:34px!important; }
@media(max-width:1199px) {
 html body #invoice #invoiceQueueReviewPanel .invoice-compact-workspace[data-review-layout=frames],html body #invoice #invoiceQueueReviewPanel .invoice-compact-workspace[data-review-layout=frames][data-source-visible=false] { grid-template-columns:minmax(0,1fr)!important; }
 html body #invoice #invoiceQueueReviewPanel .invoice-details-frame { display:none; }
 html body #invoice #invoiceQueueReviewPanel .invoice-compact-workspace[data-item-selected=true] .invoice-details-frame { display:flex; }
 html body #invoice #invoiceQueueReviewPanel .invoice-compact-workspace[data-item-selected=true] .invoice-items-frame,html body #invoice #invoiceQueueReviewPanel .invoice-compact-workspace[data-item-selected=true] .invoice-source-frame { display:none!important; }
 html body #invoice #invoiceQueueReviewPanel .invoice-details-back { display:inline-flex; }
 html body #invoice #invoiceQueueReviewPanel .invoice-frame { height:auto; min-height:200px; max-height:none; }
 html body #invoice #invoiceQueueReviewPanel .invoice-details-frame { height:max(220px,calc(100dvh - var(--invoice-dock-reserve,150px) - 90px)); min-height:220px; padding-bottom:0; }
 html body #invoice #invoiceQueueReviewPanel .invoice-source-frame { max-height:450px; }
 html body #invoice #invoiceQueueReviewPanel .invoice-frame button { min-height:44px!important; }
 html body #invoice #invoiceQueueReviewPanel .invoice-details-frame .invoice-editor-footer { position:static!important; }
}

html body #invoice #invoiceQueueReviewPanel .invoice-details-frame input:is([name="qty"],[name="unitPrice"],[name="amount"]) { text-align:center; min-height:44px; line-height:1.4; }

/* Compact, aligned item details; the frame owns scrolling and actions. */
html body #invoice #invoiceQueueReviewPanel .invoice-details-frame .canonical-package-dialog-header { position:static!important; inset:auto!important; margin:0!important; padding:0!important; border:0!important; min-height:0; }
html body #invoice #invoiceQueueReviewPanel .invoice-details-frame .invoice-integrated-editor { padding:10px!important; }
html body #invoice #invoiceQueueReviewPanel .invoice-details-frame label { margin:0!important; gap:3px; font-size:12px; line-height:1.35; }
html body #invoice #invoiceQueueReviewPanel .invoice-details-frame :is(.invoice-conversation-identity,.larder-purchase-fields) { margin:0 0 8px; gap:6px 8px; }
html body #invoice #invoiceQueueReviewPanel .invoice-details-frame [data-intake-question] > label { margin-bottom:8px!important; }
html body #invoice #invoiceQueueReviewPanel .invoice-details-frame .invoice-conversation-name { font-size:13px; padding:8px; }
html body #invoice #invoiceQueueReviewPanel .invoice-details-frame input,html body #invoice #invoiceQueueReviewPanel .invoice-details-frame select { font-size:13px; padding:8px; }
html body #invoice #invoiceQueueReviewPanel .invoice-details-frame .invoice-editor-source-check { padding:8px; margin:0 0 8px; font-size:12px; line-height:1.4; }
html body #invoice #invoiceQueueReviewPanel .invoice-details-frame .invoice-editor-source-check p { margin:0 0 6px; }
html body #invoice #invoiceQueueReviewPanel .invoice-details-frame .invoice-editor-source-check ul { margin:4px 0 6px; padding-left:20px; }
html body #invoice #invoiceQueueReviewPanel .invoice-details-frame .invoice-package-fields { display:grid!important; grid-template-columns:minmax(0,1fr); gap:6px; margin:0 0 8px!important; font-size:12px; line-height:1.4; }
html body #invoice #invoiceQueueReviewPanel .invoice-details-frame .invoice-package-fields :is([data-conversation-count],[data-conversation-amount]) { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:8px; }
html body #invoice #invoiceQueueReviewPanel .invoice-details-frame .invoice-package-fields [hidden] { display:none!important; }
html body #invoice #invoiceQueueReviewPanel .invoice-details-frame .invoice-package-fields :is([data-conversation-of],[data-conversation-period]) { display:none; }
html body #invoice #invoiceQueueReviewPanel .invoice-details-frame .invoice-package-fields :is(input,select) { width:100%; }
html body #invoice #invoiceQueueReviewPanel .invoice-details-frame [data-purchase-pricing-preview] { margin:6px 0 8px; padding:8px; font-size:13px; line-height:1.4; }
html body #invoice #invoiceQueueReviewPanel .invoice-details-frame :is(.invoice-conversation-commit-note,.invoice-definition-ownership) { font-size:12px; line-height:1.4; margin:6px 0; }
html body #invoice #invoiceQueueReviewPanel .invoice-details-frame .invoice-match-details { margin:6px 0; font-size:12px; }
html body #invoice #invoiceQueueReviewPanel .invoice-details-frame [data-purchase-source] { width:100%; margin:0; }
html body #invoice #invoiceQueueReviewPanel .invoice-details-frame .invoice-editor-footer { margin:8px 0 0; padding:8px 0 0; }
html body #invoice #invoiceQueueReviewPanel .invoice-details-frame .invoice-conversation-save-status { text-align:left; padding:0; margin:0 0 6px; min-height:0; }
html body #invoice #invoiceQueueReviewPanel .invoice-details-frame .modal-actions { gap:6px; margin:0; }
html body #invoice #invoiceQueueReviewPanel .invoice-details-frame .modal-actions button { flex:1 1 120px; min-width:0; font-size:12px; }
html body #invoice #invoiceQueueReviewPanel .invoice-details-frame .invoice-future-scope-note { display:block; margin:6px 0; font-size:12px; line-height:1.4; }
html body #invoice #invoiceQueueReviewPanel .invoice-details-frame .invoice-item-action-stack { display:grid; grid-template-columns:minmax(0,1fr); gap:6px; margin-top:8px; }
html body #invoice #invoiceQueueReviewPanel .invoice-details-frame .invoice-item-action-stack button { width:100%!important; height:44px!important; min-height:44px!important; margin:0!important; padding:8px 10px!important; font-size:13px!important; border-radius:6px!important; box-sizing:border-box; }
html body #invoice #invoiceQueueReviewPanel .invoice-details-frame [data-mark-ready] { background:var(--accent,#315c50); color:white; }
html body #invoice #invoiceQueueReviewPanel .invoice-details-frame #addLine { margin:0 12px 12px; width:calc(100% - 24px); }
@media(max-width:1199px) {
 html body #invoice #invoiceQueueReviewPanel .invoice-compact-workspace[data-item-selected=false] .invoice-details-frame { display:flex; height:auto; min-height:0; }
}
html body #invoice #invoiceQueueReviewPanel .invoice-details-frame [data-intake-question] { display:block!important; }
html body #invoice #invoiceQueueReviewPanel .invoice-details-frame .invoice-package-mode { display:flex; }
html body #invoice #invoiceQueueReviewPanel .invoice-details-frame .modal-actions { padding:0!important; border:0; background:transparent; }
html body #invoice #invoiceQueueReviewPanel .invoice-details-frame .invoice-future-scope-note { padding:0!important; }
html body #invoice #invoiceQueueReviewPanel .invoice-details-frame [data-mark-ready] { background:var(--accent,#315c50)!important; color:white!important; }
html body #invoice #invoiceQueueReviewPanel .invoice-details-frame .invoice-editor-receiving { display:block; margin:8px 0; padding:8px 0; border-top:1px solid var(--line); border-bottom:1px solid var(--line); }
html body #invoice #invoiceQueueReviewPanel .invoice-details-frame .invoice-editor-receiving h4 { font-size:13px; margin:0 0 6px; }
html body #invoice #invoiceQueueReviewPanel .invoice-details-frame .invoice-editor-receiving p { font-size:12px; line-height:1.4; margin:6px 0; }
html body #invoice #invoiceQueueReviewPanel .invoice-details-frame .invoice-editor-receiving > label { margin-bottom:6px!important; }
html body #invoice #invoiceQueueReviewPanel .invoice-details-frame .invoice-receiving-editor-fields { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:6px 8px; }
html body #invoice #invoiceQueueReviewPanel .invoice-details-frame .invoice-receiving-editor-fields[hidden] { display:none; }
html body #invoice #invoiceQueueReviewPanel .invoice-details-frame .invoice-receiving-editor-fields label:last-child { grid-column:1/-1; }
html body #invoice #invoiceRecoveryShelf { padding:10px 12px; overflow:visible; }
html body #invoice #invoiceRecoveryShelf summary { min-height:44px; display:flex; align-items:center; cursor:pointer; font-size:13px; font-weight:600; }
html body #invoice #invoiceRecoveryShelf [data-device-recovery-body] { padding-top:6px; }
html body #invoice #invoiceRecoveryShelf .button-row { display:flex; flex-wrap:wrap; gap:6px; margin:6px 0; }
html body #invoice #invoiceRecoveryShelf button { position:static!important; transform:none!important; min-height:44px; white-space:normal; max-width:100%; }
html body #invoice :is(.invoice-pending-reads,.invoice-skipped-duplicates) { margin:8px 0; padding:10px; border:1px solid var(--line); border-radius:8px; font-size:13px; }
html body #invoice .invoice-skipped-duplicates:not([open]) { padding:0 10px; }
html body #invoice .invoice-skipped-duplicates > summary { min-height:44px; align-content:center; cursor:pointer; color:var(--muted); font-size:13px; font-weight:600; }
html body #invoice :is(.invoice-pending-reads,.invoice-skipped-duplicates) button { min-height:44px; white-space:normal; max-width:100%; margin:4px; }
html body #invoice .invoice-intake-options { position:relative; max-width:100%; }
html body #invoice .invoice-intake-options[open] > div { position:static!important; inset:auto!important; display:grid; gap:6px; padding:8px 0; max-width:100%; }
html body #invoice .invoice-intake-options button { min-height:44px; white-space:normal; max-width:100%; }
html body #invoice #invoiceQueueReviewPanel .invoice-details-frame .invoice-receiving-editor-fields { align-items:end; }
