/* Presenter screen — iPad: ready cards + dark kitchen column; phone (max-width 760px): one list of every live order (see presenter.js) */
#view-presenter { background: var(--cream); }
.pr {
  height: 100%; display: grid; gap: 14px 20px; padding: 18px var(--pad) 20px;
  grid-template-columns: minmax(0, 1fr) 320px; grid-template-rows: minmax(0, 1fr) auto; grid-template-areas: "main side" "foot side";
}
.pr__main { grid-area: main; min-height: 0; display: flex; flex-direction: column; gap: 14px; }
.pr__title { margin: 0; display: flex; align-items: baseline; gap: 12px; font-size: 24px; font-weight: 900; }
.pr__title small { font-size: 13px; font-weight: 700; opacity: .75; }
.pr__note { margin: 0; font-size: 13px; opacity: .75; }
.pr__cards { flex: 0 1 auto; min-height: 0; overflow-y: auto; -webkit-overflow-scrolling: touch; padding: 4px 10px 14px 4px; margin: -4px -10px -14px -4px; display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 18px; align-content: start; align-items: start; }
.pr__main .pr__note { margin-top: auto; }
.pr__empty { display: grid; gap: 6px; padding: 36px 20px; text-align: center; border: 2.5px dashed var(--ink); border-radius: 24px; }
.pr__empty b { font-size: 22px; font-weight: 900; }
.pr__empty span { font-size: 14px; opacity: .7; }

/* dark column: what the kitchen is making */
.pr__side { grid-area: side; min-height: 0; overflow-y: auto; -webkit-overflow-scrolling: touch; display: flex; flex-direction: column; gap: 12px; padding: 20px 16px; border-radius: 26px; background: var(--ink); color: var(--cream); }
.pr__side-title { margin: 0 4px; font-size: 19px; font-weight: 900; }
.pr__hint { margin: -6px 4px 4px; font-size: 12px; opacity: .7; }
.pr__making { display: grid; gap: 12px; align-content: start; }
.pr__making-none { margin: 8px 4px; font-size: 14px; opacity: .6; }

/* kitchen-column card */
.pr-mk { padding: 10px 12px 8px; border: var(--border); border-radius: 16px; background: var(--white); color: var(--ink); }
.pr-mk__head { display: flex; align-items: center; gap: 8px; }
.pr-mk__no { font-size: 28px; line-height: 1.15; }
.pr-mk__time { margin-left: auto; font-size: 16px; font-variant-numeric: tabular-nums; }
.pr-mk .pr-list { padding: 4px 0 0; }
.pr-mk .pr-row { grid-template-columns: 30px 26px minmax(0, 1fr) auto; gap: 8px; min-height: 52px; padding: 6px 4px; }
.pr-mk .pr-check { width: 30px; height: 30px; border-radius: 8px; }
.pr-mk .pr-check svg { width: 20px; height: 20px; }
.pr-mk .pr-name b { font-size: 15px; }
.pr-mk .pr-chip { padding: 4px 9px; font-size: 11px; }
.pr-mk__none { margin: 2px 2px 6px; font-size: 13px; opacity: .55; }
.pr-state { padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 900; white-space: nowrap; }
.pr-state--new { background: var(--cream-deep); }
.pr-state--cook { background: var(--pec); }
.pr-state--late { background: var(--orange); }

