/*
 * Seva Flow — the collaborative kitchen board (menu_items/index) and the kitchen module's
 * navigation. Loaded after application.css by the application layout; the board's record state
 * lives on the server, this file only draws it. Sections run: the board's frame and toolbar,
 * the desktop spreadsheet, the phone card list, the row menu and bulk bar, the kitchen rail,
 * the history screen, print. See docs/FRONTEND_STANDARD.md.
 */

/* ── Board frame, toolbar and sync state ── */
.stage:has(.kitchen-workspace) { max-width: 1600px; }
.kitchen-workspace, .kitchen-workspace .board__layout, .kitchen-workspace .board__main { min-width: 0; }
.kitchen-workspace .meal-tabs { margin-block: 6px; }
.kitchen-workspace .menu-add, .kitchen-workspace .summary-bar { margin-block: 8px; }
.kitchen-workspace .kitchen-toolbar {
  display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-block: 8px; font-size: 12px;
}
.kitchen-toolbar label { display: flex; align-items: center; gap: 6px; margin: 0; min-width: 0; }
.kitchen-toolbar .kitchen-search { flex: 1 1 200px; }
.kitchen-toolbar input, .kitchen-toolbar select:not(.combo__native) {
  min-height: 34px; width: auto; max-width: 100%; margin: 0; padding: 5px 9px; border: 1px solid var(--line);
  border-radius: 7px; background: var(--surface); color: var(--ink); font: inherit;
}
.kitchen-toolbar .kitchen-search input { width: 100%; min-width: 0; }
.kitchen-toolbar .kitchen-layout { display: inline-flex; gap: 2px; }
/* Reachable, not omnipresent (SF-B111, ADR 0035): a phone user needs a deliberate way into the
   compact table since the automatic switch never reaches a narrow viewport on its own — a
   desktop user already has it, matching the reference, which draws no such toggle at all. */
