* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text); font-family: var(--font); font-size: 16px; }
body { overscroll-behavior: none; user-select: none; -webkit-user-select: none; }
#app { max-width: 1100px; margin: 0 auto; padding: 12px; padding-bottom: 96px; }
h1 { font-size: 24px; font-weight: 600; margin: 0; }
h2 { font-size: 18px; font-weight: 600; margin: 0 0 8px; }
.muted { color: var(--text-2); font-size: 13px; }
.row { display: flex; gap: var(--gap); align-items: center; }
.row.wrap { flex-wrap: wrap; }
.between { justify-content: space-between; }
.grow { flex: 1; min-width: 0; }
.stack > * + * { margin-top: var(--gap); }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; }

button { font: inherit; color: var(--text); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); min-height: var(--btn-h-sm); padding: 0 16px; cursor: pointer; transition: transform .1s ease, background .15s; touch-action: manipulation; }
button:active { transform: scale(.97); }
button:disabled { opacity: .4; pointer-events: none; }
button.big { min-height: var(--btn-h); font-size: 17px; border-radius: 14px; width: 100%; }
button.primary { background: var(--accent); color: var(--accent-text); border-color: transparent; font-weight: 600; }
button.danger { color: var(--bad); }
button.on { background: var(--text); color: var(--bg); border-color: transparent; }
button.ghost { border: none; background: transparent; color: var(--text-2); }

.topbar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; gap: 8px; }
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); font-size: 13px; min-height: 36px; }
.dot { width: 9px; height: 9px; border-radius: 50%; background: var(--ok); display: inline-block; }
.dot.off { background: var(--warn); }

.chips { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; }
.chips button { white-space: nowrap; border-radius: 999px; min-height: var(--btn-h-sm); }

.layout { display: grid; grid-template-columns: 1fr; gap: 12px; }
@media (min-width: 820px) { .layout { grid-template-columns: 1.5fr 1fr; align-items: start; } .cartbox { position: sticky; top: 12px; } }

