/* Kitcherette shared UI primitives. Single visual source of truth for shared shell components. */
:root{
  --kitcherette-third-subheader-height:46px;
  /* v389: one geometry owner for fixed bottom chrome. */
  --app-content-end-gap:10px;
  --app-bottom-chrome-height:var(--app-bottom-nav-height);
  --kitcherette-bottom-header-bg:var(--surface);
  --kitcherette-bottom-header-border:var(--border);
  --kitcherette-bottom-control-h:32px;
  --kitcherette-bottom-control-radius:10px;
  --kitcherette-bottom-control-bg:rgba(255,253,248,.78);
  --kitcherette-shell-gap:6px;
}
body.dark-mode{--kitcherette-bottom-control-bg:rgba(29,37,33,.80)}

/* ---------- top header ---------- */
header.topbar{
  display:flex;align-items:center;justify-content:flex-end;gap:var(--kitcherette-shell-gap);position:sticky;padding-right:64px;
}
header.topbar>.kitcherette-header-export-slot{
  display:flex;align-items:center;gap:var(--kitcherette-shell-gap);min-width:0;flex:0 0 auto;
  position:absolute;top:50%;right:58px;transform:translateY(-50%);margin:0;
}
header.topbar>.kitcherette-header-export-slot:empty{display:none}
header.topbar>.kitcherette-header-export-slot button{width:38px;min-width:38px;height:40px;min-height:40px;padding:0;border-radius:12px;display:grid;place-items:center}
header.topbar>#mascot-menu-button.kitcherette-right-menu-button{
  display:inline-grid;place-items:center;flex:0 0 42px;width:42px;min-width:42px;max-width:42px;height:42px;padding:0;
  position:absolute;top:50%;right:10px;transform:translateY(-50%);margin:0!important;
  border-radius:13px;background:rgba(250,248,242,.68);border:1px solid rgba(255,255,255,.42);box-shadow:0 4px 14px rgba(23,31,27,.08);
  backdrop-filter:blur(8px);-webkit-backdrop-filter:blur(8px);font-size:1.22rem;line-height:1;
}
header.topbar>#mascot-menu-button.kitcherette-right-menu-button:active{transform:translateY(-50%) scale(.97)}
body.dark-mode header.topbar>#mascot-menu-button.kitcherette-right-menu-button{background:rgba(31,37,34,.66);border-color:rgba(255,255,255,.12)}
#settings-header-mascot,.topbar-mascot svg,#kitcherette-header-mascot{display:none!important}
#side-menu,#side-menu-overlay{display:none!important;pointer-events:none!important;visibility:hidden!important}

/* ---------- unified bottom chrome ---------- */
#app-bottom-chrome{
  position:fixed;left:0;right:0;bottom:0;z-index:120;
  display:flex;flex-direction:column;width:100%;
  padding-bottom:env(safe-area-inset-bottom);
  transition:transform .46s cubic-bezier(.22,.72,.18,1),opacity .34s ease;
  transform:translate3d(0,0,0);will-change:transform,opacity;
  pointer-events:none;
}
#app-bottom-chrome>#app-primary-nav,
#app-bottom-chrome>#app-context-nav,
#app-bottom-chrome>.kitcherette-third-subheader{
  position:relative!important;inset:auto!important;bottom:auto!important;left:auto!important;right:auto!important;
  transform:none!important;z-index:auto!important;box-sizing:border-box;
  flex:0 0 auto;pointer-events:auto;color:var(--text);
}
#app-bottom-chrome>#app-primary-nav,
#app-bottom-chrome>#app-context-nav{background:var(--kitcherette-bottom-header-bg)}
body.app-chrome-hidden #app-bottom-chrome{
  transform:translate3d(0,calc(100% + 16px),0);
  opacity:.04;pointer-events:none;
}
body.app-chrome-hidden #app-bottom-chrome>*{pointer-events:none}
body.kitcherette-setup-active #app-bottom-chrome{display:none!important}

