/* Larder V7.08 — UI polish layer. Loaded last. Screen only; printed menus/sheets untouched. */
@media screen {
  .app-shell {
    font-variant-numeric: tabular-nums;
    -webkit-font-smoothing: antialiased;
  }

  /* ---------- Page headings: one style everywhere ---------- */
  .app-shell .page-heading .eyebrow,
  .app-shell .eyebrow {
    margin: 0 0 4px;
    color: var(--muted) !important;
    font-size: 12px !important;
    font-weight: 700 !important;
    letter-spacing: 0.08em !important;
    text-transform: uppercase;
  }
  .app-shell .page-heading h1,
  .app-shell .si-heading h2,
  .app-shell .operations-today-heading h2 {
    margin: 0;
    font-family: Georgia, "Times New Roman", serif !important;
    font-size: 32px !important;
    font-weight: 700 !important;
    line-height: 1.15 !important;
    letter-spacing: -0.01em;
    color: var(--ink) !important;
  }
  .app-shell .page-heading > p:not(.eyebrow) {
    margin: 6px 0 0;
    color: var(--muted) !important;
    font-size: 14px !important;
    font-weight: 500 !important;
  }
  .app-shell .panel-header h2,
  .app-shell .panel > header h2 {
    font-size: 16px !important;
    font-weight: 700 !important;
    letter-spacing: 0;
  }

  /* ---------- Sub-navigation tiles → compact segmented control ---------- */
  .app-shell .workflow-focus-strip.workflow-focus-strip-tabs {
    display: flex !important;
    flex-wrap: wrap;
    gap: 4px !important;
    padding: 4px !important;
    border: 1px solid var(--larder-hairline) !important;
    border-radius: 10px !important;
    background: var(--surface-muted) !important;
    box-shadow: none !important;
    width: fit-content;
    max-width: 100%;
  }
  .app-shell .workflow-focus-strip.workflow-focus-strip-tabs button {
    flex: 0 1 auto;
    min-height: 0 !important;
    height: auto !important;
    padding: 8px 14px !important;
    border: 1px solid transparent !important;
    border-radius: 8px !important;
    background: transparent !important;
    box-shadow: none !important;
    color: var(--muted) !important;
    gap: 2px !important;
  }
  .app-shell .workflow-focus-strip.workflow-focus-strip-tabs button > span:first-child,
  .app-shell .workflow-focus-strip.workflow-focus-strip-tabs button strong {
    font-size: 13px !important;
    font-weight: 700 !important;
    color: inherit !important;
  }
  .app-shell .workflow-focus-strip.workflow-focus-strip-tabs button small,
  .app-shell .workflow-focus-strip.workflow-focus-strip-tabs button > span + span {
    font-size: 12px !important;
    font-weight: 500 !important;
    color: var(--muted) !important;
  }
  .app-shell .workflow-focus-strip.workflow-focus-strip-tabs button:hover {
    color: var(--ink) !important;
    background: color-mix(in srgb, var(--paper) 60%, transparent) !important;
  }
  .app-shell .workflow-focus-strip.workflow-focus-strip-tabs button.is-active {
    color: var(--sage-selected-ink) !important;
    background: var(--paper) !important;
    border-color: var(--larder-hairline) !important;
    box-shadow: 0 1px 2px rgba(20, 30, 30, 0.08) !important;
  }

  /* ---------- Section tabs: consistent sizing ---------- */
  .app-shell .section-overview-tabs .section-overview-tab {
    min-height: 34px;
    padding: 0 14px !important;
    font-size: 13px !important;
    font-weight: 600 !important;
  }
  .app-shell .section-overview-tabs .section-overview-tab.is-active {
    font-weight: 700 !important;
  }

  /* ---------- Buttons: one height scale ---------- */
  .app-shell :is(.primary-button, .secondary-button, .danger-button) {
    min-height: 34px;
    font-weight: 650;
  }
  .app-shell button:not([class]):not(:has(*)) {
    min-height: 30px;
    padding: 0 12px;
    font-size: 12px !important;
    font-weight: 600;
    border-radius: 8px !important;
    line-height: 1.2;
  }
  /* Destructive actions stay quiet until hovered */
  .app-shell .danger-button.compact-button,
  .app-shell .month-manager-actions .danger-button {
    background: transparent !important;
    color: var(--danger) !important;
    border: 1px solid color-mix(in srgb, var(--danger) 35%, var(--larder-hairline)) !important;
    box-shadow: none !important;
  }
  .app-shell .danger-button.compact-button:hover,
  .app-shell .month-manager-actions .danger-button:hover {
    background: var(--sage-danger-soft) !important;
    border-color: var(--danger) !important;
  }
  .app-shell :is(button, a, input, select, textarea, summary):focus-visible {
    outline: 2px solid var(--accent) !important;
    outline-offset: 2px;
  }

  /* ---------- Tables ---------- */
  .app-shell table th {
    font-size: 12px !important;
    font-weight: 700 !important;
    letter-spacing: 0.04em;
    color: var(--muted) !important;
    vertical-align: middle;
  }
  .app-shell table td {
    vertical-align: middle !important;
  }
  .app-shell .shared-invoice-inbox table td,
  .app-shell .shared-invoice-inbox table th {
    padding-top: 10px !important;
    padding-bottom: 10px !important;
  }
  .app-shell .shared-invoice-inbox table th:nth-child(5),
  .app-shell .shared-invoice-amount {
    text-align: right !important;
    padding-right: 24px !important;
  }
  .app-shell .shared-invoice-inbox table td:last-child {
    white-space: nowrap;
  }
  .app-shell .shared-invoice-inbox table td:last-child .shared-invoice-context-trigger {
    float: right;
    margin: -6px 0;
  }
  .app-shell .shared-invoice-status {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    border-radius: 999px;
    background: var(--surface-muted);
    color: var(--muted) !important;
    font-size: 12px !important;
    font-weight: 650;
    line-height: 1.3;
    white-space: nowrap;
  }
  .app-shell .shared-invoice-context-trigger {
    font-size: 18px !important;
    min-width: 32px;
    min-height: 32px;
    border-radius: 8px !important;
    color: var(--muted);
  }
  .app-shell .shared-invoice-context-trigger:hover {
    background: var(--surface-muted);
    color: var(--ink);
  }
  .app-shell .shared-invoice-source {
    color: var(--muted) !important;
  }

  /* ---------- KPI cards ---------- */
  .app-shell .metric small.mtd-comparison,
  .app-shell .metric > small {
    display: flex !important;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: flex-start !important;
    gap: 4px 8px !important;
    margin: 6px 0 0 !important;
    padding: 0 !important;
    text-align: left !important;
    font-size: 12px !important;
  }
  .app-shell .metric small .comparison-main,
  .app-shell .metric small .comparison-main span {
    font-weight: 700;
    font-size: 12px !important;
  }
  .app-shell .metric small .comparison-basis {
    color: var(--muted) !important;
    font-size: 12px !important;
    font-weight: 500 !important;
    text-transform: none !important;
    letter-spacing: 0 !important;
  }
  .app-shell .metric > span:first-child {
    font-size: 12px !important;
    font-weight: 700 !important;
    letter-spacing: 0.06em;
    color: var(--muted) !important;
  }

  /* ---------- Status footer: quiet unless something is wrong ---------- */
  .app-shell .status-footer .status-chip {
    font-size: 12px !important;
    font-weight: 600 !important;
    padding: 3px 10px !important;
    border-radius: 999px !important;
  }
  .app-shell .status-footer .status-chip.is-good {
    background: transparent !important;
    border: 1px solid var(--larder-hairline) !important;
    color: var(--muted) !important;
  }
  .app-shell .status-footer .refresh-status {
    color: var(--muted) !important;
    font-size: 12px !important;
  }

  /* ---------- Chips & badges: one pill shape ---------- */
  .app-shell :is(.status-badge, .status-chip, .si-pill, .month-manager-status-badge, .reporting-period-status) {
    border-radius: 999px !important;
    font-size: 12px !important;
    font-weight: 650 !important;
    line-height: 1.3 !important;
    letter-spacing: 0.01em;
  }
}