/* ready card */
.pr-card { background: var(--white); border: var(--border); border-radius: 24px; box-shadow: var(--shadow); }
.pr-card__head { display: flex; align-items: center; gap: 12px; padding: 12px 16px; background: var(--white); border-bottom: var(--border); border-radius: 21px 21px 0 0; transition: background-color .3s var(--ease-out); }
.pr-card.is-complete .pr-card__head { background: var(--pec); }
.pr-card__no { flex: none; font-size: 54px; line-height: 1; }
.pr-card__meta { display: grid; gap: 3px; min-width: 0; }
.pr-card__status { font-size: 18px; font-weight: 900; line-height: 1.2; }
.pr-time { font-size: 12px; font-weight: 700; white-space: nowrap; }
.pr-time b { font-size: 13px; font-variant-numeric: tabular-nums; }
.pr-time.is-stale { justify-self: start; padding: 2px 8px; border-radius: 8px; background: var(--orange); }
.pr-deal { flex: none; margin-left: auto; padding: 4px 10px; border: 2px solid var(--ink); border-radius: 999px; background: var(--hot); font-family: var(--font-label); font-size: 11px; font-weight: 900; white-space: nowrap; }
.pr-deal__short { display: none; }
.pr-card__foot { display: flex; gap: 12px; padding: 6px 14px 16px; }
.pr-call { flex: none; padding-inline: 18px; }
.pr-hand { flex: 1; min-width: 0; }
.pr-hand:disabled { font-size: 16px; }
.pr-call:disabled { opacity: .35; }

/* inside a card: food (follows the kitchen) and drinks (poured here) */
.pr-sec { padding: 4px 0 0; }
.pr-sec:not([hidden]) + .pr-sec { border-top: 2px dashed rgb(27 15 12 / .18); margin: 0 12px; }
.pr-sec:not([hidden]) + .pr-sec .pr-sec__h { margin-inline: 6px; }
.pr-sec:not([hidden]) + .pr-sec .pr-list { padding-inline: 0; }
.pr-row.is-food:not(.is-done) .pr-check { border-style: dashed; opacity: .45; } /* the kitchen ticks these, not a tap here */
.pr-sec__h { display: flex; align-items: center; gap: 8px; min-height: 30px; margin: 6px 18px 0; font-size: 13px; font-weight: 900; }
.pr-sec__h small { font-size: 11px; font-weight: 700; opacity: .6; }
.pr-kstate { margin-left: auto; display: inline-flex; align-items: center; gap: 6px; padding: 4px 11px; border-radius: 999px; font-size: 12px; font-weight: 900; white-space: nowrap; }
.pr-kstate--wait { background: var(--cream-deep); }
.pr-kstate--cook { background: var(--pec); }
.pr-kstate--late { background: var(--orange); }
.pr-kstate--ready { background: var(--green); color: var(--white); }
.pr-spin { width: 13px; height: 13px; border: 2.5px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: pr-spin .8s linear infinite; }
@keyframes pr-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .pr-spin { animation-duration: 2.4s; } }
.pr-card.is-making { box-shadow: var(--shadow-sm); }

/* checklist */
.pr-list { display: grid; gap: 2px; padding: 8px 10px; }
.pr-row {
  display: grid; grid-template-columns: 34px 32px minmax(0, 1fr) auto; align-items: center; gap: 10px;
  width: 100%; min-height: 58px; margin: 0; padding: 8px 8px; border: 0; border-radius: 12px; background: none; color: inherit; font: inherit; text-align: left;
}
button.pr-row { cursor: pointer; transition: transform .09s var(--ease-out), background-color .15s; }
button.pr-row:active, button.pr-row.is-pressed { transform: scale(.97); background: var(--cream); }
.pr-check { width: 34px; height: 34px; display: grid; place-items: center; border: var(--border); border-radius: 9px; background: var(--white); transition: background-color .15s; }
.pr-check svg { width: 22px; height: 22px; stroke: var(--pec); stroke-width: 3.4; opacity: 0; }
.pr-check path { stroke-dasharray: 1 2; stroke-dashoffset: 1; transition: stroke-dashoffset .3s .04s var(--ease-out); } /* the tick draws itself */
.pr-row.is-done .pr-check { background: var(--ink); }
.pr-row.is-done .pr-check svg { opacity: 1; }
.pr-row.is-done .pr-check path { stroke-dashoffset: 0; }
.pr-qty { font-size: 16px; text-align: center; }
.pr-name { display: grid; gap: 2px; min-width: 0; }
.pr-name b { font-size: 17px; line-height: 1.1; overflow-wrap: anywhere; }
.pr-name small { font-size: 11px; font-weight: 700; opacity: .65; }
.pr-qty, .pr-name { transition: opacity .2s; }
.pr-row.is-done .pr-qty, .pr-row.is-done .pr-name > b, .pr-row.is-done .pr-name > small { opacity: .38; } /* not .pr-name itself: its 抜き must stay bright */
.pr-chip { padding: 5px 10px; border-radius: 999px; background: var(--cream-deep); font-size: 12px; font-weight: 900; white-space: nowrap; }
.pr-chip--todo { background: var(--pec); }