/* ---------- third bottom subheader ---------- */
.kitcherette-third-subheader{
  width:100%;max-width:800px;margin:0 auto;min-height:var(--kitcherette-third-subheader-height);padding:7px 8px;display:grid;grid-template-columns:minmax(0,1fr) auto;
  align-items:center;gap:var(--kitcherette-shell-gap);background:rgba(246,245,240,.72);border:1px solid rgba(255,255,255,.42);border-bottom:0;border-radius:16px 16px 0 0;
  box-shadow:0 -4px 18px rgba(30,42,35,.07);backdrop-filter:blur(8px);-webkit-backdrop-filter:blur(8px);transition:opacity .18s ease;
}
.kitcherette-third-subheader[hidden]{display:none}
body.dark-mode .kitcherette-third-subheader{background:rgba(29,37,33,.74);border-color:rgba(255,255,255,.11)}
.kitcherette-third-search-slot,.kitcherette-third-action-slot{min-width:0}
.kitcherette-third-search-slot,.kitcherette-third-search-wrap,.kitcherette-third-subheader .persistent-name-filter,.kitcherette-third-subheader .compact-name-filter-wrap{width:100%;height:var(--kitcherette-bottom-control-h);margin:0;padding:0;border:0;background:transparent;box-shadow:none}
.kitcherette-third-subheader :is(input[type="search"],input[type="text"],.compact-name-filter){
  display:block;width:100%;height:var(--kitcherette-bottom-control-h);min-height:var(--kitcherette-bottom-control-h);max-height:var(--kitcherette-bottom-control-h);margin:0;padding:0 12px;
  border-radius:var(--kitcherette-bottom-control-radius);border:1px solid var(--kitcherette-bottom-header-border);background:var(--kitcherette-bottom-control-bg);color:var(--text);
  font:inherit;font-size:.75rem;font-weight:500;line-height:30px;box-shadow:0 4px 14px rgba(30,42,35,.06);box-sizing:border-box;appearance:none;-webkit-appearance:none;
}
.kitcherette-third-subheader :is(input[type="search"],input[type="text"],.compact-name-filter):focus{outline:none;border-color:var(--accent,var(--kitcherette-accent,#6d8878));box-shadow:0 0 0 2px color-mix(in srgb,var(--accent,var(--kitcherette-accent,#6d8878)) 16%,transparent),0 4px 14px rgba(30,42,35,.06)}
.kitcherette-third-action-slot{display:flex;align-items:center;justify-content:flex-end}
.kitcherette-third-subheader :is(.kitcherette-third-action,.kitcherette-third-action-slot button,.kitcherette-third-menu-tab,.kitcherette-third-menu-new){
  height:var(--kitcherette-bottom-control-h);min-height:var(--kitcherette-bottom-control-h);max-height:var(--kitcherette-bottom-control-h);margin:0;padding:0 11px;border-radius:var(--kitcherette-bottom-control-radius);
  border:1px solid var(--kitcherette-bottom-header-border);background:var(--kitcherette-bottom-control-bg);color:var(--text);font:inherit;font-size:.75rem;font-weight:700;line-height:30px;
  box-shadow:0 4px 14px rgba(30,42,35,.06);white-space:nowrap;
}
.kitcherette-third-menu-scroller{display:flex;align-items:center;gap:7px;width:100%;overflow-x:auto;overflow-y:hidden;scrollbar-width:none}
.kitcherette-third-menu-scroller::-webkit-scrollbar{display:none}
.kitcherette-third-menu-tab,.kitcherette-third-menu-new{flex:0 0 auto}
.kitcherette-third-menu-tab.active{background:var(--accent,var(--kitcherette-accent,#6d8878));border-color:var(--accent,var(--kitcherette-accent,#6d8878));color:#fff}
.kitcherette-third-menu-new{width:32px;min-width:32px;padding:0;font-size:1rem}
/* Unified layout geometry.
   The wrapper's real rendered height is measured once for content clearance.
   Child bars never position themselves relative to each other. */
body{
  --app-page-bottom:var(--app-bottom-chrome-height);
}
main{
  padding-bottom:calc(var(--app-bottom-chrome-height) + var(--app-content-end-gap))!important;
}

/* Ordinary shared-shell pages own content only; screen clearance belongs to main. */
#view-recipes:not(.recipe-editing),
#view-current-stock:not(.inventory-editing),
#view-expected-orders,
#view-stock-orders,
#view-service{
  padding-bottom:0!important;
}
#view-recipes:not(.recipe-editing) #menu-editor,
#view-recipes:not(.recipe-editing) #editor-drink-list,
#view-current-stock:not(.inventory-editing) #current-stock-list,
#view-expected-orders #expected-orders-list,
#view-stock-orders #purchase-requirements-summary,
#view-service #drink-list{
  padding-bottom:0!important;
}

/* Generic Ingredients still has a real page-local floating create action.
   Its list reserves that physical overlay once; the page itself does not. */
#view-generic-ingredients{padding-bottom:0!important}
#view-generic-ingredients #generic-ingredient-list{padding-bottom:var(--floating-action-clearance,76px)!important}

/* Retired tab-specific third bars and source toolbars. */
#view-current-stock:not(.inventory-editing) #pantry-fast-toolbar,
#view-current-stock:not(.inventory-editing) .inventory-toolbar .category-manager-launch[data-category-scope="pantry"],
#view-current-stock:not(.inventory-editing) [data-pantry-advanced],
#view-current-stock:not(.inventory-editing) #pantry-advanced-panel,
.kitcherette-source-control-hidden{display:none!important}

/* ---------- list shell + category grid ---------- */
#view-recipes:not(.recipe-editing) .recipe-topbar .sort-control,
#view-generic-ingredients:not(.generic-ingredient-editing) .sort-control{display:none!important}
.kitcherette-list-category-grid{display:block;position:relative;order:-1;width:100%;height:auto;min-height:0;margin:0 0 12px;padding:0;overflow:visible;clear:both}


/* ---------- Menu surface ---------- */
#view-expected-orders .rest-menu-selected-row,#view-expected-orders .rest-menu-tabs,#view-expected-orders .rest-menu-level-actions,#view-expected-orders [data-menu-setup-mise],#view-expected-orders [data-menu-start-preparation]{display:none!important}
#view-expected-orders #restaurant-menu-shell{padding:12px;margin:8px 0 18px}
#view-expected-orders #restaurant-menu-shell .rest-menu-top,#view-expected-orders #restaurant-menu-shell .rest-menu-body{background:transparent}
#view-expected-orders .rest-menu-top.rest-menu-tools-only{display:flex;justify-content:flex-end;margin:0 0 8px;padding:0;background:transparent;border:0;box-shadow:none}

/* ---------- Work placeholder ---------- */
.work-coming-soon{min-height:calc(100dvh - 190px);display:grid;place-items:center;padding:24px 16px 120px}
.work-coming-soon-card{width:min(100%,520px);padding:28px 24px;text-align:center;border-radius:24px;background:var(--kitcherette-passive,rgba(248,247,242,.58));border:1px solid var(--kitcherette-line,rgba(47,64,54,.10));box-shadow:var(--kitcherette-shadow-soft,0 10px 28px rgba(30,42,35,.08));backdrop-filter:blur(10px);-webkit-backdrop-filter:blur(10px)}
.work-coming-soon-icon{display:block;font-size:2rem;margin-bottom:10px}.work-coming-soon-card h2{margin:5px 0 8px}.work-coming-soon-card p{margin:0;opacity:.72;line-height:1.5}
body.dark-mode .work-coming-soon-card{background:rgba(45,52,47,.62);border-color:rgba(238,236,225,.10)}

@media(max-width:620px){.kitcherette-third-subheader{padding:7px 8px}.kitcherette-third-subheader :is(.kitcherette-third-action,.kitcherette-third-action-slot button,.kitcherette-third-menu-tab){font-size:.75rem}}
@media(prefers-reduced-motion:reduce){#app-bottom-chrome,.kitcherette-third-subheader{transition:none}}

@media(max-width:620px){
  html body header.topbar{padding-right:60px!important}
  html body header.topbar>.kitcherette-header-export-slot{right:55px!important}
  html body header.topbar>#mascot-menu-button.kitcherette-right-menu-button{right:8px!important;margin:0!important}
}

/* Export controls are revealed only after the active view is resolved. */
header.topbar>.kitcherette-header-export-slot[data-active="false"]{display:none!important}
header.topbar>.kitcherette-header-export-slot [hidden]{display:none!important}


/* v395 category tiles: v390 styling with a fixed 5-column shared grid for every
   categorical list surface. Icons are inline SVG and inherit currentColor. */
.kitcherette-category-tiles>.category-grid{
  display:grid!important;
  grid-template-columns:repeat(4,minmax(0,1fr))!important;
  grid-auto-rows:auto!important;
  gap:8px!important;
  align-items:start!important;
}
.kitcherette-category-tiles .category-grid-item{
  width:100%!important;
  height:auto!important;
  min-height:0!important;
  max-height:none!important;
  aspect-ratio:1 / 1!important;
  padding:10px 8px!important;
  gap:7px!important;
  border-radius:16px!important;
  background:rgba(250,248,242,.74)!important;
  border:1px solid rgba(255,255,255,.48)!important;
  color:var(--ink)!important;
  box-shadow:0 3px 12px rgba(19,30,25,.07)!important;
  -webkit-backdrop-filter:blur(7px)!important;
  backdrop-filter:blur(7px)!important;
}
.kitcherette-category-tiles .category-grid-item:active{transform:scale(.98)!important}
.kitcherette-category-tiles .category-grid-item.active{
  background:color-mix(in srgb,var(--accent,var(--kitcherette-accent,#6d8878)) 16%,rgba(250,248,242,.90))!important;
  border-color:color-mix(in srgb,var(--accent,var(--kitcherette-accent,#6d8878)) 52%,transparent)!important;
  color:var(--ink)!important;
  box-shadow:0 4px 14px rgba(19,30,25,.08),inset 0 0 0 1px color-mix(in srgb,var(--accent,var(--kitcherette-accent,#6d8878)) 12%,transparent)!important;
}
.kitcherette-category-tiles .category-grid-icon{
  display:grid!important;
  place-items:center!important;
  width:30px!important;
  height:30px!important;
  flex:0 0 30px!important;
  color:var(--text-secondary,var(--muted-text,#5f6b66))!important;
  font-size:0!important;
  line-height:0!important;
}
.kitcherette-category-tiles .category-grid-item.active .category-grid-icon{
  color:var(--accent,var(--kitcherette-accent,#6d8878))!important;
}
.kitcherette-category-tiles .category-grid-icon svg{
  display:block!important;
  width:28px!important;
  height:28px!important;
  fill:none!important;
  stroke:currentColor!important;
  stroke-width:1.75!important;
  stroke-linecap:round!important;
  stroke-linejoin:round!important;
  vector-effect:non-scaling-stroke!important;
}
.kitcherette-category-tiles .category-grid-label{
  display:-webkit-box!important;
  max-width:100%!important;
  min-height:2.2em!important;
  overflow:hidden!important;
  -webkit-box-orient:vertical!important;
  -webkit-line-clamp:2!important;
  text-align:center!important;
  overflow-wrap:normal!important;
  word-break:normal!important;
  font-size:.76rem!important;
  font-weight:650!important;
  line-height:1.1!important;
}
body.dark-mode .kitcherette-category-tiles .category-grid-item{
  background:rgba(28,34,31,.76)!important;
  border-color:rgba(255,255,255,.12)!important;
  color:var(--text)!important;
}
body.dark-mode .kitcherette-category-tiles .category-grid-item.active{
  background:color-mix(in srgb,var(--accent,var(--kitcherette-accent,#789584)) 20%,rgba(28,34,31,.90))!important;
  border-color:color-mix(in srgb,var(--accent,var(--kitcherette-accent,#789584)) 60%,transparent)!important;
  color:var(--text)!important;
}
body.dark-mode .kitcherette-category-tiles .category-grid-icon{color:rgba(229,234,230,.72)!important}
body.dark-mode .kitcherette-category-tiles .category-grid-item.active .category-grid-icon{color:var(--accent,var(--kitcherette-accent,#789584))!important}

/* Retire older fixed 48px recipe/pantry category rows. These more specific
   selectors ensure the shared square-tile contract wins over historical CSS. */
html body #view-recipes:not(.recipe-editing) #editor-drink-list>.kitcherette-category-tiles>.category-grid,
html body #view-current-stock:not(.inventory-editing) #current-stock-list>.kitcherette-category-tiles>.category-grid,
html body #view-stock-orders #purchase-requirements-summary>.kitcherette-category-tiles>.category-grid{
  grid-auto-rows:auto!important;
}
html body #view-recipes:not(.recipe-editing) #editor-drink-list>.kitcherette-category-tiles>.category-grid>.category-grid-item,
html body #view-current-stock:not(.inventory-editing) #current-stock-list>.kitcherette-category-tiles>.category-grid>.category-grid-item,
html body #view-stock-orders #purchase-requirements-summary>.kitcherette-category-tiles>.category-grid>.category-grid-item{
  height:auto!important;
  min-height:0!important;
  max-height:none!important;
  aspect-ratio:1 / 1!important;
}

@media(min-width:700px){
  .kitcherette-category-tiles>.category-grid{grid-template-columns:repeat(4,minmax(0,1fr))!important}
}


/* v400 — Android/IME-safe inline Menu editing.
   Fixed bottom chrome is visually withdrawn while typing so it cannot cover
   the reduced visual viewport; document geometry stays unchanged to avoid a jump. */
body.menu-inline-editing #app-bottom-chrome{
  opacity:0!important;
  visibility:hidden!important;
  pointer-events:none!important;
  transition:none!important;
}


/* v405 — Recipe editor uses the shared category-grid presentation owner. */
#view-recipes.recipe-editing.recipe-quick-editing #drink-form.recipe-quick-entry .recipe-category-grid-host>.kitcherette-list-category-grid{
  margin:0!important;padding:0!important;background:transparent!important;border:0!important;box-shadow:none!important;
}
#view-recipes.recipe-editing.recipe-quick-editing #drink-form.recipe-quick-entry .recipe-category-grid-host .category-grid{
  grid-template-columns:repeat(4,minmax(0,1fr))!important;gap:6px!important;
}
#view-recipes.recipe-editing.recipe-quick-editing #drink-form.recipe-quick-entry .recipe-category-grid-host .category-grid-item{
  min-height:68px!important;padding:7px 4px!important;border-radius:12px!important;
}

/* v509 — Android-style long-press reordering: primary + contextual subheader */
#app-primary-nav,#app-primary-nav *,
#app-context-nav,#app-context-nav *{
  -webkit-user-select:none!important;
  user-select:none!important;
  -webkit-touch-callout:none!important;
}
#app-primary-nav [data-nav-module],
#app-context-nav [data-context-module]{
  transition:transform 180ms cubic-bezier(.2,.8,.2,1),filter 160ms ease;
  touch-action:manipulation;
  -webkit-tap-highlight-color:transparent;
}
body.navigation-reordering #app-primary-nav,
body.navigation-reordering #app-context-nav{user-select:none!important;-webkit-user-select:none!important}
body.primary-nav-reordering #app-primary-nav,
body.context-nav-reordering #app-context-nav{touch-action:none!important;cursor:grabbing}
body.primary-nav-reordering #app-primary-nav [data-nav-module],
body.context-nav-reordering #app-context-nav [data-context-module]{touch-action:none!important}
body.primary-nav-reordering #app-primary-nav [data-nav-module].is-nav-dragging,
body.context-nav-reordering #app-context-nav [data-context-module].is-nav-dragging{
  position:relative;
  z-index:20;
  transform:translate3d(var(--nav-drag-x,0),-6px,0) scale(1.08)!important;
  filter:drop-shadow(0 8px 12px rgba(0,0,0,.24));
  transition:filter 120ms ease;
  will-change:transform;
}

/* v510 tertiary tab long-press reorder */
#kitcherette-third-subheader [data-third-module],
#kitcherette-third-subheader [data-third-module] *{
  -webkit-user-select:none!important;user-select:none!important;-webkit-touch-callout:none!important;
}
#kitcherette-third-subheader [data-third-module]{touch-action:manipulation;transition:transform 180ms cubic-bezier(.2,.8,.2,1),filter 160ms ease}
body.third-nav-reordering #kitcherette-third-subheader{touch-action:none!important}
body.third-nav-reordering #kitcherette-third-subheader [data-third-module].is-nav-dragging{
  position:relative;z-index:20;transform:translate3d(var(--nav-drag-x,0),-6px,0) scale(1.08)!important;
  filter:drop-shadow(0 8px 12px rgba(0,0,0,.24));transition:filter 120ms ease;will-change:transform;
}

/* v512 real sortable placeholder */
.kitcherette-nav-drag-placeholder{
  display:block;flex:0 0 auto;box-sizing:border-box;border-radius:12px;
  background:color-mix(in srgb,currentColor 10%,transparent);
  outline:1px dashed color-mix(in srgb,currentColor 28%,transparent);
  pointer-events:none;
}
body.navigation-reordering .is-nav-dragging{
  pointer-events:none!important;touch-action:none!important;
  transform:scale(1.07)!important;
  filter:drop-shadow(0 9px 13px rgba(0,0,0,.28))!important;
}

/* v514 — retain pointer ownership for long-press drag.
   touch-action is decided at pointerdown; setting it only after activation is too late. */
#app-primary-nav [data-nav-module],
#app-context-nav [data-context-module],
#kitcherette-third-subheader [data-third-module]{
  touch-action:none!important;
  overscroll-behavior:contain;
}

/* v518 — Shared / Explore are Recipes top-header destinations, not submenu tabs. */
.recipe-header-source-actions{display:flex;align-items:center;gap:6px;min-width:0}
.recipe-header-source-actions[hidden]{display:none!important}
.recipe-header-source-button{
  min-height:34px;padding:5px 9px;border-radius:10px;border:1px solid color-mix(in srgb,currentColor 18%,transparent);
  background:color-mix(in srgb,var(--surface,#fff) 72%,transparent);font:inherit;font-size:.78rem;white-space:nowrap;
}
.recipe-header-source-button[aria-current="page"]{font-weight:700;background:color-mix(in srgb,currentColor 10%,transparent)}
@media(max-width:520px){.recipe-header-source-button{padding-inline:7px;font-size:.72rem}}

/* v519 — recipe source actions are independent of the conditionally hidden export slot. */
header.topbar>.recipe-header-source-actions{
  position:absolute;top:50%;right:150px;transform:translateY(-50%);
  display:flex;align-items:center;gap:6px;z-index:2;
}
header.topbar>.recipe-header-source-actions .recipe-header-source-button{
  width:auto;min-width:0;height:36px;min-height:36px;padding:5px 9px;display:inline-flex;align-items:center;justify-content:center;
}
@media(max-width:620px){
  header.topbar>.recipe-header-source-actions{right:104px;max-width:calc(100vw - 116px)}
  header.topbar>.recipe-header-source-actions .recipe-header-source-button{font-size:.7rem;padding-inline:6px}
}

/* v523 — shared top-header internal navigation.
   Uses the established Recipes segmented slider for every normal page. */
header.topbar>.app-header-internal-tabs{
  --recipe-source-index:0;--app-header-tab-count:2;
  position:absolute;top:50%;right:150px;transform:translateY(-50%);
  display:grid;grid-template-columns:repeat(var(--app-header-tab-count),minmax(0,1fr));align-items:center;
  width:min(390px,calc(100vw - 230px));height:38px;padding:3px;gap:0;
  border:1px solid color-mix(in srgb,currentColor 14%,transparent);
  border-radius:14px;background:color-mix(in srgb,var(--surface,#fff) 72%,transparent);
  box-shadow:0 2px 10px rgba(0,0,0,.08);overflow:hidden;z-index:2;
  backdrop-filter:blur(12px);-webkit-backdrop-filter:blur(12px);
}
header.topbar>.app-header-internal-tabs[hidden]{display:none!important}
header.topbar>.app-header-internal-tabs .app-header-tab-indicator{
  position:absolute;z-index:0;left:3px;top:3px;bottom:3px;
  width:calc((100% - 6px)/var(--app-header-tab-count));border-radius:11px;
  background:color-mix(in srgb,var(--surface,#fff) 94%,currentColor 6%);
  box-shadow:0 1px 5px rgba(0,0,0,.14);
  transform:translateX(calc(var(--recipe-source-index) * 100%));
  transition:transform 220ms cubic-bezier(.2,.8,.2,1);pointer-events:none;
}
header.topbar>.app-header-internal-tabs .app-header-tab-button{
  position:relative;z-index:1;width:100%;min-width:0;height:32px;min-height:32px;
  padding:0 7px;border:0;border-radius:10px;background:transparent!important;box-shadow:none!important;
  display:flex;align-items:center;justify-content:center;font:inherit;font-size:.74rem;font-weight:500;
  white-space:nowrap;overflow:hidden;text-overflow:ellipsis;opacity:.68;
  transition:opacity 180ms ease,font-weight 180ms ease;
}
header.topbar>.app-header-internal-tabs .app-header-tab-button[aria-selected="true"]{opacity:1;font-weight:700}
@media(max-width:620px){
  header.topbar>.app-header-internal-tabs{right:58px;width:calc(100vw - 70px);max-width:390px}
  header.topbar>.app-header-internal-tabs .app-header-tab-button{font-size:.68rem;padding-inline:4px}
}
@media(prefers-reduced-motion:reduce){header.topbar>.app-header-internal-tabs .app-header-tab-indicator{transition:none}}

/* v526 — Recipes creation control is owned by the shared tertiary subheader.
   The historical recipe footer remains only as a hidden compatibility host. */
#view-recipes .recipe-source-footer.v316-new-recipe-action{display:none!important}
#kitcherette-third-subheader .kitcherette-recipe-new-button{
  min-height:var(--kitcherette-bottom-control-h);
  padding:0 12px;
  border-radius:var(--kitcherette-bottom-control-radius);
  white-space:nowrap;
}

/* v527 — Recipes/Pantry category chooser: translucent bottom overlay.
   Category grids elsewhere retain their existing in-page presentation. */
#view-recipes:not(.recipe-editing) .kitcherette-category-overlay,
#view-current-stock:not(.inventory-editing) .kitcherette-category-overlay,
#view-stock-orders .kitcherette-category-overlay{
  position:fixed!important;
  left:50%!important;
  bottom:calc(var(--app-bottom-chrome-height, 64px) + var(--kitcherette-third-subheader-height,46px) + 8px)!important;
  width:min(760px,calc(100vw - 16px))!important;
  max-height:min(52vh,440px)!important;
  margin:0!important;
  padding:10px!important;
  overflow:auto!important;
  z-index:86!important;
  border:1px solid color-mix(in srgb,currentColor 12%,transparent)!important;
  border-radius:18px!important;
  background:color-mix(in srgb,var(--surface,#fff) 72%,transparent)!important;
  box-shadow:0 -8px 32px rgba(0,0,0,.14)!important;
  backdrop-filter:blur(16px)!important;
  -webkit-backdrop-filter:blur(16px)!important;
  transform:translate(-50%,calc(100% + 32px))!important;
  opacity:0!important;
  visibility:hidden!important;
  pointer-events:none!important;
  transition:transform .24s cubic-bezier(.2,.8,.2,1),opacity .2s ease,visibility 0s linear .24s!important;
}
#view-recipes:not(.recipe-editing) .kitcherette-category-overlay.is-open,
#view-current-stock:not(.inventory-editing) .kitcherette-category-overlay.is-open,
#view-stock-orders .kitcherette-category-overlay.is-open{
  transform:translate(-50%,0)!important;
  opacity:1!important;visibility:visible!important;pointer-events:auto!important;
  transition-delay:0s!important;
}
.kitcherette-category-overlay-toggle{
  position:absolute;
  left:50%;top:-31px;transform:translateX(-50%);
  height:29px;min-height:29px;padding:3px 12px;
  display:flex;align-items:center;gap:5px;
  border:1px solid color-mix(in srgb,currentColor 13%,transparent);
  border-bottom:0;border-radius:12px 12px 0 0;
  background:color-mix(in srgb,var(--surface,#fff) 74%,transparent);
  color:var(--text);font:inherit;font-size:.72rem;font-weight:700;
  box-shadow:0 -3px 12px rgba(0,0,0,.07);
  backdrop-filter:blur(12px);-webkit-backdrop-filter:blur(12px);
  z-index:4;
}
.kitcherette-category-overlay-toggle>span:first-child{transition:transform .2s ease}
.kitcherette-category-overlay-toggle.active>span:first-child{transform:rotate(180deg)}
.kitcherette-category-overlay-toggle[hidden]{display:none!important}
body.dark-mode #view-recipes .kitcherette-category-overlay,
body.dark-mode #view-current-stock .kitcherette-category-overlay,
body.dark-mode #view-stock-orders .kitcherette-category-overlay,
body.dark-mode .kitcherette-category-overlay-toggle{
  background:color-mix(in srgb,var(--surface,#1d2521) 76%,transparent)!important;
}
@media(prefers-reduced-motion:reduce){
 #view-recipes .kitcherette-category-overlay,#view-current-stock .kitcherette-category-overlay,#view-stock-orders .kitcherette-category-overlay{transition:none!important}
}

/* v542 — fresh right-menu workspaces use the established Kitchen shell.
   Content intentionally empty; bottom primary bar remains present but contains no items. */
.workspace-shell-view{min-height:100dvh;background:transparent!important}
.workspace-shell-page{min-height:calc(100dvh - var(--app-bottom-nav-height));background:transparent}
body[data-right-workspace] #app-primary-nav{display:grid!important;grid-template-columns:1fr!important}
body[data-right-workspace] #app-context-nav,
body[data-right-workspace] #kitcherette-third-subheader{display:none!important}

/* v655 Kitchen primary navigation: Recipes, Menu, Preparation, Mise en place, Cook. */
body:not([data-right-workspace]) #app-primary-nav{grid-template-columns:repeat(5,minmax(0,1fr))}
body[data-right-workspace="service"] #app-primary-nav{grid-template-columns:1fr!important}

body[data-right-workspace="pantry"] #app-primary-nav{grid-template-columns:repeat(3,minmax(0,1fr))!important}

body[data-right-workspace="shopping-list"] #app-primary-nav{grid-template-columns:repeat(3,minmax(0,1fr))!important}

/* v545 Service owns its three workflow destinations in the primary bottom header. */
body[data-right-workspace="service"] #app-primary-nav{grid-template-columns:repeat(3,minmax(0,1fr))!important}

/* v655 Bar primary navigation: Recipes, Menu, Preparation, Mise en place, Cook. */
body[data-right-workspace="bar"] #app-primary-nav{grid-template-columns:repeat(5,minmax(0,1fr))!important}

/* Venue management workspace: Overview, Floor, Business, Reports. */
body[data-right-workspace="venue"] #app-primary-nav{grid-template-columns:repeat(4,minmax(0,1fr))!important}
body[data-right-workspace="crew"] #app-primary-nav{grid-template-columns:repeat(3,minmax(0,1fr))!important}

/* v552 Today overlay: page-content layer only.
   The full bottom chrome (tertiary + contextual + primary) remains outside and visible.
   The drawer itself is translucent so the underlying current page visually continues beneath it. */
#today-overlay-backdrop{
  position:fixed;inset:0 0 var(--app-bottom-chrome-height) 0;
  background:rgba(0,0,0,.08);opacity:0;pointer-events:none;
  transition:opacity .2s ease;z-index:1190;
}
#today-overlay-backdrop.open{opacity:1;pointer-events:auto}
#today-overlay-drawer{
  position:fixed;left:0;top:0;bottom:var(--app-bottom-chrome-height);
  width:min(92vw,560px);overflow:auto;overscroll-behavior:contain;
  transform:translateX(-102%);transition:transform .24s ease;
  z-index:1200;
  background:color-mix(in srgb,var(--surface) 72%,transparent);
  -webkit-backdrop-filter:blur(10px);
  backdrop-filter:blur(10px);
  box-shadow:8px 0 30px rgba(0,0,0,.12);
}
#today-overlay-drawer.open{transform:translateX(0)}
#today-overlay-drawer #view-dashboard{
  display:block!important;min-height:100%;height:auto;
  background:transparent!important;
}
#today-overlay-drawer .dashboard-shell,
#today-overlay-drawer #dashboard-content{
  background:transparent!important;
}
body.today-overlay-open #app-bottom-chrome{
  display:flex!important;visibility:visible!important;opacity:1!important;
  transform:translate3d(0,0,0)!important;z-index:1300!important;
}
body.today-overlay-open #app-bottom-chrome>#app-primary-nav,
body.today-overlay-open #app-bottom-chrome>#app-context-nav,
body.today-overlay-open #app-bottom-chrome>#kitcherette-third-subheader{
  display:grid!important;visibility:visible!important;opacity:1!important;
  transform:none!important;pointer-events:auto!important;
}
body.today-overlay-open #app-bottom-chrome>#app-context-nav[hidden],
body.today-overlay-open #app-bottom-chrome>#kitcherette-third-subheader[hidden]{
  display:none!important;
}


/* v569 repair — Bar Recipes is the shared Recipes page, not an empty right-workspace shell.
   Keep Recipes contextual navigation + filter/category subheader available in Bar. */
body[data-right-workspace="bar"]:is([data-kitcherette-page="recipes"],[data-kitcherette-page="recipes-shared"],[data-kitcherette-page="recipes-explore"]) #app-context-nav:not([hidden]),
body[data-right-workspace="bar"] #kitcherette-third-subheader[data-kitcherette-slot-owner="recipes"]:not([hidden]){
  display:grid!important;
}

/* v592 — standalone Pantry and Shopping keep the shared Recipes/Pantry filter subheader. */
body[data-right-workspace="pantry"] #kitcherette-third-subheader:not([hidden]),
body[data-right-workspace="shopping-list"] #kitcherette-third-subheader:not([hidden]){display:grid!important}

/* v650 — Recipes header/category controls: only the active owners remain. */
header.topbar>.kitcherette-header-export-slot[data-active="true"]{display:flex!important;right:58px!important;gap:6px}
header.topbar>.kitcherette-header-export-slot .kitcherette-recipe-header-print{
  width:42px;min-width:42px;height:42px;min-height:42px;margin:0;padding:0;box-sizing:border-box;display:grid;place-items:center;
  border-radius:13px;background:rgba(250,248,242,.68);border:1px solid rgba(255,255,255,.42);color:var(--text);
  box-shadow:0 4px 14px rgba(23,31,27,.08);backdrop-filter:blur(8px);-webkit-backdrop-filter:blur(8px);font-size:1.1rem;line-height:1
}
body.dark-mode header.topbar>.kitcherette-header-export-slot .kitcherette-recipe-header-print{background:rgba(31,37,34,.66);border-color:rgba(255,255,255,.12)}
header.topbar>.kitcherette-header-export-slot .kitcherette-print-icon{width:21px;height:21px;display:block}
header.topbar>.kitcherette-header-export-slot .kitcherette-print-icon svg{width:100%;height:100%;display:block;fill:none;stroke:currentColor;stroke-width:1.9;stroke-linecap:round;stroke-linejoin:round}
.kitcherette-visually-hidden{position:absolute!important;width:1px!important;height:1px!important;padding:0!important;margin:-1px!important;overflow:hidden!important;clip:rect(0,0,0,0)!important;white-space:nowrap!important;border:0!important}

/* Recipe sort/filter selector lives inside the collapsible Categories overlay. */
#view-recipes .kitcherette-category-overlay .kitcherette-recipe-category-sort{
  display:flex;align-items:center;gap:10px;width:100%;height:auto;min-height:42px;margin:0 0 10px;padding:5px 8px 5px 12px;
  border:1px solid color-mix(in srgb,currentColor 12%,transparent);border-radius:12px;background:color-mix(in srgb,var(--surface,#fff) 62%,transparent);
}
#view-recipes .kitcherette-category-overlay .kitcherette-recipe-category-sort>span{display:inline!important;flex:0 0 auto;font-size:.78rem}
#view-recipes .kitcherette-category-overlay .kitcherette-recipe-category-sort #recipe-sort{flex:1;width:100%;max-width:none;height:32px;min-height:32px}

/* v658 — Recipes source filters live inside Categories */
#view-recipes .kitcherette-recipe-source-filters{display:flex;gap:7px;padding:8px 0 10px;overflow-x:auto}
#view-recipes .kitcherette-recipe-source-filters button{appearance:none;border:1px solid var(--border);background:color-mix(in srgb,var(--surface) 72%,transparent);color:var(--text);border-radius:999px;min-height:34px;padding:6px 12px;font:inherit;font-size:.78rem;font-weight:650;white-space:nowrap}
#view-recipes .kitcherette-recipe-source-filters button.active{background:var(--accent);border-color:var(--accent);color:var(--on-accent,#fff)}


/* Today/left drawer overlays the complete app chrome. */
#today-overlay-backdrop{
  inset:0!important;
  z-index:1390!important;
}
#today-overlay-drawer{
  bottom:0!important;
  z-index:1400!important;
}
body.today-overlay-open #app-bottom-chrome{
  z-index:1180!important;
  pointer-events:none!important;
}


/* Pantry follows the canonical Recipes bottom-control hierarchy. */
body[data-kitcherette-page="current-stock"] #kitcherette-third-subheader{
  grid-template-columns:minmax(0,1fr) auto!important;
  grid-template-rows:40px auto!important;
  row-gap:6px!important;
}
#kitcherette-third-subheader>.kitcherette-pantry-category-row-toggle{
  grid-column:1/-1!important;grid-row:1!important;justify-self:stretch!important;
  position:static!important;left:auto!important;top:auto!important;transform:none!important;
  display:flex!important;align-items:center!important;justify-content:center!important;gap:6px!important;
  width:100%!important;min-width:0!important;height:40px!important;min-height:40px!important;
  margin:0!important;padding:0 13px!important;
  border:1px solid var(--kitcherette-bottom-header-border)!important;
  border-radius:12px!important;background:var(--kitcherette-bottom-control-bg)!important;color:var(--text)!important;
  box-shadow:0 4px 14px rgba(30,42,35,.06)!important;white-space:nowrap!important;
  font:inherit!important;font-size:.75rem!important;font-weight:700!important;
}
body[data-kitcherette-page="current-stock"] #kitcherette-third-subheader>.kitcherette-third-search-slot{grid-column:1;grid-row:2}
body[data-kitcherette-page="current-stock"] #kitcherette-third-subheader>.kitcherette-third-action-slot{grid-column:2;grid-row:2}

/* Recipe library controls. The rendered component owns its geometry, including
   first load and legacy view entry; layout does not depend on a body route flag. */
#kitcherette-third-subheader[data-kitcherette-slot-owner="recipes"]{
  grid-template-columns:minmax(104px,.85fr) minmax(180px,1.35fr) minmax(112px,.9fr)!important;
  grid-template-rows:40px 40px!important;column-gap:6px!important;row-gap:6px!important;
}
#kitcherette-third-subheader[data-kitcherette-slot-owner="recipes"]>.kitcherette-third-search-slot{
  grid-column:1/-1!important;grid-row:1!important;min-width:0!important;
}
#kitcherette-third-subheader[data-kitcherette-slot-owner="recipes"]>.kitcherette-recipe-category-row-toggle{
  grid-column:1!important;grid-row:2!important;justify-self:stretch!important;position:static!important;
  left:auto!important;top:auto!important;transform:none!important;display:inline-flex!important;align-items:center!important;
  justify-content:center!important;gap:6px!important;width:100%!important;min-width:0!important;max-width:none!important;height:40px!important;
  min-height:40px!important;margin:0!important;padding:0 9px!important;border:1px solid var(--kitcherette-bottom-header-border)!important;
  border-radius:12px!important;background:var(--kitcherette-bottom-control-bg)!important;color:var(--text)!important;
  box-shadow:0 4px 14px rgba(30,42,35,.06)!important;white-space:nowrap!important;font:inherit!important;font-size:.75rem!important;font-weight:700!important;
}
#kitcherette-third-subheader[data-kitcherette-slot-owner="recipes"]>.kitcherette-third-action-slot{
  grid-column:3!important;grid-row:2!important;min-width:0!important;
}
#kitcherette-third-subheader[data-kitcherette-slot-owner="recipes"] .kitcherette-recipe-new-button{
  width:100%!important;min-width:0!important;padding-inline:8px!important;
}
#kitcherette-third-subheader[data-kitcherette-slot-owner="recipes"]>.recipe-bottom-source-tabs{
  --recipe-source-index:0;
  grid-column:2!important;grid-row:2!important;position:relative!important;inset:auto!important;
  transform:none!important;width:100%!important;max-width:none!important;height:40px!important;min-width:0!important;
  margin:0!important;align-self:stretch!important;justify-self:stretch!important;
  display:grid!important;grid-template-columns:28px minmax(0,1fr) 28px!important;align-items:center!important;
  padding:2px!important;gap:0!important;overflow:hidden!important;
  border:1px solid var(--kitcherette-bottom-header-border)!important;border-radius:14px!important;
  background:color-mix(in srgb,var(--kitcherette-bottom-control-bg) 88%,transparent)!important;
  box-shadow:0 3px 12px rgba(30,42,35,.06)!important;backdrop-filter:blur(10px);-webkit-backdrop-filter:blur(10px);
  touch-action:pan-y!important;user-select:none;-webkit-user-select:none;
}
#kitcherette-third-subheader>.recipe-bottom-source-tabs .recipe-source-dial-window{
  position:relative;min-width:0;height:34px;overflow:hidden;touch-action:pan-y;cursor:grab;
  -webkit-mask-image:linear-gradient(90deg,transparent 0,#000 18%,#000 82%,transparent 100%);
  mask-image:linear-gradient(90deg,transparent 0,#000 18%,#000 82%,transparent 100%);
  -webkit-user-select:none;user-select:none;
}
#kitcherette-third-subheader>.recipe-bottom-source-tabs.is-dragging .recipe-source-dial-window{cursor:grabbing}
#kitcherette-third-subheader>.recipe-bottom-source-tabs .recipe-source-dial-track{
  position:absolute;left:-25%;top:0;width:150%;height:34px;display:grid;grid-template-columns:repeat(3,1fr);align-items:stretch;
  transform:translateX(calc((1 - var(--recipe-source-index)) * 16.6666667%));
  transition:transform 220ms cubic-bezier(.2,.8,.2,1);will-change:transform;
}
#kitcherette-third-subheader>.recipe-bottom-source-tabs.has-drag-position .recipe-source-dial-track{
  transform:translateX(calc((1 - var(--recipe-source-index)) * 16.6666667% + var(--recipe-source-drag-x)));transition:none;
}
#kitcherette-third-subheader>.recipe-bottom-source-tabs .recipe-source-dial-track .app-header-tab-button{
  position:relative!important;z-index:1!important;border-radius:10px!important;
  width:100%!important;height:34px!important;min-height:34px!important;padding:0 3px!important;border:0!important;background:transparent!important;
  box-shadow:none!important;white-space:nowrap!important;overflow:hidden!important;text-overflow:ellipsis!important;
  opacity:.38!important;font-size:.67rem!important;font-weight:500!important;transform:none!important;
  transition:opacity 160ms ease,font-weight 160ms ease,transform 160ms ease!important;
}
#kitcherette-third-subheader>.recipe-bottom-source-tabs .recipe-source-dial-track .app-header-tab-button[aria-selected="true"]{
  opacity:1!important;font-weight:700!important;transform:scale(1.04)!important;
}
#kitcherette-third-subheader>.recipe-bottom-source-tabs .recipe-source-dial-arrow{
  position:relative;z-index:4;width:28px;height:34px;min-width:28px;padding:0;border:0;background:transparent;color:var(--text);
  font:inherit;font-size:1.18rem;font-weight:650;line-height:1;opacity:.72;display:grid;place-items:center;cursor:pointer;
}
#kitcherette-third-subheader>.recipe-bottom-source-tabs .recipe-source-dial-arrow::after{
  content:"";position:absolute;inset:-2px -7px;z-index:-1;pointer-events:none;
  background:radial-gradient(ellipse at center,color-mix(in srgb,var(--kitcherette-bottom-control-bg) 96%,transparent) 38%,transparent 72%);
}
#kitcherette-third-subheader>.recipe-bottom-source-tabs .recipe-source-dial-arrow:disabled{opacity:.16;cursor:default}
@media(max-width:520px){
  #kitcherette-third-subheader[data-kitcherette-slot-owner="recipes"]{
    grid-template-columns:minmax(0,28fr) minmax(0,44fr) minmax(0,28fr)!important;
    gap:5px!important;padding-inline:6px!important;box-sizing:border-box!important;width:100%!important;
  }
  #kitcherette-third-subheader[data-kitcherette-slot-owner="recipes"]>.kitcherette-third-action-slot,
  #kitcherette-third-subheader[data-kitcherette-slot-owner="recipes"] .kitcherette-recipe-bottom-actions{
    min-width:0!important;width:100%!important;overflow:visible!important;
  }
  #kitcherette-third-subheader[data-kitcherette-slot-owner="recipes"]>.kitcherette-recipe-category-row-toggle{font-size:.68rem!important}
  #kitcherette-third-subheader[data-kitcherette-slot-owner="recipes"] .kitcherette-recipe-new-button{
    max-width:100%!important;padding-inline:5px!important;white-space:nowrap!important;font-size:.66rem!important;
  }
  #kitcherette-third-subheader[data-kitcherette-slot-owner="recipes"]>.recipe-bottom-source-tabs{grid-template-columns:24px minmax(0,1fr) 24px!important}
  #kitcherette-third-subheader>.recipe-bottom-source-tabs .recipe-source-dial-arrow{width:24px;min-width:24px}
  #kitcherette-third-subheader>.recipe-bottom-source-tabs .recipe-source-dial-track .app-header-tab-button{font-size:.62rem!important}
}
@media(prefers-reduced-motion:reduce){#kitcherette-third-subheader>.recipe-bottom-source-tabs .recipe-source-dial-track{transition:none}}