/* V7.11.30 product-wide finish: one density, control scale, and containment model. */
@media screen {
  .app-shell .view.is-visible {
    min-width: 0;
  }

  .app-shell .view.is-visible :is(.panel, .section-overview-grid > article, .section-overview-grid > section) {
    min-width: 0;
  }

  .app-shell .panel {
    border-color: color-mix(in srgb, var(--line) 88%, transparent);
    border-radius: 12px;
  }

  .app-shell .panel-header {
    align-items: center;
    padding: 16px 18px;
  }

  .app-shell .panel-header > :first-child > :is(p, small) {
    max-width: 72ch;
    line-height: 1.45;
  }

  .app-shell :is(input:not([type="checkbox"]):not([type="radio"]), select) {
    min-height: 38px;
  }

  .app-shell textarea {
    line-height: 1.45;
    resize: vertical;
  }

  .app-shell label {
    line-height: 1.35;
  }

  .app-shell :is(.primary-button, .secondary-button, .danger-button):not(.icon-button) {
    min-height: 38px;
    padding-inline: 13px;
    line-height: 1.2;
  }

  .app-shell .compact-button:not(.icon-button) {
    min-height: 34px;
    padding-inline: 11px;
  }

  .app-shell :is(.table-wrap, .history-table-wrap, .shared-invoice-table-wrap, .permission-table-wrap) {
    max-width: 100%;
    min-width: 0;
    overflow-x: auto;
    overscroll-behavior-inline: contain;
    scrollbar-gutter: stable;
  }

  .app-shell table {
    font-variant-numeric: tabular-nums;
  }

  .app-shell table :is(th, td) {
    line-height: 1.35;
  }

  .app-shell :is(.empty-state, .section-overview-empty, .overview-empty) {
    max-width: none;
    padding: 24px;
    border: 1px dashed color-mix(in srgb, var(--line) 90%, transparent);
    border-radius: 10px;
    background: color-mix(in srgb, var(--soft) 70%, transparent);
    text-align: center;
  }

  .app-shell :is(.status-line, .hint, .helper-text, [role="status"]) {
    overflow-wrap: anywhere;
  }

  .app-shell .button-row {
    align-items: center;
    gap: 7px;
  }

  .app-shell .button-row > :is(button, details) {
    flex: 0 0 auto;
  }

  #menuPublishing .menu-publishing-editor {
    min-width: 0;
  }

  #menuPublishing .menu-publishing-preview-shell {
    min-width: 0;
  }

  #menuPublishing .mp-item-editor,
  #menuPublishing .mp-section-editor {
    scroll-margin-top: calc(var(--workspace-content-top, 180px) + 14px);
  }

  #dashboard :is(.mtd-comparison, .comparison-main, .comparison-basis, .alcohol-sales-comparison) {
    min-width: 0;
    max-width: 100%;
    white-space: normal;
    overflow-wrap: anywhere;
  }
}

@media screen and (max-width: 760px) {
  .app-shell .page-heading h1,
  .app-shell .si-heading h2,
  .app-shell .operations-today-heading h2 {
    font-size: clamp(25px, 8vw, 30px) !important;
  }

  .app-shell .panel-header {
    padding: 13px 14px !important;
  }

  .app-shell :is(.primary-button, .secondary-button, .danger-button, .text-button):not(.icon-button),
  .app-shell details > summary {
    min-height: 40px;
  }

  .app-shell :is(input:not([type="checkbox"]):not([type="radio"]), select, textarea) {
    font-size: 16px;
  }

  .app-shell .button-row {
    flex-wrap: wrap;
  }

  .app-shell .button-row > :is(button, details) {
    flex: 1 1 auto;
  }

  .app-shell .drop-zone :is(strong, span, small),
  .app-shell #invoiceDropDetail {
    display: block;
    width: auto !important;
    max-width: 100%;
    min-width: 0 !important;
    white-space: normal !important;
    overflow: visible !important;
    text-overflow: clip !important;
    overflow-wrap: anywhere;
  }

  .app-shell .drop-zone > span {
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 4px !important;
    text-align: left;
  }

  #invoice .invoice-workspace-v2__filters {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
    overflow: visible;
  }

  #invoice .invoice-workspace-v2__filters button {
    width: 100%;
    min-height: 38px;
    white-space: normal;
  }

  .app-shell .status-footer {
    padding-bottom: calc(8px + env(safe-area-inset-bottom));
  }

  #menuPublishing .menu-publishing-toolbar .panel-actions,
  #menuPublishing .menu-publishing-toolbar .panel-actions > :is(button, details) {
    width: 100%;
  }

  #menuPublishing .menu-publishing-preview-head {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  #menuPublishing .menu-publishing-preview-head #mpPreviewFormat {
    grid-column: 1 / -1;
    width: auto;
    max-width: 100%;
    white-space: normal;
  }
}

@media screen and (max-width: 480px) {
  #dashboard .today-month-card .metrics-grid {
    grid-template-columns: minmax(0, 1fr) !important;
  }

  #dashboard .today-month-card .metric {
    min-width: 0;
  }
}

/* Type floor for captions that are sized in em/inline (screen UI only, never the printed menu sheet). */
@media screen {
  .app-shell :is(small, summary, .comparison-basis, .publish-published, .publish-draft,
    .mp-dish-connection, .mp-sheet-note, .mp-autosave-note, .mp-section-drag-help):not(.mp-menu-sheet, .mp-menu-sheet *) {
    font-size: 12px !important;
  }
}

@media screen {
  /* Numeric columns (tagged at runtime) line up on the right */
  .app-shell table :is(th, td).is-num {
    text-align: right !important;
    font-variant-numeric: tabular-nums;
  }
  /* Per-row audit counts: informative, not alarming */
  .app-shell .status-badge.warning[data-open-central-audit] {
    margin-left: 6px;
    padding: 1px 8px !important;
    background: transparent !important;
    border: 1px solid color-mix(in srgb, var(--sage-warning) 40%, var(--larder-hairline)) !important;
    color: var(--sage-warning) !important;
    text-transform: none !important;
    letter-spacing: 0 !important;
    font-weight: 600 !important;
    vertical-align: 1px;
  }
  .app-shell .status-badge.warning[data-open-central-audit]:hover {
    background: var(--sage-warning-soft) !important;
  }
  .app-shell td .link-button {
    text-decoration: none !important;
    font-weight: 650;
  }
  .app-shell td .link-button:hover {
    text-decoration: underline !important;
  }
}

@media screen and (max-width: 720px) {
  .app-shell .workflow-focus-strip.workflow-focus-strip-tabs { width: 100%; }
  .app-shell .workflow-focus-strip.workflow-focus-strip-tabs button { flex: 1 1 140px; }
  .app-shell .page-heading h1,
  .app-shell .si-heading h2,
  .app-shell .operations-today-heading h2 { font-size: 26px !important; }
}