.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); grid-auto-rows: 92px; grid-auto-flow: dense; gap: 10px; }
@media (min-width: 560px) { .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 1000px) { .grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.tile { text-align: left; display: flex; flex-direction: column; justify-content: space-between; padding: 12px; border-radius: var(--radius); min-height: 0; height: 100%; width: 100%; }
.tile.w { grid-column: span 2; }
.tile.t { grid-row: span 2; }
.tile .nm { font-weight: 600; font-size: 15px; line-height: 1.25; }
.tile .pr { color: var(--text-2); font-size: 13px; }
.tile .bar { width: 28px; height: 5px; border-radius: 3px; margin-bottom: 6px; }
.tile.out { opacity: .45; }
.tile.sel { outline: 3px solid var(--accent); }
.tile.edit { border-style: dashed; }

.tables { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
@media (min-width: 560px) { .tables { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.table { border-radius: var(--radius); padding: 14px; min-height: 100px; text-align: left; display: flex; flex-direction: column; justify-content: space-between; height: auto; }
.table.free { background: var(--ok-bg); color: var(--ok); border-color: transparent; }
.table.busy { background: var(--warn-bg); color: var(--warn); border-color: transparent; }
.table.billed { background: var(--surface-2); color: var(--accent); border-color: transparent; }

.line { display: flex; align-items: center; gap: 8px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.line .nm { flex: 1; min-width: 0; }
.line .st { font-size: 12px; color: var(--text-2); }
.line .qty { min-width: 18px; text-align: center; font-weight: 600; }
.round { width: var(--btn-h-sm); padding: 0; border-radius: 50%; }
.total { font-size: 22px; font-weight: 600; }
.banner { padding: 10px 12px; border-radius: var(--radius-sm); font-size: 14px; }
.banner.ok { background: var(--ok-bg); color: var(--ok); }
.banner.warn { background: var(--warn-bg); color: var(--warn); }
.banner.bad { background: var(--bad-bg); color: var(--bad); }

.keypad { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; max-width: 360px; margin: 0 auto; }
.keypad button { min-height: var(--btn-h); font-size: 22px; }
.pindots { display: flex; justify-content: center; gap: 16px; margin: 12px 0; }
.pindots span { width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--text-3); }
.pindots span.f { background: var(--text); border-color: var(--text); }

.sheet { position: fixed; inset: 0; background: rgba(0,0,0,.45); display: flex; align-items: flex-end; justify-content: center; z-index: 20; }
.sheet > div { background: var(--bg); width: 100%; max-width: 520px; border-radius: 24px 24px 0 0; padding: 16px; max-height: 92vh; overflow: auto; animation: up .22s ease; }
@keyframes up { from { transform: translateY(40px); opacity: 0; } to { transform: none; opacity: 1; } }

.nav { position: fixed; left: 0; right: 0; bottom: 0; background: var(--surface); border-top: 1px solid var(--line); display: flex; gap: 8px; padding: 8px 12px calc(8px + env(safe-area-inset-bottom)); z-index: 10; }
.nav button { flex: 1; min-height: var(--btn-h); border: none; background: transparent; font-size: 13px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; color: var(--text-2); }
.nav button.on { background: var(--surface-2); color: var(--text); }

.paper { font-family: var(--font-mono); font-size: 12px; line-height: 1.6; background: var(--surface); border: 1px dashed var(--text-3); border-radius: 8px; padding: 12px; }
.paper.void { border-color: var(--bad); }
table.rep { width: 100%; border-collapse: collapse; font-size: 14px; }
table.rep th { text-align: left; color: var(--text-2); font-weight: 500; font-size: 12px; padding: 6px 4px; }
table.rep td { padding: 8px 4px; border-top: 1px solid var(--line); vertical-align: top; }
.bar-track { height: 8px; border-radius: 4px; background: var(--surface-2); flex: 1; }
.bar-fill { height: 8px; border-radius: 4px; background: var(--ok); }
.bar-fill.bad { background: var(--bad); }
input, select { font: inherit; color: var(--text); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); min-height: var(--btn-h-sm); padding: 0 12px; width: 100%; user-select: text; -webkit-user-select: text; }
label { display: block; font-size: 13px; color: var(--text-2); margin: 10px 0 4px; }

.table.ready { background: var(--accent); color: var(--accent-text); border-color: transparent; }
.kcard { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; }
.kcard.late { border-color: var(--warn); border-width: 2px; }
.kcard.red { border-color: var(--bad); border-width: 2px; }
.tchip { display: inline-flex; align-items: center; padding: 4px 10px; border-radius: 999px; font-size: 13px; font-weight: 600; background: var(--surface-2); white-space: nowrap; }
.tchip.ok, .tchip.ready { background: var(--ok-bg); color: var(--ok); }
.tchip.late, .tchip.cold { background: var(--warn-bg); color: var(--warn); }
.tchip.red { background: var(--bad-bg); color: var(--bad); }

/* speed: tiles off screen are not laid out until needed */
.grid .tile { content-visibility: auto; contain-intrinsic-size: auto 92px; }
.tile { position: relative; }
.tile .cnt { position: absolute; top: 8px; right: 8px; min-width: 26px; height: 26px; padding: 0 7px; border-radius: 13px; background: var(--accent); color: var(--accent-text); font-weight: 700; font-size: 14px; display: grid; place-items: center; animation: pop .16s ease; }
@keyframes pop { from { transform: scale(.6); } to { transform: scale(1); } }

/* ===================== AI look: midnight, aurora, glass, glow ===================== */
html { background: var(--bg); }
body { background: transparent; letter-spacing: .005em; font-feature-settings: "tnum" 1, "cv11" 1; }
body::before { content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(900px 520px at 12% -8%, rgba(91,124,255,.30), transparent 60%),
    radial-gradient(760px 520px at 92% 4%, rgba(176,90,255,.24), transparent 62%),
    radial-gradient(900px 600px at 55% 112%, rgba(34,211,238,.14), transparent 60%),
    linear-gradient(180deg, var(--bg), var(--bg-2)); }
:root[data-mode="light"] body::before { background:
    radial-gradient(900px 520px at 12% -8%, rgba(91,124,255,.20), transparent 60%),
    radial-gradient(760px 520px at 92% 4%, rgba(176,90,255,.15), transparent 62%),
    radial-gradient(900px 600px at 55% 112%, rgba(34,211,238,.12), transparent 60%),
    linear-gradient(180deg, var(--bg), var(--bg-2)); }
h1, h2 { letter-spacing: -.01em; }
h2 { font-weight: 650; }

.card, .kcard { background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); backdrop-filter: var(--glass-blur); -webkit-backdrop-filter: var(--glass-blur); }
.kcard.late { border-color: var(--warn); box-shadow: 0 0 0 1px var(--warn), 0 8px 26px rgba(255,190,92,.18); }
.kcard.red { border-color: var(--bad); box-shadow: 0 0 0 1px var(--bad), 0 8px 26px rgba(255,107,134,.22); }

button { background: var(--surface); border: 1px solid var(--line); transition: transform .12s ease, background .15s, box-shadow .2s, border-color .2s; }
button:hover { border-color: rgba(var(--accent-rgb), .55); }
button:active { transform: scale(.965); }
button.primary { background: var(--grad); color: #fff; border: none; box-shadow: var(--glow); text-shadow: 0 1px 8px rgba(40,10,90,.35); }
button.primary:active { box-shadow: 0 3px 14px rgba(120,100,255,.4); }
button.on { background: var(--grad); color: #fff; border-color: transparent; box-shadow: 0 4px 18px rgba(120,100,255,.32); }
button.danger { color: var(--bad); border-color: rgba(255,107,134,.35); }
button.ghost { background: transparent; border: none; box-shadow: none; }
.chips button { background: var(--surface); }
.chips button.on { box-shadow: 0 4px 16px rgba(120,100,255,.32); }

input, select { background: var(--surface); border: 1px solid var(--line); transition: border-color .15s, box-shadow .15s; }
input:focus, select:focus { outline: none; border-color: rgba(var(--accent-rgb), .8); box-shadow: 0 0 0 3px rgba(var(--accent-rgb), .22); }

.pill { background: var(--surface); backdrop-filter: var(--glass-blur); -webkit-backdrop-filter: var(--glass-blur); }
.dot { box-shadow: 0 0 10px var(--ok); }
.dot.off { box-shadow: 0 0 10px var(--warn); }

/* menu tiles: tinted by the item's own colour, lit from the top left */
.tile { border: 1px solid rgba(255,255,255,.07); border-radius: var(--radius);
  background: linear-gradient(150deg, color-mix(in srgb, var(--tc, var(--accent)) 30%, var(--solid)) 0%, color-mix(in srgb, var(--tc, var(--accent)) 8%, var(--solid)) 70%);
  box-shadow: 0 6px 18px rgba(0,0,0,.25), inset 0 1px 0 rgba(255,255,255,.10); }
:root[data-mode="light"] .tile { border-color: rgba(60,70,150,.10); background: linear-gradient(150deg, color-mix(in srgb, var(--tc, var(--accent)) 24%, #fff) 0%, color-mix(in srgb, var(--tc, var(--accent)) 6%, #fff) 75%); box-shadow: 0 6px 16px rgba(40,50,120,.10), inset 0 1px 0 rgba(255,255,255,.8); }
.tile:hover { border-color: color-mix(in srgb, var(--tc, var(--accent)) 60%, transparent); }
.tile:active { transform: scale(.96); }
.tile .nm { font-size: 16px; font-weight: 650; }
.tile .pr { font-weight: 600; color: var(--text-2); }
.tile .bar { width: 34px; height: 4px; box-shadow: 0 0 12px var(--tc, var(--accent)); }
.tile.edit { border-style: dashed; }
.tile .cnt { background: var(--grad); box-shadow: 0 0 14px rgba(155,92,255,.6); }

/* tables */
.table { border: 1px solid var(--line); box-shadow: var(--shadow); }
.table.free { background: linear-gradient(150deg, rgba(62,232,168,.16), rgba(62,232,168,.04)); color: var(--ok); border-color: rgba(62,232,168,.25); }
.table.busy { background: linear-gradient(150deg, rgba(255,190,92,.20), rgba(255,190,92,.05)); color: var(--warn); border-color: rgba(255,190,92,.30); }
.table.billed { background: var(--grad-soft); color: var(--text); border-color: rgba(var(--accent-rgb), .4); }
.table.ready { background: var(--grad); color: #fff; box-shadow: var(--glow); border-color: transparent; }

/* order panel */
.cartbox { background: var(--surface); }
.line { border-bottom-color: var(--line); }
.line .qty { font-size: 17px; min-width: 26px; }
.round { background: var(--surface-2); }
.total { font-size: 28px; font-weight: 700; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; letter-spacing: -.01em; }

.banner { backdrop-filter: var(--glass-blur); -webkit-backdrop-filter: var(--glass-blur); border: 1px solid transparent; }
.banner.ok { border-color: rgba(62,232,168,.25); } .banner.warn { border-color: rgba(255,190,92,.28); } .banner.bad { border-color: rgba(255,107,134,.3); }

.nav { background: color-mix(in srgb, var(--solid) 78%, transparent); backdrop-filter: var(--glass-blur); -webkit-backdrop-filter: var(--glass-blur); border-top: 1px solid var(--line); }
.nav button.on { background: var(--grad-soft); }

.sheet { background: rgba(4,5,14,.62); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.sheet > div { background: color-mix(in srgb, var(--solid) 92%, transparent); border: 1px solid var(--line); box-shadow: 0 -10px 50px rgba(0,0,0,.5); backdrop-filter: var(--glass-blur); -webkit-backdrop-filter: var(--glass-blur); }
.sheet > div::before { content: ""; display: block; width: 40px; height: 4px; border-radius: 2px; background: var(--line); margin: -4px auto 12px; }

.keypad button { background: var(--surface-2); font-weight: 600; }
.pindots span.f { background: var(--grad); border-color: transparent; box-shadow: 0 0 10px rgba(155,92,255,.6); }
.bar-fill { background: linear-gradient(90deg, #3ee8a8, #22d3ee); } .bar-fill.bad { background: linear-gradient(90deg, #ff6b86, #ff9a5c); }
.tchip { background: var(--surface-2); }
table.rep td { border-top-color: var(--line); }

/* confirm-the-order pop-up: big tiles */
.sheet.wide > div { max-width: 780px; }
@media (min-width: 700px) { .sheet.wide { align-items: center; } .sheet.wide > div { border-radius: 26px; } .sheet.wide > div::before { display: none; } }
.cf-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 12px; }
.cf-head h1 { font-size: 28px; letter-spacing: -.015em; }
.cf-count { font-size: 44px; font-weight: 700; line-height: 1; text-align: center; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.cf-count span { display: block; font-size: 12px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--text-2); -webkit-text-fill-color: var(--text-2); }
.cf-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; max-height: 56vh; overflow: auto; padding: 2px; }
.cf-tile { position: relative; display: grid; grid-template-columns: auto 1fr; gap: 14px; align-items: center; padding: 16px 16px 16px 18px; border-radius: 20px; border: 1px solid rgba(255,255,255,.08);
  background: linear-gradient(140deg, color-mix(in srgb, var(--sc) 34%, var(--solid)), color-mix(in srgb, var(--sc) 9%, var(--solid)) 75%); box-shadow: 0 8px 22px rgba(0,0,0,.28), inset 0 1px 0 rgba(255,255,255,.12); overflow: hidden; }
.cf-tile::before { content: ""; position: absolute; left: 0; top: 14px; bottom: 14px; width: 4px; border-radius: 0 3px 3px 0; background: var(--sc); box-shadow: 0 0 14px var(--sc); }
:root[data-mode="light"] .cf-tile { border-color: rgba(60,70,150,.1); background: linear-gradient(140deg, color-mix(in srgb, var(--sc) 26%, #fff), color-mix(in srgb, var(--sc) 6%, #fff) 80%); box-shadow: 0 8px 20px rgba(40,50,120,.1); }
.cf-q { font-size: 52px; font-weight: 750; line-height: 1; letter-spacing: -.03em; min-width: 52px; text-align: center; }
.cf-n { font-size: 21px; font-weight: 650; line-height: 1.2; }
.cf-note { margin-top: 4px; font-size: 14px; font-weight: 600; color: var(--warn); }
.cf-st { position: absolute; top: 8px; right: 12px; font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--text-2); }
.cf-ok { min-height: 64px; font-size: 19px; }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

/* Practice mode banner */
.practice-bar{display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap;margin:0 0 10px;padding:10px 14px;border-radius:14px;color:#2a1700;font-size:13px;background:repeating-linear-gradient(135deg,#ffcf4a 0 14px,#ffb81f 14px 28px);box-shadow:0 6px 22px rgba(255,184,31,.28)}
.practice-bar b{font-size:15px;letter-spacing:.08em}
.practice-bar button{background:#2a1700;color:#ffe9b0;border:0}

/* ===== Responsive till: phone + tablet, upright + sideways ===== */
#app { overflow-x: hidden; }
.chips { flex-wrap: wrap; overflow-x: visible; }
.tile, .table, button { min-width: 0; }
button { min-height: 46px; }
button.round { width: 46px; height: 46px; }
.line > b { white-space: nowrap; }
.grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); grid-auto-rows: 104px; }
.tables { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.table { min-height: 112px; }
.sheet > div { max-height: 92dvh; padding-bottom: calc(16px + env(safe-area-inset-bottom)); }
/* full screen: the till uses the whole window and has its own tab strip */
html.full #app { max-width: none; padding: 10px 12px calc(10px + env(safe-area-inset-bottom)); }
.tnav { display: flex; gap: 6px; overflow-x: auto; margin: 0 0 10px; padding: 2px 0 6px; scrollbar-width: none; }
.tnav::-webkit-scrollbar { display: none; }
.tnav button { flex: 0 0 auto; border-radius: 999px; padding: 0 18px; font-weight: 600; }
.cart-bar, .cart-head { display: none; }
.cart-body { display: flex; flex-direction: column; min-height: 0; }
.cart-scroll { min-height: 0; overflow-y: auto; overscroll-behavior: contain; }
/* wide (tablet, or phone sideways): menu left, order right, Send/Pay pinned */
@media (min-width: 700px) {
  .layout { grid-template-columns: minmax(0, 1.55fr) minmax(300px, 1fr); align-items: stretch; gap: 14px; height: calc(100dvh - 118px); }
  html.full .layout { height: calc(100dvh - 100px); }
  .layout > div:first-child { overflow-y: auto; min-height: 0; padding-right: 2px; overscroll-behavior: contain; }
  .cartbox { position: static; display: flex; flex-direction: column; min-height: 0; padding: 12px; }
  .cartbox .cart-body { flex: 1; }
  .cart-foot { padding-top: 8px; border-top: 1px solid var(--line); }
}
/* sideways phone: very little height, so tighten everything */
@media (max-height: 520px) and (orientation: landscape) {
  #app { padding: 6px 10px; }
  h2 { font-size: 16px; margin-bottom: 4px; }
  .topbar { margin-bottom: 6px; } .topbar .muted { display: none; }
  .layout { height: calc(100dvh - 70px); gap: 10px; }
  html.full .layout { height: calc(100dvh - 58px); }
  .grid { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); grid-auto-rows: 78px; gap: 8px; }
  .tile { padding: 8px 10px; } .tile .nm { font-size: 14px; }
  button.big { min-height: 48px; }
  .line { padding: 4px 0; } .total { font-size: 19px; }
  .tnav { margin-bottom: 6px; padding-bottom: 2px; }
}
/* upright phone: menu first, order is a bar at the bottom that opens full screen */
@media (max-width: 699px) {
  .layout { display: block; }
  .layout > div:first-child { padding-bottom: 84px; }
  .cartbox { position: fixed; left: 0; right: 0; bottom: 0; z-index: 15; border-radius: 22px 22px 0 0; padding: 10px 12px calc(10px + env(safe-area-inset-bottom)); background: color-mix(in srgb, var(--solid) 94%, transparent); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); border: 1px solid var(--line); box-shadow: 0 -12px 40px rgba(0,0,0,.45); }
  .cart-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%; min-height: 54px; font-size: 16px; background: var(--grad); color: #fff; border: 0; border-radius: 16px; box-shadow: var(--glow); padding: 0 16px; }
  .cart-bar b { font-size: 20px; } .cart-bar .go { font-weight: 600; opacity: .9; }
  .cart-bar:disabled { background: var(--surface-2); color: var(--text-2); box-shadow: none; }
  .cartbox .cart-body { display: none; }
  .cartbox.open { top: 0; border-radius: 0; padding-top: calc(10px + env(safe-area-inset-top)); }
  .cartbox.open .cart-bar { display: none; }
  .cartbox.open .cart-body { display: flex; height: 100%; }
  .cart-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; font-size: 18px; }
  .cart-scroll { flex: 1; }
}
.modebtn { width: 44px; min-height: 40px; padding: 0; font-size: 24px; line-height: 1; opacity: .6; }

/* order screen fills the window exactly (no guessed heights), the order pane scrolls and Send/Pay stay pinned */
@media (min-width: 700px) {
  #app.order { display: flex; flex-direction: column; height: 100dvh; padding-bottom: 10px; }
  #app.order .layout { flex: 1 1 auto; min-height: 0; height: auto; grid-template-rows: minmax(0, 1fr); }
  #app.order .cartbox { min-height: 0; }
}
@media (max-height: 520px) and (orientation: landscape) { .line .st { display: none; } .line .nm { font-size: 14px; } }

/* ===================== ORDER SCREEN v2, Online colours, customers ===================== */
:root { --uber: #06c167; --uber-ink: #04321a; --pickme: #ffd100; --pickme-ink: #2e2500; }

/* who the order is for: big and obvious */
.ordtop .oh-big { font-size: 32px; font-weight: 800; line-height: 1.05; letter-spacing: -.02em; }
.ordtop .oh-id .muted { margin-top: 2px; }
.ordtop .row { gap: 12px; }

/* order panel */
.cart-head { display: flex; flex-direction: column; gap: 8px; margin-bottom: 8px; padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.cart-head .ch-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.cart-head .ch-id .muted { white-space: nowrap; }
.cart-head .ch-cust:empty { display: none; }
@media (min-width: 700px) { .cart-head { flex-direction: row; align-items: center; justify-content: space-between; } .cart-head .ch-cust { flex: 0 1 auto; min-width: 0; } .cart-head .cchip { max-width: 100%; overflow: hidden; } }
.cart-head .ch-id .ch-big { display: none; font-size: 30px; font-weight: 800; line-height: 1.05; letter-spacing: -.02em; }
.cartbox.open .cart-head .ch-big { display: block; }
.cart-x { display: none; width: 46px; border-radius: 50%; padding: 0; font-size: 18px; }
.cchip { display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 0 14px; border-radius: 999px; font-weight: 600; white-space: nowrap; }
.cchip small { color: var(--text-2); font-weight: 500; }
.cchip.on { background: rgba(var(--accent-rgb), .16); border-color: rgba(var(--accent-rgb), .5); }
.empty-order { text-align: center; color: var(--text-2); padding: 34px 10px; font-size: 16px; }
.empty-order div { font-size: 42px; margin-bottom: 6px; opacity: .8; }
.oline { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: 'nm pr' 'sub step'; gap: 6px 12px; align-items: center; padding: 13px 0; border-bottom: 1px solid var(--line); }
.oline .onm { grid-area: nm; font-size: 19px; font-weight: 650; line-height: 1.2; overflow-wrap: anywhere; }
.oline .oprice { grid-area: pr; font-size: 18px; white-space: nowrap; text-align: right; }
.oline .osub { grid-area: sub; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; min-width: 0; }
.oline .ostep { grid-area: step; display: flex; align-items: center; gap: 6px; }
.oline .qty { min-width: 30px; text-align: center; font-size: 21px; font-weight: 700; }
.oline.sent .onm { opacity: .82; }
.lstate { font-size: 12px; font-weight: 600; padding: 2px 9px; border-radius: 999px; background: var(--surface-2); color: var(--text-2); }
.lstate.sent { background: rgba(48, 209, 88, .16); color: var(--ok); }
.lstate.part, .lstate.warn { background: rgba(255, 190, 92, .16); color: var(--warn); }
.lnote { font-size: 12px; color: var(--text-2); font-style: italic; }
.ord-more { margin-top: 12px; border: 1px dashed var(--line); border-radius: 14px; padding: 10px 12px; }
.ord-more summary { cursor: pointer; color: var(--text-2); font-size: 14px; }

.cart-foot { display: flex; flex-direction: column; gap: 10px; }
.cart-total { display: flex; align-items: flex-end; justify-content: space-between; gap: 10px; }
.cart-total .ct-l { display: flex; flex-direction: column; color: var(--text-2); font-size: 14px; }
.ct-disc { color: var(--warn); font-weight: 600; }
.cart-total .total { font-size: 34px; line-height: 1; }
.send-btn { display: flex; align-items: center; justify-content: center; gap: 12px; width: 100%; min-height: 70px; border: 0; border-radius: 20px; background: var(--grad); color: #fff; font-size: 21px; font-weight: 750; letter-spacing: .01em; box-shadow: var(--glow), inset 0 1px 0 rgba(255,255,255,.25); }
.send-btn .si { font-size: 26px; line-height: 1; }
.send-btn .sn { display: inline-flex; align-items: center; justify-content: center; min-width: 32px; height: 32px; border-radius: 16px; background: rgba(255,255,255,.95); color: #5a3cff; font-size: 17px; padding: 0 8px; }
.send-btn:not(.off):not(:disabled) { animation: sendglow 2.6s ease-in-out infinite; }
@keyframes sendglow { 0%,100% { box-shadow: var(--glow), inset 0 1px 0 rgba(255,255,255,.25); } 50% { box-shadow: 0 10px 40px rgba(155,92,255,.62), inset 0 1px 0 rgba(255,255,255,.25); } }
@media (prefers-reduced-motion: reduce) { .send-btn:not(.off):not(:disabled) { animation: none; } }
.send-btn.off { min-height: 52px; background: var(--surface-2); color: var(--text-2); box-shadow: none; font-size: 16px; font-weight: 600; opacity: 1; }
.cart-sec { gap: 10px; }
.cart-sec button { min-height: 54px; font-size: 17px; border-radius: 16px; }
.cart-sec .pay-main { background: var(--grad); color: #fff; border: 0; font-weight: 750; box-shadow: var(--glow); }
.cart-sec .pay-sec { font-weight: 650; }
.disc-link { display: inline-block; margin-top: 8px; min-height: 40px; padding: 0 16px; border-radius: 999px; background: rgba(var(--accent-rgb), .14); border: 1px solid rgba(var(--accent-rgb), .45); color: var(--text); font-weight: 650; }

/* phone upright: the bottom bar is a summary + the main action */
@media (max-width: 699px) {
  .cart-bar { display: flex; gap: 10px; align-items: stretch; background: none; box-shadow: none; border: 0; border-radius: 0; padding: 0; min-height: 0; width: 100%; }
  .cart-bar .cb-sum { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; align-items: flex-start; justify-content: center; gap: 1px; min-height: 60px; padding: 6px 14px; border-radius: 18px; background: var(--surface-2); border: 1px solid var(--line); text-align: left; }
  .cart-bar .cb-sum .cb-n { font-size: 13px; color: var(--text-2); }
  .cart-bar .cb-sum b { font-size: 22px; line-height: 1.1; }
  .cart-bar .cb-sum small { font-size: 12px; color: var(--text-2); }
  .cart-bar .cb-go { flex: 1.25 1 0; min-width: 0; min-height: 60px; border: 0; border-radius: 18px; background: var(--grad); color: #fff; font-size: 17px; font-weight: 750; display: flex; align-items: center; justify-content: center; gap: 8px; box-shadow: var(--glow); line-height: 1.1; padding: 0 10px; }
  .cart-bar .cb-go b { min-width: 28px; height: 28px; border-radius: 14px; background: rgba(255,255,255,.95); color: #5a3cff; display: inline-flex; align-items: center; justify-content: center; font-size: 15px; padding: 0 7px; }
  .cart-bar .cb-sum:disabled { opacity: .6; }
  .cartbox.open .cart-x { display: inline-flex; align-items: center; justify-content: center; }
  .layout > div:first-child { padding-bottom: 96px; }
  .cartbox.open .cart-total .total { font-size: 38px; }
}
@media (max-height: 520px) and (orientation: landscape) {
  .ordtop .oh-big { font-size: 22px; }
  .oline { padding: 8px 0; gap: 4px 10px; } .oline .onm { font-size: 16px; } .oline .osub .lstate { display: none; } .oline .osub:not(:has(.lnote)) { display: none; } .oline .ostep { grid-column: 1 / -1; justify-self: end; margin-top: -2px; }
  .send-btn { min-height: 52px; font-size: 18px; } .send-btn.off { min-height: 44px; }
  .cart-total .total { font-size: 24px; } .cart-sec button { min-height: 46px; }
  .cart-head { margin-bottom: 4px; padding-bottom: 4px; }
}

/* Online orders: Uber green, PickMe yellow */
.chtag { display: inline-flex; align-items: center; font-size: 12px; font-weight: 800; letter-spacing: .02em; padding: 3px 10px; border-radius: 999px; }
.chtag.uber { background: var(--uber); color: var(--uber-ink); }
.chtag.pickme { background: var(--pickme); color: var(--pickme-ink); }
.kcard.chb { border-left-width: 7px; border-left-style: solid; }
.kcard.chb.uber { border-left-color: var(--uber); background-image: linear-gradient(90deg, rgba(6,193,103,.13), transparent 45%); }
.kcard.chb.pickme { border-left-color: var(--pickme); background-image: linear-gradient(90deg, rgba(255,209,0,.14), transparent 45%); }
.onlf { display: inline-flex; align-items: center; gap: 8px; border-width: 2px; }
.onlf b { font-weight: 800; opacity: .85; }
.onlf.uber { border-color: var(--uber); } .onlf.pickme { border-color: var(--pickme); }
.onlf.uber.on { background: var(--uber); color: var(--uber-ink); }
.onlf.pickme.on { background: var(--pickme); color: var(--pickme-ink); }
.chpick { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 10px 0; }
.chpick button { min-height: 96px; border: 0; border-radius: 20px; font-size: 20px; }
.chpick button.uber { background: var(--uber); color: var(--uber-ink); }
.chpick button.pickme { background: var(--pickme); color: var(--pickme-ink); }
.chpick.small { margin: 8px 0 0; gap: 8px; }
.chpick.small button { min-height: 50px; font-size: 16px; font-weight: 700; opacity: .55; }
.chpick.small button.on { opacity: 1; outline: 3px solid var(--text); outline-offset: 2px; }

/* the five till tabs (when the till runs full screen) fit without scrolling */
.tnav { overflow-x: visible; }
.tnav button { flex: 1 1 0; padding: 0 6px; min-height: 48px; font-size: 15px; }
@media (min-width: 700px) { .tnav { max-width: 640px; } }

/* More + Customers */
.more-row { display: flex; align-items: center; gap: 14px; width: 100%; text-align: left; min-height: 72px; padding: 10px 16px; border-radius: 18px; }
.more-row .mi { font-size: 26px; width: 34px; text-align: center; }
.more-row .mt { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.more-row .mt small { color: var(--text-2); font-size: 13px; }
.more-row .mc { font-size: 26px; color: var(--text-2); }
.capture .bar-track { height: 8px; }
.crow { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; padding: 10px 14px; border-radius: 16px; min-height: 66px; }
.crow .cr-l { display: flex; flex-direction: column; min-width: 0; width: 38%; }
.crow .cr-l b, .crow .cr-l small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.crow .cr-l small { color: var(--text-2); font-size: 13px; }
.crow .cr-m { flex: 1; min-width: 0; display: flex; flex-wrap: wrap; gap: 3px 10px; color: var(--text-2); font-size: 13px; align-items: center; }
.crow .cr-r { white-space: nowrap; }
.sg { font-style: normal; font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 999px; background: var(--surface-2); color: var(--text); }
.sg.new { background: rgba(10,132,255,.2); } .sg.regular { background: rgba(48,209,88,.2); } .sg.big { background: rgba(255,190,92,.22); } .sg.lapsed { background: rgba(255,107,134,.2); }
@media (max-width: 560px) { .crow { flex-wrap: wrap; } .crow .cr-l { width: 60%; } .crow .cr-m { order: 3; flex-basis: 100%; } }
.cv-stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin-top: 12px; }
.cv-stats div { background: var(--surface-2); border-radius: 14px; padding: 10px 12px; display: flex; flex-direction: column; }
.cv-stats b { font-size: 18px; } .cv-stats small { color: var(--text-2); font-size: 12px; }
.cv-days { display: flex; gap: 6px; align-items: flex-end; height: 70px; }
.cv-days div { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 4px; height: 100%; }
.cv-days i { display: block; width: 100%; border-radius: 6px 6px 2px 2px; background: var(--grad); min-height: 0; }
.cv-days small { font-size: 11px; color: var(--text-2); }
.cu-known { min-height: 20px; margin: 6px 0 4px; font-size: 14px; font-weight: 600; }
.cu-known.ok { color: var(--ok); } .cu-known.new { color: var(--text-2); }

#cu-q { flex: 1 1 60%; min-width: 0; width: auto; }
#cu-sort { flex: 0 0 auto; width: auto; min-width: 130px; }
.sticky-actions { position: sticky; bottom: calc(-16px - env(safe-area-inset-bottom)); margin: 12px -4px 0; padding: 10px 4px calc(10px + env(safe-area-inset-bottom)); background: linear-gradient(180deg, transparent, var(--solid) 28%); }
.cart-head .ch-id { text-align: left; flex: 1; min-width: 0; }
.cchip b { overflow: hidden; text-overflow: ellipsis; max-width: 150px; white-space: nowrap; }
.cchip small { white-space: nowrap; }
/* wide (tablet / phone on its side): the table name is already at the top, so the panel head is just the customer */
@media (min-width: 700px) { .cart-head .ch-top { display: none; } .cart-head { justify-content: flex-start; } .cart-head .ch-cust { flex: 1 1 auto; } .cart-head .cchip { width: 100%; justify-content: center; } }
/* phone on its side: every pixel counts, so the order lines come first and the buttons get slimmer */
@media (max-height: 520px) and (orientation: landscape) {
  .oline { grid-template-columns: minmax(0, 1fr) auto auto; grid-template-areas: 'nm step pr'; padding: 6px 0; gap: 4px 10px; }
  .oline .ostep { grid-column: auto; justify-self: auto; margin-top: 0; }
  .oline .oprice { min-width: 76px; font-size: 16px; }
  .oline .onm { font-size: 16px; }
  .cart-foot { gap: 6px; padding-top: 6px; }
  .send-btn { min-height: 46px; font-size: 17px; border-radius: 14px; } .send-btn .si { font-size: 20px; } .send-btn.off { min-height: 40px; font-size: 14px; }
  .cart-sec button { min-height: 42px; font-size: 15px; border-radius: 12px; }
  .cart-total .total { font-size: 22px; } .cart-total .ct-l { font-size: 12px; }
  .cart-head { margin-bottom: 2px; padding-bottom: 4px; } .cchip { min-height: 34px; }
  button.round { width: 40px; height: 40px; min-height: 40px; }
  .ord-more { display: none; }
}
@media (max-height: 520px) and (orientation: landscape) {
  #msgbox { position: fixed; top: 6px; left: 12px; right: 12px; z-index: 40; pointer-events: none; }
  #msgbox:empty { display: none; }
  .cart-head { min-height: 0; }
}

/* ---------- v2: search, dish options, kitchen / pass, sold-out list, bills ---------- */
.msearch { position: relative; margin-bottom: 10px; }
.msearch input { width: 100%; padding-left: 40px; padding-right: 44px; min-height: 50px; font-size: 17px; border-radius: 16px; }
.msearch .ms-i { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); opacity: .6; pointer-events: none; font-size: 17px; }
.msearch .ms-x { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); min-height: 38px; min-width: 38px; padding: 0; border-radius: 50%; background: transparent; border: 0; box-shadow: none; }
.msearch .ms-x[hidden] { display: none; }
.chips.dim button { opacity: .45; }
.tile .tcat { font-size: 11px; opacity: .7; margin-top: 2px; }
.grid .nomatch { grid-column: 1 / -1; padding: 22px 4px; }
.movebtn { white-space: nowrap; }
.oline .onm[data-a] { cursor: pointer; }
.oline .onm-e { margin-left: 8px; font-size: 14px; opacity: .55; }
.lstate.hold { background: rgba(245,166,35,.18); color: var(--warn, #f5a623); }
.comps { font-size: 14px; opacity: .8; padding: 8px 0; }
.heldnote { font-size: 13px; opacity: .8; margin-bottom: 8px; }
.knote { font-size: 14px; font-weight: 700; color: var(--warn, #f5a623); margin-left: 12px; }
.kseg { display: inline-flex; background: var(--surface); border-radius: 16px; padding: 4px; gap: 4px; }
.kseg button { min-height: 48px; padding: 0 20px; border-radius: 12px; border: 0; background: transparent; box-shadow: none; font-size: 17px; font-weight: 650; display: inline-flex; gap: 8px; align-items: center; }
.kseg button.on { background: var(--grad, var(--accent)); color: #fff; }
.kseg b { min-width: 24px; text-align: center; padding: 1px 7px; border-radius: 999px; background: rgba(128,128,160,.25); font-size: 14px; }
.kseg b.hot { background: #e8453c; color: #fff; }
.undo-strip { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 16px; }
.kcard.pass .pass-big { font-size: 30px; line-height: 1.1; }
.kcard.pass .pass-go { min-height: 64px; font-size: 19px; }
.eg-row { display: flex; justify-content: space-between; align-items: center; width: 100%; min-height: 56px; text-align: left; border-radius: 14px; }
.eg-row small { display: block; opacity: .6; font-weight: 400; }
.eg-row em { font-style: normal; font-weight: 700; padding: 6px 12px; border-radius: 999px; background: rgba(46,160,90,.2); color: #2ea05a; }
.eg-row.off em { background: rgba(232,69,60,.2); color: #e8453c; }
.topbar { flex-wrap: wrap; gap: 8px; }

/* ===== Big timers, By dish, counter timers ===== */
.bt { display: inline-flex; align-items: baseline; gap: 6px; font-variant-numeric: tabular-nums; font-weight: 800; font-size: 34px; line-height: 1; letter-spacing: -.5px; padding: 6px 12px; border-radius: 12px; background: var(--ok-bg); color: var(--ok); white-space: nowrap; }
.bt.late, .bt.cold { background: var(--warn-bg); color: var(--warn); }
.bt.red { background: var(--bad-bg); color: var(--bad); animation: btpulse 1s ease-in-out infinite; }
.bt.ready { background: var(--ok-bg); color: var(--ok); }
.bt.late::after { content: "LATE"; font-size: 12px; letter-spacing: .5px; }
.bt.red::after { content: "VERY LATE"; font-size: 12px; letter-spacing: .5px; }
.bt.cold::after { content: "COLD"; font-size: 12px; letter-spacing: .5px; }
.bt.sm { font-size: 15px; padding: 2px 8px; border-radius: 999px; gap: 4px; font-weight: 700; letter-spacing: 0; }
.bt.sm::after { font-size: 10px !important; }
@keyframes btpulse { 50% { opacity: .55; } }
@media (prefers-reduced-motion: reduce) { .bt.red, .kcard.red, .table.p-red { animation: none !important; } }
.kcard.cold { border-color: var(--warn); border-width: 2px; }
.kcard.red { animation: cardpulse 1.4s ease-in-out infinite; }
@keyframes cardpulse { 50% { box-shadow: 0 0 0 4px rgba(255,107,134,.35); } }
.longest { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; padding: 10px 14px; border-radius: var(--radius); margin-bottom: 12px; background: var(--ok-bg); border: 2px solid var(--ok); }
.longest.late, .longest.cold { background: var(--warn-bg); border-color: var(--warn); }
.longest.red { background: var(--bad-bg); border-color: var(--bad); }
.longest .lg-l { font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: .6px; opacity: .8; }
.longest .bt { font-size: 44px; background: transparent; padding: 0; }
.longest .lg-w { font-size: 20px; font-weight: 700; }
.kcard.dish .dish-name { font-size: 24px; line-height: 1.15; }
.kcard.dish .dish-qty { font-size: 34px; font-weight: 800; margin-left: 10px; color: var(--accent); }
.kcard.dish .dish-from { margin: 8px 0 10px; font-size: 16px; color: var(--text-2); }
.kcard.dish .dish-go button { flex: 1 1 70px; min-height: 56px; font-size: 18px; }
.kseg.small button { min-height: 40px; padding: 6px 14px; font-size: 14px; }
.kcard.cw { padding: 10px 14px; }
.table .tpend { display: flex; align-items: center; gap: 6px; font-size: 12px; flex-wrap: wrap; }
.table.p-late { box-shadow: 0 0 0 3px var(--warn); }
.table.p-cold { box-shadow: 0 0 0 3px var(--warn); }
.table.p-red { box-shadow: 0 0 0 3px var(--bad); animation: cardpulse 1.4s ease-in-out infinite; }
.lstate.k { display: inline-flex; align-items: center; gap: 6px; }
.lstate.k.ok, .lstate.k.ready { background: var(--ok-bg); color: var(--ok); }
.lstate.k.late, .lstate.k.cold { background: var(--warn-bg); color: var(--warn); }
.lstate.k.red { background: var(--bad-bg); color: var(--bad); }
.lstate.k .bt.sm { background: transparent; padding: 0; }
@media (max-height: 520px) and (orientation: landscape) { .oline .osub .lstate.k { display: inline-flex; } .oline .osub:has(.lstate.k) { display: flex; } }

/* ===== Tablet sideways, PC, bigger Pay pop-up, split bills ===== */
/* tablet / laptop sideways (tall enough that the phone-sideways rules do not apply): one slim row per dish so 8+ dishes fit */
@media (min-width: 700px) and (orientation: landscape) and (min-height: 521px) {
  .layout { grid-template-columns: minmax(0, 1.25fr) minmax(360px, 1fr); }
  .cartbox { padding: 10px 14px; }
  .oline { grid-template-columns: minmax(0, 1fr) auto auto; grid-template-areas: 'nm step pr' 'sub sub sub'; padding: 7px 0; gap: 2px 12px; }
  .oline .onm { font-size: 17px; line-height: 1.15; }
  .oline .oprice { min-width: 84px; font-size: 17px; }
  .oline .ostep { grid-column: auto; margin: 0; }
  .oline .qty { font-size: 19px; min-width: 26px; }
  button.round { width: 42px; height: 42px; min-height: 42px; }
  .oline .osub { gap: 4px; }
  .oline .osub:not(:has(.lnote)):not(:has(.lstate.k)) { display: none; }
  .oline .osub .lstate:not(.k):not(.warn) { display: none; }
  .oline .osub .lnote { font-size: 13px; }
  .cart-head { margin-bottom: 2px; padding-bottom: 4px; }
  .cart-foot { gap: 6px; padding-top: 6px; }
  .send-btn { min-height: 52px; font-size: 18px; border-radius: 14px; } .send-btn.off { min-height: 42px; font-size: 14px; }
  .cart-sec button { min-height: 46px; border-radius: 12px; }
  .cart-total .total { font-size: 26px; }
  .ord-more { display: none; }
}
/* PC / big screens: more tiles, wider order panel, roomier tables */
@media (min-width: 1000px) {
  #app { max-width: 1700px; margin: 0 auto; }
  .tables { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .grid { grid-auto-rows: 100px; }
}
@media (min-width: 1280px) {
  .grid { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .tables { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .layout { grid-template-columns: minmax(0, 1.6fr) minmax(420px, 1fr); }
}
@media (min-width: 1000px) and (orientation: landscape) and (min-height: 521px) {
  .layout { grid-template-columns: minmax(0, 1.5fr) minmax(400px, 1fr); }
  .oline .onm { font-size: 18px; } .oline .oprice { font-size: 18px; }
}
/* bigger Pay and Split pop-ups */
.sheet.pay > div { max-width: 600px; padding: 20px; }
.sheet.pay button.big { min-height: 60px; font-size: 18px; }
.sheet.pay .row button.grow { min-height: 54px; font-size: 17px; }
.sheet.pay input { min-height: 56px; font-size: 22px; }
@media (min-width: 700px) { .sheet.pay { align-items: center; } .sheet.pay > div { border-radius: 26px; max-width: 660px; } .sheet.pay > div::before { display: none; } }
@media (min-width: 1000px) { .sheet.pay > div { max-width: 760px; padding: 26px 30px; } .sheet.pay h1 { font-size: 30px; } }
.paidlist .remain { border-top: 1px solid var(--line); margin-top: 6px; padding-top: 8px; font-size: 20px; }
.paidlist button.x { width: 34px; height: 34px; min-height: 34px; margin-left: 6px; font-size: 14px; }
/* bills of one table */
.billtabs { display: flex; gap: 8px; overflow-x: auto; margin: 0 0 10px; scrollbar-width: none; }
.billtabs button { flex: 0 0 auto; display: flex; flex-direction: column; align-items: flex-start; min-height: 50px; border-radius: 14px; padding: 4px 16px; font-weight: 650; }
.billtabs button small { font-weight: 500; opacity: .85; }
.billtabs button.on { background: var(--grad, var(--accent)); color: #fff; }
.table .nbills { font-style: normal; font-size: 12px; font-weight: 700; background: rgba(255,255,255,.16); border-radius: 999px; padding: 2px 9px; align-self: flex-start; }

/* tighter rows so more dishes show (tablet / PC sideways) */
@media (min-width: 700px) and (orientation: landscape) and (min-height: 521px) {
  .oline { padding: 4px 0; gap: 0 12px; }
  .oline .onm { font-size: 16px; }
  .oline .oprice { font-size: 16px; }
  button.round { width: 36px; height: 36px; min-height: 36px; }
  .oline .qty { font-size: 17px; }
  .cart-head { margin-bottom: 0; } .cchip { min-height: 34px; }
  .cart-foot { gap: 5px; padding-top: 5px; }
  .send-btn { min-height: 48px; } .send-btn.off { min-height: 38px; }
  .cart-sec button { min-height: 42px; white-space: nowrap; padding: 0 8px; }
  .cart-total .total { font-size: 24px; }
  .ordtop { margin-bottom: 6px; } .ordtop .oh-big { font-size: 24px; }
}
@media (min-width: 1000px) and (orientation: landscape) and (min-height: 521px) { .oline .onm, .oline .oprice { font-size: 17px; } }
/* phone sideways: total and Send share a row, slimmer rows */
@media (max-height: 520px) and (orientation: landscape) {
  .cart-foot { display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 5px 10px; }
  .cart-foot .cart-total { grid-column: 1; grid-row: 1; flex-direction: column; align-items: flex-start; }
  .cart-foot .send-btn { grid-column: 2; grid-row: 1; }
  .cart-foot .cart-sec { grid-column: 1 / -1; grid-row: 2; }
  .cart-foot .heldnote { grid-column: 1 / -1; }
  .oline { padding: 3px 0; }
  button.round { width: 34px; height: 34px; min-height: 34px; }
  .cart-sec button { white-space: nowrap; padding: 0 8px; min-height: 38px; }
  .cart-head { min-height: 0; padding-bottom: 2px; } .cchip { min-height: 30px; font-size: 13px; }
}

/* Pay pop-up: small Tip link, keypad for touch screens, typing straight away on PC */
.tip-link { position: absolute; top: -4px; right: 0; min-height: 34px; padding: 0 12px; font-size: 13px; border-radius: 999px; background: transparent; opacity: .75; }
.pkpad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 12px; }
.pkpad button { min-height: 58px; font-size: 24px; font-weight: 600; border-radius: 14px; }
input.kfocus { outline: 3px solid var(--accent); outline-offset: 1px; }
@media (max-height: 520px) and (orientation: landscape) { .pkpad { grid-template-columns: repeat(6, 1fr); } .pkpad button { min-height: 44px; font-size: 20px; } }
/* change due: big, so nobody gives the wrong money back */
.chg-box { margin-top: 12px; border-radius: 18px; text-align: center; padding: 10px 12px; }
.chg-box:empty { display: none; }
.chg-box small { display: block; font-size: 14px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; }
.chg-box b { display: block; font-size: 44px; line-height: 1.1; font-weight: 800; }
.chg-box.give { background: var(--ok-bg); color: var(--ok); border: 2px solid var(--ok); }
.chg-box.exact { background: var(--surface-2); color: var(--text-2); }
.chg-box.exact b { font-size: 24px; }
.chg-box.short { background: var(--bad-bg); color: var(--bad); border: 2px solid var(--bad); }
.chg-box.short b { font-size: 30px; }
@media (max-height: 520px) and (orientation: landscape) { .chg-box b { font-size: 30px; } }
@media (max-height: 900px) and (min-height: 521px) { .pkpad { gap: 6px; margin-top: 8px; } .pkpad button { min-height: 46px; font-size: 22px; } .sheet.pay > div { padding-top: 14px; } .sheet.pay .chg-box b { font-size: 38px; } }

/* ===== Start screen, centred pop-ups, pay screen that fits without scrolling ===== */
.start-wrap { display: flex; flex-direction: column; gap: 14px; }
.start-btns { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.start-btn { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; min-height: clamp(130px, 30vh, 280px); border-radius: 22px; padding: 12px; text-align: center; border: 1px solid var(--line); }
.start-btn .si { font-size: clamp(34px, 7vh, 64px); line-height: 1; }
.start-btn b { font-size: clamp(22px, 3.6vh, 34px); }
.start-btn small { color: var(--text-2, var(--muted)); font-size: 14px; }
.start-btn.dine { background: linear-gradient(135deg, rgba(var(--accent-rgb), .30), rgba(var(--accent-rgb), .10)); }
.start-btn.take { background: linear-gradient(135deg, rgba(48,209,88,.26), rgba(48,209,88,.08)); }
.start-btn.deliv { background: linear-gradient(135deg, rgba(10,132,255,.26), rgba(10,132,255,.08)); }
@media (max-width: 559px) { .start-btns { grid-template-columns: 1fr; } .start-btn { flex-direction: row; justify-content: flex-start; gap: 14px; min-height: clamp(76px, 15vh, 140px); padding: 10px 18px; text-align: left; } .start-btn .si { font-size: 38px; } .start-btn b { font-size: 22px; } .start-btn small { margin-left: auto; } }
@media (max-height: 520px) and (orientation: landscape) { .start-btn { min-height: 90px; } .start-btn .si { font-size: 30px; } }
.start-strip .strip-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.chip-t { display: flex; flex-direction: column; align-items: flex-start; gap: 0; min-height: 0; padding: 7px 12px; border-radius: 14px; border: 1px solid var(--line); font-size: 13px; line-height: 1.25; }
.chip-t b { font-size: 15px; } .chip-t.ready { border-color: var(--ok); } .chip-t.billed { border-color: rgba(var(--accent-rgb), .7); }

/* pop-ups that sit in the middle of the screen */
.sheet.mid { align-items: center; padding: 12px; }
.sheet.mid > div { max-width: 460px; border-radius: 24px; max-height: calc(100dvh - 24px); }
.sheet.mid > div::before { display: none; }
.sheet.mid.gate > div { max-width: 520px; }

/* Pay: always fits the screen, no finger-scrolling */
.sheet.payx.pay { align-items: stretch; padding: 0; }
.sheet.payx.pay > div { max-width: none; width: 100%; height: 100vh; height: 100dvh; max-height: 100dvh; border-radius: 0; overflow: hidden; display: flex; flex-direction: column; padding: 10px max(12px, env(safe-area-inset-right)) calc(10px + env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-left)); }
.sheet.payx.pay > div::before { display: none; }
.sheet.payx .pay-wrap { flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 8px; }
.sheet.payx .pay-l { display: flex; flex-direction: column; gap: 6px; flex: none; min-width: 0; }
.sheet.payx .pay-r { display: flex; flex-direction: column; gap: 6px; flex: 1; min-height: 0; min-width: 0; }
.sheet.payx .pay-head { display: flex; align-items: center; gap: 10px; }
.sheet.payx.pay .pay-x { width: 44px; height: 44px; min-height: 44px; flex: none; padding: 0; font-size: 20px; border-radius: 50%; }
.sheet.payx .pay-tot { flex: 1; text-align: center; min-width: 0; font-size: 13px; }
.sheet.payx .pay-big { font-size: clamp(28px, 5.5vh, 42px); font-weight: 800; line-height: 1.1; color: var(--text); }
.sheet.payx .pay-links { display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; }
.sheet.payx.pay .pay-links .pl { min-height: 34px; padding: 0 12px; font-size: 14px; border-radius: 999px; background: rgba(var(--accent-rgb), .14); border: 1px solid rgba(var(--accent-rgb), .45); }
.sheet.payx.pay .row.pay-method button.grow, .sheet.payx.pay .row.pay-tip button.grow { min-height: 44px; font-size: 16px; }
.sheet.payx .pay-paid { display: flex; flex-wrap: wrap; gap: 6px; font-size: 14px; justify-content: center; }
.sheet.payx .pay-paid .pp { display: inline-flex; align-items: center; gap: 4px; padding: 2px 4px 2px 10px; border-radius: 999px; background: var(--surface-2, rgba(255,255,255,.08)); }
.sheet.payx .pay-paid .pp.rem { padding-right: 10px; border: 1px solid rgba(var(--accent-rgb), .6); }
.sheet.payx.pay .pay-paid .x { width: 26px; height: 26px; min-height: 26px; padding: 0; font-size: 12px; border-radius: 50%; }
.sheet.payx .pay-f { display: flex; align-items: center; gap: 8px; }
.sheet.payx .pay-f label { flex: none; width: 6.2em; margin: 0; font-size: 14px; }
.sheet.payx.pay .pay-f input { flex: 1; min-width: 0; min-height: 44px; font-size: 22px; }
.sheet.payx.pay .row.pay-q button.grow, .sheet.payx.pay .row.amtchips button.grow { min-height: 38px; font-size: 15px; }
.sheet.payx .pay-r .row { margin: 0; flex: none; }
.sheet.payx .chg-box { margin: 0; padding: 4px 8px; flex: none; }
.sheet.payx .chg-box small { font-size: 12px; }
.sheet.payx .chg-box b { font-size: clamp(30px, 5vh, 40px); }
.sheet.payx .chg-box.exact b { font-size: 20px; }
.sheet.payx .pkpad { flex: 1; min-height: 0; display: grid; grid-template-columns: repeat(3, 1fr); grid-template-rows: repeat(4, minmax(0, 1fr)); gap: 6px; margin: 0; }
.sheet.payx.pay .pkpad button { min-height: 0; height: 100%; font-size: clamp(18px, 3.4vh, 26px); }
.sheet.payx .pay-fill { flex: 1; }
.sheet.payx.pay .pay-go { flex: none; min-height: 52px; font-size: 18px; margin: 0; }
@media (min-width: 700px) and (min-height: 521px) {
  .sheet.payx.pay { align-items: center; padding: 16px; }
  .sheet.payx.pay > div { max-width: 900px; height: min(calc(100dvh - 32px), 660px); max-height: calc(100dvh - 32px); border-radius: 26px; padding: 18px 22px; }
  .sheet.payx .pay-wrap { flex-direction: row; gap: 20px; }
  .sheet.payx .pay-l { flex: 1; overflow: hidden; }
  .sheet.payx .pay-r { flex: 1.1; }
  .sheet.payx .pay-big { font-size: clamp(34px, 6vh, 52px); }
}
@media (max-height: 520px) and (orientation: landscape) {
  .sheet.payx .pay-wrap { flex-direction: row; gap: 14px; }
  .sheet.payx .pay-l { flex: 1; overflow: hidden; }
  .sheet.payx .pay-r { flex: 1.2; }
  .sheet.payx .pay-big { font-size: 26px; }
  .sheet.payx .pkpad { grid-template-columns: repeat(6, 1fr); grid-template-rows: repeat(2, minmax(0, 1fr)); }
  .sheet.payx.pay .pay-go { min-height: 44px; }
  .sheet.payx.pay .pay-f input { min-height: 38px; }
}
/* short screens (small phones): everything in Pay gets a little tighter so it still fits without scrolling */
@media (max-height: 720px) {
  .sheet.payx .pay-big { font-size: 28px; }
  .sheet.payx.pay .pay-x { width: 38px; height: 38px; min-height: 38px; }
  .sheet.payx.pay .pay-links .pl { min-height: 30px; font-size: 13px; }
  .sheet.payx.pay .row.pay-method button.grow, .sheet.payx.pay .row.pay-tip button.grow { min-height: 38px; font-size: 15px; }
  .sheet.payx.pay .pay-f input { min-height: 38px; font-size: 20px; }
  .sheet.payx.pay .row.pay-q button.grow, .sheet.payx.pay .row.amtchips button.grow { min-height: 32px; font-size: 14px; }
  .sheet.payx.pay .pay-go { min-height: 46px; }
  .sheet.payx .chg-box b { font-size: 30px; }
  .sheet.payx .pay-wrap, .sheet.payx .pay-l, .sheet.payx .pay-r { gap: 5px; }
  .sheet.payx.pay > div { padding-top: 6px; }
}
@media (max-height: 520px) and (orientation: landscape) { .ordtop .oh-id .muted { display: block; font-size: 12px; margin: 0; } }

/* ===== Pay on tablet / PC: ticket on the left, total + cash + method on the right (Loyverse style) ===== */
@media (min-width: 700px) and (min-height: 480px) {
  .sheet.payx.pay { align-items: center; padding: 16px; }
  .sheet.payx.pay > div { max-width: 1040px; height: min(calc(100dvh - 32px), 700px); max-height: calc(100dvh - 32px); border-radius: 26px; padding: 18px 22px; }
  .sheet.payx.pay > div::before { display: none; }
}
@media (max-height: 479px) and (orientation: landscape) { .sheet.payx .pay-wrap { flex-direction: row; } }
.sheet.payx .pw-wide { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(230px, 36%) minmax(0, 1fr); gap: 20px; }
.pw-ticket { display: flex; flex-direction: column; min-height: 0; border-right: 1px solid var(--line); padding-right: 18px; }
.pw-th { flex: none; padding-bottom: 8px; border-bottom: 1px solid var(--line); font-size: 18px; }
.pw-th .muted { font-size: 13px; font-weight: 400; }
.pw-lines { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; }
.pw-line { display: flex; justify-content: space-between; gap: 10px; padding: 7px 0; font-size: 16px; }
.pw-sum { flex: none; border-top: 1px solid var(--line); padding-top: 4px; }
.pw-grand { font-size: 20px; font-weight: 800; }
.sheet.payx .pw-main { display: flex; flex-direction: column; gap: 8px; min-height: 0; min-width: 0; }
.pw-bar { display: flex; align-items: center; justify-content: space-between; flex: none; }
.sheet.payx.pay .pw-split { min-height: 40px; padding: 0 16px; background: transparent; border: 0; font-weight: 700; letter-spacing: .08em; color: var(--accent); }
.pw-total { text-align: center; flex: none; }
.sheet.payx .pw-total .pay-big { font-size: clamp(38px, 7vh, 56px); }
.sheet.payx .pw-total .pay-links { margin-top: 6px; }
.sheet.payx .pw-total .pay-tip, .sheet.payx .pw-total .pay-paid { margin-top: 6px; }
.sheet.payx .pw-cash { display: flex; align-items: flex-end; gap: 12px; flex: none; }
.sheet.payx .pw-cash .pay-f { flex: 1; flex-direction: column; align-items: stretch; gap: 2px; min-width: 0; }
.sheet.payx .pw-cash .pay-f label { width: auto; font-size: 14px; font-weight: 600; color: var(--ok); }
.sheet.payx.pay .pw-cash .pay-f input { min-height: 54px; font-size: 24px; }
.sheet.payx.pay .pw-charge { flex: none; min-height: 56px; padding: 0 30px; font-size: 17px; font-weight: 800; letter-spacing: .08em; background: linear-gradient(135deg, #5b7bff, #b05cff); color: #fff; border: 0; }
.sheet.payx.pay .pw-methods button.grow { min-height: 52px; font-size: 17px; }
/* the "give back to the customer" box keeps its full size */
.sheet.payx .pw-main .chg-box { padding: 10px 12px; }
.sheet.payx .pw-main .chg-box small { font-size: 14px; }
.sheet.payx .pw-main .chg-box b { font-size: 44px; }
.sheet.payx .pw-main .chg-box.exact b { font-size: 24px; }
.sheet.payx .pw-main .chg-box.short b { font-size: 30px; }
/* and stays large on phones too, as far as the height allows */
.sheet.payx .chg-box { padding: 8px 12px; }
.sheet.payx .chg-box b { font-size: clamp(34px, 6vh, 44px); }
.sheet.payx .chg-box.exact b { font-size: 22px; } .sheet.payx .chg-box.short b { font-size: 30px; }
@media (max-height: 720px) { .sheet.payx .chg-box b { font-size: 34px; } .sheet.payx .pw-main .chg-box b { font-size: 40px; } }

/* kitchen alerts: NEW tickets, Got it, sound switches */
.kcard.isnew { border: 2px solid var(--accent); box-shadow: 0 0 0 3px rgba(var(--accent-rgb), .25), 0 0 24px rgba(var(--accent-rgb), .35); animation: newpulse 1.4s ease-in-out infinite; }
@keyframes newpulse { 50% { box-shadow: 0 0 0 5px rgba(var(--accent-rgb), .45), 0 0 34px rgba(var(--accent-rgb), .5); } }
@media (prefers-reduced-motion: reduce) { .kcard.isnew { animation: none; } }
.newtag { background: var(--accent); color: #fff; font-weight: 800; font-size: 12px; letter-spacing: .08em; padding: 3px 8px; border-radius: 999px; }
button.gotit { background: linear-gradient(135deg, #1fbf75, #12a35f); color: #fff; border: 0; font-weight: 800; min-height: 56px; font-size: 20px; }
button.gotall { background: linear-gradient(135deg, #1fbf75, #12a35f); color: #fff; border: 0; font-weight: 800; margin-bottom: 12px; min-height: 56px; font-size: 20px; }
.ksound { display: flex; gap: 8px; margin: 0 0 10px; flex-wrap: wrap; }
.ksound button { min-height: 38px; padding: 0 14px; border-radius: 999px; font-size: 14px; }
.navbadge { display: inline-block; min-width: 20px; padding: 0 6px; margin-left: 4px; border-radius: 999px; background: #ff453a; color: #fff; font-size: 12px; line-height: 20px; text-align: center; }