/* buttons: 呼ぶ rings */
@keyframes pr-ring { from { box-shadow: var(--shadow), 0 0 0 0 rgb(27 15 12 / .4); } to { box-shadow: var(--shadow), 0 0 0 18px rgb(27 15 12 / 0); } }
@keyframes pr-wobble { 25% { transform: rotate(-16deg) scale(1.2); } 75% { transform: rotate(10deg) scale(1.2); } }
.pr-call.is-ringing { animation: pr-ring .8s var(--ease-out); }
.pr-call.is-ringing .icon { animation: pr-wobble .5s ease-in-out; }

/* motion: a handed card flies off to the right, a new 渡し済み chip bumps in */
@keyframes pr-fly { to { transform: translateX(56px) scale(.85); opacity: 0; } }
@keyframes pr-chip-in { from { transform: scale(.5); opacity: 0; } 60% { transform: scale(1.22); opacity: 1; } }
.pr-card.is-leaving { animation: pr-fly .38s var(--ease-out) forwards; }
.pr-hchip.is-entering { animation: pr-chip-in .5s var(--ease-spring) both; }

/* 渡し済み strip */
.pr__handed { grid-area: foot; display: flex; align-items: center; gap: 12px; min-height: 66px; padding: 8px 14px 8px 20px; border: 2.5px dashed var(--ink); border-radius: 20px; }
.pr__handed-label { font-size: 14px; font-weight: 900; white-space: nowrap; }
.pr__handed-chips { display: flex; gap: 8px; min-width: 0; overflow: hidden; padding: 6px; margin: -6px; }
.pr__handed-none { font-size: 13px; opacity: .55; }
.pr-hchip { flex: none; padding: 6px 14px; border-radius: 999px; background: var(--cream-deep); font-size: 15px; }
.pr__undo { margin-left: auto; min-height: 48px; padding: 8px 16px; font-size: 14px; }
.pr__undo:disabled { --bg: transparent; opacity: .35; }
.pr__undo .icon { width: 1.3em; height: 1.3em; }

/* ---------- phone ---------- */
@media (max-width: 760px) {
  .pr { display: flex; flex-direction: column; gap: 0; padding: 0; }
  .pr__main { flex: 1; min-height: 0; overflow-y: auto; display: block; padding: 14px 14px 16px; }
  .pr__side, .pr__title, .pr__note { display: none; }
  .pr__cards { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; overflow: visible; padding: 0 6px 6px 0; margin: 0; }
  .pr__empty { margin-top: 8px; }
  .pr-card__no { font-size: 50px; }
  .pr-card__status { font-size: 17px; }
  .pr-deal__long { display: none; }
  .pr-deal__short { display: inline; }

  .pr__handed { flex: none; min-height: 0; gap: 8px; padding: 10px 14px calc(10px + env(safe-area-inset-bottom)); border: 0; border-top: var(--border); border-radius: 0; background: var(--white); }
  .toasts { bottom: calc(84px + env(safe-area-inset-bottom)); } /* keep toasts above the fixed 渡し済み bar */
  .pr__handed-label { font-size: 13px; }
  .pr-hand:disabled { font-size: 14px; white-space: nowrap; }
  .pr__undo { white-space: nowrap; padding-inline: 12px; }
  .pr-hchip { padding: 5px 11px; font-size: 14px; }
}

/* 抜き: red, and never dimmed with the rest of a ticked row — the presenter checks them when bagging */
.pr-mods { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 3px; }
.pr-mods b { padding: 2px 7px; border-radius: 6px; background: var(--red); color: var(--white); font: 900 12px/1.2 var(--font-jp); }
