/* Shared workspace shell: Today, Invoices, Menus, Recipes, More. */
.shell-account-menu { position:relative; }
.shell-account-menu > summary { cursor:pointer; padding:8px 10px; font-size:12px; border:1px solid var(--line); border-radius:8px; }
.shell-account-menu > div { position:absolute; right:0; top:calc(100% + 6px); z-index:1020; padding:8px; min-width:150px; display:grid; gap:8px; background:var(--paper); border:1px solid var(--line); border-radius:8px; }
.more-operation-tools > summary { cursor:pointer; padding:8px 9px; font-size:13px; }
.invoice-header-cautions { display:block; white-space:normal; max-width:28rem; font-size:12px; line-height:1.45; color:var(--ink); margin-top:6px; }
body .sidebar {
  position: sticky !important; top: 0 !important; z-index: 1000 !important;
  display: grid !important; grid-template-columns: 190px minmax(0,1fr) !important;
  grid-template-rows: auto auto !important; align-items: center !important;
  gap: 10px 16px !important; width: 100% !important; min-height: 0 !important;
  padding: 12px 24px !important; border: 0 !important; border-bottom: 1px solid var(--line) !important;
  color: var(--ink) !important; background: var(--paper) !important;
  box-shadow: 0 3px 12px color-mix(in srgb,var(--ink) 4%,transparent) !important;
}
body .sidebar .brand { grid-column: 1 !important; grid-row: 1 !important; display:flex !important; align-items:center !important; gap:10px !important; margin:0 !important; padding:0 !important; }
body .sidebar .brand-mark { width:36px !important; height:36px !important; min-width:36px !important; border-radius:8px !important; }
body .sidebar .brand h1 { font-size:21px !important; line-height:1.1 !important; margin:0 !important; }
body .sidebar .brand p { font-size:12px !important; margin:3px 0 0 !important; }
body .sidebar .shell-actions { grid-column:2 !important; grid-row:1 !important; display:flex !important; justify-content:flex-end !important; flex-wrap:wrap !important; gap:6px !important; min-width:0 !important; margin:0 !important; padding:0 !important; }
body .sidebar .shell-actions button { min-height:34px !important; padding:6px 10px !important; font-size:12px !important; }
body .sidebar .simple-tabs { grid-column:1 / -1 !important; grid-row:2 !important; position:relative !important; display:flex !important; flex-wrap:wrap !important; align-items:center !important; gap:6px !important; width:100% !important; min-height:38px !important; height:auto !important; margin:0 !important; padding:0 !important; overflow:visible !important; border:0 !important; border-radius:0 !important; background:transparent !important; box-shadow:none !important; }
body .sidebar .simple-tabs > .tab, body .sidebar .more-workspaces > .nav-menu-toggle { display:inline-flex !important; align-items:center !important; justify-content:center !important; flex:0 0 auto !important; gap:8px !important; width:auto !important; min-width:0 !important; min-height:38px !important; padding:8px 18px !important; border:1px solid transparent !important; border-radius:8px !important; color:var(--ink) !important; background:transparent !important; font-size:14px !important; font-weight:600 !important; white-space:nowrap !important; box-shadow:none !important; }
body .sidebar .simple-tabs > .tab.is-active, body .sidebar .more-workspaces.is-active > .nav-menu-toggle { color:var(--sage-selected-ink) !important; background:var(--sage-selected) !important; border-color:var(--line) !important; box-shadow:inset 0 -2px 0 var(--accent) !important; }
body .sidebar .simple-tabs > .tab:hover, body .sidebar .more-workspaces > .nav-menu-toggle:hover { background:var(--wash) !important; }
body .sidebar .more-workspaces { position:static !important; min-width:0 !important; }
body .sidebar .more-workspaces > .nav-menu-panel { display:none !important; }
body .sidebar .more-workspaces[open] > #moreWorkspaces { position:absolute !important; top:calc(100% + 8px) !important; left:50% !important; right:auto !important; transform:translateX(-50%) !important; display:grid !important; grid-template-columns:repeat(4,minmax(0,1fr)) !important; width:min(800px,100%) !important; max-width:100% !important; min-width:0 !important; max-height:70vh !important; overflow:auto !important; z-index:1010 !important; gap:14px !important; padding:18px !important; margin:0 !important; border:1px solid var(--line) !important; border-radius:8px !important; background:var(--paper) !important; }
.more-workspace-group { min-width:0; }
.more-workspace-group > strong { display:block; padding:5px 9px 10px; color:var(--muted); font-size:12px; font-weight:600; text-transform:uppercase; letter-spacing:.04em; }
body .sidebar .more-workspaces .nav-subtab { display:flex !important; justify-content:flex-start !important; text-align:left !important; width:100% !important; min-width:0 !important; min-height:36px !important; white-space:normal !important; padding:8px 9px !important; font-size:13px !important; border:0 !important; border-radius:8px !important; }
body #dashboard.view.is-visible { grid-template-columns:minmax(0,1fr) !important; grid-template-areas:"work" "metrics" "attention" "reports" "records" !important; gap:18px !important; }
body #dashboard > .today-work { grid-area:work !important; display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:14px; }
.today-work button { display:flex; flex-direction:column; gap:8px; padding:20px; text-align:left; white-space:normal; color:var(--ink); border:1px solid var(--line); border-radius:8px; background:var(--paper); cursor:pointer; }
.today-work button:hover { border-color:var(--accent); background:var(--wash); }
.today-work strong { display:flex; width:100%; justify-content:space-between; gap:8px; font-size:17px; }
.today-work button > span { font-size:13px; color:var(--muted); line-height:1.5; }
body #dashboard.view.is-visible > .metrics-grid { grid-area:metrics !important; grid-column:1 !important; }
body #dashboard.view.is-visible > .action-center-panel { grid-area:attention !important; grid-column:1 !important; }
body #dashboard > .today-reports { grid-area:reports !important; grid-column:1 !important; border:1px solid var(--line); border-radius:8px; background:var(--paper); padding:0; }
.today-reports > summary { padding:18px 20px; cursor:pointer; font-weight:600; }
.today-reports > summary span { color:var(--muted); font-size:12px; font-weight:400; margin-left:10px; }
.today-report-content { display:grid; grid-template-columns:minmax(0,1fr); gap:16px; padding:0 18px 18px; }
body #dashboard .today-report-content > .panel, body #dashboard .today-report-content > .dashboard-visual-grid { display:block !important; grid-area:auto !important; grid-column:auto !important; margin:0 !important; }
body #dashboard.view.is-visible > .dashboard-recent-files-panel { grid-area:records !important; grid-column:1 !important; }
body #foodWorkspaceTabs .food-area-tools { margin:0; padding:0; border:0; }
@media(max-width:760px) {
  body .sidebar { position:relative !important; padding:12px !important; grid-template-columns:minmax(0,1fr) !important; gap:10px !important; }
  body .sidebar .brand { grid-row:1 !important; }
  body .sidebar .shell-actions { grid-row:2 !important; grid-column:1 !important; justify-content:flex-start !important; }
  body .sidebar .simple-tabs { grid-row:3 !important; gap:2px !important; }
  body .sidebar .simple-tabs > .tab, body .sidebar .more-workspaces > .nav-menu-toggle { padding:9px 8px !important; font-size:13px !important; min-height:44px !important; }
  body .sidebar .more-workspaces[open] > #moreWorkspaces { grid-template-columns:repeat(2,minmax(0,1fr)) !important; padding:12px !important; max-height:65vh !important; }
  body .sidebar .more-workspaces .nav-subtab { min-height:44px !important; }
  body #dashboard > .today-work { grid-template-columns:1fr; gap:10px; }
  .today-work button { padding:16px; }
  .today-reports > summary span { display:block; margin:6px 0 0; }
  .today-report-content { padding:0 10px 10px; }
}
@media(min-width:370px) and (max-width:760px) {
  body .sidebar { grid-template-columns:auto minmax(0,1fr) !important; gap:6px !important; padding:8px 10px !important; }
  body .sidebar .brand p, body .sidebar .brand-mark { display:none !important; }
  body .sidebar .brand h1 { font-size:18px !important; }
  body .sidebar .shell-actions { grid-column:2 !important; grid-row:1 !important; justify-content:flex-end !important; gap:4px !important; }
  body .sidebar .shell-actions button { min-height:44px !important; min-width:0 !important; width:auto !important; flex:0 0 auto !important; padding:6px 8px !important; }
  .shell-account-menu { flex:0 0 auto; min-width:64px; }
  body .sidebar .simple-tabs { grid-row:2 !important; }
  .shell-account-menu > summary { min-height:44px; display:flex; align-items:center; padding:6px 8px; }
}
@media (max-width: 360px) {
  body .sidebar .shell-actions { display: grid !important; grid-template-columns: repeat(2,minmax(0,1fr)) !important; }
  body .sidebar .shell-actions button { width: 100% !important; min-width: 0 !important; }
}

