/* Dishup full-screen (read-only print-events). Isolated from timer card styles. */

.dishup-root {
  display: flex;
  flex-direction: column;
  min-height: 0;
  height: 100%;
  background: var(--bg-dish);
}

/* Timer-side: active item-timer panel (no order cards / history / new-badge). */
.dishup-root[data-active-item-timers="1"] .dishup-history,
.dishup-root[data-active-item-timers="1"] .dishup-history-show-btn,
.dishup-root[data-active-item-timers="1"] .dishup-empty,
.dishup-root[data-active-item-timers="1"] .dishup-new-badge,
.dishup-root[data-right-panel-empty="1"] .dishup-history,
.dishup-root[data-right-panel-empty="1"] .dishup-history-show-btn,
.dishup-root[data-right-panel-empty="1"] .dishup-empty,
.dishup-root[data-right-panel-empty="1"] .dishup-new-badge {
  display: none !important;
}

.dishup-root[data-active-item-timers="1"] .dishup-pane-status:empty,
.dishup-root[data-right-panel-empty="1"] .dishup-pane-status:empty {
  display: none;
}

.dishup-root[data-active-item-timers="1"] .dishup-rail,
.dishup-root[data-right-panel-empty="1"] .dishup-rail {
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.dishup-timer-side-split {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
  height: 100%;
}

.dishup-timer-side-half {
  flex: 1 1 50%;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.dishup-timer-side-half.is-armed-half {
  border-top: 1px solid var(--border-soft, #c5d0dc);
}

.dishup-timer-side-label {
  flex: 0 0 auto;
  padding: 0.28rem 0.45rem 0.15rem;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--fg-muted, #555);
  letter-spacing: 0.04em;
}

.dishup-active-timers,
.dishup-pending-timers {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  padding: 0.2rem 0.45rem 0.55rem;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  flex: 1 1 auto;
  min-height: 0;
}

.dishup-active-timer-card,
.dishup-armed-timer-card {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem 0.55rem;
  padding: 0.55rem 0.55rem;
  border: 1px solid var(--border-soft, #c5d0dc);
  border-radius: 0.35rem;
  background: #fff;
  container-type: inline-size;
  container-name: active-timer-card;
}

.dishup-active-timer-card.is-overdue,
.dishup-armed-timer-card.is-pending {
  border-color: #d94848;
  background: #fff7f7;
}

.dishup-active-timer-table {
  flex: 0 0 auto;
  font-size: clamp(0.9rem, 2.6cqi, 1.05rem);
  font-weight: 650;
  color: var(--fg-muted, #555);
}

.dishup-active-timer-name {
  flex: 1 1 7rem;
  min-width: 0;
  font-size: clamp(1rem, 3.1cqi, 1.22rem);
  font-weight: 700;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.dishup-active-timer-remain {
  flex: 0 0 auto;
  min-width: 4.6ch;
  font-size: clamp(1.35rem, 5cqi, 1.95rem);
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
  line-height: 1;
  border: 1px solid transparent;
  background: transparent;
  padding: 0.1rem 0.15rem;
  margin: 0;
  color: inherit;
  cursor: pointer;
  touch-action: manipulation;
  border-radius: 0.25rem;
}

.dishup-active-timer-card.is-overdue .dishup-active-timer-remain {
  color: #c92a2a;
}

.dishup-active-timer-card.is-paused .dishup-active-timer-remain {
  color: #8a5a10;
  border-color: rgba(212, 160, 23, 0.5);
  background: rgba(255, 248, 220, 0.7);
}

.dishup-active-timer-actions,
.dishup-armed-timer-actions {
  display: flex;
  flex: 0 0 auto;
  align-items: stretch;
  gap: 0.55rem;
  margin-left: auto;
}

.dishup-active-timer-adj,
.dishup-armed-timer-start,
.dishup-armed-timer-cancel {
  min-width: 3.4rem;
  min-height: 2.85rem;
  padding: 0.35rem 0.65rem;
  border: 1px solid var(--border-soft, #c5d0dc);
  border-radius: 0.3rem;
  background: #f4f7fb;
  color: #1f2a37;
  font-size: 0.95rem;
  font-weight: 700;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.dishup-armed-timer-start {
  min-width: 5.5rem;
}

.dishup-armed-timer-cancel {
  min-width: 4.2rem;
  background: #fff5f5;
  border-color: #e03131;
  color: #c92a2a;
}

.dishup-armed-timer-grace {
  font-size: clamp(0.9rem, 2.8cqi, 1.05rem);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: #c92a2a;
  white-space: nowrap;
}

.dishup-active-timer-adj:active,
.dishup-armed-timer-start:active,
.dishup-armed-timer-cancel:active {
  background: #e4ebf5;
}

/* Full Dish-up: active rail + right history column (≈1 card width). */
.dishup-root.is-history-side {
  position: relative;
}

.dishup-root.is-history-side .dishup-main {
  display: flex;
  flex-direction: row;
  align-items: stretch;
  flex: 1;
  min-height: 0;
  gap: var(--dishup-gap, 0.4rem);
  padding-right: 0.2rem;
}

.dishup-root.is-history-side .dishup-rail {
  flex: 5 1 0;
  min-width: 0;
}

.dishup-root.is-history-side .dishup-history {
  flex: 1 1 0;
  min-width: 0;
  max-height: none;
  height: auto;
  align-self: stretch;
  border-top: none;
  border-left: 1px solid var(--border-soft);
  padding: 0.28rem 0.3rem 0.35rem;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.dishup-root.is-history-side .dishup-history-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.35rem;
  margin-bottom: 0.25rem;
}

.dishup-root.is-history-side .dishup-history-title {
  font-size: 0.68rem;
  margin-bottom: 0;
}

.dishup-root.is-history-side .dishup-history-hide-btn {
  flex-shrink: 0;
  border: 1px solid var(--border-soft, #c5d0dc);
  background: #fff;
  color: var(--fg-muted, #555);
  border-radius: 0.25rem;
  padding: 0.12rem 0.4rem;
  font-size: 0.62rem;
  font-weight: 700;
  cursor: pointer;
}

.dishup-root.is-history-side .dishup-history-hide-btn:active {
  background: #eef2f6;
}

/* History collapsed: keep 5-up rail; compact reopen on right edge. */
.dishup-root.is-history-side.is-history-collapsed .dishup-history {
  display: none !important;
}

.dishup-root.is-history-side.is-history-collapsed .dishup-main {
  padding-right: 1.65rem;
}

.dishup-root.is-history-side .dishup-history-show-btn {
  position: absolute;
  top: 2.6rem;
  right: 0.15rem;
  z-index: 5;
  writing-mode: vertical-rl;
  border: 1px solid var(--border-soft, #c5d0dc);
  background: #f7f7f8;
  color: var(--fg, #222);
  border-radius: 0.3rem 0 0 0.3rem;
  padding: 0.55rem 0.28rem;
  font-size: 0.68rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.dishup-root.is-history-side .dishup-history-show-btn[hidden] {
  display: none !important;
}

/* Keep「新規注文あり」clear of the compact history reopen control. */
.dishup-root.is-history-side.is-history-collapsed .dishup-new-badge {
  top: calc(50% + 2.4rem);
}

.dishup-root.is-history-side .dishup-history-row {
  flex-direction: column;
  align-items: stretch;
  gap: 0.25rem;
  padding: 0.35rem 0.3rem;
  background: #fff;
  border: 1px solid var(--border-soft);
}

.dishup-root.is-history-side .dishup-history-main {
  flex-direction: column;
  align-items: flex-start;
  gap: 0.12rem;
}

.dishup-root.is-history-side .dishup-history-name {
  white-space: normal;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  font-size: 0.72rem;
  line-height: 1.25;
}

.dishup-root.is-history-side .dishup-history-table {
  font-size: 0.85rem;
}

.dishup-root.is-history-side .dishup-history-undo-btn {
  align-self: flex-end;
  min-height: 1.85rem;
  min-width: 2.75rem;
}

.dishup-pane-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem;
  /* Slightly tighter: reclaim vertical space for 5-up body + remaining banner. */
  padding: 0.28rem 0.5rem 0.22rem;
  border-bottom: 1px solid var(--border-soft);
  flex-shrink: 0;
}

.dishup-pane-title {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--fg);
  letter-spacing: 0.04em;
}

.dishup-pane-status {
  font-size: 0.68rem;
  color: var(--fg-muted);
}

.dishup-rail {
  position: relative;
  flex: 1;
  min-height: 0;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  /* Card width is sized against the visible rail (5 tables per viewport). */
  container-type: inline-size;
  container-name: dishup-rail;
}

.dishup-cards {
  --dishup-gap: 0.4rem;
  --dishup-pad-x: 0.45rem;
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: stretch;
  gap: var(--dishup-gap);
  padding: 0.4rem var(--dishup-pad-x) 0.5rem;
  min-height: 100%;
  box-sizing: border-box;
}

.dishup-empty {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  text-align: center;
  color: var(--fg-muted);
  font-size: 0.85rem;
  pointer-events: none;
  z-index: 1;
}

/* Author display:flex must not defeat the hidden attribute (empty overlay bug). */
.dishup-empty[hidden] {
  display: none !important;
}

.dishup-new-badge {
  position: absolute;
  top: 50%;
  right: 0.45rem;
  transform: translateY(-50%);
  z-index: 3;
  border: 1px solid #c45c26;
  background: #fff4ec;
  color: #8a3a12;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.6rem 0.5rem;
  border-radius: 0.35rem;
  writing-mode: vertical-rl;
  cursor: pointer;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
}

.dishup-new-badge[hidden] {
  display: none !important;
}

.dishup-card {
  flex: 0 0 auto;
  width: min(17.5rem, 36vw);
  max-width: 20rem;
  display: flex;
  flex-direction: column;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 0.4rem;
  overflow: hidden;
  min-height: 0;
}

/*
 * Full Dish-up screen: fit 5 table cards in the visible rail width.
 * Formula: (rail − horizontal padding − 4 gaps) / 5.
 * min-width keeps text usable on narrow viewports (then scroll).
 */
.dishup-screen .dishup-card {
  width: calc(
    (100cqi - 2 * var(--dishup-pad-x, 0.45rem) - 4 * var(--dishup-gap, 0.4rem)) /
      5
  );
  max-width: none;
  /* Floor only for ultra-narrow rails (then horizontal scroll). */
  min-width: 8.75rem;
}

/* With right history column, prefer exact 5-up fit over a large min-width floor. */
.dishup-root.is-history-side .dishup-card {
  min-width: 0;
}

/* Timer side pane: restore pre-separation compact card width. */
.timer-screen .dishup-card {
  width: min(15.5rem, 78vw);
  max-width: none;
  min-width: 0;
}

@media (max-width: 900px) {
  .dishup-screen .dishup-cards {
    --dishup-gap: 0.35rem;
    --dishup-pad-x: 0.35rem;
  }
}

.dishup-card.is-warn-yellow {
  border-color: #e0b000;
  box-shadow: inset 0 0 0 1px rgba(224, 176, 0, 0.35);
}

/* Table-level: nothing served yet for this table (all-food frame). */
.dishup-card.is-table-unserved {
  background: #fff8ef;
  border-color: #e2c08a;
  box-shadow: inset 3px 0 0 0 #d4a017;
}

.dishup-card.is-table-unserved .dishup-card-head {
  background: #fff3e3;
}

/* Future long-wait (config-gated; not enabled by default). */
.dishup-card.is-table-long-wait {
  background: #fff5f5;
  border-color: #e0a0a0;
  box-shadow: inset 3px 0 0 0 #c23b3b;
}

.dishup-unserved-flag {
  display: inline-block;
  margin-top: 0.18rem;
  padding: 0.08rem 0.28rem;
  border-radius: 0.2rem;
  font-size: 0.58rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  color: #8a5a10;
  background: rgba(212, 160, 23, 0.18);
}

/* Light stall yellow after lastServedAt (formal; default 5 min). */
.dishup-card.is-table-stall {
  background: #fffced;
  border-color: #e6d27a;
  box-shadow: inset 3px 0 0 0 #c9a800;
}

.dishup-card.is-table-stall .dishup-card-head {
  background: #fff8d6;
}

.dishup-stall-flag {
  display: inline-block;
  margin-top: 0.14rem;
  padding: 0.08rem 0.28rem;
  border-radius: 0.2rem;
  font-size: 0.56rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  color: #7a6508;
  background: rgba(201, 168, 0, 0.2);
}

.dishup-card-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  column-gap: 0.35rem;
  row-gap: 0.14rem;
  padding: 0.28rem 0.4rem 0.26rem;
  border-bottom: 1px solid var(--border-soft);
  background: #fcfcfd;
}

.dishup-head-left {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-start;
  line-height: 1;
  min-width: 0;
}

.dishup-table-no {
  font-size: clamp(1.85rem, 4.2cqi, 2.45rem);
  font-weight: 800;
  color: var(--fg);
  letter-spacing: 0.02em;
  line-height: 0.95;
}

.dishup-head-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: flex-start;
  text-align: right;
  min-width: 0;
  gap: 0.06rem;
}

.dishup-elapsed {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--fg);
  line-height: 1.15;
}

.dishup-since-last {
  font-size: 0.58rem;
  font-weight: 600;
  color: var(--fg-muted);
  line-height: 1.2;
  white-space: nowrap;
}

.dishup-ordered-at {
  flex: 0 0 auto;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--fg);
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
  white-space: nowrap;
  text-align: right;
}

/*
 * Remaining-count banner: between header and item list.
 * Accent (not warn/danger) — ops emphasis for leftover serve qty.
 * ~1.5× prior 0.62rem helper text; keep thin for 5-up body space.
 */
.dishup-remaining-banner {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.15rem;
  padding: 0.2rem 0.35rem;
  margin: 0;
  text-align: center;
  font-size: clamp(0.88rem, 2.4cqi, 0.98rem);
  font-weight: 800;
  letter-spacing: 0.06em;
  line-height: 1.2;
  color: var(--accent, #2f5f49);
  background: var(--accent-soft, #e8f1ec);
  border-bottom: 1px solid var(--border-soft, #eceef2);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.dishup-remaining-banner.is-last-one {
  font-weight: 900;
  color: var(--accent-dim, #3d7a5c);
}

.dishup-card-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 0.28rem 0.35rem 0.4rem;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.dishup-item-row {
  display: grid;
  /* pin | name | timer | complete — pin column kept for DOM order; pin UI hidden */
  grid-template-columns: auto minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 0.28rem;
  /* Vertical padding enlarges the row tap target (mis-tap reduction). */
  padding: 0.4rem 0.18rem;
  border-radius: 0.25rem;
}

/* Soft divider between product blocks (parent+toppings = one row). */
.dishup-item-row + .dishup-item-row {
  border-top: 1px solid color-mix(in srgb, var(--border-soft, #eceef2) 85%, #c8ced6);
  margin-top: 0.06rem;
  padding-top: 0.4rem;
}

.dishup-item-row.is-completed + .dishup-item-row,
.dishup-item-row.is-local-served + .dishup-item-row,
.dishup-item-row + .dishup-item-row.is-completed,
.dishup-item-row + .dishup-item-row.is-local-served {
  border-top-color: color-mix(in srgb, var(--border-soft, #eceef2) 70%, transparent);
}

.dishup-item-row.is-complete-target {
  cursor: pointer;
}

.dishup-item-row.is-complete-target:hover {
  background: rgba(28, 36, 48, 0.04);
}

.dishup-item-row.is-completed {
  opacity: 0.72;
}

.dishup-item-row.is-partially-completed .dishup-partial-qty {
  opacity: 0.95;
}

/* Pin control hidden on Dish-up UI (persistence/logic retained). */
.dishup-root .item-pin-btn {
  display: none !important;
}

.dishup-root .dishup-item-row {
  grid-template-columns: minmax(0, 1fr) auto auto;
}

.dishup-item-row.is-orphan {
  background: #fff6f0;
  outline: 1px dashed #d0895a;
}

.dishup-item-main {
  display: flex;
  align-items: flex-start;
  gap: 0.28rem;
  min-width: 0;
}

.dishup-item-text {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.08rem;
  min-width: 0;
  flex: 1 1 auto;
}

.dishup-qty-badge {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.35rem;
  height: 1.35rem;
  padding: 0 0.25rem;
  border-radius: 0.2rem;
  background: #1c2430;
  color: #fff;
  font-size: 0.78rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  margin-top: 0.12rem;
}

.dishup-item-name {
  /* ~10% smaller than prior clamp(0.95rem, 2.4cqi, 1.2rem) */
  font-size: clamp(0.86rem, 2.15cqi, 1.08rem);
  font-weight: 700;
  color: var(--fg);
  line-height: 1.3;
  overflow-wrap: anywhere;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
}

.dishup-item-toppings {
  list-style: none;
  margin: 0;
  padding: 0 0 0 0.55rem;
  display: flex;
  flex-direction: column;
  gap: 0.02rem;
}

.dishup-item-topping {
  /* ~10% smaller than prior clamp(0.72rem, 1.9cqi, 0.88rem) */
  font-size: clamp(0.65rem, 1.7cqi, 0.8rem);
  font-weight: 600;
  color: var(--fg-muted, #5a6370);
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.dishup-item-topping::before {
  content: "└ ";
  color: var(--fg-muted, #5a6370);
  font-weight: 500;
}

.dishup-item-row.is-completed .dishup-item-topping,
.dishup-item-row.is-local-served .dishup-item-topping {
  text-decoration: line-through;
  opacity: 0.72;
}

.dishup-history-toppings {
  list-style: none;
  margin: 0.1rem 0 0;
  padding: 0 0 0 0.45rem;
}

.dishup-history-topping {
  font-size: 0.64rem;
  font-weight: 600;
  color: var(--fg-muted, #5a6370);
  line-height: 1.25;
}

.dishup-history-topping::before {
  content: "└ ";
}

.dishup-orphan-flag {
  color: #b45309;
  font-weight: 800;
  font-size: 0.75rem;
}

.dishup-done-btn {
  border: 1px solid var(--border);
  background: #eef1f4;
  color: #3a4553;
  font-size: 0.78rem;
  font-weight: 700;
  min-height: 2rem;
  min-width: 2.75rem;
  padding: 0.35rem 0.5rem;
  border-radius: 0.3rem;
  cursor: pointer;
  touch-action: manipulation;
}

.dishup-done-btn:disabled,
.dishup-done-btn[aria-disabled="true"] {
  background: #f3f4f6;
  color: #9aa3af;
  cursor: not-allowed;
}

.dishup-row-undo-btn,
.item-row-undo-btn {
  border: 1px solid var(--border);
  background: #fff;
  color: #3a4553;
  font-size: 0.78rem;
  font-weight: 700;
  min-height: 2rem;
  min-width: 2.75rem;
  padding: 0.35rem 0.5rem;
  border-radius: 0.3rem;
  cursor: pointer;
  touch-action: manipulation;
}

.dishup-row-undo-btn:active,
.item-row-undo-btn:active {
  background: #eee;
}

.dishup-item-row.is-local-served,
.dishup-item-row.is-completed {
  /* Served = Dish-up completion only (not Station 済). */
}

.dishup-item-row.is-local-served .dishup-item-text,
.dishup-item-row.is-completed .dishup-item-text {
  opacity: 0.55;
}

.dishup-item-row.is-local-served .dishup-item-name,
.dishup-item-row.is-completed .dishup-item-name {
  color: var(--fg-muted);
  text-decoration-line: line-through;
  text-decoration-style: double;
  text-decoration-thickness: from-font;
  font-size: 0.92em;
}

/* Keep qty / undo / controls readable on served rows */
.dishup-item-row.is-local-served .dishup-qty-badge,
.dishup-item-row.is-completed .dishup-qty-badge,
.dishup-item-row.is-local-served .item-complete-cell,
.dishup-item-row.is-completed .item-complete-cell,
.dishup-item-row.is-local-served .item-timer-cell,
.dishup-item-row.is-completed .item-timer-cell,
.dishup-item-row.is-local-served .dishup-pin-btn,
.dishup-item-row.is-completed .dishup-pin-btn,
.dishup-item-row.is-local-served .dishup-row-undo-btn,
.dishup-item-row.is-completed .dishup-row-undo-btn,
.dishup-item-row.is-local-served .item-row-undo-btn,
.dishup-item-row.is-completed .item-row-undo-btn {
  opacity: 1;
}

/* Former Dish-up Station-handoff served look removed
 * (KDS-DISHUP-SERVED-VISUAL-SEMANTICS-FIX-001). Station rows keep handoff dim below. */
.dishup-handoff-partial-qty {
  margin-left: 0.25rem;
  font-size: 0.72em;
  font-weight: 700;
  color: var(--fg-muted);
  text-decoration: none;
}

.dishup-done-qty,
.dishup-partial-qty {
  margin-left: 0.25rem;
  font-size: 0.72em;
  font-weight: 700;
  color: var(--fg-muted);
}

.item-complete-cell {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  flex-shrink: 0;
}

.item-complete-partial-menu {
  display: inline-flex;
  gap: 0.15rem;
}

.item-complete-qty-btn {
  min-width: 1.75rem;
  min-height: 1.75rem;
  padding: 0.15rem 0.35rem;
  border: 1px solid var(--border);
  border-radius: 0.3rem;
  background: #fff;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  touch-action: manipulation;
}

.fry-row .item-complete-cell,
.side-row .item-complete-cell,
.udon-row .item-complete-cell,
.longcook-row .item-complete-cell {
  margin-left: 0.25rem;
}

/* Station handoff controls (separate from Dish-up completion) */
.item-handoff-cell {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  flex-shrink: 0;
  margin-left: 0.25rem;
}

.item-handoff-partial-menu {
  display: inline-flex;
  gap: 0.15rem;
}

.item-handoff-qty-btn,
.item-handoff-btn,
.item-handoff-undo-btn {
  min-width: 1.75rem;
  min-height: 1.75rem;
  padding: 0.15rem 0.35rem;
  border: 1px solid var(--border);
  border-radius: 0.3rem;
  background: #fff;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  touch-action: manipulation;
}

.item-handoff-btn {
  min-width: 2.6rem;
}

.item-handoff-btn:disabled {
  opacity: 0.55;
  cursor: default;
}

.item-complete-btn.is-mutation-pending,
.dishup-done-btn.is-mutation-pending,
.item-handoff-btn.is-mutation-pending,
.item-handoff-undo-btn.is-mutation-pending,
.dishup-row-undo-btn.is-mutation-pending,
.item-timer-start-btn.is-mutation-pending,
.item-complete-cell.is-mutation-pending,
.item-handoff-cell.is-mutation-pending {
  opacity: 0.55;
  pointer-events: none;
  cursor: default;
}

.item-handoff-undo-btn {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--fg-muted);
  background: #f3f4f6;
}

.fry-row.is-station-handed,
.side-row.is-station-handed,
.udon-row.is-station-handed,
.longcook-row.is-station-handed {
  opacity: 0.55;
}

.fry-row.is-station-handed .fry-item-name,
.side-row.is-station-handed .side-item-name,
.udon-row.is-station-handed .udon-item-name,
.longcook-row.is-station-handed .longcook-item-name {
  text-decoration: line-through;
  text-decoration-thickness: 1px;
  color: var(--fg-muted);
}

.fry-row.is-station-partial-handed,
.side-row.is-station-partial-handed,
.udon-row.is-station-partial-handed,
.longcook-row.is-station-partial-handed {
  opacity: 0.88;
}

.dishup-history {
  flex-shrink: 0;
  border-top: 1px solid var(--border-soft);
  padding: 0.35rem 0.5rem 0.4rem;
  background: #f7f7f8;
  max-height: 22%;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
}

.dishup-history-title {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--fg-muted);
  margin-bottom: 0.2rem;
}

.dishup-history-note {
  margin-top: 0.25rem;
  font-size: 0.58rem;
  color: var(--fg-muted);
  opacity: 0.85;
}

.dishup-history-body {
  font-size: 0.72rem;
  color: var(--fg);
}

.dishup-history-empty {
  font-size: 0.64rem;
  color: var(--fg-muted);
  opacity: 0.9;
  padding: 0.15rem 0;
}

.dishup-history-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.dishup-history-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.4rem;
  padding: 0.2rem 0.15rem;
  border-radius: 0.25rem;
  background: rgba(255, 255, 255, 0.55);
}

.dishup-history-main {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0.35rem;
  min-width: 0;
  flex: 1;
}

.dishup-history-table {
  font-weight: 800;
  font-size: 0.72rem;
  flex-shrink: 0;
}

.dishup-history-name {
  font-size: 0.68rem;
  font-weight: 600;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dishup-history-qty {
  margin-left: 0.15rem;
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--fg-muted);
}

.dishup-history-clock {
  font-size: 0.64rem;
  color: var(--fg-muted);
  font-variant-numeric: tabular-nums;
  flex-shrink: 0;
}

.dishup-history-undo-btn {
  flex-shrink: 0;
  min-height: 1.7rem;
  min-width: 2.6rem;
  padding: 0.15rem 0.45rem;
  border: 1px solid var(--border);
  border-radius: 0.3rem;
  background: #fff;
  font-size: 0.68rem;
  font-weight: 700;
  cursor: pointer;
  touch-action: manipulation;
}

.dishup-history-undo-btn:active {
  background: #eee;
}