/* Page Assembly is owned by assets/invoice-workspace-v2.css. */
/* Phase 2 — simpler invoice queue */
.app-shell .shared-invoice-toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.app-shell .shared-invoice-toolbar-actions { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.app-shell .shared-invoice-stage-filter { display: inline-flex; flex-wrap: wrap; gap: 2px; padding: 3px; border: 1px solid var(--line, #d4d1ca); border-radius: 10px; background: var(--wash, #f1efe9); }
.app-shell .shared-invoice-stage-filter button { border: 0; background: transparent; border-radius: 7px; padding: 6px 11px; font-size: 13px; font-weight: 600; color: var(--muted, #6b6a64); cursor: pointer; min-height: 32px; }
.app-shell .shared-invoice-stage-filter button span { font-variant-numeric: tabular-nums; margin-left: 3px; color: inherit; opacity: .8; }
.app-shell .shared-invoice-stage-filter button:hover { color: var(--ink, #28251d); }
.app-shell .shared-invoice-stage-filter button[aria-pressed="true"] { background: var(--paper, #fff); color: var(--ink, #28251d); box-shadow: 0 1px 2px #0002; }
.app-shell .shared-invoice-unassigned { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 14px; margin-bottom: 10px; border: 1px solid color-mix(in srgb, #b7791f 45%, transparent); background: color-mix(in srgb, #b7791f 8%, var(--paper, #fff)); border-radius: 10px; font-size: 14px; }
.app-shell .shared-invoice-unassigned span { color: var(--ink, #28251d); }
.app-shell .shared-invoice-selection-bar { position: sticky; top: 8px; z-index: 5; display: flex; flex-wrap: wrap; align-items: center; gap: 12px; padding: 8px 12px; margin-bottom: 10px; border-radius: 10px; background: #1f2a26; color: #fff; border: 0; }
.app-shell .shared-invoice-selection-bar > strong { color: #fff; font-size: 14px; }
.app-shell .shared-invoice-selection-bar .button-row { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; }
.app-shell .shared-invoice-selection-bar .secondary-button { background: #fff; color: #1f2a26; border-color: #fff; }
.app-shell .shared-invoice-selection-bar .secondary-button.is-danger { color: #9b2c2c; }
.app-shell .shared-invoice-selection-bar .text-button { background: none; border: 0; color: #d9e4de; font-weight: 600; cursor: pointer; padding: 6px 8px; }
.app-shell .shared-invoice-selection-bar .shared-invoice-pair-confirm { flex-basis: 100%; color: #e8efeb; font-size: 13px; }
.app-shell .shared-invoice-selection-bar .shared-invoice-pair-confirm strong { color: #fff; }
.app-shell .shared-invoice-undo { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; font-size: 13px; color: var(--muted, #6b6a64); }
.app-shell .shared-invoice-sort { all: unset; cursor: pointer; font: inherit; color: inherit; text-transform: inherit; letter-spacing: inherit; }
.app-shell .shared-invoice-sort:hover { color: var(--ink, #28251d); }
.app-shell .shared-invoice-sort:focus-visible { outline: 2px solid var(--accent, #2f5d50); outline-offset: 2px; border-radius: 3px; }
.app-shell .shared-invoice-table th[aria-sort="ascending"], .app-shell .shared-invoice-table th[aria-sort="descending"] { color: var(--ink, #28251d); }
.app-shell .shared-invoice-table td:nth-child(5) { font-variant-numeric: tabular-nums; }
.app-shell .shared-invoice-table tr[data-stage="ready"] .shared-invoice-status { background: color-mix(in srgb, #437a22 18%, #fff); color: #2f5a17 !important; border-color: color-mix(in srgb, #437a22 35%, #fff); }
.app-shell .shared-invoice-table tr[data-stage="attention"] .shared-invoice-status { background: color-mix(in srgb, #b7791f 14%, #fff); color: #7a4e0e !important; border-color: color-mix(in srgb, #b7791f 40%, #fff); }
.app-shell .shared-invoice-table tr[data-stage="reading"] .shared-invoice-status { background: color-mix(in srgb, #01696f 12%, #fff); color: #0c4e54 !important; }
.app-shell .invoice-failed-read-recovery { margin:12px 0; padding:14px 16px; border:1px solid color-mix(in srgb, #b7791f 42%, var(--line)); border-radius:12px; background:color-mix(in srgb, #b7791f 8%, var(--panel)); }
.app-shell .invoice-failed-read-recovery strong { display:block; margin-bottom:4px; color:#7a4e0e; }
.app-shell .invoice-failed-read-recovery p { margin:4px 0; max-width:72ch; }
.app-shell .shared-invoice-empty { text-align: center; color: var(--muted, #6b6a64); padding: 28px 10px !important; }
.app-shell .shared-invoice-inbox .assembly-activity { display: flex; align-items: center; gap: 12px; }
.app-shell .shared-invoice-inbox .assembly-activity > div { flex: 1; }
@media (max-width: 600px) {
  .app-shell .shared-invoice-toolbar { gap: 8px; }
  .app-shell .shared-invoice-toolbar-actions { width: 100%; justify-content: flex-end; }
  .app-shell .shared-invoice-stage-filter { width: 100%; }
  .app-shell .shared-invoice-stage-filter button { flex: 1 1 auto; padding: 6px 8px; }
  body.app-shell #invoice .shared-invoice-table tbody tr, .app-shell #invoice .shared-invoice-table tbody tr { grid-template-columns: 28px minmax(0, 1fr) auto; gap: 4px 10px; padding: 12px 6px; align-items: center; }
  .app-shell #invoice .shared-invoice-table tbody td { padding: 0 !important; text-align: left !important; height: auto !important; min-height: 0 !important; line-height: 1.35; }
  .app-shell #invoice .shared-invoice-table tbody td:first-child { grid-row: 1 / 4; align-self: start; padding-top: 2px !important; }
  .app-shell #invoice .shared-invoice-table tbody td:nth-child(2) { grid-column: 2; grid-row: 1; }
  .app-shell #invoice .shared-invoice-table tbody td:nth-child(5) { grid-column: 3; grid-row: 1; text-align: right !important; }
  .app-shell #invoice .shared-invoice-table tbody td:nth-child(3) { grid-column: 2; grid-row: 2; color: var(--muted); font-size: 13px; }
  .app-shell #invoice .shared-invoice-table tbody td:nth-child(4) { grid-column: 3; grid-row: 2; text-align: right !important; font-size: 13px; }
  .app-shell #invoice .shared-invoice-table tbody td:nth-child(6) { grid-column: 2; grid-row: 3; color: var(--muted); font-size: 12px; }
  .app-shell #invoice .shared-invoice-table tbody td:nth-child(7) { grid-column: 3; grid-row: 3; justify-content: flex-end; }
  .app-shell #invoice .shared-invoice-table tbody td[colspan] { grid-column: 1 / -1; grid-row: auto; }
  .app-shell .shared-invoice-selection-bar { top: 4px; gap: 8px; }
  body #invoice .shared-invoice-selection-bar .button-row { width: 100%; display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
  body #invoice .shared-invoice-selection-bar .button-row > :is(button, details) { width: 100%; min-height: 38px; }
  body #invoice .shared-invoice-selection-bar .button-row > .text-button { grid-column: 1 / -1; min-height: 32px; font-size: 14px; }
  body #invoice #invoiceDraftsPanel .shared-invoice-table tbody tr.is-selected > td { background: transparent !important; box-shadow: none !important; }
  body #invoice #invoiceDraftsPanel .shared-invoice-table tbody tr.is-selected { background: color-mix(in srgb, var(--accent) 12%, var(--paper)); box-shadow: inset 3px 0 0 var(--accent); }
  .app-shell .shared-invoice-unassigned { flex-wrap: wrap; }
}
/* 7.10.1 — ready invoices open from the status */
.app-shell .shared-invoice-table .shared-invoice-review-button { cursor: pointer; border: 1px solid color-mix(in srgb, #437a22 35%, #fff); font: inherit; min-height: 30px; padding: 4px 12px; }
.app-shell .shared-invoice-table .shared-invoice-review-button:hover { background: #437a22 !important; color: #fff !important; border-color: #437a22; }
.app-shell .shared-invoice-table .shared-invoice-review-button:focus-visible { outline: 2px solid #437a22; outline-offset: 2px; }

/* Keep legacy duplicate status lines out of the way. The current upload activity
   lives inside the drop zone and must remain visible while files are prepared. */
#extractStatus, #extractProgress { display: none !important; }
.larder-activity { position: fixed; right: 16px; z-index: 1001; width: min(420px, calc(100vw - 32px)); display: flex; align-items: flex-start; gap: 12px; padding: 12px 14px; border-radius: 12px; background: #fff; color: #28251d; border: 1px solid #d4d1ca; box-shadow: 0 8px 28px rgba(20, 30, 25, .16); font-size: 14px; line-height: 1.4; }
.larder-activity[hidden] { display: none; }
.larder-activity[data-kind="working"] { border-left: 4px solid #01696f; }
.larder-activity[data-kind="done"] { border-left: 4px solid #437a22; }
.larder-activity[data-kind="error"] { border-left: 4px solid #a13544; }
.larder-activity-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.larder-activity-body strong { font-size: 14px; font-weight: 700; overflow-wrap: anywhere; }
.larder-activity-detail { color: #5f5e59; font-size: 13px; overflow-wrap: anywhere; }
.larder-activity-time { color: #01696f; font-size: 12px; font-weight: 600; font-variant-numeric: tabular-nums; }
.larder-activity-spinner { flex: 0 0 18px; width: 18px; height: 18px; margin-top: 1px; border-radius: 50%; border: 2.5px solid color-mix(in srgb, #01696f 22%, #fff); border-top-color: #01696f; animation: larder-activity-spin .8s linear infinite; }
.larder-activity-icon { flex: 0 0 20px; width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; font-weight: 800; color: #fff; background: #437a22; }
.larder-activity[data-kind="error"] .larder-activity-icon { background: #a13544; }
.larder-activity-bar { display: block; height: 4px; margin-top: 4px; border-radius: 4px; background: color-mix(in srgb, #01696f 14%, #fff); overflow: hidden; }
.larder-activity-bar > span { display: block; height: 100%; background: #01696f; border-radius: 4px; transition: width .4s ease; }
.larder-activity-bar.is-indeterminate > span { width: 35%; animation: larder-activity-slide 1.4s ease-in-out infinite; }
.larder-activity-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.larder-activity-more summary { cursor: pointer; font-size: 12px; color: #01696f; font-weight: 600; }
.larder-activity-more > div { max-height: 220px; overflow: auto; font-size: 12px; margin-top: 4px; }
.larder-activity-close { flex: 0 0 auto; width: 28px; height: 28px; min-height: 0; padding: 0; margin: -4px -6px 0 0; border: 0; border-radius: 6px; background: transparent; color: #7a7974; font-size: 20px; line-height: 1; cursor: pointer; }
.larder-activity-close:hover { background: #f1efe9; color: #28251d; }
@keyframes larder-activity-spin { to { transform: rotate(360deg); } }
@keyframes larder-activity-slide { 0% { transform: translateX(-100%); } 100% { transform: translateX(290%); } }
@media (prefers-reduced-motion: reduce) { .larder-activity-spinner, .larder-activity-bar.is-indeterminate > span { animation-duration: 3s; } }
@media (max-width: 600px) { .larder-activity { right: 8px; left: 8px; width: auto; } }

/* Audit: button labels centered; non-sortable headers match sortable ones */
button.compact-button { align-items: center; justify-content: center; }
.history-table th:not(:has(.table-sort-button)) { text-transform: none; letter-spacing: normal; }
.price-suspect-note { margin-top: 10px; border: 1px solid #d4d1ca; border-radius: 10px; padding: 8px 12px; background: #fbfbf9; }
.price-suspect-note summary { cursor: pointer; font-size: 13px; font-weight: 600; color: #964219; }
.price-suspect-note ul { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 6px; }
.price-suspect-note li { display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; align-items: center; font-size: 13px; }
.price-suspect-note li small { grid-column: 1; color: #5f5e59; }
.price-suspect-note li .price-link { grid-column: 2; grid-row: 1 / span 2; }

/* Visual pass: a reading row's status (timer + Recover) gets its own line on phones */
@media (max-width: 600px) {
  .app-shell #invoice .shared-invoice-table tbody td:nth-child(7):has(.shared-invoice-read-status, .shared-invoice-review-button) { grid-column: 2 / 4; grid-row: 4; justify-content: space-between; gap: 8px; }
}
/* Food area shortcuts (Compare prices, Vendor sheets, Conversion chart) are links to
   other screens, not tabs: right-align them and drop the boxed button look. */
.app-shell .food-area-tools :is([data-food-prices], [data-food-conversions]) { margin-left: auto; }
.app-shell .food-area-tools :is([data-food-prices], [data-food-vendors], [data-food-conversions]) { background: transparent !important; border-color: transparent !important; box-shadow: none !important; color: var(--accent) !important; font-weight: 650; }
.app-shell .food-area-tools :is([data-food-prices], [data-food-vendors], [data-food-conversions]):hover { background: var(--surface-muted) !important; }
.app-shell .food-area-tools :is([data-food-prices], [data-food-vendors], [data-food-conversions])::after { content: " →"; }
/* Empty recipe quick note: one quiet line instead of "No quick note / Quick note" */
.app-shell .recipe-quick-note.is-empty small { color: var(--muted); opacity: .8; }
.app-shell .recipe-list-row:not(:hover, .is-current) .recipe-quick-note.is-empty { opacity: .55; }

/* V7.11 Today redesign: invoice work first, month numbers with their dates, calm follow-ups. */
body #dashboard.view.is-visible { grid-template-areas: "work" "attention" "reports" "records" !important; }
body #dashboard > .today-layout {
  grid-area: work !important; grid-column: 1 !important;
  display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 18px; align-items: start;
}
body #dashboard .today-layout > .panel, body #dashboard .today-side > .panel { margin: 0 !important; padding: 22px 24px !important; border-radius: 12px !important; }
.today-side { display: grid; gap: 18px; min-width: 0; }
.today-card-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.today-card-head h2 { margin: 0; font-family: Georgia, "Times New Roman", serif; font-size: 22px; }
.today-card-head .text-button, .today-queue-more { color: var(--accent-dark); font-weight: 600; font-size: 14px; background: none; border: 0; padding: 4px 0; cursor: pointer; }

.today-stages { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin: 16px 0; }
.today-stage {
  display: flex; flex-direction: column; align-items: flex-start; gap: 2px; min-width: 0; padding: 14px 16px; text-align: left;
  color: var(--ink); background: var(--field, #fff); border: 1px solid var(--line); border-radius: 10px; cursor: pointer;
}
.today-stage strong { font-size: 30px; line-height: 1.1; font-variant-numeric: tabular-nums lining-nums; }
.today-stage span { font-weight: 600; font-size: 15px; }
.today-stage small { color: var(--muted); font-size: 13px; line-height: 1.35; }
.today-stage:hover { border-color: var(--accent); }
.today-stage.is-next { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.today-stage.is-warn strong { color: var(--gold); }
.today-stage.is-empty strong { color: var(--muted); }

.today-work-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 14px; }
.today-work-actions:empty { display: none; }
.today-work-actions button { min-height: 42px; padding: 0 20px; font-size: 15px; }
.today-reading-note { color: var(--muted); font-size: 14px; }

.today-queue { border-top: 1px solid var(--line); }
.today-queue-row {
  display: grid; grid-template-columns: minmax(0, 1fr) 72px 110px 128px; align-items: center; gap: 10px; width: 100%;
  padding: 11px 4px; text-align: left; color: var(--ink); background: none; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; cursor: pointer;
}
.today-queue-row:hover { background: var(--wash, rgba(57,118,107,.06)); }
.today-queue-name { display: flex; flex-direction: column; min-width: 0; }
.today-queue-name strong { font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.today-queue-name small { color: var(--muted); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.today-queue-date { color: var(--muted); font-size: 13px; }
.today-queue-amount { font-weight: 600; font-variant-numeric: tabular-nums lining-nums; text-align: right; padding-right: 8px; }
.today-tag { justify-self: start; padding: 3px 10px; font-size: 12.5px; font-weight: 600; border-radius: 20px; color: var(--muted); background: var(--raised); white-space: nowrap; }
.today-tag.is-ok { color: var(--accent-dark); background: color-mix(in srgb, var(--accent) 16%, var(--paper)); }
.today-tag.is-warn { color: var(--gold); background: color-mix(in srgb, var(--gold) 14%, var(--paper)); }
.today-queue-more { display: block; margin-top: 12px; }
.today-empty { margin: 14px 0 4px; color: var(--muted); }

body #dashboard .today-month-card .metrics-grid {
  display: grid !important; grid-template-columns: repeat(2, minmax(0, 1fr)) !important; gap: 16px 22px !important;
  margin: 12px 0 0 !important; padding: 0 !important; border: 0 !important; background: none !important; box-shadow: none !important;
}
body #dashboard .today-month-card .metric {
  min-height: 0 !important; padding: 0 !important; border: 0 !important; background: none !important; box-shadow: none !important;
  display: flex !important; flex-direction: column !important; align-items: flex-start !important; gap: 2px !important; text-align: left !important;
}
body #dashboard .today-month-card .metric strong { order: -1; font-size: 30px !important; line-height: 1.15 !important; letter-spacing: -.01em; font-variant-numeric: tabular-nums lining-nums; }
body #dashboard .today-month-card .metric > span { font-size: 13px !important; font-weight: 500 !important; letter-spacing: 0 !important; text-transform: none !important; color: var(--muted) !important; }
body #dashboard .today-month-card .metric small { font-size: 12.5px !important; }
body #dashboard .today-month-card .metric:hover strong { color: var(--accent-dark); }
.today-asof { margin: 16px 0 0; padding: 10px 12px; font-size: 13px; line-height: 1.45; color: var(--muted); background: var(--raised); border-radius: 8px; }
.today-asof b { color: var(--ink); }

.today-spend-bar { display: flex; height: 14px; margin: 14px 0 12px; overflow: hidden; border-radius: 7px; background: var(--raised); }
.today-spend-bar i { display: block; height: 100%; }
.today-spend-legend { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2px 18px; }
.today-spend-legend button, .today-vendors button {
  display: flex; align-items: center; gap: 8px; width: 100%; min-height: 0; padding: 4px 0; font-size: 14px; color: var(--ink);
  text-align: left; background: none; border: 0; border-radius: 0; cursor: pointer;
}
.today-spend-legend i { flex: 0 0 10px; width: 10px; height: 10px; border-radius: 3px; }
.today-spend-legend strong, .today-vendors strong { margin-left: auto; font-variant-numeric: tabular-nums lining-nums; }
.today-spend-legend button:hover span, .today-vendors button:hover span { color: var(--accent-dark); text-decoration: underline; }
.today-vendors { margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--line); }
.today-mini-label { margin: 0 0 4px; font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }

/* Follow-ups: one calm row instead of an alarm panel. */
body #dashboard.view.is-visible > .action-center-panel { padding: 16px 22px !important; border-radius: 12px !important; }
body #dashboard > .action-center-panel .panel-header { margin-bottom: 8px !important; }
body #dashboard > .action-center-panel .panel-header h2 { font-size: 13px !important; font-weight: 700 !important; letter-spacing: .07em; text-transform: uppercase; color: var(--muted) !important; font-family: inherit !important; }
body #dashboard > .action-center-panel #monthConfidenceSummary { display: block !important; }
body #dashboard > .action-center-panel #monthConfidenceBadge { display: inline-flex !important; }
body #dashboard > .action-center-panel .attention-summary-grid { border: 0 !important; background: none !important; }
body #dashboard > .action-center-panel .attention-summary-card { border-left: 0 !important; box-shadow: none !important; background: none !important; }
body #dashboard > .action-center-panel .attention-summary-card strong { color: var(--ink) !important; }
body #dashboard > .action-center-panel .attention-summary-card.credit strong { color: var(--gold) !important; }
body #dashboard > .action-center-panel .attention-summary-grid { grid-template-columns: repeat(5, minmax(0, 1fr)) !important; }
body #dashboard > .action-center-panel .attention-summary-card.operations strong { color: var(--accent-dark) !important; }
body #dashboard > .action-center-panel .attention-summary-card.failures strong { color: var(--danger) !important; }

@media (max-width: 1100px) {
  body #dashboard > .today-layout { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 640px) {
  body #dashboard > .action-center-panel .attention-summary-grid { grid-template-columns: minmax(0, 1fr) !important; }
  .today-stages { grid-template-columns: minmax(0, 1fr); }
  .today-stage { flex-direction: row; align-items: baseline; gap: 10px; }
  .today-stage small { display: none; }
  .today-queue-row { grid-template-columns: minmax(0, 1fr) auto; }
  .today-queue-date, .today-queue-amount { display: none; }
  .today-spend-legend { grid-template-columns: minmax(0, 1fr); }
  body #dashboard .today-month-card .metric strong { font-size: 24px !important; }
}
body #dashboard > .action-center-panel .panel-header { background: none !important; padding: 0 !important; border: 0 !important; }
body #dashboard > .action-center-panel .attention-summary-card::before { opacity: .55; }

/* V7.11 review: focus on the open invoice and fit every line column beside the page. */
body #invoice[data-intake-stage="review"] #invoiceDraftsPanel,
body #invoice[data-intake-stage="finish"] #invoiceDraftsPanel { display: none !important; }
body #invoice[data-intake-stage="review"] #invoiceBalanceStatus.is-balanced,
body #invoice[data-intake-stage="finish"] #invoiceBalanceStatus.is-balanced { display: none !important; }
@media (min-width: 1000px) {
body #invoice .invoice-review-workspace.has-reference .invoice-line-grid-header,
body #invoice .invoice-review-workspace.has-reference #invoiceLineRows .invoice-nine-grid {
  grid-template-columns: minmax(200px, 1fr) 70px 104px 112px 108px !important;
  grid-template-areas: "item qty unit pkg total" "def def cat recv det" !important;
  min-width: 0 !important; row-gap: 8px !important;
}
body #invoice .invoice-review-workspace.has-reference .invoice-line-grid-header > :nth-child(1),
body #invoice .invoice-review-workspace.has-reference #invoiceLineRows .invoice-nine-grid > :nth-child(1) { grid-area: item; }
body #invoice .invoice-review-workspace.has-reference .invoice-line-grid-header > :nth-child(2),
body #invoice .invoice-review-workspace.has-reference #invoiceLineRows .invoice-nine-grid > :nth-child(2) { grid-area: qty; }
body #invoice .invoice-review-workspace.has-reference .invoice-line-grid-header > :nth-child(3),
body #invoice .invoice-review-workspace.has-reference #invoiceLineRows .invoice-nine-grid > :nth-child(3) { grid-area: unit; }
body #invoice .invoice-review-workspace.has-reference .invoice-line-grid-header > :nth-child(4),
body #invoice .invoice-review-workspace.has-reference #invoiceLineRows .invoice-nine-grid > :nth-child(4) { grid-area: def; }
body #invoice .invoice-review-workspace.has-reference .invoice-line-grid-header > :nth-child(5),
body #invoice .invoice-review-workspace.has-reference #invoiceLineRows .invoice-nine-grid > :nth-child(5) { grid-area: pkg; }
body #invoice .invoice-review-workspace.has-reference .invoice-line-grid-header > :nth-child(6),
body #invoice .invoice-review-workspace.has-reference #invoiceLineRows .invoice-nine-grid > :nth-child(6) { grid-area: total; }
body #invoice .invoice-review-workspace.has-reference .invoice-line-grid-header > :nth-child(7),
body #invoice .invoice-review-workspace.has-reference #invoiceLineRows .invoice-nine-grid > :nth-child(7) { grid-area: cat; }
body #invoice .invoice-review-workspace.has-reference .invoice-line-grid-header > :nth-child(8),
body #invoice .invoice-review-workspace.has-reference #invoiceLineRows .invoice-nine-grid > :nth-child(8) { grid-area: recv; }
body #invoice .invoice-review-workspace.has-reference .invoice-line-grid-header > :nth-child(9),
body #invoice .invoice-review-workspace.has-reference #invoiceLineRows .invoice-nine-grid > :nth-child(9) { grid-area: det; }
body #invoice .invoice-review-workspace.has-reference .invoice-line-table,
body #invoice .invoice-review-workspace.has-reference .invoice-line-grid-header { min-width: 0 !important; width: 100% !important; }
}
body #invoice #invoiceQueueReviewPanel { scroll-margin-top: 176px; }
body #invoice #invoiceEditorTitle { font-family: Georgia, "Times New Roman", serif; font-size: 22px; }

/* V7.11 audit queue: readable cards — what, where, why, and the actions in one glance. */
body #invoice #dataHealthQueue .audit-section { padding: 0 !important; overflow: hidden; margin-bottom: 12px; }
body #invoice #dataHealthQueue .audit-section > summary,
body #invoice #dataHealthQueue .audit-section[open] > summary {
  display: flex; align-items: center; gap: 10px; padding: 12px 16px !important;
  background: var(--paper) !important; color: var(--ink) !important; border-bottom: 1px solid var(--line);
  font-size: 15px;
}
body #invoice #dataHealthQueue .audit-section[open] > summary b,
body #invoice #dataHealthQueue .audit-section[open] > summary span,
body #invoice #dataHealthQueue .audit-section[open] > summary strong { color: var(--ink) !important; }
body #invoice #dataHealthQueue .audit-section:not([open]) > summary { border-bottom: 0; }
body #invoice #dataHealthQueue .audit-section > summary .status-badge { margin-left: auto; }
body #invoice #dataHealthQueue .audit-section > div { margin: 0 !important; padding: 0; }
body #invoice #dataHealthQueue .audit-section > .hint { padding: 10px 16px; margin: 0; }
body #invoice #dataHealthQueue .audit-record { border-bottom: 1px solid var(--line); }
body #invoice #dataHealthQueue .audit-record:last-child { border-bottom: 0; }
body #invoice #dataHealthQueue .data-health-finding.audit-card {
  display: grid !important; grid-template-columns: minmax(0, 1fr) auto !important; align-items: center; gap: 16px !important;
  padding: 12px 16px !important; margin: 0 !important; border: 0 !important; border-left: 3px solid transparent !important;
  border-radius: 0 !important; background: transparent !important; box-shadow: none !important; content-visibility: visible;
}
body #invoice #dataHealthQueue .audit-card[data-audit-severity="high"] { border-left-color: var(--warning, #b07a25) !important; }
body #invoice #dataHealthQueue .audit-card:hover { background: color-mix(in srgb, var(--paper) 70%, var(--body)) !important; }
body #invoice #dataHealthQueue .audit-card > .audit-card-body { display: grid !important; gap: 3px; min-width: 0; }
body #invoice #dataHealthQueue .audit-card-subject { display: flex; align-items: baseline; gap: 10px; min-width: 0; flex-wrap: wrap; }
body #invoice #dataHealthQueue .audit-card-subject strong { font-size: 15px; color: var(--ink); }
body #invoice #dataHealthQueue .audit-card-subject span { font-size: 13px; color: var(--muted); }
body #invoice #dataHealthQueue .audit-card-issue { margin: 0 !important; font-size: 13.5px; color: var(--ink); }
body #invoice #dataHealthQueue .audit-card-issue b { font-weight: 650; }
body #invoice #dataHealthQueue .audit-card small { font-size: 12.5px; color: var(--muted); }
body #invoice #dataHealthQueue .audit-card-actions { display: flex; gap: 6px; align-items: center; flex-wrap: nowrap; }
body #invoice #dataHealthQueue .audit-card-actions button { min-height: 32px; margin: 0; padding: 5px 11px; font-size: 12.5px; white-space: nowrap; }
body #invoice #dataHealthQueue .audit-card [data-central-audit-message]:empty { display: none; }
body #invoice #dataHealthQueue .audit-related-checks { margin: 0 !important; padding: 0 16px 10px 19px; }
body #invoice #dataHealthQueue .audit-related-checks > summary { font-size: 12.5px; color: var(--muted); padding: 2px 0 4px; }
body #invoice #dataHealthQueue .audit-related-checks .audit-card { padding: 8px 0 8px 12px !important; border-left: 2px solid var(--line) !important; }
@media (max-width: 720px) {
  body #invoice #dataHealthQueue .data-health-finding.audit-card { grid-template-columns: 1fr !important; gap: 8px !important; }
  body #invoice #dataHealthQueue .audit-card-actions { flex-wrap: wrap; }
}

/* V7.11 recipe & menu audits live in their own tabs, using the same card layout as Audit. */
body .recipe-menu-audit-list { border: 1px solid var(--line); border-radius: 10px; background: var(--paper); overflow: hidden; margin: 10px 0; }
body .recipe-menu-audit-list .audit-record { border-bottom: 1px solid var(--line); }
body .recipe-menu-audit-list .audit-record:last-child { border-bottom: 0; }
body .recipe-menu-audit-list .data-health-finding.audit-card {
  display: grid !important; grid-template-columns: minmax(0, 1fr) auto !important; align-items: center; gap: 16px !important;
  padding: 12px 16px !important; margin: 0 !important; border: 0 !important; border-left: 3px solid transparent !important;
  border-radius: 0 !important; background: transparent !important; box-shadow: none !important; content-visibility: visible;
}
body .recipe-menu-audit-list .audit-card[data-audit-severity="high"] { border-left-color: var(--warning, #b07a25) !important; }
body .recipe-menu-audit-list .audit-card:hover { background: color-mix(in srgb, var(--paper) 70%, var(--body)) !important; }
body .recipe-menu-audit-list .audit-card > .audit-card-body { display: grid !important; gap: 3px; min-width: 0; }
body .recipe-menu-audit-list .audit-card-subject { display: flex; align-items: baseline; gap: 10px; min-width: 0; flex-wrap: wrap; }
body .recipe-menu-audit-list .audit-card-subject strong { font-size: 15px; color: var(--ink); }
body .recipe-menu-audit-list .audit-card-subject span { font-size: 13px; color: var(--muted); }
body .recipe-menu-audit-list .audit-card-issue { margin: 0 !important; font-size: 13.5px; color: var(--ink); }
body .recipe-menu-audit-list .audit-card-issue b { font-weight: 650; }
body .recipe-menu-audit-list .audit-card small { font-size: 12.5px; color: var(--muted); }
body .recipe-menu-audit-list .audit-card-actions { display: flex; gap: 6px; align-items: center; flex-wrap: nowrap; }
body .recipe-menu-audit-list .audit-card-actions button { min-height: 32px; margin: 0; padding: 5px 11px; font-size: 12.5px; white-space: nowrap; }
body .recipe-menu-audit-list .audit-card [data-central-audit-message]:empty { display: none; }
body .recipe-menu-audit-list .audit-related-checks { margin: 0 !important; padding: 0 16px 10px 19px; }
body .recipe-menu-audit-list .audit-related-checks > summary { font-size: 12.5px; color: var(--muted); padding: 2px 0 4px; }
body .recipe-menu-audit-list .audit-related-checks .audit-card { padding: 8px 0 8px 12px !important; border-left: 2px solid var(--line) !important; }
@media (max-width: 720px) {
  body .recipe-menu-audit-list .data-health-finding.audit-card { grid-template-columns: 1fr !important; gap: 8px !important; }
  body .recipe-menu-audit-list .audit-card-actions { flex-wrap: wrap; }
}
body .recipe-menu-audit-toolbar { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto; gap: 10px; align-items: end; }
body .recipe-menu-audit-toolbar label { display: grid; gap: 4px; font-size: 12.5px; color: var(--muted); margin: 0; }
body .recipe-menu-audit-toolbar button { margin: 0; }
@media (max-width: 720px) { body .recipe-menu-audit-toolbar { grid-template-columns: 1fr; } }

/* Comfortable density: keep operational lists easy to scan without wasting wide screens. */
@media (min-width: 761px) {
  body #invoice .invoice-inbox-workspace > #invoiceDraftsPanel {
    width: min(100%, 2100px);
    box-sizing: border-box;
  }
  body #invoice .shared-invoice-table th,
  body #invoice .shared-invoice-table td {
    padding-top: 8px !important;
    padding-bottom: 8px !important;
  }
  body #invoice .shared-invoice-table th:first-child { width: 44px; }
  body #invoice .shared-invoice-table th:nth-child(2) { width: auto; }
  body #invoice .shared-invoice-table th:nth-child(3) { width: 150px; }
  body #invoice .shared-invoice-table th:nth-child(4) { width: 132px; }
  body #invoice .shared-invoice-table th:nth-child(5) { width: 116px; }
  body #invoice .shared-invoice-table th:nth-child(6) { width: 250px; }
  body #invoice .shared-invoice-table th:nth-child(7) { width: 230px; }

  body .app-shell :is(
    .history-table,
    .vendor-pricing-table,
    .price-history-table,
    .vendor-price-table,
    .order-guide-table,
    .schedule-table,
    .overhead-ledger-table,
    .audit-history-table,
    .garnish-station-table,
    .station-prep-table
  ) :is(th,td),
  body .app-shell .si-table :is(th,td) {
    padding-top: 7px;
    padding-bottom: 7px;
  }
  body .app-shell :is(.recipe-card,.menu-card,.order-session-card,.inventory-month-row,.staff-notification-list article) {
    padding-block: 8px;
  }
}

/* Workspace tabs belong in the document flow. A sticky grid item could be
   pushed to the bottom of a long queue and cover the final rows. */
body #invoiceWorkspaceTabs {
  position: static !important;
  top: auto !important;
  align-self: start;
}
body #invoice #dataHealthQueue .audit-elsewhere { display: grid; gap: 8px; margin-top: 4px; }
body #invoice #dataHealthQueue .audit-elsewhere-row {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%; text-align: left;
  padding: 12px 16px; border: 1px dashed var(--line); border-radius: 10px; background: transparent; color: var(--ink); cursor: pointer;
}
body #invoice #dataHealthQueue .audit-elsewhere-row span { display: grid; gap: 2px; }
body #invoice #dataHealthQueue .audit-elsewhere-row small { color: var(--muted); font-size: 12.5px; }
body #invoice #dataHealthQueue .audit-elsewhere-row b { font-size: 13px; color: var(--accent, #2f5d50); white-space: nowrap; }
body #invoice #dataHealthQueue .audit-elsewhere-row:hover { background: var(--paper); }
body #foodWorkspaceTabs .tab-count:empty { display: none; }
body #foodWorkspaceTabs .tab-count { display: inline-block; margin-left: 6px; min-width: 20px; padding: 1px 7px; border-radius: 999px; background: color-mix(in srgb, var(--line) 80%, transparent); color: var(--ink); font-size: 11.5px; font-weight: 650; line-height: 1.5; text-align: center; font-variant-numeric: tabular-nums; }
body .recipe-menu-audit-panel .data-health-center { display: block; }
body .recipe-menu-audit-panel .data-health-center > .hint { max-width: none; margin: 8px 0 0; }

/* One invoice queue language: one command bar, one invoice identity field, and
   a compact action row that continues the selected invoice. */
body #invoice .shared-invoice-commandbar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  margin: 0 0 8px; padding: 6px; border: 1px solid var(--line); border-radius: 12px;
  background: color-mix(in srgb, var(--paper) 82%, var(--wash));
}
body #invoice .shared-invoice-commandbar .shared-invoice-stage-filter {
  flex: 1 1 auto; padding: 0; border: 0; background: transparent;
}
body #invoice .shared-invoice-commandbar .shared-invoice-toolbar-actions { margin: 0; flex: 0 0 auto; }
body #invoice .shared-invoice-sort-menu > div { min-width: 240px; gap: 10px; }
body #invoice .shared-invoice-sort-menu label { display: grid; gap: 4px; color: var(--muted); font-size: 12px; font-weight: 650; }
body #invoice .shared-invoice-sort-menu select { min-height: 36px; padding: 6px 9px; font: inherit; color: var(--ink); }
body #invoice .invoice-reliability-strip {
  gap: 5px 16px; margin: 0 4px 8px; padding: 4px 6px; border: 0; border-radius: 0;
  background: transparent; font-size: 12px;
}
body #invoice .invoice-reliability-strip strong { font-size: 12px; }
body #invoice .shared-invoice-table-cohesive { min-width: 660px; table-layout: fixed; }
body #invoice .shared-invoice-table-cohesive th:first-child { width: 44px; }
body #invoice .shared-invoice-table-cohesive th:nth-child(2) { width: auto; }
body #invoice .shared-invoice-table-cohesive th:nth-child(3) { width: 132px; text-align: right; padding-right: 20px !important; }
body #invoice .shared-invoice-table-cohesive th:nth-child(4) { width: 292px; }
body #invoice .shared-invoice-table-cohesive td { padding-top: 9px !important; padding-bottom: 9px !important; }
body #invoice .shared-invoice-table-cohesive .shared-invoice-identity { min-width: 0; }
body #invoice .shared-invoice-table-cohesive .shared-invoice-name { font-size: 14px; line-height: 1.25; }
body #invoice .shared-invoice-meta {
  display: flex; align-items: center; flex-wrap: wrap; gap: 2px 0; margin-top: 3px;
  color: var(--muted); font-size: 12px; line-height: 1.3;
}
body #invoice .shared-invoice-meta > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
body #invoice .shared-invoice-meta > span + span::before { content: "\00b7"; margin: 0 7px; color: color-mix(in srgb, var(--muted) 55%, transparent); }
body #invoice .shared-invoice-table-cohesive .shared-invoice-amount { padding-right: 20px !important; font-weight: 650; }
body #invoice .shared-invoice-table-cohesive .shared-invoice-status-cell {
  display: flex; align-items: center; justify-content: flex-end; gap: 6px; min-width: 0;
}
body #invoice .shared-invoice-table-cohesive .shared-invoice-status { max-width: calc(100% - 36px); overflow: hidden; text-overflow: ellipsis; }
body #invoice .shared-invoice-inline-actions .invoice-reader-controls {
  min-height: 48px; padding: 7px 10px 7px 54px; gap: 8px; justify-content: flex-start; border: 0; background: color-mix(in srgb, var(--accent) 7%, var(--paper));
}
body #invoice .shared-invoice-inline-actions .invoice-reader-controls > strong { margin-right: 6px; font-size: 12px; color: var(--muted); }
body #invoice .shared-invoice-inline-actions .invoice-reader-controls .button-row { margin: 0; gap: 5px; }
body #invoice .shared-invoice-inline-actions .invoice-reader-controls button,
body #invoice .shared-invoice-inline-actions .invoice-reader-controls summary { min-height: 32px; padding: 5px 10px; font-size: 12px; }
body #invoice .shared-invoice-selection-hint { margin: 6px 4px 0; font-size: 12px; }

@media (max-width: 820px) {
  body #invoice .shared-invoice-commandbar { align-items: stretch; flex-direction: column; }
  body #invoice .shared-invoice-commandbar .shared-invoice-toolbar-actions { width: 100%; justify-content: flex-end; }
  body #invoice .shared-invoice-table-cohesive { min-width: 0; }
  body #invoice .shared-invoice-table-cohesive thead { display: none; }
  body #invoice .shared-invoice-table-cohesive tbody { display: grid; }
  body #invoice .shared-invoice-table-cohesive tbody tr:not(.shared-invoice-inline-actions) {
    display: grid; grid-template-columns: 30px minmax(0, 1fr) auto; gap: 5px 10px; align-items: center; padding: 11px 8px;
  }
  body #invoice .shared-invoice-table-cohesive tbody tr:not(.shared-invoice-inline-actions) > td { display: block; padding: 0 !important; border: 0; }
  body #invoice .shared-invoice-table-cohesive tbody tr:not(.shared-invoice-inline-actions) > td:first-child { grid-column: 1; grid-row: 1 / 3; align-self: start; padding-top: 2px !important; }
  body #invoice .shared-invoice-table-cohesive tbody tr:not(.shared-invoice-inline-actions) > td:nth-child(2) { grid-column: 2; grid-row: 1 / 3; }
  body #invoice .shared-invoice-table-cohesive tbody tr:not(.shared-invoice-inline-actions) > td:nth-child(3) { grid-column: 3; grid-row: 1; text-align: right !important; }
  body #invoice .shared-invoice-table-cohesive tbody tr:not(.shared-invoice-inline-actions) > td:nth-child(4) { grid-column: 3; grid-row: 2; display: flex; justify-content: flex-end; }
  body #invoice .shared-invoice-table-cohesive .shared-invoice-meta { max-width: 62vw; }
  body #invoice .shared-invoice-inline-actions { display: table-row !important; }
  body #invoice .shared-invoice-inline-actions > td { display: table-cell !important; }
  body #invoice .shared-invoice-inline-actions .invoice-reader-controls { padding-left: 12px; }
}
@media (max-width: 560px) {
  body #invoice .shared-invoice-commandbar .shared-invoice-toolbar-actions { display: grid; grid-template-columns: minmax(0,1fr) auto auto; }
  body #invoice .shared-invoice-commandbar .shared-invoice-read-unread { width: 100%; }
  body #invoice .shared-invoice-table-cohesive tbody tr:not(.shared-invoice-inline-actions) { grid-template-columns: 28px minmax(0, 1fr); }
  body #invoice .shared-invoice-table-cohesive tbody tr:not(.shared-invoice-inline-actions) > td:nth-child(2) { grid-row: 1; }
  body #invoice .shared-invoice-table-cohesive tbody tr:not(.shared-invoice-inline-actions) > td:nth-child(3) { grid-column: 2; grid-row: 2; justify-self: start; }
  body #invoice .shared-invoice-table-cohesive tbody tr:not(.shared-invoice-inline-actions) > td:nth-child(4) { grid-column: 2; grid-row: 3; justify-content: space-between; }
  body #invoice .shared-invoice-table-cohesive .shared-invoice-meta { max-width: 78vw; }
  body #invoice .invoice-reliability-strip span:nth-of-type(n+3) { display: none; }
}

/* V7.11.23 — keep the invoice queue compact and keep app status in view. */
body.invoice-workspace-active .main {
  grid-template-rows: auto auto minmax(0, 1fr) auto;
}
body.invoice-workspace-active .main > .topbar { grid-row: 1; }
body.invoice-workspace-active .main > #invoiceWorkspaceTabs {
  grid-row: 2;
  margin: 0 0 10px;
}
body.invoice-workspace-active .main > :is(#invoice, #invoiceOverview).is-visible { grid-row: 3; }
body.invoice-workspace-active .main > .status-footer {
  grid-row: 4;
  align-self: end;
}

@media (min-width: 821px) {
  body #invoice .invoice-inbox-workspace > #invoiceDraftsPanel {
    width: min(100%, 1480px);
  }
  body #invoice .shared-invoice-table-cohesive {
    width: 100%;
    min-width: 720px;
  }
  body #invoice .shared-invoice-table-cohesive th:first-child { width: 38px; }
  body #invoice .shared-invoice-table-cohesive th:nth-child(2) { width: auto; }
  body #invoice .shared-invoice-table-cohesive th:nth-child(3) { width: 118px; }
  body #invoice .shared-invoice-table-cohesive th:nth-child(4) { width: 310px; }
  body #invoice .shared-invoice-table-cohesive tbody tr:not(.shared-invoice-inline-actions) > td {
    height: 46px;
    padding-top: 5px !important;
    padding-bottom: 5px !important;
  }
  body #invoice .shared-invoice-table-cohesive .shared-invoice-status {
    max-width: none;
    overflow: visible;
    text-overflow: clip;
  }
  body #invoice .shared-invoice-inline-actions .invoice-reader-controls {
    min-height: 42px;
    padding-top: 5px;
    padding-bottom: 5px;
  }
}

body #invoice .shared-invoice-meta {
  column-gap: 0;
}
body #invoice .shared-invoice-meta > span + span {
  margin-left: 8px;
  padding-left: 8px;
  border-left: 1px solid color-mix(in srgb, var(--muted) 38%, transparent);
}
body #invoice .shared-invoice-meta > span + span::before { content: none; }

/* Signature navigation: shared 24-unit vector family, color follows the control. */
body .larder-line-icon { display:inline-block; width:24px; height:24px; flex:0 0 24px; vertical-align:middle; }
body .sidebar .rail-icon { display:flex; align-items:center; justify-content:center; width:24px; height:24px; }
body .app-shell .sidebar nav.tabs.simple-tabs > button.tab,
body .app-shell .sidebar .more-workspaces > .nav-menu-toggle { color:#203e35 !important; }
body .app-shell .sidebar nav.tabs.simple-tabs > button.tab.is-active,
body .app-shell .sidebar .more-workspaces.is-active > .nav-menu-toggle { color:#f5f1e7 !important; background:#203e35 !important; border-color:#203e35 !important; box-shadow:none !important; }
body .sidebar .nav-subtab:has(> .larder-line-icon) { display:flex !important; align-items:center; gap:9px; }
body .sidebar .nav-subtab > .larder-line-icon { width:20px; height:20px; flex-basis:20px; }
body #dashboard button:has(> .larder-line-icon) { display:inline-flex; align-items:center; gap:8px; }
body #dashboard button > .larder-line-icon { width:20px; height:20px; flex-basis:20px; }
html.dark-mode body .app-shell .sidebar nav.tabs.simple-tabs > button.tab:not(.is-active),
html.dark-mode body .app-shell .sidebar .more-workspaces:not(.is-active) > .nav-menu-toggle { color:#d4dfd8 !important; }

/* Preview is the opening menu workspace; editor is an intentional second step. */
@media screen {
  body #menuPublishing .mp-workspace-mode { display:flex; flex-wrap:wrap; align-items:center; gap:8px; margin:0 0 14px; }
  body #menuPublishing .mp-workspace-mode button { min-height:40px; padding:8px 16px; border:1px solid var(--line); border-radius:8px; color:var(--ink); background:var(--paper); }
  body #menuPublishing .mp-workspace-mode button[aria-pressed="true"] { color:#f5f1e7; background:#203e35; border-color:#203e35; }
  body #menuPublishing #mpPreviewHelp { font-size:13px; color:var(--muted); }
  body #menuPublishing .menu-publishing-workspace { align-items:start !important; }
  body #menuPublishing[data-workspace-mode="preview"] .menu-publishing-workspace { display:block !important; }
  body #menuPublishing #mpEditorPanel[hidden] { display:none !important; }
  body #menuPublishing .menu-publishing-preview-shell { align-self:start !important; margin:0 !important; top:20px !important; max-height:calc(100dvh - 40px); }
  body #menuPublishing[data-workspace-mode="preview"] .menu-publishing-preview-shell { position:relative !important; top:auto !important; max-height:none !important; width:min(1140px,100%); box-sizing:border-box; margin:0 auto !important; }
  body #menuPublishing #mpPreview [data-mp-preview-item] { cursor:pointer; }
  body #menuPublishing #mpPreview [data-mp-preview-item]:is(:hover,:focus-visible) { outline:2px solid #3b7464; outline-offset:3px; background:#e8eee7; }
  @media(max-width:1050px) {
    body #menuPublishing[data-workspace-mode="edit"] .menu-publishing-preview-shell { display:none !important; }
  }
}
