/* KDS · final layout (approved style A geometry). No colours here: every colour is a token from tokens.css. 8pt grid: 1rem = 8px at 1920x1080; the root size scales with the screen. */
*{box-sizing:border-box;margin:0;padding:0}
html{font-size:8px}
@media (min-width:701px){html{font-size:min(calc(100vw / 240),calc(100vh / 135))}}
html,body{height:100%}
body{background:var(--screen);color:var(--screen-ink);font-family:var(--font-ui);font-weight:var(--w-regular);
  letter-spacing:-.011em;-webkit-font-smoothing:antialiased;font-feature-settings:"tnum" 1;overflow:hidden}
svg{display:block;flex:none}
button{font:inherit;border:0;cursor:pointer}

.screen{height:100vh;display:grid;grid-template-columns:minmax(0,1fr);grid-template-rows:11rem 1fr 11rem}

/* top bar */
.top{display:flex;align-items:center;justify-content:space-between;padding:0 4rem}
.top .l,.top .r{display:flex;align-items:center;gap:4rem}
.title{font-size:3.5rem;font-weight:var(--w-bold);letter-spacing:-.02em}
.sub{font-size:3.5rem;color:var(--screen-ink-2)}
.status{display:flex;align-items:center;gap:1.5rem;font-size:2.5rem;color:var(--screen-ink)}
.status svg{display:none;width:3rem;height:3rem}
.t.whole,.sum{display:none}
.status i{width:1.5rem;height:1.5rem;border-radius:50%;background:var(--ok-dot)}
.clock{font-size:3.5rem;font-weight:var(--w-bold);letter-spacing:-.02em}

/* ticket grid: always 4 x 2, equal cells */
.grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));grid-template-rows:repeat(2,1fr);gap:3rem;padding:0 4rem;min-height:0}

.t{background:var(--card);color:var(--card-ink);border-radius:var(--card-radius);box-shadow:0 0 0 1px var(--card-edge),var(--card-shadow);
  display:flex;flex-direction:column;min-height:0;overflow:hidden}

.th{display:flex;align-items:center;justify-content:space-between;gap:2rem;height:12rem;padding:0 3rem;flex:none}
.num{font-family:var(--font-num);font-size:7.5rem;line-height:1;font-weight:var(--w-bold);letter-spacing:-.04em}
.meta{display:flex;flex-direction:column;align-items:flex-end;gap:1rem}
.timer{font-size:3.5rem;line-height:1;font-weight:var(--w-bold)}
.type{display:flex;align-items:center;gap:1rem;font-size:2.75rem;line-height:1}
.type svg{width:2.75rem;height:2.75rem}

.items{list-style:none;flex:1;min-height:0;padding:1rem 3rem 0;display:flex;flex-direction:column;gap:2rem}
.items li{display:grid;grid-template-columns:6rem minmax(0,1fr);align-items:baseline}
.q{font-size:3.5rem;line-height:1.25;font-weight:var(--w-bold)}
.nm{font-size:3.5rem;line-height:1.25;font-weight:var(--w-bold);letter-spacing:-.02em;overflow-wrap:anywhere}
.md .g{white-space:nowrap}
.md{overflow-wrap:anywhere}.md .g.long{white-space:normal} /* a long dish name or option list wraps inside the ticket (was clipped) */
.md{grid-column:2;font-size:2.75rem;line-height:1.3;color:var(--card-ink-2);margin-top:.5rem}
.note{display:flex;align-items:center;gap:1rem;padding:0 3rem 2rem;font-size:2.75rem;line-height:1;color:var(--card-ink-2);flex:none}
.note svg{width:2.75rem;height:2.75rem}
.tf{padding:0 3rem 3rem;flex:none}
.done{width:100%;height:8rem;border-radius:calc(var(--card-radius) * .5 + 4px);background:var(--accent);color:var(--on-accent);box-sizing:border-box;border:var(--accent-edge-w,0px) solid var(--accent-edge,transparent);
  font-size:3.5rem;font-weight:var(--w-bold);display:flex;align-items:center;justify-content:center;gap:1.5rem}
