/* Kitchen screen — dark board split in four; the 4 oldest orders fill it (see kitchen.js) */
#view-kitchen { background: var(--ink); color: var(--cream); }
.kt { height: 100%; display: flex; flex-direction: column; gap: 12px; padding: 12px var(--pad) 14px; }

/* summary row */
.kt__summary { flex: none; display: flex; align-items: center; flex-wrap: wrap; gap: 10px; }
.kt-chip { display: inline-flex; align-items: center; gap: 10px; padding: 7px 8px 7px 18px; border-radius: 999px; color: var(--ink); font-size: 16px; font-weight: 900; }
.kt-chip--new { background: var(--white); }
.kt-chip--cook { background: var(--pec); }
.kt-chip b { min-width: 30px; padding: 2px 9px; border-radius: 999px; background: var(--ink); color: var(--cream); font-size: 16px; text-align: center; }
.kt__hint { margin-left: auto; font-size: 13px; opacity: .75; }

/* board: a cross of four quarters. The dashed slots sit behind; the tickets fill them in order (top left first). */
.kt__main { flex: 1; min-height: 0; position: relative; }
.kt__slots, .kt__board { position: absolute; inset: 0; display: grid; grid-template: repeat(2, minmax(0, 1fr)) / repeat(2, minmax(0, 1fr)); gap: 16px; }
.kt__board { grid-auto-flow: row dense; }
.kt__slots i { border: 2.5px dashed rgb(251 245 232 / .18); border-radius: 22px; }
.kt__empty { position: absolute; inset: 0; display: grid; place-content: center; gap: 6px; text-align: center; opacity: .6; pointer-events: none; }
.kt__empty b { font-size: 24px; font-weight: 900; }
.kt__empty span { font-size: 14px; }
/* more orders waiting than fit: "+2" over the bottom-right corner */
.kt__more {
  position: absolute; right: -8px; bottom: -10px; z-index: 2; min-width: 64px; padding: 8px 16px; text-align: center;
  border: 3px solid var(--ink); border-radius: 999px; background: var(--cream); color: var(--ink); box-shadow: 0 0 0 3px var(--cream), var(--shadow-lg);
  font-size: 34px; line-height: 1; animation: pop-in .35s var(--ease-spring);
}
.kt__more small { margin-left: 4px; font-family: var(--font-jp); font-size: 15px; font-weight: 900; }
.kt__more.is-bumped { animation: bump .35s var(--ease-spring); }

/* ticket: the whole card is the button */
.kt-ticket {
  position: relative; min-width: 0; min-height: 0; display: flex; flex-direction: column; cursor: pointer;
  background: var(--white); color: var(--ink); border: 3px solid var(--white); border-radius: 22px; overflow: hidden;
  -webkit-touch-callout: none; transition: transform .1s var(--ease-out), box-shadow .1s var(--ease-out);
}
.kt-ticket:active, .kt-ticket.is-pressed { transform: scale(.975); }
.kt-ticket:focus-visible { outline: 4px solid var(--blue); outline-offset: 3px; }
.kt-ticket__head { flex: none; display: flex; align-items: center; gap: 8px; padding: 4px 14px 4px 16px; background: var(--white); border-bottom: 2.5px solid var(--ink); transition: background-color .25s; }
.kt-ticket__no { flex: none; font-size: clamp(44px, 4.7vw, 58px); line-height: 1.05; }
.kt-ticket__state { flex: none; font-family: var(--font-label); font-size: clamp(15px, 1.55vw, 18px); font-weight: 900; letter-spacing: .02em; white-space: nowrap; }
/* what a tap does: ink before cooking, green (completion) while cooking */
.kt-ticket__next { margin-left: auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; padding: 8px clamp(10px, 1.2vw, 16px); border-radius: 999px; background: var(--ink); color: var(--cream); font-size: clamp(15px, 1.55vw, 18px); font-weight: 900; white-space: nowrap; }
.kt-ticket.is-cooking .kt-ticket__next { background: var(--green); color: var(--white); }
.kt-ticket__time { flex: none; min-width: 2.8em; text-align: right; font-size: clamp(26px, 2.7vw, 32px); font-variant-numeric: tabular-nums; }
.kt-ticket.is-cooking .kt-ticket__head { background: var(--pec); border-bottom-color: transparent; }
.kt-ticket.is-cooking .kt-ticket__state, .kt-ticket.is-late .kt-ticket__state { font-family: var(--font-jp); font-size: clamp(16px, 1.6vw, 19px); }
.kt-ticket.is-late { border-color: var(--orange); }
.kt-ticket.is-late .kt-ticket__head { background: var(--orange); border-bottom-color: transparent; }
.kt-ticket[data-busy] { opacity: 1; } /* busy only blocks taps; the card shouldn't fade */
.kt-ticket[data-busy] .kt-ticket__next { opacity: .6; }