/* Menu editing: everyday controls first, specialist tools on demand. */
body:has(#menuPublishing.is-visible) .main > .topbar { display:flex; }
#menuPublishing .menu-publishing-toolbar { padding:14px 20px; gap:12px; }
#menuPublishing .mp-autosave-note { font-size:11px; margin:4px 0 0; }
#menuPublishing .menu-library-slots { margin-bottom:10px; }
#menuPublishing .menu-library-slots button { padding:9px 12px; }
#menuPublishing .mp-settings-disclosure { margin:0 0 12px; border-bottom:1px solid var(--border); padding-bottom:10px; }
#menuPublishing .mp-settings-disclosure > summary, #mpPrintLayoutDetails > summary { cursor:pointer; padding:10px; font-weight:700; }
#menuPublishing .mp-typeface-setting:empty { display:none; }
#menuPublishing .mp-item-summary { display:grid; grid-template-columns:minmax(120px,1fr) 120px auto auto; gap:10px; align-items:end; }
#menuPublishing .mp-item-states { display:flex; flex-wrap:wrap; gap:8px; align-self:center; }
#menuPublishing .mp-item-editor { padding:10px 0; margin:0; }
#menuPublishing .mp-dish-details > summary { cursor:pointer; padding:8px 0; font-size:12px; }
#menuPublishing .mp-item-actions { display:flex; align-items:center; gap:4px; }
#menuPublishing .mp-item-more { position:relative; }
#menuPublishing .mp-item-more > summary { cursor:pointer; padding:8px; list-style:none; }
#menuPublishing .mp-item-more > div { position:absolute; right:0; top:100%; min-width:150px; padding:8px; z-index:30; background:#202a2c; border:1px solid #697674; border-radius:10px; box-shadow:0 8px 24px #0006; display:grid; gap:6px; }
#menuPublishing .mp-dish-navigation { display:grid; grid-template-columns:minmax(120px,1fr) minmax(120px,1fr); gap:10px; margin:0 0 16px; }
#mpDishSearchStatus { grid-column:1 / -1; display:grid; gap:4px; }
#mpDishSearchStatus:empty { display:none; }
#mpDishSearchStatus button { text-align:left; display:flex; justify-content:space-between; gap:10px; }
#mpDishSearchStatus small { color:var(--muted); }
#mpPrintLayoutDetails { border-top:1px solid #64716d55; }
#mpPrintLayoutDetails .mp-print-adjustments { padding-top:12px; }
.mp-library-more { align-self:center; }
.mp-library-more summary { cursor:pointer; padding:8px; }
#mpSaveStatus { font-size:12px; }
@media (max-width:1100px) {
  #menuPublishing .mp-item-summary { grid-template-columns:minmax(100px,1fr) 120px auto; }
  #menuPublishing .mp-item-states { grid-column:1 / 3; grid-row:2; }
  #menuPublishing .mp-item-actions { grid-column:3; grid-row:1 / 3; }
}
@media (max-width:520px) {
  #menuPublishing .mp-dish-navigation { grid-template-columns:1fr; }
  #menuPublishing .mp-item-summary { grid-template-columns:minmax(0,1fr) 110px; }
  #menuPublishing .mp-item-states { grid-column:1; grid-row:2; }
  #menuPublishing .mp-item-actions { grid-column:2; grid-row:2; flex-wrap:wrap; }
  #menuPublishing .menu-publishing-toolbar { padding:12px; }
}
#menuPublishing .menu-publishing-toolbar .eyebrow { display:none; }
#menuPublishing .menu-publishing-toolbar h2 { margin:0 0 4px; }
#menuPublishing .mp-arrange-help { margin:0 0 10px; font-size:11px; }
#menuPublishing .mp-arrange-help > summary { cursor:pointer; }
#menuPublishing .mp-section-head { display:grid; grid-template-columns:auto minmax(0,1fr); gap:8px; align-items:center; }
#menuPublishing .mp-section-order { display:flex; flex-direction:row; flex-wrap:nowrap; }
#menuPublishing .mp-section-tools { grid-column:1 / -1; }
#menuPublishing .mp-section-tools > summary { cursor:pointer; font-size:11px; padding:4px 0; }
#menuPublishing .mp-section-tools[open] { display:grid; gap:8px; }
#menuPublishing .mp-section-tools > .mp-section-moves { margin:8px 0; }
#menuPublishing .mp-section-tools > select { margin:8px 0; }
#menuPublishing .mp-dish-navigation { padding:0 16px; }
#menuPublishing .mp-item-editor { overflow:visible; }
#menuPublishing .mp-item-price input { min-width:0; }

/* Recipe capture starts with ingredients and method; advanced fields stay intact. */
#recipeEditorPanel .recipe-entry-guide { margin:10px 0; }
#recipeEditorPanel .recipe-entry-guide p { color:var(--muted); font-size:12px; }
#recipeEditorPanel .recipe-entry-guide label { display:flex; align-items:center; gap:8px; }
#recipeEditorPanel .recipe-entry-guide input { width:auto; }
#recipeEditorPanel .recipe-optional-details { border-top:1px solid #74858044; margin-top:16px; padding:12px 0; }
#recipeEditorPanel .recipe-optional-details > summary { cursor:pointer; font-weight:700; padding:4px 0 12px; }
#recipeEditorPanel:not(.recipe-costing-expanded) .prep-costing-guide,
#recipeEditorPanel:not(.recipe-costing-expanded) #recipeEditorSummary,
#recipeEditorPanel:not(.recipe-costing-expanded) .line-toolbar,
#recipeEditorPanel:not(.recipe-costing-expanded) .prep-costing-table th:nth-child(4),
#recipeEditorPanel:not(.recipe-costing-expanded) .prep-costing-table th:nth-child(5),
#recipeEditorPanel:not(.recipe-costing-expanded) .prep-costing-table th:nth-child(6),
#recipeEditorPanel:not(.recipe-costing-expanded) #recipeIngredientRows td:nth-child(4),
#recipeEditorPanel:not(.recipe-costing-expanded) #recipeIngredientRows td:nth-child(5),
#recipeEditorPanel:not(.recipe-costing-expanded) #recipeIngredientRows td:nth-child(6) { display:none !important; }
#recipeEditorPanel:not(.recipe-costing-expanded) .prep-costing-table { min-width:0; width:100%; table-layout:auto; }
#recipeEditorPanel:not(.recipe-costing-expanded) .prep-costing-table th:first-child { width:50%; }
.recipe-readiness-note { color:var(--muted); font-size:12px; }
#recipeViewerBack { max-width:100%; white-space:normal; }
@media (max-width:600px) {
 #recipeEditorPanel:not(.recipe-costing-expanded) .prep-costing-table,
 #recipeEditorPanel:not(.recipe-costing-expanded) .prep-costing-table tbody,
 #recipeEditorPanel:not(.recipe-costing-expanded) .prep-costing-table tfoot { display:block; width:100%; }
 #recipeEditorPanel:not(.recipe-costing-expanded) .prep-costing-table thead { display:none; }
 #recipeEditorPanel:not(.recipe-costing-expanded) #recipeIngredientRows tr { display:grid; grid-template-columns:minmax(0,1fr) minmax(0,1fr) 40px; border-bottom:1px solid #74858044; padding:8px 0; }
 #recipeEditorPanel:not(.recipe-costing-expanded) #recipeIngredientRows td { min-width:0; padding:4px; }
 #recipeEditorPanel:not(.recipe-costing-expanded) #recipeIngredientRows td:first-child { grid-column:1 / 3; }
 #recipeEditorPanel:not(.recipe-costing-expanded) #recipeIngredientRows td:nth-child(2) { grid-column:1; grid-row:2; }
 #recipeEditorPanel:not(.recipe-costing-expanded) #recipeIngredientRows td:nth-child(2)::before { content:"Quantity"; font-size:12px; }
 #recipeEditorPanel:not(.recipe-costing-expanded) #recipeIngredientRows td:nth-child(3) { grid-column:2; grid-row:2; }
 #recipeEditorPanel:not(.recipe-costing-expanded) #recipeIngredientRows td:nth-child(3)::before { content:"Unit"; font-size:12px; }
 #recipeEditorPanel:not(.recipe-costing-expanded) #recipeIngredientRows td:last-child { grid-column:3; grid-row:1 / 3; }
 #recipeEditorPanel:not(.recipe-costing-expanded) #recipeIngredientRows input { min-width:0; width:100%; }
}

.recipe-viewer-modal.is-editing #saveRecipe,
.recipe-viewer-modal.is-editing #printViewedRecipe { display:none !important; }
.recipe-viewer-modal.is-editing .modal-actions { display:flex; flex-wrap:wrap; align-items:center; gap:8px; }
.recipe-viewer-modal.is-editing .modal-actions #recipeCloseSaveStatus { margin-right:auto; }
@media(max-width:600px) {
 .recipe-viewer-modal.is-editing .modal-actions #recipeCloseSaveStatus { flex-basis:100%; }
 .recipe-viewer-modal.is-editing .modal-actions > button:not([hidden]) { width:auto; flex:1; }
}

/* Layout contract: controls wrap inside their own surface, not across neighbors. */
body .sidebar .shell-actions > button { width:auto !important; flex:0 0 auto !important; }
body .main, body .view, body .panel, body .panel-header > *, body .panel-actions,
body .form-grid > *, body .modal-header > * { min-width:0; }
body .panel-header { gap:12px; flex-wrap:wrap; }
body .panel-header > :first-child { min-width:0; }
body .panel-header h2, body .modal-header h2 { overflow-wrap:anywhere; }
body .panel-header .panel-actions { display:flex; flex-wrap:wrap; align-items:center; gap:8px; max-width:100%; }
body .panel-header .panel-actions > :is(button, details):not([hidden]) { width:auto; flex:0 1 auto; max-width:100%; }
body .panel-header .panel-actions > label { min-width:0; }
body .panel-header :is(button,summary) { white-space:normal; }
body .form-grid :is(input,select,textarea), body .panel-actions :is(input,select) { min-width:0; max-width:100%; }
body .modal-actions { gap:8px; }
body .modal-actions > button { white-space:normal; }
body .view :is(input,select,textarea,button,summary,h2,h3), body .view [tabindex] { scroll-margin-top:calc(var(--workspace-content-top,180px) + 12px); }
body .menu-publishing-preview-shell { max-height:calc(100dvh - var(--workspace-content-top,180px) - 12px); overflow:auto; overscroll-behavior-y:auto; }
body .menu-publishing-preview-head { align-items:center; flex-wrap:wrap; gap:8px; line-height:1.4; }
body .menu-publishing-preview-head > span { flex:1 1 auto; }
body #menuPublishing .mp-item-more > div { background:var(--paper); color:var(--ink); border-color:var(--line); }
body #menuPublishing .mp-section-editor:has(.mp-item-more[open]) { overflow:visible; position:relative; z-index:30; }
body #menuPublishing .mp-item-summary > * { min-width:0; }
body #menuPublishing .mp-item-summary { align-items:end; }
body #menuPublishing .mp-item-summary input { width:100%; }
body #menuPublishing .mp-item-summary input[type="checkbox"] { width:auto; }
body #invoice .shared-invoice-status { color:var(--ink); line-height:1.4; }
body #invoiceArchivePanel .invoice-history-table td.row-actions { display:table-cell; text-align:right; vertical-align:middle; }
body #invoiceArchivePanel .invoice-history-table td.row-actions > * { display:inline-flex; vertical-align:middle; margin:2px; }
body[data-active-view="salesIntelligence"] .main > .topbar { display:none !important; }

/* Action menus use a measured viewport position; scroll their contents if needed. */
body details[open] > .workspace-action-popover {
  position:fixed !important; right:auto !important; bottom:auto !important; margin:0 !important;
  box-sizing:border-box; min-width:0 !important; max-width:calc(100vw - 24px) !important;
  overflow:auto !important; overscroll-behavior:contain; z-index:1100 !important;
  background:var(--paper) !important; color:var(--ink); border:1px solid var(--line);
}
body .workspace-action-popover > :is(button,a) { white-space:normal; overflow-wrap:anywhere; min-height:36px; }

@media (max-width:1100px) {
  body .menu-publishing-preview-shell { position:static; max-height:none; }
  body .panel-header .panel-actions { justify-content:flex-start; }
}
@media (max-width:760px) {
  /* Workspace choices remain visible, including the last tab. */
  body .persistent-workspace-tabs, body .operations-section-tabs { position:static !important; flex-wrap:wrap !important; overflow:visible; gap:4px; }
  body .persistent-workspace-tabs > *, body .operations-section-tabs > * { max-width:100%; }
  body .persistent-workspace-tabs .section-overview-tab, body .operations-section-tabs > button { min-height:40px !important; white-space:normal; }
  body .operations-section-tabs .operations-staff-link { margin-left:0; border-left:0; }
  body .ordering-space-tabs { grid-template-columns:repeat(2,minmax(0,1fr)); }
  body .ordering-space-tab { min-width:0; width:auto; white-space:normal; }
  body .sidebar .shell-actions { gap:6px !important; }
  body .sidebar .shell-actions > button { flex:1 1 auto !important; padding-inline:8px !important; }
  body .panel-header { align-items:flex-start; padding:12px !important; gap:10px; }
  body .panel-header > .panel-actions { width:100%; display:flex !important; gap:8px !important; }
  body .panel-header .panel-actions > :is(button,details):not([hidden]) { flex:1 1 auto; width:auto !important; min-height:40px; }
  body .panel-header .panel-actions > details > summary { min-height:40px; display:flex; align-items:center; justify-content:center; box-sizing:border-box; }
  body .view :is(input,select,textarea,button,summary,h2,h3), body .view [tabindex] { scroll-margin-top:16px; }
  body #vendorPricing .metrics-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
  body .recipe-row-main small { white-space:normal; overflow-wrap:anywhere; text-overflow:clip; line-height:1.5; }
  body .recipe-row-main strong { white-space:normal; overflow-wrap:anywhere; }
  body .recipe-row-actions { align-self:start; }
  body #invoiceArchivePanel .invoice-history-table td.row-actions { display:flex; flex-wrap:wrap; justify-content:flex-end; }
  body #invoiceArchivePanel .invoice-history-table td.row-actions > * { margin:0; }
}
@media (max-width:600px) {
  /* Same invoice list and actions, arranged to fit without a covering status column. */
  body #invoice .shared-invoice-table-wrap { overflow:visible; }
  body #invoice .shared-invoice-table, body #invoice .shared-invoice-table tbody { display:block; min-width:0; width:100%; }
  body #invoice .shared-invoice-table thead { position:absolute; width:1px; height:1px; clip-path:inset(50%); overflow:hidden; }
  body #invoice .shared-invoice-table tbody tr { display:grid; grid-template-columns:28px minmax(0,1fr) minmax(0,1fr); gap:6px 8px; padding:12px 6px; border-top:1px solid var(--line); }
  body #invoice .shared-invoice-table tbody td { display:block; border:0; padding:0; min-width:0; width:auto; background:transparent !important; }
  body #invoice .shared-invoice-table td:first-child { grid-column:1; grid-row:1 / 5; padding-top:4px; }
  body #invoice .shared-invoice-table td:nth-child(2) { grid-column:2 / 4; grid-row:1; }
  body #invoice .shared-invoice-table td:nth-child(3) { grid-column:2; grid-row:2; }
  body #invoice .shared-invoice-table td:nth-child(3)::before { content:"# "; color:var(--muted); }
  body #invoice .shared-invoice-table td:nth-child(4) { grid-column:2; grid-row:3; color:var(--muted); }
  body #invoice .shared-invoice-table td:nth-child(5) { grid-column:3; grid-row:2; font-weight:700; }
  body #invoice .shared-invoice-table td:nth-child(6) { grid-column:2 / 4; grid-row:4; }
  body #invoice .shared-invoice-table td:nth-child(7) { grid-column:3; grid-row:3; display:flex; align-items:center; justify-content:flex-end; gap:4px; }
  body #invoice .shared-invoice-table td[colspan] { grid-column:1 / -1; grid-row:auto; }
  body #invoice .shared-invoice-context-trigger { min-width:30px; min-height:30px; }
  body #invoice .shared-invoice-name { min-height:24px; white-space:normal; overflow-wrap:anywhere; }
  body #invoice .shared-invoice-table .shared-invoice-status { font-size:12px; text-align:right; }
  body #invoice .shared-invoice-selection-actions .button-row { width:100%; }
  body #invoice .shared-invoice-selection-actions .button-row > :is(button,details) { flex:1 1 auto; }
  body #menuPublishing .mp-item-summary { grid-template-columns:minmax(0,1fr) 76px; }
  body #menuPublishing .mp-item-states { grid-column:1 / -1; grid-row:2; }
  body #menuPublishing .mp-item-actions { grid-column:1 / -1; grid-row:3; justify-content:flex-end; }
  body #menuPublishing .mp-item-states label { white-space:normal; }
  body #menuPublishing .mp-item-actions :is(button,summary) { min-width:36px; min-height:36px; }
  body #menuPublishing .mp-item-editor { padding-block:12px; }
}

/* Reports must constrain wide tables without widening their headings or cards. */
body .sales-report-details, body .settings-collapsible-content,
body .sales-report-insights { min-width:0; grid-template-columns:minmax(0,1fr); }
body .sales-report-details > summary, body .sales-report-details > div { min-width:0; max-width:100%; }
body .sales-report-details .table-wrap { min-width:0; max-width:100%; overflow-x:auto; }
body .sales-summary-value { display:grid; justify-content:stretch; gap:5px; }
body .sales-summary-value .mtd-comparison { justify-items:start; }
body .mtd-comparison .comparison-main { flex-wrap:wrap; white-space:normal; }
body .mtd-comparison .comparison-basis { white-space:normal; }
body .time-off-card > :is(strong,small) { display:block; }
body .time-off-card > small { margin-top:6px; line-height:1.5; }
body .recipe-viewer-modal.is-editing #recipeEditorPanel > .panel-header h2 { display:none; }
body .recipe-viewer-modal.is-editing #recipeEditorPanel > .panel-header { background:transparent !important; justify-content:flex-end; padding:0 0 10px !important; border:0; }
body .recipe-viewer-modal.is-editing #recipeEditorPanel > .panel-header .panel-actions { width:auto; }
body .recipe-viewer-modal.is-editing .modal-actions { display:flex !important; }
body .recipe-viewer-modal.is-editing .modal-actions > button:not([hidden]) { width:auto !important; min-width:0; flex:1 1 100px; }
body .recipe-viewer-modal.is-editing .modal-actions #recipeCloseSaveStatus { flex-basis:100%; }
@media(max-width:760px) {
  body .sales-import-summary, body .vendor-price-summary-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
  body .sales-import-summary article { align-content:start; padding:12px; }
  body .recipe-card.recipe-list-row { align-items:start; }
  body .recipe-row-actions { flex-direction:column; align-items:stretch; }
  body .recipe-row-actions > button { min-height:36px; }
}
@media(max-width:760px) {
  body #menus .menu-card { display:grid; grid-template-columns:40px minmax(0,1fr); align-items:center; gap:10px; text-align:left; }
  body #menus .menu-card-photo { width:40px; height:40px; min-height:40px; }
  body #menus .menu-card-body { min-width:0; }
  body #menus #menuList { max-height:45dvh; overflow-y:auto; overscroll-behavior-x:contain; overscroll-behavior-y:auto; }
}
body .workflow-focus-strip small { white-space:normal; overflow-wrap:anywhere; text-overflow:clip; line-height:1.4; }
body .workflow-focus-strip button > span { min-width:0; max-width:100%; }
@media(min-width:761px) and (max-width:1000px) {
  body .workflow-focus-strip:has(> button:nth-child(4)) { grid-template-columns:repeat(2,minmax(0,1fr)); }
}
body .section-overview-grid > .panel,
body .ordering-command-panel,
body #stationPrepSheets.view.is-visible { grid-template-columns:minmax(0,1fr); }
body #stationPrepSheets > * { min-width:0; max-width:100%; }
body .station-prep-toolbar > *, body .section-overview-row > * { min-width:0; }
body .station-prep-toolbar p { white-space:normal; }
@media(max-width:760px) {
  body .ordering-space-tabs { display:grid !important; grid-template-columns:repeat(2,minmax(0,1fr)) !important; width:100%; min-width:0; overflow:visible !important; }
  body .ordering-space-tabs > button { min-width:0 !important; width:auto !important; flex:none !important; }
  body .station-prep-tabs { flex-wrap:wrap; width:100%; min-width:0; }
}

@media screen {
  body #mpPrintModal .mp-print-pages,
  body #mpCheatSheetModal .mp-cheat-preview-stage { grid-template-columns:minmax(0,1fr); min-width:0; width:100%; justify-items:center; }
  body #mpPrintModal .mp-print-page,
  body #mpCheatSheetModal .mp-print-page { zoom:var(--workspace-print-scale,0.9576470588); }
}
@media(max-width:760px) {
  body .ordering-space-tab > span { white-space:normal; overflow:visible; text-overflow:clip; }
}

/* Overview links are content rows, not primary-navigation tabs. */
body .section-overview-list { min-width:0; grid-template-columns:minmax(0,1fr); }
body .section-overview-row.tab { display:grid !important; grid-template-columns:minmax(0,1fr) auto; min-width:0 !important; max-width:100%; text-align:left !important; white-space:normal; }
body .section-overview-row.tab :is(strong,small) { white-space:normal; overflow-wrap:anywhere; }

/* Keep the compact account control from being squeezed by older shell rules. */
@media(min-width:370px) and (max-width:760px) {
  body .sidebar .shell-actions { flex-wrap:nowrap !important; gap:4px !important; }
  body .sidebar .shell-actions > button { flex:0 0 auto !important; width:auto !important; }
  body .sidebar .shell-actions > .shell-account-menu { flex:0 0 auto !important; min-width:70px !important; width:auto !important; }
  body .sidebar .shell-account-menu > summary { width:auto !important; white-space:nowrap; overflow:visible; }
}

/* Kitchen rail: compact daily navigation with the full Larder one click away. */
@media (min-width:761px) {
  body .app-shell { display:block !important; min-height:100dvh; }
  body .sidebar {
    position:fixed !important; inset:0 auto 0 0 !important; z-index:1000 !important;
    display:flex !important; flex-direction:column !important; align-items:center !important;
    width:72px !important; height:100dvh !important; min-height:0 !important;
    padding:14px 8px !important; gap:10px !important; box-sizing:border-box !important;
    border:0 !important; border-right:1px solid var(--line) !important;
    background:color-mix(in srgb,var(--paper) 96%,var(--wash)) !important;
    box-shadow:3px 0 16px color-mix(in srgb,var(--ink) 5%,transparent) !important;
  }
  body .main { width:auto !important; min-width:0 !important; margin-left:72px !important; }
  body .sidebar .brand { display:block !important; margin:0 0 8px !important; padding:0 !important; }
  body .sidebar .brand > div:last-child { display:none !important; }
  body .sidebar .brand-mark { display:grid !important; place-items:center !important; width:44px !important; height:44px !important; min-width:44px !important; border-radius:12px !important; }
  body .sidebar .simple-tabs {
    display:flex !important; flex:1 1 auto !important; flex-direction:column !important; align-items:center !important;
    width:100% !important; min-height:0 !important; margin:0 !important; padding:0 !important;
    gap:5px !important; overflow:visible !important; position:static !important;
  }
  body .sidebar .simple-tabs > .tab,
  body .sidebar .more-workspaces > .nav-menu-toggle {
    position:relative !important; display:flex !important; flex:0 0 auto !important;
    align-items:center !important; justify-content:center !important;
    width:48px !important; height:48px !important; min-width:48px !important; min-height:48px !important;
    padding:0 !important; border:1px solid transparent !important; border-radius:12px !important;
    color:var(--muted) !important; background:transparent !important; box-shadow:none !important;
  }
  body .sidebar .simple-tabs > .tab:hover,
  body .sidebar .simple-tabs > .tab:focus-visible,
  body .sidebar .more-workspaces > .nav-menu-toggle:hover,
  body .sidebar .more-workspaces > .nav-menu-toggle:focus-visible { color:var(--ink) !important; background:var(--wash) !important; }
  body .sidebar .simple-tabs > .tab.is-active,
  body .sidebar .more-workspaces.is-active > .nav-menu-toggle {
    color:var(--sage-selected-ink) !important; background:var(--sage-selected) !important;
    border-color:color-mix(in srgb,var(--accent) 24%,var(--line)) !important;
    box-shadow:inset 3px 0 0 var(--accent) !important;
  }
  body .sidebar .rail-icon { display:block; font-family:ui-monospace,SFMono-Regular,Menlo,monospace; font-size:21px; line-height:1; font-weight:700; }
  body .sidebar .nav-label { position:absolute !important; width:1px; height:1px; padding:0; margin:-1px; overflow:hidden; clip:rect(0,0,0,0); white-space:nowrap; border:0; }
  body .sidebar [data-rail-label]::after {
    content:attr(data-rail-label); position:absolute; left:calc(100% + 10px); top:50%; transform:translateY(-50%);
    display:none; width:max-content; max-width:180px; padding:7px 9px; border-radius:7px;
    color:var(--paper); background:var(--ink); font-size:12px; font-weight:650; line-height:1; letter-spacing:0;
    box-shadow:0 5px 16px #0002; pointer-events:none; z-index:1200;
  }
  body .sidebar [data-rail-label]:is(:hover,:focus-visible)::after { display:block; }
  body .sidebar .rail-divider { width:34px; height:1px; margin:5px 0; background:var(--line); }
  body .sidebar .more-workspaces { position:static !important; margin-top:auto !important; }
  body .sidebar .more-workspaces[open] > #moreWorkspaces {
    position:fixed !important; left:84px !important; right:auto !important; top:auto !important; bottom:16px !important;
    transform:none !important; display:grid !important; grid-template-columns:repeat(4,minmax(150px,1fr)) !important;
    width:min(860px,calc(100vw - 110px)) !important; max-width:calc(100vw - 110px) !important;
    max-height:calc(100dvh - 32px) !important; overflow:auto !important; gap:18px 28px !important;
    padding:22px !important; border:1px solid var(--line) !important; border-radius:16px !important;
    background:var(--paper) !important; box-shadow:0 24px 70px #1723212b !important;
  }
  body .sidebar .workspace-launcher-heading { grid-column:1 / -1; display:grid; gap:4px; padding:0 4px 12px; border-bottom:1px solid var(--line); }
  body .sidebar .workspace-launcher-heading strong { font-family:var(--serif); font-size:26px; line-height:1.1; }
  body .sidebar .workspace-launcher-heading small { color:var(--muted); font-size:13px; }
  body .sidebar .shell-actions {
    position:fixed !important; top:16px !important; right:24px !important; z-index:1001 !important;
    display:flex !important; width:auto !important; margin:0 !important; padding:0 !important; gap:7px !important;
  }
  body .sidebar .shell-actions > button { min-height:38px !important; padding:7px 12px !important; font-size:12px !important; }
  body .main > .topbar .workbar { padding-right:220px; }
  body .sidebar .rail-account { position:relative; flex:0 0 auto; margin-top:1px; }
  body .sidebar .rail-account > summary {
    position:relative; display:grid; place-items:center; width:48px; height:48px; padding:0; box-sizing:border-box;
    border:1px solid transparent; border-radius:12px; list-style:none; cursor:pointer;
  }
  body .sidebar .rail-account > summary::-webkit-details-marker { display:none; }
  body .sidebar .rail-account > summary:hover { background:var(--wash); }
  body .sidebar .rail-account-avatar { display:grid; place-items:center; width:30px; height:30px; border-radius:50%; color:var(--paper); background:var(--ink); font-size:10px; font-weight:800; letter-spacing:.04em; }
  body .sidebar .rail-account > div { left:calc(100% + 10px); right:auto; top:auto; bottom:0; min-width:160px; border-radius:10px; box-shadow:0 12px 36px #17232126; }
}

@media (max-width:760px) {
  body .app-shell { display:block !important; padding-bottom:76px; }
  body .sidebar {
    position:fixed !important; inset:auto 0 0 0 !important; z-index:1000 !important;
    display:flex !important; flex-direction:row !important; align-items:center !important; width:100% !important; height:72px !important;
    padding:7px max(8px,env(safe-area-inset-right)) max(7px,env(safe-area-inset-bottom)) max(8px,env(safe-area-inset-left)) !important;
    border:0 !important; border-top:1px solid var(--line) !important; background:var(--paper) !important;
    box-shadow:0 -4px 18px color-mix(in srgb,var(--ink) 8%,transparent) !important;
  }
  body .sidebar .brand, body .sidebar .rail-divider, body .sidebar .rail-secondary { display:none !important; }
  body .sidebar .simple-tabs { display:grid !important; flex:1 1 auto !important; grid-template-columns:repeat(5,minmax(0,1fr)) !important; align-items:stretch !important; width:auto !important; min-width:0 !important; height:100% !important; gap:2px !important; margin:0 !important; padding:0 !important; overflow:visible !important; }
  body .sidebar .simple-tabs > .tab,
  body .sidebar .more-workspaces > .nav-menu-toggle {
    display:flex !important; flex-direction:column !important; align-items:center !important; justify-content:center !important;
    width:100% !important; min-width:0 !important; min-height:56px !important; padding:4px 2px !important; gap:4px !important;
    border:0 !important; border-radius:9px !important; color:var(--muted) !important; background:transparent !important; box-shadow:none !important;
  }
  body .sidebar .simple-tabs > .rail-secondary { display:none !important; }
  body .sidebar .simple-tabs > .tab.is-active,
  body .sidebar .more-workspaces.is-active > .nav-menu-toggle { color:var(--sage-selected-ink) !important; background:var(--sage-selected) !important; box-shadow:inset 0 -2px 0 var(--accent) !important; }
  body .sidebar .rail-icon { font-family:ui-monospace,SFMono-Regular,Menlo,monospace; font-size:19px; line-height:1; font-weight:700; }
  body .sidebar .nav-label { display:block !important; position:static !important; width:auto; height:auto; margin:0; overflow:visible; clip:auto; font-size:10px; line-height:1; font-weight:700; }
  body .sidebar .more-workspaces { position:static !important; margin:0 !important; }
  body .sidebar .more-workspaces[open] > #moreWorkspaces {
    position:fixed !important; inset:auto 10px 82px 10px !important; transform:none !important;
    display:grid !important; grid-template-columns:repeat(2,minmax(0,1fr)) !important;
    width:auto !important; max-width:none !important; max-height:calc(100dvh - 104px) !important;
    overflow:auto !important; gap:12px !important; padding:16px !important; border-radius:14px !important;
    background:var(--paper) !important; box-shadow:0 20px 60px #17232140 !important;
  }
  body .sidebar .workspace-launcher-heading { grid-column:1 / -1; display:grid; gap:3px; padding-bottom:10px; border-bottom:1px solid var(--line); }
  body .sidebar .workspace-launcher-heading strong { font-family:var(--serif); font-size:23px; }
  body .sidebar .workspace-launcher-heading small { color:var(--muted); }
  body .sidebar .rail-account { display:block !important; flex:0 0 48px; position:relative; margin:0; }
  body .sidebar .rail-account > summary { display:flex; flex-direction:column; align-items:center; justify-content:center; width:48px; height:56px; padding:4px 2px; gap:4px; box-sizing:border-box; border:0; border-radius:9px; list-style:none; cursor:pointer; }
  body .sidebar .rail-account > summary::-webkit-details-marker { display:none; }
  body .sidebar .rail-account-avatar { display:grid; place-items:center; width:22px; height:22px; border-radius:50%; color:var(--paper); background:var(--ink); font-size:8px; }
  body .sidebar .rail-account > div { position:fixed; left:auto; right:8px; top:auto; bottom:82px; min-width:160px; }
  body .sidebar .shell-actions {
    position:fixed !important; top:8px !important; right:10px !important; z-index:1001 !important;
    display:flex !important; width:auto !important; padding:0 !important; margin:0 !important; gap:5px !important;
  }
  body .sidebar .shell-actions > button { flex:0 0 auto !important; width:auto !important; min-height:36px !important; padding:6px 9px !important; font-size:11px !important; }
  body .main > .topbar { padding-top:50px !important; }
}