@media (min-width: 900px) {
  .kitchen-toolbar .kitchen-layout { display: none; }
}
.kitchen-toolbar button { min-height: 34px; border-radius: 7px; padding: 5px 9px; font-size: 12px; }
.kitchen-toolbar button[aria-pressed="true"] {
  background: var(--saffron-soft); color: var(--saffron-deep); border-color: var(--saffron);
}
.kitchen-table-count { color: var(--ink2); font-variant-numeric: tabular-nums; white-space: nowrap; }
.kitchen-table-scroll { min-width: 0; }
.kitchen-table-head, .kitchen-workspace .dish__cook-name { display: none; }
.kitchen-workspace .dish__sync {
  display: flex; align-items: center; flex-wrap: wrap; gap: 8px; grid-column: 1 / -1; padding: 6px 8px;
  background: var(--warn-bg); color: var(--ink); font-size: 12px; border-top: 1px solid var(--line);
}
.kitchen-workspace .dish__sync span { flex: 1 1 180px; }
.kitchen-workspace .dish__sync button { min-height: 28px; font-size: 12px; }
.kitchen-workspace .dish.has-local-edit { outline: 2px solid var(--saffron); outline-offset: -2px; }
.kitchen-workspace .dish[aria-busy="true"] { cursor: progress; }
.kitchen-workspace .dish :is(button, a, input):focus-visible {
  outline: 2px solid var(--saffron-deep); outline-offset: 2px;
}
/* These tracks are shared by the header and independently broadcast rows. */
.kitchen-workspace[data-kitchen-layout="table"] {
  --kitchen-columns: minmax(210px, 1fr) 116px 144px 120px 220px 142px 108px; --kitchen-min-width: 1060px;
}
.kitchen-workspace[data-kitchen-layout="table"] .kitchen-table-scroll {
  overflow: auto; max-height: 70vh; max-height: 70dvh; border: 1px solid var(--line); border-radius: 9px;
  background: var(--surface); overscroll-behavior: contain; scrollbar-gutter: stable;
}
.kitchen-workspace[data-kitchen-layout="table"] .kitchen-table-head {
  display: grid; grid-template-columns: var(--kitchen-columns); min-width: var(--kitchen-min-width); position: sticky;
  top: 0; z-index: 8; background: var(--bg); color: var(--ink2); border-bottom: 1px solid var(--line);
  font-size: 11px; font-weight: 700;
}
.kitchen-workspace[data-kitchen-layout="table"] .kitchen-table-head > span {
  padding: 9px 8px; border-right: 1px solid var(--line);
}
.kitchen-workspace[data-kitchen-layout="table"] .kitchen-table-head > span:first-child {
  position: sticky; left: 0; z-index: 9; background: var(--bg);
}
.kitchen-workspace[data-kitchen-layout="table"] :is(.lanes, .lane, .lane__cards) {
  display: block; min-width: var(--kitchen-min-width); margin: 0; padding: 0; gap: 0;
}
.kitchen-workspace[data-kitchen-layout="table"] .course {
  margin: 0; padding: 5px 8px; min-height: 27px; background: var(--saffron-soft);
  border-bottom: 1px solid var(--line); font-size: 11px;
}
.kitchen-workspace[data-kitchen-layout="table"] .course__name { position: sticky; left: 8px; }
.kitchen-workspace[data-kitchen-layout="table"] .dish {
  --kitchen-row-bg: var(--surface); display: grid; grid-template-columns: var(--kitchen-columns); gap: 0;
  min-height: 36px; margin: 0; padding: 0; border: 0; border-bottom: 1px solid var(--line); border-radius: 0;
  box-shadow: none; background: var(--kitchen-row-bg); font-size: 12px;
}
.kitchen-workspace[data-kitchen-layout="table"] .dish:nth-child(even) { --kitchen-row-bg: var(--bg); }
.kitchen-workspace[data-kitchen-layout="table"] .dish:hover { --kitchen-row-bg: var(--saffron-soft); }
.kitchen-workspace[data-kitchen-layout="table"] :is(.dish__head, .dish__foot, .dish__side) { display: contents; }
.kitchen-workspace[data-kitchen-layout="table"] .dish__meta { display: none; }
.kitchen-workspace[data-kitchen-layout="table"] .dish form { margin: 0; min-width: 0; }
.kitchen-workspace[data-kitchen-layout="table"] :is(.dish__title, .dish__status, .dish__price, .dish__time, .dish__portions, .dish__assignee, .dish__tools) {
  grid-row: 1; align-self: stretch; display: flex; align-items: center; min-width: 0; margin: 0; padding: 3px 7px;
  border-right: 1px solid var(--line); border-radius: 0; background: transparent;
}
.kitchen-workspace[data-kitchen-layout="table"] .dish__title {
  grid-column: 1; position: sticky; left: 0; z-index: 3; background: var(--kitchen-row-bg); padding-left: 34px;
}
.kitchen-workspace[data-kitchen-layout="table"] .dish__name {
  font-size: 12px; font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.kitchen-workspace[data-kitchen-layout="table"] .dish__status { grid-column: 2; }
.kitchen-workspace[data-kitchen-layout="table"] .dish__price {
  grid-column: 3; font-variant-numeric: tabular-nums; font-size: 11px; white-space: nowrap; justify-content: flex-end;
}
.kitchen-workspace[data-kitchen-layout="table"] .dish__time { grid-column: 4; font-size: 11px; white-space: nowrap; }
.kitchen-workspace[data-kitchen-layout="table"] .dish__portions {
  grid-column: 5; gap: 3px; justify-content: flex-end; flex-wrap: nowrap;
}
.kitchen-workspace[data-kitchen-layout="table"] .dish__assignee { grid-column: 6; }
.kitchen-workspace[data-kitchen-layout="table"] .dish__tools {
  grid-column: 7; visibility: visible; opacity: 1; pointer-events: auto; gap: 2px;
}
.kitchen-workspace[data-kitchen-layout="table"] .dish__assignee .dish__cook {
  width: 100%; height: auto; min-height: 28px; display: flex; gap: 5px; border-radius: 5px;
}
.kitchen-workspace[data-kitchen-layout="table"] .dish__cook-name {
  display: inline; font-size: 11px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.kitchen-workspace[data-kitchen-layout="table"] .dish__tools .btn {
  width: 28px; min-width: 28px; max-width: 28px; height: 28px; min-height: 28px; padding: 4px; border-radius: 5px;
  flex: none;
}
.kitchen-workspace[data-kitchen-layout="table"] .dish__portions .pm { width: 26px; height: 28px; min-height: 28px; }
.kitchen-workspace[data-kitchen-layout="table"] .dish__input {
  width: 56px; height: 28px; min-height: 28px; padding: 2px 4px; border-radius: 4px; font-size: 12px;
}
.kitchen-workspace[data-kitchen-layout="table"] .dish__mode {
  font-size: 10px; min-height: 28px; max-width: 80px; white-space: nowrap; overflow: hidden;
}
.kitchen-workspace[data-kitchen-layout="table"] .dish .badge {
  font-size: 10px; min-height: 23px; padding: 3px 7px; border-radius: 5px;
}
.kitchen-workspace[data-kitchen-layout="table"] .dish__rename { width: 100%; }
.kitchen-workspace[data-kitchen-layout="table"] .dish__rename-input {
  width: 100%; min-width: 0; min-height: 28px; padding: 3px; font-size: 12px;
}
.kitchen-workspace[data-kitchen-layout="table"] .dish.is-renaming .dish__name { display: none; }
/* Keep the existing non-interactive photo handle available for mouse/keyboard dragging.
   It does not consume another grid track; the frozen name cell reserves its space. */
.kitchen-workspace[data-kitchen-layout="table"] .dish__thumb {
  display: grid; place-items: center; position: absolute; left: 6px; top: 4px; width: 22px; height: 28px;
  min-width: 0; z-index: 4; border-radius: 5px; overflow: hidden;
}
.kitchen-workspace[data-kitchen-layout="table"] .dish__thumb :is(svg, img) { max-width: 100%; max-height: 100%; }
.kitchen-workspace[data-kitchen-layout="table"] .dish__tools > form { flex: none; width: 28px; }
.kitchen-workspace[data-kitchen-layout="table"] .dish__assignee > form { max-width: 100%; }
.kitchen-workspace[data-kitchen-layout="table"] .dish__cook { max-width: 100%; overflow: hidden; }
/* A phone defaults to cards, with an optional horizontally scrolling table. */
@media (max-width: 899px) {
  .kitchen-workspace .kitchen-toolbar { gap: 6px; }
  .kitchen-toolbar .kitchen-search { flex-basis: 100%; }
  .kitchen-toolbar input, .kitchen-toolbar select, .kitchen-toolbar button { min-height: 44px; font-size: 14px; }
  .kitchen-workspace[data-kitchen-layout="cards"] .lane__cards { gap: 6px; }
  .kitchen-workspace[data-kitchen-layout="cards"] .dish { padding: 8px; border-radius: 8px; touch-action: pan-y; }
  .kitchen-workspace[data-kitchen-layout="cards"] .dish__thumb {
    display: grid; width: 28px; height: 36px; flex: none;
  }
  .kitchen-workspace[data-kitchen-layout="cards"] .dish__head { gap: 6px; }
  .kitchen-workspace[data-kitchen-layout="cards"] .dish__name { font-size: 14px; }
  .kitchen-workspace[data-kitchen-layout="cards"] .dish__foot { gap: 5px; flex-wrap: wrap; margin-top: 4px; }
  .kitchen-workspace[data-kitchen-layout="cards"] .dish__tools {
    visibility: visible; opacity: 1; pointer-events: auto;
  }
  .kitchen-workspace[data-kitchen-layout="cards"] :is(.dish__tools .btn, .dish__cook, .pm, .dish__input, .dish__mode, .menu-step) {
    min-width: 44px; min-height: 44px;
  }
  .kitchen-workspace[data-kitchen-layout="cards"] .dish__input { font-size: 16px; }
  .kitchen-workspace[data-kitchen-layout="cards"] .dish__rename-input { font-size: 16px; min-height: 44px; }
  .kitchen-workspace[data-kitchen-layout="cards"] .dish__portions { flex-wrap: wrap; }
  .kitchen-workspace[data-kitchen-layout="table"] {
    --kitchen-columns: 150px 116px 144px 120px 260px 142px 150px; --kitchen-min-width: 1082px;
  }
  .kitchen-workspace[data-kitchen-layout="table"] .dish { min-height: 50px; touch-action: pan-x pan-y; }
  .kitchen-workspace[data-kitchen-layout="table"] :is(.dish__tools .btn, .dish__portions .pm, .dish__input, .dish__mode, .menu-step) {
    min-width: 44px; min-height: 44px;
  }
  .kitchen-workspace[data-kitchen-layout="table"] .dish__input { font-size: 16px; }
  .kitchen-workspace[data-kitchen-layout="table"] .dish__tools > form { width: 44px; }
  .kitchen-workspace[data-kitchen-layout="table"] .dish__tools .btn { width: 44px; max-width: 44px; }
  .kitchen-workspace[data-kitchen-layout="table"] .dish__thumb { top: 10px; }
  .kitchen-workspace .dish__sync button { min-height: 44px; }
}
@media (max-width: 420px) {
  .kitchen-workspace[data-kitchen-layout="cards"] .dish__head { flex-wrap: wrap; }
  .kitchen-workspace[data-kitchen-layout="cards"] .dish__title { flex: 1 1 100%; }
  .kitchen-workspace[data-kitchen-layout="cards"] .dish__side { width: 100%; justify-content: space-between; }
}
@media print {
  .kitchen-workspace :is(.kitchen-toolbar, .dish__tools, .feed-rail, .menu-add, .dish__sync) { display: none; }
  .kitchen-workspace .kitchen-table-scroll { max-height: none; overflow: visible; }
  .kitchen-workspace .dish { break-inside: avoid; }
}
/* ── Screen head, meal tabs, add row and summary bar ── Desktop keeps spreadsheet density;
   phones use the approved compact kitchen list rather than form-heavy cards. */
body:has(.kitchen-workspace) .screen__head { margin: 0 0 6px; align-items: flex-end; }
body:has(.kitchen-workspace) .screen__title { margin: 0; font-size: 27px; line-height: 1.12; letter-spacing: -.9px; }
body:has(.kitchen-workspace) .screen__links { justify-content: flex-end; gap: 7px; margin: -38px 0 16px; }
body:has(.kitchen-workspace) .screen__links .btn {
  min-height: 32px; border-radius: 7px; font-size: 10.5px; box-shadow: none;
}
.kitchen-workspace {
  /* The row height the density toggle switches between; the two stops are tokens. */
  --kt-row: var(--kt-row-compact);
}
.kitchen-workspace .meal-tabs {
  min-height: 44px; margin: 0; padding: 0 12px; border: 1px solid var(--kt-line); border-bottom: 0;
  border-radius: 9px 9px 0 0; background: #fff; overflow-x: auto; scrollbar-width: none;
}
.kitchen-workspace .meal-tabs .seg {
  min-height: 43px; display: flex; align-items: stretch; gap: 18px; padding: 0; border: 0; background: transparent;
}
.kitchen-workspace .meal-tabs .seg > a {
  position: relative; display: inline-flex; align-items: center; min-height: 43px; padding: 0 2px; border: 0;
  border-radius: 0; background: transparent; color: #807a72; font-size: 11px; white-space: nowrap;
}
.kitchen-workspace .meal-tabs .seg > a.is-active {
  color: var(--kt-accent); font-weight: 700; background: transparent;
}
.meal-tabs__count { margin-left: 5px; color: var(--ink3); font-weight: 600; }
.kitchen-workspace .meal-tabs .seg > a.is-active .meal-tabs__count { color: inherit; }
.kitchen-workspace .meal-tabs .seg > a.is-active::after {
  content: ""; position: absolute; inset: auto 0 -1px; height: 2px; border-radius: 2px; background: var(--kt-accent);
}
.kitchen-workspace .meal-tabs__add { margin-left: auto; }
.kitchen-workspace > .menu-add {
  margin: 0; padding: 8px; border: 1px solid var(--kt-line); border-bottom: 0; background: #fff;
}
.kitchen-workspace > .menu-add :is(input, select, .combo) { min-height: 34px; border-radius: 7px; }
.kitchen-workspace > .menu-add .btn--primary { min-height: 34px; }
.kitchen-workspace .summary-bar {
  display: grid; grid-template-columns: minmax(120px, .8fr) minmax(0, 3.2fr) auto; align-items: stretch; gap: 0;
  min-height: 78px; margin: 0 0 14px; padding: 0; border: 1px solid var(--kt-line); border-radius: 9px;
  background: #fff; box-shadow: none; overflow: hidden;
}
.kitchen-workspace .summary-bar > .guests {
  display: flex; align-items: center; padding: 13px 18px; border-right: 1px solid var(--kt-line);
}
.kitchen-workspace .summary-bar .guests__field { margin: 0; flex-direction: column; align-items: flex-start; }
.kitchen-workspace .summary-bar .guests__top {
  display: flex; align-items: center; gap: 4px; margin: 0 0 2px; color: var(--ink3); font-size: 9px;
}
.kitchen-workspace .summary-bar .guests__value { display: flex; align-items: baseline; gap: 5px; }
.kitchen-workspace .summary-bar .guests__field input {
  width: 68px; min-height: 31px; padding: 0 0 2px; border: 0; border-bottom: 1px dashed #d4c5b5; border-radius: 0;
  background: transparent; font-size: 24px; font-weight: 700; letter-spacing: -.6px;
}
.kitchen-workspace .summary-bar .guests__value small { color: var(--ink3); font-size: 9px; }
.kitchen-workspace .summary-shell { display: flex; flex-direction: column; min-width: 0; }
.kitchen-workspace .summary { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; min-width: 0; flex: 1; }
.kitchen-workspace .summary-bar:has(> .guests) .summary__servings { display: none; }
.kitchen-workspace .summary__item {
  display: flex; flex-direction: column; justify-content: center; min-width: 0; padding: 11px 18px;
  border-right: 1px solid var(--kt-line);
}
.kitchen-workspace .summary__item b {
  font-size: 22px; line-height: 1.1; letter-spacing: -.45px; white-space: nowrap;
}
.kitchen-workspace .summary__item b em { color: var(--ink3); font-size: 13px; font-style: normal; font-weight: 500; }
.kitchen-workspace .summary__item small { margin-top: 5px; color: var(--ink3); font-size: 9px; line-height: 1.25; }
.kitchen-workspace .summary__ready b { color: #44785c; }
.kitchen-workspace .attn-bar {
  min-height: 29px; margin: 0; padding: 4px 12px; border: 0; border-top: 1px solid var(--kt-line); border-radius: 0;
  background: transparent; font-size: 10px;
}
.kitchen-workspace .summary-bar__help { align-self: center; margin: 0 8px; }
.kitchen-workspace > .seg[role="group"] {
  width: fit-content; margin: 0 0 8px auto; padding: 2px; border: 1px solid var(--kt-line); background: #fff;
}
.kitchen-workspace > .seg[role="group"] a { min-height: 27px; font-size: 9px; }
.kitchen-workspace .kitchen-toolbar {
  min-height: 43px; margin: 0; padding: 6px 8px; border: 1px solid var(--kt-line); border-bottom: 0; background: #fff;
}
.kitchen-workspace .kitchen-toolbar .kitchen-search { flex: 1 1 300px; max-width: 390px; }
.kitchen-workspace .kitchen-toolbar .kitchen-search > span, .kitchen-workspace .kitchen-toolbar > label:not(.kitchen-search) > span {
  display: none;
}
.kitchen-workspace .kitchen-toolbar input, .kitchen-workspace .kitchen-toolbar select {
  min-height: 30px; border-radius: 6px; background: #fff; font-size: 10px;
}
.kitchen-workspace .kitchen-toolbar button { min-height: 30px; border-radius: 6px; font-size: 10px; }
.kitchen-workspace .kitchen-table-count { margin-left: auto; font-size: 9px; }
.kitchen-workspace[data-kitchen-layout="table"] {
  --kitchen-columns: minmax(250px,1.45fr) 122px 128px 92px 188px 142px 102px; --kitchen-min-width: 1050px;
}
.kitchen-workspace[data-kitchen-layout="table"] .kitchen-table-scroll {
  max-height: calc(100dvh - 350px); border-color: var(--kt-line); border-radius: 0 0 9px 9px;
}
.kitchen-workspace[data-kitchen-layout="table"] .kitchen-table-head {
  background: #f8f6f2; color: #857f76; font-size: 9px; letter-spacing: .35px; text-transform: uppercase;
}
.kitchen-workspace[data-kitchen-layout="table"] .kitchen-table-head > span { padding: 7px 8px; }
.kitchen-workspace[data-kitchen-layout="table"] .course {
  min-height: 28px; padding: 6px 9px; background: #f7f5f0; color: #6d675f; font-size: 10px; font-weight: 700;
}
.kitchen-workspace[data-kitchen-layout="table"] .dish { min-height: 38px; background: #fff; font-size: 11px; }
.kitchen-workspace[data-kitchen-layout="table"] .dish:nth-child(even) { --kitchen-row-bg: #fcfbf8; }
.kitchen-workspace[data-kitchen-layout="table"] .dish:hover { --kitchen-row-bg: #fff8f1; }
.kitchen-workspace[data-kitchen-layout="table"] .dish__name { font-size: 11px; font-weight: 650; }
.kitchen-workspace[data-kitchen-layout="table"] .dish__input, .kitchen-workspace[data-kitchen-layout="table"] .dish__mode, .kitchen-workspace[data-kitchen-layout="table"] .dish__assignee .dish__cook, .kitchen-workspace[data-kitchen-layout="table"] .dish__tools .btn, .kitchen-workspace[data-kitchen-layout="table"] .dish__portions .pm {
  min-height: 26px; height: 26px;
}
@media (max-width: 899px) {
  body:has(.kitchen-workspace) main { padding-inline: 0; padding-top: 12px; }
  body:has(.kitchen-workspace) .screen__head, body:has(.kitchen-workspace) .screen__links, .kitchen-workspace > .menu-add, .kitchen-workspace > .seg[role="group"], .kitchen-workspace .feed-rail {
    margin-inline: 14px;
  }
  body:has(.kitchen-workspace) .screen__head { margin-bottom: 8px; padding: 0 14px; }
  body:has(.kitchen-workspace) .screen__title { font-size: 30px; letter-spacing: -1.1px; }
  body:has(.kitchen-workspace) .screen__links {
    margin: 0 14px 10px; justify-content: flex-start; overflow-x: auto; scrollbar-width: none;
  }
  body:has(.kitchen-workspace) .screen__links .btn { min-height: 40px; flex: none; }
  .kitchen-workspace { padding-bottom: 14px; }
  .kitchen-workspace .meal-tabs {
    min-height: 54px; margin: 0 14px 14px; padding: 4px; border: 0; border-radius: 13px; background: #efeee9;
  }
  .kitchen-workspace .meal-tabs .seg { min-height: 46px; width: 100%; gap: 0; }
  .kitchen-workspace .meal-tabs .seg > a {
    flex: 1; justify-content: center; min-height: 46px; border-radius: 11px; font-size: 13px;
  }
  .kitchen-workspace .meal-tabs .seg > a.is-active {
    color: #222522; background: #fff; box-shadow: 0 1px 3px rgba(34,28,22,.06);
  }
  .kitchen-workspace .meal-tabs .seg > a.is-active::after { display: none; }
  .kitchen-workspace .meal-tabs__add { display: none; }
  .kitchen-workspace > .menu-add {
    display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px; margin-bottom: 12px; padding: 7px; border: 0;
    border-radius: 12px; background: #fff;
  }
  .kitchen-workspace > .menu-add .menu-add__title { min-height: 42px; font-size: 16px; }
  .kitchen-workspace > .menu-add :is(select, .combo) { display: none; }
  .kitchen-workspace > .menu-add .btn--primary {
    min-width: 44px; min-height: 42px; padding-inline: 10px; font-size: 0;
  }
  .kitchen-workspace > .menu-add .btn--primary::after { content: "+"; font-size: 24px; line-height: 1; }
  .kitchen-workspace .summary-bar { display: block; min-height: 0; margin: 0 14px 14px; border-radius: 13px; }
  .kitchen-workspace .summary-bar > .guests { display: none; }
  .kitchen-workspace .summary { grid-template-columns: repeat(3, minmax(0,1fr)); min-height: 104px; }
  .kitchen-workspace .summary__servings, .kitchen-workspace .summary__dishes, .kitchen-workspace .summary__ready {
    display: flex;
  }
  .kitchen-workspace .summary__cost, .kitchen-workspace .attn-bar, .kitchen-workspace .summary-bar__help {
    display: none;
  }
  .kitchen-workspace .summary__item { padding: 18px 14px 12px; border-right: 1px solid var(--kt-line); }
  .kitchen-workspace .summary__item:last-of-type { border-right: 0; }
  .kitchen-workspace .summary__item b { font-size: 27px; }
  .kitchen-workspace .summary__item small { font-size: 10px; }
  .kitchen-workspace .kitchen-toolbar {
    display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 8px; min-height: 58px; margin: 0 14px 10px;
    padding: 0; border: 0; background: transparent;
  }
  .kitchen-workspace .kitchen-toolbar .kitchen-search { max-width: none; flex-basis: auto; }
  .kitchen-workspace .kitchen-toolbar .kitchen-search input {
    width: 100%; min-height: 50px; padding: 10px 14px; border-radius: 13px; background: #fff; font-size: 16px;
  }
  .kitchen-workspace .kitchen-toolbar > label:not(.kitchen-search), .kitchen-workspace .kitchen-toolbar > .btn, .kitchen-workspace .kitchen-table-count {
    display: none;
  }
  .kitchen-workspace .kitchen-layout { display: flex; gap: 6px; }
  .kitchen-workspace .kitchen-layout button {
    width: 50px; min-width: 50px; min-height: 50px; padding: 4px; overflow: hidden; font-size: 9px;
    border-radius: 13px; background: #fff;
  }
  .kitchen-workspace .lane { margin: 0 14px 12px; }
  .kitchen-workspace[data-kitchen-layout="cards"] .course {
    min-height: 34px; padding: 5px 2px 7px; color: #7a7f71; background: transparent; font-size: 13px;
    font-weight: 700;
  }
  .kitchen-workspace[data-kitchen-layout="cards"] .lane__cards {
    gap: 0; overflow: hidden; border: 1px solid var(--kt-line); border-radius: 14px; background: #fff;
  }
  .kitchen-workspace[data-kitchen-layout="cards"] .dish {
    position: relative; min-height: 112px; margin: 0; padding: 18px 112px 18px 16px; border: 0;
    border-bottom: 1px solid var(--kt-line); border-radius: 0; background: #fff; box-shadow: none;
    touch-action: pan-y;
  }
  .kitchen-workspace[data-kitchen-layout="cards"] .dish:last-child { border-bottom: 0; }
  .kitchen-workspace[data-kitchen-layout="cards"] .dish::after {
    content: "›"; position: absolute; right: 12px; top: 50%; transform: translateY(-50%); color: #a3aa98;
    font-size: 38px; font-weight: 250; line-height: 1; pointer-events: none;
  }
  .kitchen-workspace[data-kitchen-layout="cards"] .dish__head, .kitchen-workspace[data-kitchen-layout="cards"] .dish__foot {
    display: contents;
  }
  .kitchen-workspace[data-kitchen-layout="cards"] .dish__thumb, .kitchen-workspace[data-kitchen-layout="cards"] .dish__meta, .kitchen-workspace[data-kitchen-layout="cards"] .dish__price, .kitchen-workspace[data-kitchen-layout="cards"] .dish__tools {
    display: none;
  }
  .kitchen-workspace[data-kitchen-layout="cards"] .dish__title {
    display: block; min-width: 0; margin: 0; padding: 0;
  }
  .kitchen-workspace[data-kitchen-layout="cards"] .dish__name {
    display: block; max-width: 100%; padding: 0; color: #242723; font-size: 14px; font-weight: 750; line-height: 1.32;
  }
  .kitchen-workspace[data-kitchen-layout="cards"] .dish__side { display: contents; }
  .kitchen-workspace[data-kitchen-layout="cards"] .dish__status { position: absolute; left: 16px; bottom: 19px; }
  .kitchen-workspace[data-kitchen-layout="cards"] .dish__status .badge {
    min-height: 24px; padding: 2px 0; border: 0; background: transparent; font-size: 11px; font-weight: 500;
  }
  .kitchen-workspace[data-kitchen-layout="cards"] .dish__time {
    position: absolute; left: 96px; bottom: 19px; min-height: 24px; padding: 3px 0; border: 0;
    background: transparent; color: #85857e; font-size: 11px;
  }
  .kitchen-workspace[data-kitchen-layout="cards"] .dish__assignee {
    position: absolute; left: 165px; bottom: 18px; max-width: calc(100% - 280px); min-height: 25px; padding: 0;
  }
  .kitchen-workspace[data-kitchen-layout="cards"] .dish__assignee .dish__cook {
    min-width: 0; min-height: 25px; height: 25px; padding: 2px 0; border: 0; background: transparent; color: #85857e;
    box-shadow: none;
  }
  .kitchen-workspace[data-kitchen-layout="cards"] .dish__assignee .ava { display: none; }
  .kitchen-workspace[data-kitchen-layout="cards"] .dish__cook-name { display: block; font-size: 11px; }
  .kitchen-workspace[data-kitchen-layout="cards"] .dish__portions {
    position: absolute; right: 39px; top: 18px; width: 72px; min-height: 80px; display: flex; flex-direction: column;
    align-items: center; justify-content: center; gap: 1px; padding: 7px 5px; border: 1px solid #e5e3dc;
    border-radius: 12px; background: #f5f5ef;
  }
  .kitchen-workspace[data-kitchen-layout="cards"] .dish__portions .pm { display: none; }
  .kitchen-workspace[data-kitchen-layout="cards"] .dish__portions .dish__count { order: -1; }
  .kitchen-workspace[data-kitchen-layout="cards"] .dish__input {
    width: 62px; min-width: 0; min-height: 44px; height: 44px; padding: 0; border: 0; background: transparent;
    text-align: center; font-size: 22px; font-weight: 750; box-shadow: none;
  }
  .kitchen-workspace[data-kitchen-layout="cards"] .dish__mode {
    order: 2; width: auto; min-width: 0; min-height: 20px; height: 20px; padding: 0; border: 0;
    background: transparent; color: #89907e; font-size: 9px; font-weight: 550; box-shadow: none;
  }
  .kitchen-workspace[data-kitchen-layout="cards"] .dish__mode svg { display: none; }
  .kitchen-workspace[data-kitchen-layout="table"] .kitchen-table-scroll {
    margin: 0 14px; max-height: 58dvh; border-radius: 12px;
  }
}
@media (max-width: 380px) {
  .kitchen-workspace[data-kitchen-layout="cards"] .dish { padding-left: 12px; padding-right: 102px; }
  .kitchen-workspace[data-kitchen-layout="cards"] .dish__status { left: 12px; }
  .kitchen-workspace[data-kitchen-layout="cards"] .dish__time { left: 88px; }
  .kitchen-workspace[data-kitchen-layout="cards"] .dish__assignee { left: 150px; max-width: calc(100% - 252px); }
  .kitchen-workspace[data-kitchen-layout="cards"] .dish__portions { right: 30px; width: 69px; }
  .kitchen-workspace .summary__item { padding-inline: 10px; }
  .kitchen-workspace .summary__item b { font-size: 24px; }
}
/* ── Summary bar without a guest count; card controls at finger size ── */
@media (min-width: 900px) {
  .kitchen-workspace .summary-bar:not(:has(> .guests)) { grid-template-columns: minmax(0, 1fr) auto; }
  .kitchen-workspace .summary-bar:not(:has(> .guests)) .summary { grid-template-columns: repeat(5, minmax(0, 1fr)); }
}
@media (max-width: 899px) {
  .kitchen-workspace .summary-bar:has(> .guests) .summary__servings { display: flex; }
  .kitchen-workspace[data-kitchen-layout="cards"] .dish__status .menu-step, .kitchen-workspace[data-kitchen-layout="cards"] .dish__assignee .dish__cook {
    min-height: 44px;
  }
  .kitchen-workspace[data-kitchen-layout="cards"] .dish__status, .kitchen-workspace[data-kitchen-layout="cards"] .dish__assignee {
    bottom: 8px;
  }
  .kitchen-workspace[data-kitchen-layout="cards"] .dish__time { bottom: 18px; }
}
/* ── Kitchen module navigation: the phone tab strip and the desktop rail links ── */
.tab--kitchen-mobile, .desktop-kitchen-links { display: none; }
@media (max-width: 1023px) {
  .tabbar--kitchen .desktop-nav__brand, .tabbar--kitchen .desktop-nav__event, .tabbar--kitchen .desktop-nav__label, .tabbar--kitchen .desktop-kitchen-links {
    display: none;
  }
  .tabbar--kitchen .tab--kitchen-mobile { display: flex; min-width: 0; font-size: 10px; font-weight: 600; }
  .tabbar--kitchen .tab--kitchen-mobile .tab__icon svg { width: 23px; height: 23px; }
  .tabbar--kitchen .tab--kitchen-mobile.is-active { color: var(--saffron-deep); }
}
@media (min-width: 1024px) {
  .tabbar--kitchen .desktop-kitchen-links { display: flex; flex-direction: column; min-height: 0; }
  .desktop-kitchen-links__label {
    display: block; margin: 9px 9px 6px; color: var(--ink3); font-size: 9px; font-weight: 750; letter-spacing: 1.15px;
    text-transform: uppercase;
  }
  .desktop-kitchen-link {
    display: flex; align-items: center; gap: 10px; min-height: 38px; margin: 1px 0; padding: 8px 10px;
    border-radius: 8px; color: #706d68; font-size: 12px; font-weight: 550;
  }
  .desktop-kitchen-link > span { display: grid; place-items: center; width: 18px; color: #7d7871; }
  .desktop-kitchen-link.is-active { color: #b93f09; background: #f9e8db; font-weight: 750; }
  .desktop-kitchen-link.is-active > span { color: #b93f09; }
  .desktop-kitchen-link__count { margin-left: auto; font-size: 11px; font-weight: 700; color: #9a958c; }
  .desktop-kitchen-link.is-active .desktop-kitchen-link__count { color: #b93f09; }
  .desktop-kitchen-link__tag {
    margin-left: auto; padding: 2px 6px; border-radius: 5px; background: #f0ece5; color: #9a958c; font-size: 9px;
    font-weight: 750; letter-spacing: .04em;
  }
  .desktop-kitchen-link.is-active .desktop-kitchen-link__tag { background: #f3d8c2; color: #b93f09; }
}

/* ── Row density, sheet tools, filters and columns menus ── */
.kitchen-workspace[data-kitchen-density="comfortable"] { --kt-row: var(--kt-row-comfortable); }
/* Toolbar controls from the reference prototype. */
.kitchen-sheet-tools { display: inline-flex; align-items: center; gap: 5px; }
.kitchen-density { gap: 6px; }
.kitchen-columns, .kitchen-filters { position: relative; }
.kitchen-columns > summary, .kitchen-filters > summary { list-style: none; cursor: pointer; }
.kitchen-columns > summary::-webkit-details-marker, .kitchen-filters > summary::-webkit-details-marker {
  display: none;
}
.kitchen-filters__menu {
  position: absolute; z-index: 40; top: calc(100% + 7px); left: 0; width: 220px; display: flex;
  flex-direction: column; gap: 8px; padding: 11px; border: 1px solid var(--line); border-radius: 9px;
  background: var(--surface); box-shadow: 0 12px 36px rgba(44,34,20,.14);
}
.kitchen-filters__menu label { display: flex; flex-direction: column; gap: 3px; font-size: 11px; color: var(--ink2); }
.kitchen-columns__menu {
  position: absolute; z-index: 40; top: calc(100% + 7px); right: 0; width: 210px; padding: 11px;
  border: 1px solid var(--line); border-radius: 9px; background: var(--surface);
  box-shadow: 0 12px 36px rgba(44,34,20,.14);
}
.kitchen-columns__menu label {
  display: flex; align-items: center; gap: 8px; min-height: 30px; font-size: 11px; color: var(--ink2);
}
/* The toolbar's own input sizing (.kitchen-toolbar input, above) would stretch these boxes. */
.kitchen-workspace .kitchen-columns__menu input { width: 14px; min-height: 14px; }
.kitchen-columns__menu .btn { width: 100%; margin-top: 7px; }
/* Row overflow menu: the reference collapses edit/copy/delete behind a single "⋯" (SF-B71). */
.dish__menu { position: relative; }
.dish__menu > summary { list-style: none; cursor: pointer; }
.dish__menu > summary::-webkit-details-marker { display: none; }
.dish__menu > summary span { pointer-events: none; }
.dish__menu-list {
  position: absolute; z-index: 40; top: calc(100% + 5px); right: 0; width: 160px; padding: 6px;
  border: 1px solid var(--line); border-radius: 9px; background: var(--surface);
  box-shadow: 0 12px 36px rgba(44,34,20,.14);
}
.dish__menu-item {
  display: flex; align-items: center; gap: 8px; width: 100%; min-height: 32px; padding: 0 8px; border: 0;
  border-radius: 6px; background: none; color: var(--ink2); font-size: 12px; text-align: left; cursor: pointer;
}
.dish__menu-item:hover { background: var(--saffron-soft); }
.dish__menu-item--danger { color: var(--danger); }
.kitchen-bulk {
  min-height: 35px; display: flex; align-items: center; gap: 8px; padding: 5px 9px; border: 1px solid #eed5bf;
  border-bottom: 0; background: #fff2e8; color: #8c4f2d; font-size: 10px;
}
.kitchen-bulk[hidden] { display: none; }
.kitchen-bulk select {
  min-height: 26px; border: 1px solid #e6cab1; border-radius: 5px; background: #fffaf6; font-size: 10px;
}
.kitchen-sheet-toast {
  position: fixed; z-index: 100; left: 50%; bottom: 22px; transform: translateX(-50%);
  max-width: min(520px, calc(100vw - 28px)); padding: 9px 14px; border-radius: 8px; background: #37372f;
  color: #fffaf1; box-shadow: 0 8px 28px rgba(30,25,15,.2); font-size: 11px;
}
/* Desktop spreadsheet — exact conceptual order from the approved workbench. */
@media (min-width: 900px) {
  .kitchen-workspace[data-kitchen-layout="table"] {
    --kitchen-columns: 32px 26px minmax(230px,1.5fr) 86px 76px 132px 116px 84px 92px 62px 88px;
    --kitchen-min-width: 1136px;
  }
  .kitchen-workspace[data-kitchen-layout="table"] .kitchen-table-head {
    grid-template-columns: var(--kitchen-columns); min-width: var(--kitchen-min-width);
  }
  .kitchen-workspace[data-kitchen-layout="table"] .kitchen-table-head > span {
    min-width: 0; min-height: 29px; display: flex; align-items: center; padding: 0 8px;
    border-right: 1px solid #ebe7de; font-size: 8px; letter-spacing: .48px; white-space: nowrap; overflow: hidden;
    text-overflow: ellipsis;
  }
  .kitchen-workspace[data-kitchen-layout="table"] .kitchen-table-head > span[data-kitchen-column="select"] {
    position: sticky; left: 0; z-index: 12; justify-content: center; padding: 0;
  }
  .kitchen-workspace[data-kitchen-layout="table"] .kitchen-table-head > span[data-kitchen-column="number"] {
    position: sticky; left: 32px; z-index: 11; justify-content: center; padding: 0; background: #f8f6f2;
  }
  .kitchen-workspace[data-kitchen-layout="table"] .kitchen-table-head > span[data-kitchen-column="dish"] {
    position: sticky; left: 58px; z-index: 11; background: #f8f6f2;
  }
  .kitchen-workspace[data-kitchen-layout="table"] .dish {
    position: relative; grid-template-columns: var(--kitchen-columns); min-width: var(--kitchen-min-width);
    min-height: var(--kt-row); height: var(--kt-row);
  }
  .kitchen-workspace[data-kitchen-layout="table"] :is(.dish__head,.dish__foot,.dish__side) { display: contents; }
  .kitchen-workspace[data-kitchen-layout="table"] .dish__select {
    grid-column: 1; grid-row: 1; position: sticky; left: 0; z-index: 6; display: grid; place-items: center;
    min-height: var(--kt-row); border-right: 1px solid var(--line); background: var(--kitchen-row-bg);
  }
  .kitchen-workspace[data-kitchen-layout="table"] .dish__select input { width: 13px; height: 13px; margin: 0; }
  /* The row's place in the whole table, 01/02/03… straight down every course group (SF-B71),
       matching the reference — not part of the markup other layouts use, so it only exists here. */
  .kitchen-workspace[data-kitchen-layout="table"] .dish__number {
    grid-column: 2; grid-row: 1; position: sticky; left: 32px; z-index: 5; display: grid; place-items: center;
    min-height: var(--kt-row); border-right: 1px solid var(--line); background: var(--kitchen-row-bg); font-size: 9px;
    font-variant-numeric: tabular-nums; color: var(--ink3);
  }
  .kitchen-workspace[data-kitchen-layout="table"] .dish__title {
    grid-column: 3; grid-row: 1; left: 58px; min-height: var(--kt-row); padding: 0 8px 0 35px;
  }
  .kitchen-workspace[data-kitchen-layout="table"] .dish__thumb {
    left: 39px; top: 50%; transform: translateY(-50%); width: 22px; height: 22px; border-radius: 5px;
  }
  .kitchen-workspace[data-kitchen-layout="table"] .dish__name { line-height: var(--kt-row); font-size: 10.8px; }
  .kitchen-workspace[data-kitchen-layout="table"] .dish__portions {
    grid-column: 4; grid-row: 1; min-height: var(--kt-row); padding: 1px 5px;
  }
  .kitchen-workspace[data-kitchen-layout="table"] .dish__time {
    grid-column: 5; grid-row: 1; min-height: var(--kt-row); padding: 1px 5px;
  }
  .kitchen-workspace[data-kitchen-layout="table"] .dish__assignee {
    grid-column: 6; grid-row: 1; min-height: var(--kt-row); padding: 1px 5px;
  }
  .kitchen-workspace[data-kitchen-layout="table"] .dish__status {
    grid-column: 7; grid-row: 1; min-height: var(--kt-row); padding: 1px 5px;
  }
  .kitchen-workspace[data-kitchen-layout="table"] .dish__price { display: contents; }
  .kitchen-workspace[data-kitchen-layout="table"] .dish__unit-price, .kitchen-workspace[data-kitchen-layout="table"] .dish__total-price, .kitchen-workspace[data-kitchen-layout="table"] .dish__price > .chip {
    grid-row: 1; display: flex; align-items: center; justify-content: flex-end; min-width: 0;
    min-height: var(--kt-row); padding: 0 7px; border-right: 1px solid var(--line); background: transparent;
    font-size: 10px; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden;
    text-overflow: ellipsis;
  }
  .kitchen-workspace[data-kitchen-layout="table"] .dish__unit-price { grid-column: 8; }
  .kitchen-workspace[data-kitchen-layout="table"] .dish__total-price { grid-column: 9; font-weight: 650; }
  .kitchen-workspace[data-kitchen-layout="table"] .dish__price > .chip {
    grid-column: 8 / 10; justify-content: center;
  }
  .kitchen-workspace[data-kitchen-layout="table"] .dish__offered {
    grid-column: 10; grid-row: 1; display: grid; place-items: center; min-height: var(--kt-row);
    border-right: 1px solid var(--line);
  }
  .kitchen-workspace[data-kitchen-layout="table"] .dish__tools {
    grid-column: 11; grid-row: 1; min-height: var(--kt-row); padding: 1px 3px;
  }
  .kitchen-workspace[data-kitchen-layout="table"] .dish__tools .btn, .kitchen-workspace[data-kitchen-layout="table"] .dish__tools > form {
    width: 25px; min-width: 25px; max-width: 25px;
  }
  .kitchen-workspace[data-kitchen-layout="table"] .dish__tools .btn { height: 25px; min-height: 25px; }
  .kitchen-workspace[data-kitchen-layout="table"] .dish__portions .pm { display: none; }
  .kitchen-workspace[data-kitchen-layout="table"] .dish__mode {
    width: 16px; min-width: 16px; max-width: 16px; min-height: 16px; height: 16px; padding: 0; border-radius: 3px;
    box-shadow: none; overflow: hidden; font-size: 0; display: grid; place-items: center;
  }
  .kitchen-workspace[data-kitchen-layout="table"] .dish__mode svg { display: none; }
  /* The reference's A/P badge before the portions number: A for a dish that follows the
       guest count, P for one a coordinator pinned to a number by hand (SF-B71). */
  .kitchen-workspace[data-kitchen-layout="table"] .dish__mode--auto::after {
    content: "A"; font-size: 9px; font-weight: 800;
  }
  .kitchen-workspace[data-kitchen-layout="table"] .dish__mode--manual::after {
    content: "P"; font-size: 9px; font-weight: 800;
  }
  .kitchen-workspace[data-kitchen-layout="table"] .dish__count { flex: 1; }
  .kitchen-workspace[data-kitchen-layout="table"] .dish__input, .kitchen-workspace[data-kitchen-layout="table"] .dish__time-input, .kitchen-workspace[data-kitchen-layout="table"] .dish__cook-select, .kitchen-workspace[data-kitchen-layout="table"] .dish__status-select {
    width: 100%; min-width: 0; height: calc(var(--kt-row) - 4px); min-height: 0; margin: 0; padding: 0 4px; border: 0;
    border-radius: 3px; background: transparent; color: inherit; font-size: 10px; outline-offset: -1px;
  }
  /* The cook/status selects are combobox-enhanced (combobox_controller.js): the native
       .dish__cook-select/.dish__status-select above is what the rule sees, but it is taken out
       of flow (select.combo__native) and it is the visible .combo trigger sibling that actually
       occupies the row — at its own 44px min-height (application.css, sized for a regular form)
       it alone forced every row to 48px regardless of --kt-row. */
  .kitchen-workspace[data-kitchen-layout="table"] .dish__cook-form .combo, .kitchen-workspace[data-kitchen-layout="table"] .dish__status-form .combo {
    width: 100%; min-width: 0; min-height: 0; height: calc(var(--kt-row) - 4px); margin: 0; padding: 0 4px; border: 0;
    border-radius: 3px; font-size: 10px; gap: 4px;
  }
  /* The status pill keeps its tone; the cook's combo sits flat on the row. */
  .kitchen-workspace[data-kitchen-layout="table"] .dish__cook-form .combo { background: transparent; color: inherit; }
  .kitchen-workspace[data-kitchen-layout="table"] .dish__cook-form .combo .ava {
    width: 16px; height: 16px; font-size: 7px;
  }
  .kitchen-workspace[data-kitchen-layout="table"] .dish__input { text-align: right; }
  .kitchen-workspace[data-kitchen-layout="table"] .dish__time-input {
    padding-inline: 2px; font-variant-numeric: tabular-nums;
  }
  .kitchen-workspace[data-kitchen-layout="table"] :is(.dish__cook-form,.dish__status-form,.dish__time-form) {
    width: 100%;
  }
  .kitchen-workspace[data-kitchen-layout="table"] .dish__offering {
    width: 100%; min-width: 0; min-height: var(--kt-row); border: 0; background: transparent; color: #bcb5aa;
    font-size: 16px; display: grid; place-items: center;
  }
  .kitchen-workspace[data-kitchen-layout="table"] .dish__offering.is-offered { color: #718960; }
  .kitchen-workspace[data-kitchen-layout="table"] .dish.is-selected { --kitchen-row-bg: #fff5e9; }
  .kitchen-workspace[data-kitchen-layout="table"] [data-kitchen-sheet-cell]:focus {
    background: #fff8ee; box-shadow: inset 0 0 0 1.5px #d4844b; outline: 0;
  }
  /* User column preferences retain a valid grid by hiding both header and row cell. */
  .kitchen-hide-status [data-kitchen-column="status"], .kitchen-hide-time [data-kitchen-column="time"], .kitchen-hide-portions [data-kitchen-column="portions"], .kitchen-hide-cook [data-kitchen-column="cook"], .kitchen-hide-offered [data-kitchen-column="offered"], .kitchen-hide-actions [data-kitchen-column="actions"] {
    visibility: hidden; pointer-events: none;
  }
  .kitchen-hide-price .kitchen-table-head [data-kitchen-column="price"], .kitchen-hide-price .dish__unit-price {
    visibility: hidden;
  }
  .kitchen-hide-total .kitchen-table-head [data-kitchen-column="total"], .kitchen-hide-total .dish__total-price {
    visibility: hidden;
  }
}
/* Phone: approved photo-first list with portions on the right. */
@media (max-width: 899px) {
  .kitchen-sheet-tools { display: none; }
  .kitchen-bulk { margin: 0 14px 8px; border: 0; border-radius: 10px; overflow-x: auto; }
  /* The photo-first row below is absolutely positioned and needs the phone-width room it was
       drawn for; .lanes's own auto-fit grid (SF-B53, tuned for the plain flex-wrap card) still
       packs two or three of these into a row well under 900px, squeezing each one down to ~214px
       and running the status/time/cook slots straight off the card's own right edge. */
  .kitchen-workspace[data-kitchen-layout="cards"] .lanes { grid-template-columns: 1fr; }
  .kitchen-workspace[data-kitchen-layout="cards"] .dish { min-height: 116px; padding: 14px 104px 14px 76px; }
  .kitchen-workspace[data-kitchen-layout="cards"] .dish__select { display: none; }
  .kitchen-workspace[data-kitchen-layout="cards"] .dish__number { display: none; }
  .kitchen-workspace[data-kitchen-layout="cards"] .dish__thumb {
    display: grid; position: absolute; left: 14px; top: 16px; width: 50px; height: 50px; border-radius: 10px;
    overflow: hidden;
  }
  .kitchen-workspace[data-kitchen-layout="cards"] .dish__thumb :is(img,svg) {
    width: 100%; height: 100%; object-fit: cover;
  }
  .kitchen-workspace[data-kitchen-layout="cards"] .dish__meta { display: none; }
  .kitchen-workspace[data-kitchen-layout="cards"] .dish__portions {
    right: 34px; top: 16px; width: 64px; min-height: 72px;
  }
  /* Each slot's left is a fixed offset, so — unlike the flex row .dish__foot lays these same
       fields out in above 900px — nothing here shrinks a neighbour out of the way on its own.
       Status and time both need their own width + overflow:hidden, or a long status label (e.g.
       "Запланировано") outgrows its 74px budget and paints over the time and cook slots after it
       (SF-B69: reproduced at every width from 391px up to the 899px breakpoint, not only ~500px —
       assignee is hidden below 391px, which only hid the same collision, not fixed it). */
  .kitchen-workspace[data-kitchen-layout="cards"] .dish__status {
    left: 76px; bottom: 17px; width: 68px; overflow: hidden;
  }
  .kitchen-workspace[data-kitchen-layout="cards"] .dish__time {
    left: 150px; bottom: 17px; width: 60px; overflow: hidden;
  }
  .kitchen-workspace[data-kitchen-layout="cards"] .dish__assignee {
    left: 215px; bottom: 17px; max-width: calc(100% - 320px);
  }
  .kitchen-workspace[data-kitchen-layout="cards"] .dish__cook-select, .kitchen-workspace[data-kitchen-layout="cards"] .dish__status-select, .kitchen-workspace[data-kitchen-layout="cards"] .dish__time-input {
    min-height: 25px; height: 25px; padding: 0; border: 0; background: transparent; font-size: 10.5px;
  }
  .kitchen-workspace[data-kitchen-layout="cards"] .dish__status .combo, .kitchen-workspace[data-kitchen-layout="cards"] .dish__time .combo {
    max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  }
  .kitchen-workspace[data-kitchen-layout="cards"] .dish__offered { display: none; }
}
@media (max-width: 390px) {
  .kitchen-workspace[data-kitchen-layout="cards"] .dish { padding-left: 70px; padding-right: 97px; }
  .kitchen-workspace[data-kitchen-layout="cards"] .dish__thumb { left: 12px; width: 47px; height: 47px; }
  .kitchen-workspace[data-kitchen-layout="cards"] .dish__status { left: 70px; }
  .kitchen-workspace[data-kitchen-layout="cards"] .dish__time { left: 139px; }
  .kitchen-workspace[data-kitchen-layout="cards"] .dish__assignee { display: none; }
  .kitchen-workspace[data-kitchen-layout="cards"] .dish__portions { right: 29px; width: 64px; }
}
/* Keyboard hint bar under the table (SF-B71/stage 3). The bottom dish/guest/cost summary row
   is already rendered by kitchen_table_controller#addFooter (.kitchen-parity-footer). */
.kitchen-shortcuts-hint {
  display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 6px 4px 0;
  border-top: 1px solid var(--line); font-size: 10px; color: var(--ink3);
}
.btn--link { border: 0; background: none; padding: 0; color: inherit; font: inherit; cursor: pointer; }

/* ── Final desktop geometry from the approved kitchen prototype ── */
@media (min-width: 900px) {
  body:has(.kitchen-workspace) .screen__title { font-size: 25px; line-height: 1.12; letter-spacing: -1px; }
  .kitchen-workspace .summary-bar { min-height: 70px; margin-bottom: 14px; }
  .kitchen-workspace .meal-tabs { min-height: 37px; }
  .kitchen-workspace .meal-tabs .seg, .kitchen-workspace .meal-tabs .seg > a { min-height: 36px; }
  .kitchen-workspace .kitchen-toolbar { min-height: 40px; padding-block: 5px; }
  .kitchen-workspace[data-kitchen-layout="table"] .kitchen-table-head > span { min-height: 28px; }
  .kitchen-workspace[data-kitchen-layout="table"] .course { min-height: 27px; }
}
/* ── Kitchen history screen ── */
.kitchen-history { max-width: 980px; }
.kitchen-history__heading { margin-bottom: 16px; }
.kitchen-history__heading p { margin: 6px 0 0; }
.kitchen-history__entry { padding: 12px 14px; }
.kitchen-history__entry + .kitchen-history__entry { margin-top: 8px; }
.kitchen-history__entry-title { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.kitchen-history__entry-title b { font-size: 12px; }
.kitchen-history__entry-title time { color: var(--ink3); font-size: 9px; white-space: nowrap; }
.kitchen-history__entry p { margin: 5px 0 0; font-size: 10px; }
/* ── Sort buttons, course groups, undo, bulk delete and the footer ── Drawn onto the board by
   kitchen_table_controller after every render; nothing here holds record state. */
.kitchen-parity-sort {
  width: 100%; height: 100%; display: flex; align-items: center; justify-content: space-between; gap: 4px;
  border: 0; background: transparent; color: inherit; font: inherit; letter-spacing: inherit; padding: 0;
  cursor: pointer;
}
.kitchen-parity-sort__mark { font-size: 9px; color: #b8b09f; }
.kitchen-parity-sort.is-active { color: #a8471a; }
.kitchen-parity-sort.is-active .kitchen-parity-sort__mark { color: #d94a0b; }
.kitchen-workspace[data-kitchen-layout] .course { display: flex; align-items: center; gap: 7px; min-height: 27px; }
.kitchen-course-toggle {
  display: flex; align-items: center; gap: 7px; min-height: 26px; border: 0; background: transparent;
  color: inherit; padding: 0; cursor: pointer;
}
.kitchen-course-toggle b { font-size: 9px; font-weight: 650; }
.kitchen-course-arrow { width: 11px; color: #a89c88; }
.kitchen-course-count { font-size: 9px; color: #b0a18a; }
.kitchen-course-total { position: sticky; right: 8px; margin-left: auto; color: #afa28d; font-size: 8px; font-weight: 400; }
.kitchen-workspace[data-kitchen-layout] .lane.is-collapsed .lane__cards { display: none; }
.kitchen-workspace .kitchen-sheet-tools .kitchen-parity-undo { width: 28px; padding: 0; }
.kitchen-parity-undo:disabled { opacity: .35; cursor: not-allowed; }
.kitchen-parity-delete { border-color: #ead0bb; }
.kitchen-parity-delete-toast {
  position: fixed; z-index: 110; left: 50%; bottom: 22px; transform: translateX(-50%); display: flex;
  align-items: center; gap: 10px; max-width: min(520px, calc(100vw - 28px)); padding: 8px 10px 8px 14px;
  border-radius: 8px; background: #37372f; color: #fffaf1; box-shadow: 0 8px 28px rgba(30,25,15,.2); font-size: 11px;
}
.kitchen-parity-delete-toast .btn { color: #fffaf1; border-color: #69665e; background: transparent; }
.kitchen-parity-footer {
  min-height: 34px; display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 0 12px;
  border: 1px solid var(--line); border-top: 0; background: #fbfaf6; color: #8c8578; font-size: 9px;
}
.kitchen-parity-footer__right { font-weight: 650; color: #665f50; font-variant-numeric: tabular-nums; }
@media (max-width: 899px) {
  .kitchen-parity-footer, .kitchen-workspace .kitchen-sheet-tools .kitchen-parity-undo { display: none; }
}

/* ── Print: A4 landscape, the sheet only ── */
@media print {
  @page {
    size: A4 landscape;
    margin: 10mm;
  }
  body:has(.kitchen-workspace) { background: #fff; }
  body:has(.kitchen-workspace) .topbar, body:has(.kitchen-workspace) .tabbar, body:has(.kitchen-workspace) .screen__links, .kitchen-workspace > .menu-add, .kitchen-workspace > .seg[role="group"], .kitchen-workspace .kitchen-toolbar, .kitchen-workspace .kitchen-bulk, .kitchen-workspace .feed-rail, .kitchen-workspace .summary-bar__help, .kitchen-workspace .meal-tabs__add, .kitchen-workspace[data-kitchen-layout] .dish__select,
  .kitchen-workspace[data-kitchen-layout] .dish__tools, .kitchen-workspace .toast, .kitchen-parity-delete-toast, .kitchen-sheet-toast {
    display: none;
  }
  body:has(.kitchen-workspace) .stage, body:has(.kitchen-workspace) main {
    width: 100%; max-width: none; margin: 0; padding: 0;
  }
  body:has(.kitchen-workspace) .screen__head { margin: 0 0 12px; }
  .kitchen-workspace .summary-bar { margin-bottom: 12px; break-inside: avoid; }
  .kitchen-workspace[data-kitchen-layout="table"] {
    --kitchen-min-width: 0px; --kitchen-columns: 0px 28px minmax(220px,1.5fr) 72px 68px 105px 92px 72px 84px 48px 0px;
  }
  .kitchen-workspace[data-kitchen-layout="table"] .kitchen-table-scroll {
    max-height: none; min-height: 0; overflow: visible; border-radius: 0;
  }
  .kitchen-workspace[data-kitchen-layout="table"] .kitchen-table-head, .kitchen-workspace[data-kitchen-layout="table"] .dish {
    min-width: 0;
  }
  /* Frozen columns unfreeze: the selectors match the strength of the sticky rules above. */
  .kitchen-workspace[data-kitchen-layout="table"] .kitchen-table-head > span[data-kitchen-column],
  .kitchen-workspace[data-kitchen-layout="table"] .dish :is(.dish__title, .dish__select, .dish__number) {
    position: static; left: auto;
  }
  .kitchen-workspace[data-kitchen-layout="table"] .dish, .kitchen-workspace[data-kitchen-layout="table"] .course {
    break-inside: avoid;
  }
  /* These two header cells label the select and actions columns, both zero-width in print
       (their row cells are hidden above) — the label's own padding still claims a few px past
       the page edge unless the header cell itself is hidden too (SF-B77). */
  .kitchen-workspace[data-kitchen-layout="table"] .kitchen-table-head > span[data-kitchen-column="select"], .kitchen-workspace[data-kitchen-layout="table"] .kitchen-table-head > span[data-kitchen-column="actions"] {
    display: none;
  }
  .kitchen-workspace[data-kitchen-layout="table"] .dish__thumb { left: 7px; }
  .kitchen-workspace[data-kitchen-layout="table"] .dish__title { padding-left: 34px; }
  .kitchen-parity-footer { position: static; }
}