.kt-ticket__lines { position: relative; flex: 1; min-height: 0; overflow: hidden; display: grid; align-content: start; gap: 12px; padding: 12px 16px 8px; }
.kt-line { display: grid; grid-template-columns: 74px minmax(0, 1fr); align-items: start; gap: 6px; }
.kt-line__qty { font-size: 42px; line-height: 1; }
.kt-line__qty i { font-style: normal; font-size: 26px; margin-left: 1px; }
.kt-line__name { display: grid; gap: 3px; min-width: 0; }
.kt-line__name .en { font-size: 40px; line-height: 1; }
.kt-line__name small { font-size: 15px; opacity: .6; }
/* a big order: smaller text → two quarters side by side (is-wide) → more columns, smaller text → scroll (with a cue). Phones skip is-wide */
.kt-ticket.is-dense .kt-ticket__lines { gap: 7px; padding-top: 9px; }
.kt-ticket.is-dense .kt-line { grid-template-columns: 56px minmax(0, 1fr); }
.kt-ticket.is-dense .kt-line__qty { font-size: 32px; }
.kt-ticket.is-dense .kt-line__name .en { font-size: 30px; }
.kt-ticket.is-dense .kt-line__name small { display: none; }
/* two columns as a grid, not CSS columns: CSS columns spill sideways out of sight; a grid grows downwards, so it can be measured and scrolled */
.kt-ticket.is-denser .kt-ticket__lines { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 16px; }
.kt-ticket.is-wide { grid-column: span 2; }
.kt-ticket.is-wide .kt-ticket__lines { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 28px; }
.kt-ticket.is-wide.is-denser .kt-ticket__lines { grid-template-columns: repeat(3, minmax(0, 1fr)); column-gap: 20px; }
.kt-ticket.is-densest .kt-ticket__lines { row-gap: 5px; }
.kt-ticket.is-densest .kt-line { grid-template-columns: 42px minmax(0, 1fr); }
.kt-ticket.is-densest .kt-line__qty { font-size: 24px; }
.kt-ticket.is-densest .kt-line__name .en { font-size: 22px; }
.kt-ticket.is-overflow .kt-ticket__lines { overflow-y: auto; }
/* the cue sticks to the bottom of the list itself, so it never covers the drinks line */
.kt-ticket.is-overflow .kt-ticket__lines::after {
  content: "↓ 品目がまだあります"; grid-column: 1 / -1; justify-self: end; position: sticky; bottom: 0; padding: 4px 10px; border-radius: 999px;
  background: var(--orange); color: var(--ink); font-size: 15px; font-weight: 900; pointer-events: none;
}
.kt-ticket__drinks { flex: none; margin: 0 14px 12px; padding: 6px 12px; border-radius: 10px; background: var(--cream-deep); font-size: 16px; }
.kt-ticket__drinks b { margin-left: 6px; font-size: 16px; }

/* motion: new tickets pop in with a yellow glow, late ones pulse, finished ones shrink out (app.keyed) */
.kt-ticket.is-fresh { animation: pop-in .42s var(--ease-spring) both, flash-new 1.2s var(--ease-out) both; }
.kt-ticket.is-late:not(.is-leaving):not(.is-fresh):not(.is-entering) { animation: pulse-warn 2.2s ease-in-out infinite; }
.kt-ticket.is-leaving { animation: leave .32s var(--ease-out) forwards; }

/* 抜き: solid red so they can't be missed at the grill */
.kt-mods { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.kt-mods b { padding: 3px 12px; border-radius: 8px; background: var(--red); color: var(--white); font: 900 22px/1.2 var(--font-jp); }
.kt-ticket.is-dense .kt-mods b { font-size: 18px; padding: 2px 9px; }
.kt-ticket.is-densest .kt-mods b { font-size: 15px; padding: 1px 7px; }

/* 受け渡し待ち strip */
.kt__ready { flex: none; display: flex; align-items: center; gap: 12px; min-height: 56px; padding: 6px 12px 6px 18px; border: 2.5px dashed rgb(251 245 232 / .55); border-radius: 20px; }
.kt__ready-label { font-size: 14px; font-weight: 900; white-space: nowrap; }
.kt__ready-chips { display: flex; flex-wrap: wrap; gap: 8px; min-width: 0; }
.kt__ready-none { font-size: 13px; opacity: .55; }
.kt-rchip { display: inline-flex; align-items: baseline; gap: 8px; padding: 6px 14px; border-radius: 999px; background: var(--pec); color: var(--ink); }
.kt-rchip b { font-size: 16px; }
.kt-rchip small { font-size: 12px; font-weight: 800; }
.kt__undo { --fg: var(--cream); margin-left: auto; min-height: 48px; padding: 8px 16px; font-size: 14px; border-color: var(--cream); }
.kt__undo:disabled { --bg: transparent; opacity: .35; }
.kt__undo .icon { width: 1.3em; height: 1.3em; }

/* a kitchen opened on something narrower than an iPad: one column of four */
@media (max-width: 760px) {
  .kt__hint { margin-left: 0; }
  .kt__slots, .kt__board { grid-template: repeat(4, minmax(0, 1fr)) / minmax(0, 1fr); }
  .kt-ticket.is-wide { grid-column: auto; }
  .kt__ready { flex-wrap: wrap; }
}
