/* Local Larder 8.0 test bed. No release or deployment is implied. */
.larder-active-menu { display:flex; gap:12px; align-items:center; font-weight:700; padding:12px; }
.larder-active-menu select { min-height:44px; max-width:430px; flex:1; }
.larder-secondary-tools { padding:12px; border:1px solid #cbd8d2; border-radius:12px; margin-top:12px; }
.larder-secondary-tools summary { cursor:pointer; min-height:44px; padding:12px; font-weight:700; }
.larder-secondary-tools button { margin:6px; }
.larder-recent-prices { margin:14px 0; }
#invoiceRecoveryStatus { margin:0 0 8px; font-weight:650; color:#345a52; }
#invoiceRecoveryStatus[data-state="failed"], #invoiceRecoveryStatus[data-state="conflict"] { color:#923428; }
#invoiceRecoveryShelf { min-width:0; }
#invoiceRecoveryShelf button { margin:4px; min-height:44px; max-width:100%; white-space:normal; overflow-wrap:anywhere; text-align:left; }
#invoiceRecoveryShelf p { white-space:normal; overflow-wrap:anywhere; }
.invoice-purchase-editor :is(input,select,button) { min-height:44px; }
.invoice-purchase-editor :is(input,select,button):focus-visible { outline:3px solid #286b5c; outline-offset:3px; }
.invoice-purchase-editor [data-future-standard-preview] { padding:14px; background:#f4ead2; border-radius:10px; margin-top:12px; }
.invoice-purchase-editor [data-future-standard-preview] p { font-size:14px; }
.larder-purchase-fields { display:grid; grid-template-columns:1fr 1fr; gap:10px; }
.larder-purchase-fields label { display:grid; gap:5px; font-size:14px; font-weight:650; }
.larder-purchase-fields input[type="number"] { text-align:center; line-height:1.3; }
html body #invoice #invoiceQueueReviewPanel #invoiceLineRows .invoice-purchase-editor .larder-purchase-fields :is(input,select) { min-height:44px !important; height:44px !important; }
html body #invoice #invoiceQueueReviewPanel #invoiceLineRows .invoice-purchase-editor .modal-actions button[data-mark-ready] { min-height:44px !important; }
@media (max-width:700px) {
  #menuPublishing .menu-library-slots { display:none; }
  #menuPublishing .menu-publishing-toolbar { padding:12px; }
  #menuPublishing .menu-publishing-toolbar .eyebrow, #menuPublishing .mp-autosave-note { display:none; }
  #menuPublishing .mp-primary-menu-actions { display:flex; flex-wrap:wrap; }
  #menuPublishing .larder-secondary-tools { width:100%; }
  body[data-active-view="menuPublishing"] #foodWorkspaceTabs { display:none !important; }
  #items > .panel > .panel-header { padding:0; }
  #items > .panel > .panel-header > div { display:none; }
  #items .price-search-field { width:100%; }
  #items .price-search-field input { min-height:46px; }
  #items .larder-recent-prices .price-focus-list a, #items .larder-recent-prices .price-focus-list button { min-height:44px; padding:12px; }
  body[data-active-view="items"] .shell-header { padding:12px; }
  #invoice[data-intake-stage="upload"] .intake-grid { display:none; }
  #invoiceDropZone { min-height:116px; }
  #invoice[data-intake-stage="upload"] #invoiceQueueWorkspace > #extractStatus { font-size:13px; }
  .invoice-purchase-editor [data-future-standard-preview] { scroll-margin-bottom:100px; }
}

#compactMenuDishes { display:none; }
@media (max-width:700px) {
  #compactMenuDishes { display:grid; gap:8px; margin:4px 12px 12px; }
  #compactMenuDishes button { min-height:44px; text-align:left; }
  html body #compactMenuSelector { min-height:44px; }
}
@media (max-width:700px) {
  html body #menuPublishing #compactMenuDishes button { min-height:44px; }
}
html body #invoice #invoiceQueueReviewPanel #invoiceReviewFooter { display:grid !important; grid-template-columns:minmax(0,1fr) auto; }
html body #invoice #invoiceQueueReviewPanel #invoiceRecoveryStatus { grid-column:1 / -1; min-width:0; overflow-wrap:break-word; font-size:13px; line-height:1.35; margin:0; }
html body #invoice #invoiceQueueReviewPanel #invoiceReviewFooter button { min-height:44px; }
@media (max-width:700px) {
  html body #menuPublishing #compactMenuDishes button { min-height:44px !important; }
  html body #invoice #invoiceQueueReviewPanel { padding-bottom:240px !important; }
  html body #invoice #invoiceQueueReviewPanel #invoiceReviewFooter button { min-height:44px !important; }
  #invoiceLineRows [data-compact-select] { scroll-margin-bottom:220px; }
}
html body #invoice #invoiceQueueReviewPanel #invoiceLineRows .invoice-purchase-editor :is(button,input,select) { min-height:44px !important; }

@media (max-width:699px) {
  html body #invoice #invoiceQueueReviewPanel .invoice-dense-category { position:static; display:block; padding:4px 12px; text-align:right; }
}

/* Diagnostic state affects colour, never pill geometry. */
body .deployment-status .status-chip { box-sizing:border-box; display:inline-flex; align-items:center; justify-content:center; min-height:24px; height:24px; padding:3px 9px; font-size:12px; font-weight:900; line-height:1 !important; }

.product-consolidation-dialog .consolidation-choice { display:flex; flex-direction:row; gap:12px; margin:12px 0; align-items:start; }
.product-consolidation-dialog .consolidation-choice input { width:22px; height:22px; flex:none; }
.product-consolidation-dialog .consolidation-choice span { min-width:0; overflow-wrap:anywhere; }
.product-consolidation-dialog .consolidation-choice small { display:block; margin-top:5px; }

.product-consolidation-dialog .consolidation-choice strong{font-size:14px}
.product-consolidation-dialog .consolidation-choice small{font-size:12px;line-height:1.4}
.product-consolidation-dialog button{min-height:44px}

/* Keep the line editor's actions in its own layer. Closing restores invoice save. */
body:has(.invoice-purchase-editor[open]) #invoiceReviewFooter,
body:has(.invoice-purchase-editor[open]) .sidebar { visibility:hidden; }
html body #invoice #invoiceQueueReviewPanel #invoiceLineRows .invoice-purchase-editor .modal-actions { position:sticky; bottom:0; z-index:3; padding:10px 0; background:var(--paper); border-top:1px solid var(--line); }
.invoice-future-scope-note { display:block; font-size:12px; color:var(--muted); line-height:1.4; padding:6px 0; }
.invoice-definition-help summary,.invoice-match-details summary { cursor:pointer; min-height:32px; padding:7px 0; }
.invoice-definition-ownership { font-size:12px; color:var(--accent-dark); }
html body #invoice #invoiceQueueReviewPanel [data-compact-hide-original] { display:none; }
.invoice-phone-source { width:calc(100vw - 16px); max-width:700px; height:calc(100dvh - 24px); max-height:calc(100dvh - 24px); padding:12px; border:1px solid var(--line); border-radius:12px; background:var(--paper); color:var(--ink); }
.invoice-phone-source[open] { display:flex; flex-direction:column; gap:10px; }
.invoice-phone-source::backdrop { background:#173b3266; }
.invoice-phone-source > button { min-height:44px; flex:none; }
.invoice-phone-source #invoiceLineReference { display:flex; flex-direction:column; flex:1; min-height:0; overflow:auto; }
.invoice-phone-source .reference-preview { min-height:0; flex:1; overflow:auto; }
.invoice-phone-source .reference-zoom-toolbar { display:flex; flex-wrap:wrap; gap:5px; }
.invoice-phone-source .reference-zoom-toolbar button { min-height:44px; }
.invoice-phone-source [data-close-invoice-reference] { display:none; }
@media(max-width:700px) {
  body[data-active-view="invoice"] .topbar { padding:10px 14px; min-height:54px; }
  body[data-active-view="invoice"] .topbar h1 { font-size:22px; margin:0; }
  html body #invoice #invoiceDropZone { min-height:70px !important; padding:10px 12px !important; }
  html body #invoice #invoiceDropZone::before { width:30px; height:30px; }
  html body #invoice #invoiceDropZone > span { gap:2px !important; }
  html body #invoice #invoiceDropDetail { font-size:12px; line-height:1.3; }
  html body #invoice .invoice-workspace-v2__filters { grid-template-columns:repeat(3,minmax(0,1fr)); gap:2px; }
  html body #invoice .invoice-workspace-v2__filters button { min-height:44px; padding:4px; font-size:12px; }
  html body #invoice .invoice-workspace-v2__toolbar { gap:4px; padding:4px; }
  html body #invoice  #invoiceDraftsPanel > .panel-header { margin:6px 0; padding:8px 10px; display:flex; align-items:center; justify-content:space-between; }
  html body #invoice  #invoiceDraftsPanel > .panel-header h2 { font-size:16px; margin:0; }
  html body #invoice .invoice-workspace-v2__hint { margin:4px; font-size:12px; }
  html body #invoice #invoiceLineRows .invoice-purchase-editor { top:8px !important; bottom:8px !important; max-height:calc(100dvh - 16px) !important; }
  html body #invoice .invoice-original-toolbar { position:sticky; top:0; z-index:4; padding:6px; background:var(--paper); }
  html body #invoice .invoice-original-toolbar button { min-height:44px; }
}

@media(max-width:700px) {
 html body[data-active-view="invoice"] .topbar,html body[data-active-view="invoice"] .topbar .workbar,html body[data-active-view="invoice"] .page-heading { min-height:0 !important; padding:8px 12px !important; margin:0 !important; }
 html body[data-active-view="invoice"] .topbar h1 { font-size:22px !important; margin:0 !important; }
 html body #invoice #invoiceDraftsPanel > .panel-header { flex-direction:row !important; gap:6px !important; padding:8px !important; }
 html body #invoice #invoiceDraftsPanel > .panel-header h2 { font-size:16px !important; }
 html body #invoice #invoiceDraftsPanel #invoiceDropZone { flex-direction:row !important; gap:10px !important; }
 html body #invoice #invoiceQueueReviewPanel #invoiceLineRows .invoice-compact-row .invoice-purchase-editor { position:fixed !important; inset:8px !important; margin:0 !important; width:calc(100vw - 16px) !important; height:calc(100dvh - 16px) !important; max-height:calc(100dvh - 16px) !important; transform:none !important; z-index:1100; overflow:auto; }
 .invoice-phone-source .reference-title { display:grid; gap:4px; }
}

html body #invoice #invoiceQueueReviewPanel .invoice-editor-footer { position:sticky; bottom:0; z-index:3; padding:8px 0; background:var(--paper); border-top:1px solid var(--line); }
html body #invoice #invoiceQueueReviewPanel #invoiceLineRows .invoice-editor-footer .modal-actions { position:static; border:0; padding:6px 0; margin:0; }
html body #invoice #invoiceQueueReviewPanel .invoice-editor-footer [data-conversation-save-status] { margin:0; text-align:left; font-weight:650; }
html body #invoice #invoiceQueueReviewPanel .invoice-purchase-editor { scroll-padding-bottom:220px; }
@media(max-width:700px) {
 html body #invoice #invoiceQueueReviewPanel #invoiceLineRows .invoice-compact-row .invoice-purchase-editor { box-sizing:border-box !important; padding:16px !important; background:var(--paper) !important; border:1px solid var(--line) !important; border-radius:12px !important; }
 html body #invoice #invoiceQueueReviewPanel #invoiceLineRows .invoice-purchase-editor [data-conversation-prefix] { flex-basis:100%; }
}