.done svg{width:3.5rem;height:3.5rem}
.cont{height:8rem;display:flex;align-items:center;justify-content:center;gap:1rem;font-size:2.75rem;color:var(--card-ink-2)}
.cont svg{width:2.5rem;height:2.5rem}

/* bottom bar */
.bot{display:flex;align-items:center;justify-content:space-between;gap:4rem;padding:0 4rem}
.allday{display:flex;align-items:center;gap:4rem;min-width:0;overflow:hidden;white-space:nowrap}
.allday .list{display:flex;flex-wrap:wrap;align-items:center;column-gap:4rem;height:4rem;overflow:hidden;min-width:0}
.allday .list .it{line-height:4rem}
.allday .lab{font-size:2.5rem;font-weight:var(--w-bold);text-transform:uppercase;letter-spacing:.06em}
.allday .it{font-size:3rem}
.allday .it b{font-weight:var(--w-bold);margin-inline-end:1rem}
.allday .more{font-size:3rem;color:var(--screen-ink-2)}
.recall{flex:none;height:7rem;padding:0 3.5rem;border-radius:999px;background:var(--quiet);color:var(--on-quiet);
  display:flex;align-items:center;gap:1.5rem;font-size:2.75rem;font-weight:var(--w-bold)}
.recall svg{width:3rem;height:3rem}
.recall span{font-weight:var(--w-regular)}

/* ===== status colours: tokens -> ticket (colour only) ===== */
.t{--hs:var(--ok-strip);--hh:var(--ok-head);--ht:var(--ok-type);--hp:var(--ok-pill);--hpi:var(--ok-pill-ink);--hb:var(--ok-bar)}
.t.new{--hs:var(--new-strip);--hh:var(--new-head);--ht:var(--new-type);--hp:var(--new-pill);--hpi:var(--new-pill-ink);--hb:var(--new-bar)}
.t.warn{--hs:var(--warn-strip);--hh:var(--warn-head);--ht:var(--warn-type);--hp:var(--warn-pill);--hpi:var(--warn-pill-ink);--hb:var(--warn-bar)}
.t.late{--hs:var(--late-strip);--hh:var(--late-head);--ht:var(--late-type);--hp:var(--late-pill);--hpi:var(--late-pill-ink);--hb:var(--late-bar)}
.th{background:var(--hs);color:var(--hh);box-shadow:inset 0 var(--bar-w) 0 var(--hb)}
.type{color:var(--ht)}
.timer{background:var(--hp);color:var(--hpi);height:5rem;padding:0 2rem;border-radius:999px;display:flex;align-items:center}
.meta{gap:1.5rem}
.items{padding-top:var(--items-top)}
.status.off i{background:var(--off-dot)}

/* ===== phone ===== */
@media (max-width:700px){
  html{font-size:7px}
  body{overflow:auto}
  .screen{height:auto;min-height:100vh;grid-template-rows:auto auto auto;padding-bottom:13rem}
  .top{height:10rem;padding:0 3rem}
  .top .sub,.top .status span{display:none}
  .top .l,.top .r{gap:2.5rem}
  .grid{grid-template-columns:1fr;grid-template-rows:none;padding:0 2rem;gap:2rem}
  .t{min-height:0}
  .items{flex:none;padding-bottom:3rem}
  .bot{position:fixed;left:0;right:0;bottom:0;height:12rem;padding:0 3rem;background:var(--screen);box-shadow:0 -1px 0 var(--quiet)}
  .t.split{display:none}
  .t.whole{display:flex}
  .allday .list,.allday .more{display:none}
  .allday .sum{display:block;font-size:3rem}
  .status svg{display:block}
  .status{gap:1rem}
  .allday{gap:2.5rem}
  .recall span{display:none}
}

/* ===================== live screen (apps/kitchen) additions — layout only, colours from tokens.css ===================== */
html{--scale:1}
@media (min-width:701px){html{font-size:calc(min(calc(100vw / 240),calc(100vh / 135)) * var(--scale))}}
@media (min-width:701px) and (orientation:portrait){html{font-size:calc(min(calc(100vw / 123),calc(100vh / 205)) * var(--scale))}
  .grid{grid-template-columns:repeat(2,minmax(0,1fr));grid-template-rows:repeat(3,1fr)}}
.screen{grid-template-rows:11rem auto 1fr 11rem}
.screen.noall{grid-template-rows:11rem auto 1fr 0}
.screen.noall .allday{visibility:hidden}
.top .l{min-width:0}
.title{white-space:nowrap}
.sub{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.clock,.timer,.num,.q,.allday .it b{unicode-bidi:isolate;direction:ltr}
.gear{width:6rem;height:6rem;border-radius:50%;background:transparent;color:var(--screen-ink-2);display:flex;align-items:center;justify-content:center;margin-inline-start:-1rem}
.gear svg{width:3.5rem;height:3.5rem}
.status.conn i{background:var(--conn-dot);animation:breathe 2.4s ease-in-out infinite}
.status.conn{color:var(--conn-ink)}
@keyframes breathe{50%{opacity:.35}}
@media (prefers-reduced-motion:reduce){.status.conn i{animation:none}}

/* tickets: tap a line to cross it out */
.t{position:relative;transition:opacity .25s ease}
.t.leaving{opacity:0}
.items li{cursor:pointer;-webkit-tap-highlight-color:transparent;border-radius:1.5rem;margin:0 -1rem;padding:0 1rem}
.items li:active{background:var(--quiet)}
.items li.x .q,.items li.x .nm{color:var(--crossed);text-decoration:line-through;text-decoration-thickness:.35rem}
.items li.x .md{color:var(--crossed)}
.items li.oth{cursor:default}
.items li.oth:active{background:none}
.items li.oth .q,.items li.oth .nm{color:var(--other);font-weight:var(--w-regular)}
.items li.oth .md{color:var(--other)}
.items li.oth.x .q,.items li.oth.x .nm{text-decoration:line-through}
.items li.sep{display:flex;align-items:center;gap:1.5rem;font-size:2.5rem;font-weight:var(--w-bold);text-transform:uppercase;letter-spacing:.06em;color:var(--other);cursor:default;padding-top:1rem;border-top:1px solid var(--rule);border-radius:0}
.items li.sep:active{background:none}
.items li.who{display:block;cursor:default;padding:1.25rem 0 .25rem;border-radius:0}
.items li.who:active{background:none}
.items li.who .who-n{display:inline-flex;align-items:center;gap:.75rem;font-size:2.4rem;font-weight:var(--w-bold);text-transform:uppercase;letter-spacing:.05em;color:var(--card-ink);background:var(--rule);border-radius:999px;padding:.35rem 1.4rem}
.items li.who .who-n svg{width:2.2rem;height:2.2rem}
.items li.who + li{border-top:0}
.items .who-t{display:inline-block;vertical-align:.15em;margin-inline-start:.5em;max-width:10em;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:.6em;font-weight:var(--w-bold);text-transform:uppercase;letter-spacing:.05em;line-height:1.5;padding:0 .6em;border-radius:999px;background:var(--rule);color:var(--card-ink)}
.items li.x .who-t{text-decoration:none}
.items li.tnote .nm{font-weight:var(--w-regular);font-size:2.75rem;color:var(--card-ink-2);font-style:italic}
.items li.tnote{cursor:default}
.items li.tnote:active{background:none}
.th{cursor:default}
.th.tap{cursor:pointer}
.type .lab{max-width:24rem;text-align:end;line-height:1.1}
.cell-empty{visibility:hidden}

/* measuring box: a ticket at cell size, off screen */
#measure{position:fixed;left:-10000px;top:0;visibility:hidden;pointer-events:none;display:flex}
#measure .t{height:100%;width:100%}

/* empty state */
.empty{grid-column:1/-1;grid-row:1/-1;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:2rem;text-align:center;color:var(--screen-ink-2)}
.empty .ic{width:16rem;height:16rem;border-radius:50%;background:var(--card);box-shadow:0 0 0 1px var(--card-edge),var(--card-shadow);display:flex;align-items:center;justify-content:center;color:var(--screen-ink-2);margin-bottom:2rem}
.empty .ic svg{width:7rem;height:7rem}
.empty b{font-size:5rem;font-weight:var(--w-bold);color:var(--screen-ink);letter-spacing:-.02em}
.empty span{font-size:3rem}

/* bottom bar extras */
.bot .r{display:flex;align-items:center;gap:3rem;flex:none}
.waitmore{font-size:2.75rem;font-weight:var(--w-bold);color:var(--screen-ink-2);white-space:nowrap}
.recall[disabled]{opacity:.45;cursor:default}

/* toast */
.toast{position:fixed;left:50%;bottom:14rem;transform:translateX(-50%);background:var(--toast);color:var(--toast-ink);font-size:2.75rem;font-weight:var(--w-bold);
  padding:2rem 4rem;border-radius:999px;opacity:0;transition:opacity .25s ease;pointer-events:none;z-index:30;white-space:nowrap}
.toast.on{opacity:1}
.soundtap{background:var(--quiet);color:var(--on-quiet);height:6rem;padding:0 3rem;border-radius:999px;font-weight:var(--w-bold)}
.soundtap svg{display:block}

/* settings sheet (same frame as the reprint sheet) */
.ssheet{position:fixed;left:50%;top:50%;transform:translate(-50%,-50%);width:min(124rem,calc(100vw - 8rem));max-height:calc(100vh - 8rem);overflow:auto;
  background:var(--sheet);color:var(--sheet-ink);border-radius:5rem;padding:5rem 6rem;box-shadow:var(--sheet-shadow);z-index:41}
.ss-row{display:flex;align-items:center;justify-content:space-between;gap:3rem;min-height:10rem;border-bottom:1px solid var(--sheet-edge)}
.ss-row:last-of-type{border-bottom:0}
.ss-row>span{font-size:3rem;font-weight:var(--w-bold)}
.ss-seg{display:flex;padding:.75rem;background:var(--sheet-quiet);border-radius:999px;gap:.5rem;flex:none}
.ss-seg button{height:6.5rem;padding:0 3rem;border-radius:999px;background:transparent;color:var(--sheet-ink-2);font-size:2.6rem;font-weight:var(--w-bold)}
.ss-seg button.on{background:var(--seg-on);color:var(--sheet-ink);box-shadow:var(--seg-shadow)}
.tog{width:11rem;height:6.5rem;border-radius:999px;background:var(--toggle-off);position:relative;flex:none;transition:background .2s}
.tog::after{content:"";position:absolute;top:.75rem;inset-inline-start:.75rem;width:5rem;height:5rem;border-radius:50%;background:#fff;box-shadow:0 1px 3px rgba(0,0,0,.25);transition:inset-inline-start .2s}
.tog.on{background:var(--toggle-on)}
.tog.on::after{inset-inline-start:5.25rem}
.ss-note{font-size:2.5rem;color:var(--sheet-ink-3);margin-top:3rem;line-height:1.4}
.ss-step{display:flex;align-items:center;gap:2rem;flex:none}
.ss-step button{width:6.5rem;height:6.5rem;border-radius:50%;background:var(--sheet-quiet);color:var(--sheet-ink);font-size:3.5rem;font-weight:var(--w-bold)}
.ss-step b{font-size:3rem;min-width:10rem;text-align:center}

/* setup (pairing) */
#setup{position:fixed;inset:0;background:var(--screen);display:none;align-items:center;justify-content:center;z-index:50;padding:4rem}
#setup.on{display:flex}
#setup .box{width:min(110rem,100%);background:var(--card);color:var(--card-ink);border-radius:5rem;padding:7rem 7rem 6rem;box-shadow:0 0 0 1px var(--card-edge),var(--card-shadow);text-align:center}
#setup .ic{width:14rem;height:14rem;border-radius:50%;background:var(--quiet);display:flex;align-items:center;justify-content:center;margin:0 auto 4rem;color:var(--card-ink)}
#setup .ic svg{width:6.5rem;height:6.5rem}
#setup h1{font-size:6rem;letter-spacing:-.03em;font-weight:var(--w-bold)}
#setup p{font-size:3rem;line-height:1.45;color:var(--card-ink-2);margin:3rem auto 5rem;max-width:90rem}
#setup p b{color:var(--card-ink)}
#setup input{width:60rem;max-width:100%;height:12rem;border-radius:3rem;border:0;box-shadow:inset 0 0 0 1px var(--card-edge);background:var(--screen);color:var(--card-ink);
  font:inherit;font-size:5.5rem;font-weight:var(--w-bold);letter-spacing:.2em;text-align:center;text-transform:uppercase;outline:none}
#setup input:focus{box-shadow:inset 0 0 0 .5rem var(--accent)}
#setup button{margin-top:4rem;height:10rem;padding:0 9rem;border-radius:999px;background:var(--accent);color:var(--on-accent);border:var(--accent-edge-w) solid var(--accent-edge);font-size:3.5rem;font-weight:var(--w-bold)}
#setup button[disabled]{opacity:.5}
#setup .err{min-height:4rem;margin-top:3rem;font-size:2.75rem;color:var(--late-head)}

@media (max-width:700px){
  .screen,.screen.noall{grid-template-rows:auto auto auto auto}
  .grid{grid-template-columns:1fr}
  .top .gear{margin-inline-start:0}
  .bot .waitmore{display:none}
  .empty{padding:12rem 0}
  .ssheet,.rsheet{width:calc(100vw - 4rem);padding:5rem 4rem}
  .ss-row{flex-wrap:wrap;padding:2rem 0}
  #setup input{font-size:4.5rem}
}

/* Hebrew (RTL): the quantity hugs its column's right edge, arrows point the reading way */
[dir=rtl] .q{text-align:right}
[dir=rtl] .allday .it b{margin-inline-end:0;margin-left:1rem}
[dir=rtl] .cont svg,[dir=rtl] .recall svg{transform:scaleX(-1)}
[dir=rtl] .nm,[dir=rtl] .md,[dir=rtl] .allday .an{unicode-bidi:plaintext;text-align:right}
/* a little air between the last line and Done (the split measures with it) */
.items{padding-bottom:1.5rem}

/* channel badge: click & collect / delivery platforms (model.js channelOf) */
.type .chan{display:inline-block;margin-inline-start:8px;padding:1px 8px;border-radius:999px;font-size:.82em;font-weight:650;background:rgba(17,17,17,.07);color:#111111;white-space:nowrap}
.type .chan.here{background:#111111;color:#fff}
/* a long channel line ("Online · ASAP · name") wraps under the type instead of running into the ticket number */
header.th .nwrap{flex:none;min-width:max-content}
header.th .meta{flex:1 1 0;min-width:0;gap:.8rem}
header.th .type{flex-wrap:wrap;justify-content:flex-end;row-gap:.6rem;max-width:100%}
header.th .type .chan{max-width:100%;overflow:hidden;text-overflow:ellipsis}
.type .chan.delivery{background:#1B365D;color:#fff;letter-spacing:.02em;text-transform:uppercase;font-size:.78em;padding:2px 9px}
.type .chan.uber_eats{background:#E8F5EC;color:#11663A}.type .chan.deliveroo{background:#E6F7F6;color:#007C78}.type .chan.takeaway{background:#F1EEFA;color:#5B47B0}

/* ticket order: drag to rearrange (hold ~300 ms on touch), Move to front/back, Undo, Reset (app.js "ticket order") */
#screen .grid .t{-webkit-touch-callout:none;-webkit-user-select:none;user-select:none}
@media (min-width:701px){#screen .grid .t{touch-action:none}}
.tmore{flex:none;width:9rem;height:9rem;margin-inline-end:-2.5rem;border-radius:50%;display:flex;align-items:center;justify-content:center;background:transparent;color:inherit;opacity:.72}
.tmore svg{width:4.25rem;height:4.25rem}
.tmore:active,.tmore:focus-visible{opacity:1;background:rgba(127,127,127,.18);outline:none}
.t.ghost{background:color-mix(in srgb,var(--screen-ink) 5%,transparent);box-shadow:inset 0 0 0 .375rem color-mix(in srgb,var(--screen-ink) 16%,transparent)}
.t.ghost>*{visibility:hidden}
.t.lift{position:fixed;z-index:60;margin:0;pointer-events:none;will-change:transform;
  transition:scale .2s cubic-bezier(.2,.8,.2,1),box-shadow .2s ease;box-shadow:0 0 0 1px var(--card-edge),0 1rem 2rem rgba(0,0,0,.08)}
.t.lift.up{scale:1.04;box-shadow:0 0 0 1px var(--card-edge),0 5rem 10rem rgba(0,0,0,.26),0 1.5rem 3rem rgba(0,0,0,.16)}
.t.lift.landing{transition:transform .24s cubic-bezier(.2,.8,.2,1),scale .24s cubic-bezier(.2,.8,.2,1),box-shadow .24s ease}
html.dragging,html.dragging *{cursor:grabbing!important}
.recall.resetord svg{width:3rem;height:3rem}
.utoast{position:fixed;left:50%;top:1.5rem;z-index:70;display:flex;align-items:center;gap:3rem;padding:1.25rem 1.25rem 1.25rem 4.5rem;border-radius:999px;
  background:var(--toast);color:var(--toast-ink);font-size:3rem;font-weight:var(--w-bold);box-shadow:0 2rem 5rem rgba(0,0,0,.22);
  opacity:0;transform:translate(-50%,-2rem);pointer-events:none;transition:opacity .2s ease,transform .2s ease}
[dir=rtl] .utoast{padding:1.25rem 4.5rem 1.25rem 1.25rem}
.utoast.on{opacity:1;transform:translate(-50%,0);pointer-events:auto}
.utoast button{height:8rem;min-width:16rem;padding:0 4rem;border-radius:999px;background:color-mix(in srgb,var(--toast-ink) 16%,transparent);color:var(--toast-ink);font-size:3rem;font-weight:var(--w-bold)}
.msheet .m-list{margin-top:4.5rem;display:flex;flex-direction:column;gap:2rem}
.mopt{display:flex;align-items:center;gap:3rem;min-height:13rem;padding:0 4.5rem;border-radius:3.5rem;background:var(--sheet-quiet);color:var(--sheet-ink);text-align:start}
.mopt svg{width:5rem;height:5rem;flex:none}
.mopt b{font-size:3.75rem;font-weight:var(--w-bold);letter-spacing:-.02em}
.mopt span{margin-inline-start:auto;font-size:2.75rem;color:var(--sheet-ink-3)}
.mopt[disabled]{cursor:default}.mopt[disabled] b,.mopt[disabled] svg{opacity:.38}
.mopt:not([disabled]):active{background:var(--sheet-edge)}
.m-note{margin-top:3.5rem;font-size:2.75rem;color:var(--sheet-ink-2);line-height:1.4}
.ss-btn{display:flex;align-items:center;gap:1.5rem;height:6.5rem;padding:0 3.5rem;border-radius:999px;background:var(--sheet-quiet);color:var(--sheet-ink);font-size:2.6rem;font-weight:var(--w-bold)}
.ss-btn svg{width:3rem;height:3rem}
[dir=rtl] svg.dir{transform:scaleX(-1)}
@media (prefers-reduced-motion:reduce){.t.lift,.t.lift.landing,.utoast{transition:none}.t.lift.up{scale:1.02}}
@media (max-width:700px){.utoast{top:auto;bottom:15rem;font-size:3.5rem;transform:translate(-50%,2rem)}}

/* Batch 10: practice mode bar */
.practice-bar{position:fixed;top:0;left:0;right:0;z-index:1000;height:24px;display:flex;align-items:center;justify-content:center;background:#111111;color:#fff;font:500 13px/1 system-ui,-apple-system,sans-serif;pointer-events:none}
body.practice{padding-top:24px}
