:root {
  --bg: #f4f1ec;
  --panel: #ffffff;
  --ink: #1f1c19;
  --muted: #6d665e;
  --line: #e2dcd3;
  --brand: #c8361d;
  --brand-ink: #ffffff;
  --ok: #1f8a4c;
  --ok-bg: #e3f4ea;
  --warn: #b7791f;
  --warn-bg: #fdf3dc;
  --bad: #b42318;
  --bad-bg: #fde8e6;
  --chip: #efe9e1;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(0,0,0,.06), 0 2px 8px rgba(0,0,0,.05);
}
body.board {
  --bg: #15171a;
  --panel: #23262b;
  --ink: #f2f2f2;
  --muted: #a3a7ad;
  --line: #3a3f46;
  --chip: #30353c;
  --ok-bg: #173a27;
  --warn-bg: #3d3014;
  --bad-bg: #4a1c18;
  --ok: #4ade80;
  --warn: #fbbf24;
  --bad: #f87171;
  --shadow: none;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--ink);
  font: 15px/1.4 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  min-height: 100vh;
}
a { color: inherit; }
h1, h2, h3 { margin: 0 0 .5em; line-height: 1.2; }
h2 { font-size: 1.15rem; }
h3 { font-size: 1rem; }
.muted { color: var(--muted); }
.small { font-size: .85em; }
.hidden { display: none !important; }

/* ---------- top bar ---------- */
.topbar {
  display: flex; align-items: center; gap: 16px;
  padding: 8px 16px; background: #1f1c19; color: #fff;
  position: sticky; top: 0; z-index: 20;
}
.brand { font-weight: 700; text-decoration: none; white-space: nowrap; }
.topbar nav { display: flex; gap: 4px; overflow-x: auto; flex: 1; }
.topbar nav a {
  text-decoration: none; padding: 6px 12px; border-radius: 999px;
  color: #d9d4cd; white-space: nowrap;
}
.topbar nav a:hover { background: #34302b; }
.topbar nav a.active { background: var(--brand); color: #fff; }
.live { color: #4ade80; font-size: 12px; }
body.offline .live { color: #f87171; animation: blink 1s infinite; }
body.offline .topbar::after {
  content: "Connection lost — retrying…"; position: fixed; top: 52px; left: 50%;
  transform: translateX(-50%); background: var(--bad); color: #fff;
  padding: 6px 14px; border-radius: 999px; font-weight: 600;
}
@keyframes blink { 50% { opacity: .2; } }
.clock { font-variant-numeric: tabular-nums; color: #d9d4cd; }

main { padding: 16px; }

/* ---------- generic controls ---------- */
.btn {
  appearance: none; border: 1px solid transparent; border-radius: 8px;
  padding: 8px 14px; font: inherit; font-weight: 600; cursor: pointer;
  background: var(--brand); color: var(--brand-ink);
  touch-action: manipulation;
}
.btn:hover { filter: brightness(1.07); }
.btn:disabled { opacity: .45; cursor: not-allowed; filter: none; }
.btn.ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn.ok { background: var(--ok); color: #fff; }
.btn.danger { background: var(--bad); color: #fff; }
.btn.sm { padding: 4px 10px; font-size: .85em; }
.btn.lg { padding: 14px 18px; font-size: 1.1rem; }
.btn.block { width: 100%; }
input, select, textarea {
  font: inherit; color: var(--ink); background: var(--panel);
  border: 1px solid var(--line); border-radius: 8px; padding: 7px 10px; width: 100%;
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--brand); outline-offset: -1px; }
input[type=checkbox] { width: auto; }
label.field { display: block; margin-bottom: 10px; }
label.field > span { display: block; font-size: .8rem; font-weight: 600; color: var(--muted); margin-bottom: 3px; }
.row { display: flex; gap: 8px; align-items: center; }
.row.end { justify-content: flex-end; }
.row.wrap { flex-wrap: wrap; }
.grow { flex: 1; }

.panel {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 14px; box-shadow: var(--shadow);
}
.chip {
  display: inline-block; padding: 2px 8px; border-radius: 999px; background: var(--chip);
  font-size: .8rem; font-weight: 600;
}
.chip.ok { background: var(--ok-bg); color: var(--ok); }
.chip.warn { background: var(--warn-bg); color: var(--warn); }
.chip.bad { background: var(--bad-bg); color: var(--bad); }

.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.seg button {
  border: 0; background: var(--panel); padding: 8px 14px; font: inherit; cursor: pointer; color: var(--ink);
}
.seg button + button { border-left: 1px solid var(--line); }
.seg button.on { background: var(--ink); color: var(--panel); font-weight: 600; }

/* ---------- toasts / modal ---------- */
#toasts { position: fixed; right: 16px; bottom: 16px; display: grid; gap: 8px; z-index: 100; }
.toast {
  background: #1f1c19; color: #fff; padding: 10px 14px; border-radius: 8px;
  box-shadow: 0 4px 16px rgba(0,0,0,.25); max-width: 360px; transition: opacity .4s, transform .4s;
}
.toast.error { background: var(--bad); }
.toast.success { background: var(--ok); }
.toast.out { opacity: 0; transform: translateY(8px); }
.modal-wrap {
  position: fixed; inset: 0; background: rgba(0,0,0,.45); display: grid; place-items: center;
  z-index: 50; padding: 16px;
}
.modal {
  background: var(--panel); color: var(--ink); border-radius: 14px; padding: 18px;
  width: min(560px, 100%); max-height: 90vh; overflow: auto; box-shadow: 0 10px 40px rgba(0,0,0,.3);
}
.modal.small { width: min(380px, 100%); }

/* ---------- landing ---------- */
.launch { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); max-width: 1000px; margin: 24px auto; }
.launch a {
  display: block; text-decoration: none; padding: 24px; border-radius: 14px;
  background: var(--panel); border: 1px solid var(--line); box-shadow: var(--shadow);
}
.launch a:hover { border-color: var(--brand); }
.launch .ico { font-size: 2.2rem; }
.launch b { display: block; font-size: 1.2rem; margin: 6px 0 2px; }

/* ---------- order page ---------- */
.order-layout {
  display: grid; gap: 16px;
  grid-template-columns: 300px minmax(0, 1fr) 340px;
  align-items: start;
}
@media (max-width: 1150px) { .order-layout { grid-template-columns: 1fr 340px; } .cust { grid-column: 1 / -1; } }
@media (max-width: 760px) { .order-layout { grid-template-columns: 1fr; } }
.cust .returning { margin: -4px 0 10px; }
.cust-card { border: 1px solid var(--ok); background: var(--ok-bg); border-radius: 8px; padding: 8px 10px; display: grid; gap: 6px; }
.cust-card .last ul, .hist ul { margin: 4px 0; padding-left: 18px; font-size: .9rem; }
.hist { border-bottom: 1px solid var(--line); padding: 10px 0; }
.hist .row { flex-wrap: wrap; }
.ac { position: relative; display: block; }
.ac textarea { display: block; }
.ac-list {
  position: absolute; top: calc(100% + 2px); left: 0; right: 0; z-index: 30; list-style: none; margin: 0; padding: 4px;
  background: var(--panel); border: 1px solid var(--line); border-radius: 8px;
  box-shadow: 0 6px 20px rgba(0,0,0,.15); max-height: 300px; overflow: auto;
}
.ac-list li { display: flex; gap: 8px; align-items: baseline; padding: 7px 9px; border-radius: 6px; cursor: pointer; }
.ac-list li.on, .ac-list li:hover { background: var(--chip); }
.ac-list li .src { flex: none; width: 1.2em; text-align: center; }
.ac-list li.note { cursor: default; color: var(--muted); font-size: .75rem; padding: 4px 9px; }
.ac-list li.note:hover { background: none; }
.tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }
.tabs button {
  border: 1px solid var(--line); background: var(--panel); border-radius: 999px;
  padding: 7px 14px; font: inherit; font-weight: 600; cursor: pointer; color: var(--ink);
}
.tabs button.on { background: var(--brand); color: #fff; border-color: var(--brand); }
.menu-grid { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); }
.menu-item {
  text-align: left; border: 1px solid var(--line); background: var(--panel); border-radius: var(--radius);
  padding: 12px; cursor: pointer; font: inherit; color: var(--ink); min-height: 92px;
  display: flex; flex-direction: column; gap: 4px; box-shadow: var(--shadow);
}
.menu-item:hover { border-color: var(--brand); }
.menu-item b { font-size: 1rem; }
.menu-item .desc { color: var(--muted); font-size: .8rem; flex: 1; }
.menu-item .from { font-weight: 700; color: var(--brand); }

.opt-grid { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0 12px; }
.opt {
  border: 1px solid var(--line); background: var(--panel); border-radius: 8px; padding: 8px 12px;
  cursor: pointer; font: inherit; color: var(--ink);
}
.opt.on { background: var(--ink); color: var(--panel); border-color: var(--ink); }
.opt small { display: block; font-size: .75rem; opacity: .75; }
.qty { display: inline-flex; align-items: center; gap: 6px; }
.qty button { width: 34px; height: 34px; border-radius: 8px; border: 1px solid var(--line); background: var(--panel); font-size: 1.1rem; cursor: pointer; color: var(--ink); }
.qty span { min-width: 26px; text-align: center; font-weight: 700; }

.cart { position: sticky; top: 64px; }
.cart-lines { list-style: none; margin: 0 0 10px; padding: 0; max-height: 46vh; overflow: auto; }
.cart-lines li { display: flex; gap: 8px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.cart-lines .what { flex: 1; }
.cart-lines .extras, .cart-lines .note { font-size: .8rem; color: var(--muted); }
.cart-lines .amt { font-weight: 700; white-space: nowrap; }
.cart-lines .x { border: 0; background: none; color: var(--bad); cursor: pointer; font-size: 1.1rem; }
.totals div { display: flex; justify-content: space-between; padding: 2px 0; }
.totals .grand { font-size: 1.5rem; font-weight: 800; border-top: 2px solid var(--ink); margin-top: 6px; padding-top: 6px; }
.empty { color: var(--muted); text-align: center; padding: 18px 0; }

.placed {
  background: var(--ok-bg); color: var(--ok); border: 2px solid var(--ok); border-radius: var(--radius);
  padding: 14px; margin-bottom: 12px; text-align: center;
}
.placed .big { font-size: 2rem; font-weight: 800; }

.recent { margin-top: 16px; }
table.list { width: 100%; border-collapse: collapse; }
table.list th, table.list td { text-align: left; padding: 7px 8px; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.list th { font-size: .78rem; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); }
table.list td.num, table.list th.num { text-align: right; }

/* ---------- boards (make / kitchen / cut) ---------- */
.board-head { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.board-head h1 { margin: 0; font-size: 1.6rem; }
.board-head .count { font-size: 1.1rem; color: var(--muted); }
.tickets { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); align-items: start; }
.ticket {
  background: var(--panel); border: 2px solid var(--line); border-radius: 12px; overflow: hidden;
  display: flex; flex-direction: column;
}
.ticket.new { animation: pop .25s ease-out; }
@keyframes pop { from { transform: scale(.96); opacity: 0; } }
.ticket.age-warn { border-color: var(--warn); }
.ticket.age-bad { border-color: var(--bad); }
.ticket .th { display: flex; align-items: baseline; gap: 8px; padding: 10px 12px; background: var(--chip); }
.ticket .no { font-size: 1.6rem; font-weight: 800; }
.ticket .who { flex: 1; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ticket .age { font-variant-numeric: tabular-nums; font-weight: 700; }
.ticket.age-warn .age { color: var(--warn); }
.ticket.age-bad .age { color: var(--bad); }
.ticket .onote { padding: 6px 12px; background: var(--warn-bg); color: var(--warn); font-weight: 600; }
.ticket .addr { padding: 6px 12px; font-size: .9rem; color: var(--muted); border-bottom: 1px solid var(--line); }
.ticket ul { list-style: none; margin: 0; padding: 0; }
.ticket li {
  padding: 10px 12px; border-top: 1px solid var(--line); cursor: pointer; display: flex; gap: 10px;
  align-items: flex-start; user-select: none;
}
.ticket li:first-child { border-top: 0; }
.ticket li .tick {
  width: 26px; height: 26px; flex: none; border-radius: 6px; border: 2px solid var(--muted);
  display: grid; place-items: center; font-weight: 800;
}
.ticket li.ready { opacity: .5; }
.ticket li.ready .tick { background: var(--ok); border-color: var(--ok); color: #000; }
.ticket li.ready .tick::after { content: "✓"; }
.ticket li .main { flex: 1; }
.ticket li .line1 { font-size: 1.2rem; font-weight: 700; }
.ticket li .qtyx { color: var(--warn); }
.ticket li .size { display: inline-block; font-size: .85rem; padding: 1px 7px; border-radius: 6px; background: var(--chip); margin-right: 4px; vertical-align: 2px; }
.ticket li .ext { color: var(--ok); font-weight: 600; }
.ticket li .inote { color: var(--warn); font-weight: 600; }
.ticket li .station { font-size: .75rem; color: var(--muted); text-transform: uppercase; }
.ticket .tf { padding: 10px 12px; border-top: 1px solid var(--line); margin-top: auto; }
.ticket.all-ready { border-color: var(--ok); }
.ticket.all-ready .th { background: var(--ok-bg); }
.ticket .progress { height: 5px; background: var(--chip); }
.ticket .progress i { display: block; height: 100%; background: var(--ok); transition: width .3s; }
.board-empty { text-align: center; color: var(--muted); font-size: 1.4rem; padding: 80px 0; }

/* ---------- admin ---------- */
.admin-wrap { max-width: 1200px; margin: 0 auto; }
.login { max-width: 360px; margin: 60px auto; }
.cat { margin-bottom: 18px; }
.cat-head { display: grid; grid-template-columns: 1fr 150px auto auto 70px auto auto; gap: 8px; align-items: center; margin-bottom: 10px; }
@media (max-width: 800px) { .cat-head { grid-template-columns: 1fr 1fr; } }
.sizes { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-bottom: 10px; }
.size-chip { display: inline-flex; align-items: center; gap: 4px; background: var(--chip); border-radius: 8px; padding: 3px 4px 3px 8px; }
.size-chip input { width: 110px; padding: 3px 6px; }
.size-chip button { border: 0; background: none; cursor: pointer; color: var(--bad); font-size: 1rem; }
.items-table input.price { width: 80px; text-align: right; }
.items-table input.nm { min-width: 140px; }
.items-table input.ds { min-width: 160px; }
.items-table input.so { width: 56px; }
.items-table tr.dirty td { background: var(--warn-bg); }
.items-table td.acts { white-space: nowrap; width: 1%; }
.items-table tr.off td:not(:last-child) { opacity: .5; }
.table-scroll { overflow-x: auto; }
.savebar {
  position: sticky; bottom: 12px; z-index: 25; margin-top: 12px; display: flex; gap: 10px; align-items: center;
  background: #1f1c19; color: #fff; border-radius: 12px; padding: 10px 12px 10px 16px;
  box-shadow: 0 6px 24px rgba(0,0,0,.25); font-weight: 600;
}
.savebar .btn.ghost { color: #fff; border-color: #5b544c; }
.deal.edited { border-color: var(--warn); box-shadow: 0 0 0 1px var(--warn); }
.deal-head { display: grid; grid-template-columns: 1fr auto auto auto auto auto auto; gap: 8px; align-items: center; }
@media (max-width: 800px) { .deal-head { grid-template-columns: 1fr 1fr; } }
.deal-parts select { min-width: 120px; }
.deal-parts details summary { cursor: pointer; white-space: nowrap; }
.choice-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 4px 12px; padding: 8px 0; }
.choice-grid label { display: flex; gap: 6px; align-items: center; }
.warn-note { background: var(--warn-bg); color: var(--warn); border-radius: 8px; padding: 8px 12px; font-weight: 600; margin: 0 0 10px; }
.stat { display: inline-block; margin-right: 24px; }
.stat b { display: block; font-size: 1.6rem; }

/* ---------- meal deals (order page) ---------- */
.modal.wide { width: min(760px, 100%); }
.deal-card { border-color: var(--warn); background: linear-gradient(180deg, var(--warn-bg), var(--panel) 60%); }
.deal-pick { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; margin-bottom: 10px; }
.deal-pick.chosen { border-color: var(--ok); }
.deal-pick h3 { margin-bottom: 4px; }
.deal-pick .opt-grid { margin: 4px 0 8px; }
.deal-pick .pnote { margin-top: 2px; }
.ticket li .deal-tag { font-size: .8rem; color: var(--warn); font-weight: 600; }
.choice-grid .choice { display: flex; gap: 6px; align-items: center; justify-content: space-between; }
.choice-grid .surch { width: 64px; padding: 3px 6px; text-align: right; }
.opt-head { display: grid; grid-template-columns: 1fr auto auto auto auto auto auto; gap: 8px; align-items: center; }
@media (max-width: 800px) { .opt-head { grid-template-columns: 1fr 1fr; } }
.used-cat { margin: 8px 0; }

/* Extra topping names stand out in red bold (order screen and deal picker) */
.opt[data-top] { color: var(--brand); font-weight: 700; }
.opt[data-top] small { color: var(--muted); font-weight: 400; }
.opt[data-top].on { color: var(--panel); }
.opt[data-top].on small { color: var(--panel); }
.quote { margin: -4px 0 10px; padding: 6px 10px; border-radius: 8px; background: var(--ok-bg); color: var(--ink); }
.quote.bad { background: var(--bad-bg); color: var(--bad); font-weight: 600; }

/* ---------- item window: fit on screen without scrolling ---------- */
.modal.xwide { width: min(1180px, 97vw); max-height: 96vh; padding: 14px 16px; }
.cfg-modal h2 { margin-bottom: 2px; }
.cfg-modal h3 { margin: 8px 0 4px; font-size: .95rem; }
.cfg-modal .opt-grid { margin: 2px 0 6px; gap: 5px; }
.cfg-modal .opt { padding: 6px 10px; }
.cfg-modal .field { margin-bottom: 8px; }
.cfg-cols { display: grid; grid-template-columns: minmax(260px, 340px) 1fr; gap: 18px; align-items: start; }
.cfg-cols .cfg-main { position: sticky; top: 0; }
.cfg-tops h3 { margin-top: 8px; }
/* Toppings: compact grid, price on the same line as the name */
.tops-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(178px, 1fr)); gap: 4px; }
/* topping name (red) centred, price always on its own line underneath */
.tops-grid .opt { padding: 4px 8px; font-size: .88rem; display: flex; flex-direction: column; justify-content: center; align-items: center; text-align: center; line-height: 1.25; }
.tops-grid .opt small { display: block; font-size: .78rem; white-space: nowrap; }
@media (max-width: 900px) {
  /* one column: size & options, then toppings, then notes + Add at the bottom */
  .cfg-cols { display: flex; flex-direction: column; align-items: stretch; gap: 0; }
  .cfg-cols .cfg-main { position: static; display: contents; }
  .cfg-cols .cfg-tops { order: 1; }
  .cfg-cols .field, .cfg-cols .cfg-actions { order: 2; }
  .tops-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); width: 100%; }
}

/* ---------- meal deal window: fit on screen without scrolling ---------- */
.deal-modal h2 { margin-bottom: 2px; }
.deal-modal h3 { margin: 0 0 4px; font-size: .95rem; }
.deal-modal .opt { padding: 5px 9px; }
.deal-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 8px; align-items: start; margin-top: 6px; }
.deal-modal .deal-pick { margin: 0; padding: 8px 10px; }
.deal-pick.editing { border-color: var(--brand); box-shadow: 0 0 0 1px var(--brand); }
.pick-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 4px; margin: 2px 0 6px; }
.pick-grid .opt { padding: 4px 7px; font-size: .84rem; line-height: 1.2; text-align: center; }
/* centred: surcharge beside the name, or centred under it when the button is too narrow (never spills out) */
.pick-grid .opt { display: flex; flex-wrap: wrap; justify-content: center; align-content: center; align-items: baseline; column-gap: 6px; min-width: 0; }
.pick-grid .opt .nm { min-width: 0; overflow-wrap: anywhere; }
.pick-grid .opt small { display: inline; white-space: nowrap; }
.deal-modal .opt-grid { margin: 2px 0 6px; gap: 4px; }
.pick-tops { margin: 2px 0 6px; flex-wrap: wrap; }
.pick-tops .top-list { color: var(--brand); font-weight: 600; }
.deal-modal .pnote { padding: 5px 8px; }
.deal-tops { margin-top: 8px; padding: 8px 10px; border: 1px solid var(--brand); border-radius: 10px; }
.deal-foot { margin-top: 10px; }
/* toppings panel sits beside the deal parts (not under them) so the window stays on one screen */
.deal-body.with-tops { display: grid; grid-template-columns: minmax(0, 1fr) minmax(340px, 40%); gap: 10px; align-items: start; }
.deal-body.with-tops .deal-cards { grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); }
.deal-body.with-tops .deal-tops { margin-top: 6px; }
.deal-tops .tops-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.pick-grid { grid-template-columns: repeat(auto-fill, minmax(108px, 1fr)); gap: 3px; }
.pick-grid .opt { padding: 3px 6px; font-size: .8rem; }
.deal-modal .deal-pick .opt-grid .opt { padding: 3px 8px; font-size: .85rem; }
.deal-modal .deal-pick h3 { margin-bottom: 2px; }
@media (max-width: 900px) {
  .deal-body.with-tops { grid-template-columns: 1fr; }
}
/* full-width toppings screen inside the deal window */
.deal-tops .tops-grid { grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); }
.deal-tops .row h3 { margin: 0; }
.deal-tops .tops-grid { margin-top: 8px; }
.picked { display: flex; align-items: center; gap: 8px; margin: 2px 0 6px; color: var(--ok); }
.picked b { color: var(--ink); }
.picked .btn { margin-left: auto; }

/* bigger customer name on bench tickets */
.ticket .who { font-size: 1.3rem; font-weight: 800; }

/* ---------- delivery page ---------- */
.dl-h { margin: 14px 0 8px; font-size: 1.1rem; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.ticket .drop { cursor: default; }
.drop-n { width: 26px; height: 26px; flex: none; border-radius: 50%; background: var(--brand); color: #fff; display: grid; place-items: center; font-weight: 800; }
.addr-big { font-size: 1.05rem; font-weight: 600; margin: 2px 0; }
.out-run { opacity: .9; }
.out-run .th { background: var(--warn-bg); }
#waiting .ticket .who, #out .ticket .who { white-space: normal; font-size: 1.1rem; }

/* ---------- new tickets flash until accepted ---------- */
@keyframes ticket-flash {
  0%, 100% { border-color: #fbbf24; box-shadow: 0 0 0 2px #fbbf24, 0 0 18px rgba(251, 191, 36, .55); background: #3d3014; }
  50%      { border-color: var(--line); box-shadow: none; background: var(--panel); }
}
.ticket.flash { animation: ticket-flash 1s ease-in-out infinite; cursor: pointer; }
.ticket.flash .th { background: transparent; }
.btn.accept { background: #fbbf24; color: #1f1c19; font-weight: 800; }
@media (prefers-reduced-motion: reduce) {
  .ticket.flash { animation: none; border-color: #fbbf24; box-shadow: 0 0 0 3px #fbbf24; }
}

/* ---------- orders page ---------- */
.orders-wrap { max-width: 1400px; margin: 0 auto; }
.filters { align-items: flex-end; }
.filters .field { margin-bottom: 8px; }
.filters input[type=date] { width: 150px; } .filters input[type=time] { width: 110px; }
.btn.on-range { background: var(--ink); color: var(--panel); border-color: var(--ink); }
.orders-table td { vertical-align: top; }
.order-row { cursor: pointer; }
.order-row:hover td, .order-row.open td { background: var(--chip); }
.items-cell { font-size: .88rem; }
.items-cell .ext, .order-detail .ext { color: var(--brand); font-weight: 600; }
.nowrap { white-space: nowrap; }
.detail-row > td { background: var(--bg); padding: 10px 14px; }
.stat { display: inline-flex; flex-direction: column; margin-right: 26px; }
.bar { height: 10px; border-radius: 5px; background: var(--brand); min-width: 2px; }

/* ---------- payment (take order) ---------- */
.pay-section h3 { margin: 12px 0 6px; }
.pay-opts { display: flex; flex-wrap: wrap; gap: 6px; }
.pay-opts .opt { text-align: left; }
.saved-card { display: inline-flex; align-items: center; }
.saved-card .x { border: 0; background: none; color: var(--bad); cursor: pointer; font-size: 1rem; padding: 0 4px; }
.card-wrap { margin-top: 8px; padding: 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); }
.card-el { padding: 10px; border: 1px solid var(--line); border-radius: 6px; background: #fff; min-height: 40px; }
.placed.pending { background: var(--warn-bg); color: var(--ink); border-color: var(--warn); }

/* ---------- customer screen (display.php) ---------- */
body.cdisplay { background: #15171a; color: #f5f5f5; margin: 0; }
.cd-wrap { min-height: 100vh; display: flex; flex-direction: column; }
.cd-head { position: relative; display: flex; align-items: center; justify-content: center; text-align: center; gap: 10px; padding: 14px 48px; font-size: 1.6rem; font-weight: 800; background: var(--brand); color: #fff; }
.cd-head .cd-dot { position: absolute; right: 20px; top: 50%; transform: translateY(-50%); font-size: .7rem; color: #bbf7d0; }
body.cdisplay.offline .cd-dot { color: #fecaca; }
.cd-main { flex: 1; display: flex; flex-direction: column; padding: 18px 28px 24px; min-height: 0; }
.cd-idle, .cd-thanks { margin: auto; text-align: center; }
.cd-big { font-size: clamp(2.5rem, 7vw, 5rem); font-weight: 900; }
.cd-idle p { font-size: 1.4rem; color: #a3a7ad; }
.cd-orderno { font-size: 2rem; margin-top: 8px; color: #fbbf24; font-weight: 800; }
.cd-thanks .cd-total { font-size: clamp(3rem, 9vw, 6rem); font-weight: 900; margin: 12px 0; }
.cd-paid { font-size: 1.6rem; color: #4ade80; font-weight: 700; }
.cd-sub { font-size: 1.4rem; color: #a3a7ad; }
.cd-order { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.cd-order h2 { font-size: 1.4rem; color: #a3a7ad; margin: 0 0 8px; }
.cd-lines { list-style: none; margin: 0; padding: 0; overflow-y: auto; flex: 1; min-height: 0; }
.cd-lines li { padding: 10px 0; border-bottom: 1px solid #2c3036; }
.cd-l1 { display: flex; gap: 12px; align-items: baseline; font-size: clamp(1.3rem, 2.6vw, 2rem); font-weight: 700; }
.cd-q { min-width: 2.6em; color: #fbbf24; }
.cd-n { flex: 1; }
.cd-p { white-space: nowrap; }
.cd-d { margin-left: calc(2.6em + 12px); color: #a3a7ad; font-size: clamp(1rem, 1.8vw, 1.35rem); }
.cd-totals { border-top: 3px solid #f5f5f5; padding-top: 10px; font-size: clamp(1.2rem, 2.2vw, 1.7rem); }
.cd-totals > div { display: flex; justify-content: space-between; padding: 2px 0; }
.cd-grand { font-size: clamp(2.2rem, 5vw, 3.6rem); font-weight: 900; }
.cd-gst { text-align: right; color: #a3a7ad; font-size: 1rem; }

/* ---------------------------------------------------------------- customer screen: adverts / daily specials */
.cd-foot { padding: 10px 24px; text-align: center; font-size: clamp(1rem, 2vw, 1.5rem); font-weight: 700; background: #0d0f11; color: #e5e7eb; border-top: 1px solid #2c3036; }
.cd-stage { position: relative; flex: 1; min-height: 60vh; overflow: hidden; border-radius: 14px; perspective: 1600px; margin: -6px -12px -10px; }
.cd-slide { position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: flex-end; overflow: hidden; border-radius: 14px; background: #1d2024; backface-visibility: hidden; }
.cd-slide.text-only { justify-content: center; align-items: center; text-align: center; background: radial-gradient(circle at 30% 20%, #3a1d1a, #15171a 70%); }
.cd-slide.text-only.special { background: radial-gradient(circle at 30% 20%, #4a3410, #15171a 70%); }
.cd-sbg { position: absolute; inset: -30px; background-size: cover; background-position: center; filter: blur(28px) brightness(.45); }
.cd-simg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.cd-slide.has-img .cd-stext { position: relative; padding: 28px 36px 26px; background: linear-gradient(transparent, rgba(0,0,0,.82) 38%); }
.cd-slide.text-only .cd-stext { padding: 24px 40px; max-width: 1100px; }
.cd-stitle { font-size: clamp(2.2rem, 6vw, 4.6rem); font-weight: 900; line-height: 1.05; }
.cd-sbody { font-size: clamp(1.2rem, 2.6vw, 2.1rem); color: #d4d7dc; margin-top: 10px; line-height: 1.3; }
.cd-sprice { display: inline-block; margin-top: 14px; padding: 6px 22px; border-radius: 999px; background: var(--brand); color: #fff; font-size: clamp(1.8rem, 4.5vw, 3.4rem); font-weight: 900; }
.cd-slide.special .cd-sprice { background: #f59e0b; color: #1a1205; }
.cd-ribbon { position: absolute; top: 22px; left: 22px; z-index: 2; padding: 8px 20px; border-radius: 999px; background: #f59e0b; color: #1a1205; font-weight: 900; font-size: clamp(1rem, 2.2vw, 1.6rem); box-shadow: 0 6px 20px rgba(0,0,0,.4); }
.cd-slide.has-img:not(.img-only) .cd-simg { animation: cdDrift 20s ease-out both; }
@keyframes cdDrift { from { transform: scale(1.06); } to { transform: scale(1); } }

/* transitions between slides (stage[data-t]); .enter = new slide, .leave = old one */
.cd-stage .cd-slide { animation-duration: .9s; animation-fill-mode: both; animation-timing-function: cubic-bezier(.4, 0, .2, 1); }
.cd-stage[data-t="fade"] .enter  { animation-name: cdFadeIn; }
.cd-stage[data-t="fade"] .leave  { animation-name: cdFadeOut; }
.cd-stage[data-t="slide"] .enter { animation-name: cdSlideIn; }
.cd-stage[data-t="slide"] .leave { animation-name: cdSlideOut; }
.cd-stage[data-t="zoom"] .enter  { animation-name: cdZoomIn; }
.cd-stage[data-t="zoom"] .leave  { animation-name: cdZoomOut; }
.cd-stage[data-t="flip"] .enter  { animation-name: cdFlipIn; }
.cd-stage[data-t="flip"] .leave  { animation-name: cdFlipOut; }
@keyframes cdFadeIn   { from { opacity: 0; } to { opacity: 1; } }
@keyframes cdFadeOut  { from { opacity: 1; } to { opacity: 0; } }
@keyframes cdSlideIn  { from { transform: translateX(100%); } to { transform: none; } }
@keyframes cdSlideOut { from { transform: none; } to { transform: translateX(-100%); } }
@keyframes cdZoomIn   { from { opacity: 0; transform: scale(1.18); } to { opacity: 1; transform: none; } }
@keyframes cdZoomOut  { from { opacity: 1; transform: none; } to { opacity: 0; transform: scale(.88); } }
@keyframes cdFlipIn   { 0%, 45% { transform: rotateY(-90deg); } 100% { transform: none; } }
@keyframes cdFlipOut  { 0% { transform: none; } 55%, 100% { transform: rotateY(90deg); } }
@media (prefers-reduced-motion: reduce) { .cd-stage .cd-slide, .cd-simg { animation: none !important; } }

/* Admin → Customer screen */
.ds-layout { display: grid; grid-template-columns: minmax(300px, 420px) minmax(0, 1fr); gap: 16px; align-items: start; }
@media (max-width: 900px) { .ds-layout { grid-template-columns: 1fr; } }
.ds-preview { position: relative; width: 100%; aspect-ratio: 16 / 9; overflow: hidden; border-radius: 10px; border: 1px solid var(--line); background: #15171a; }
.ds-preview iframe { position: absolute; top: 0; left: 0; width: 400%; height: 400%; border: 0; transform: scale(.25); transform-origin: 0 0; pointer-events: none; }
.ds-list { display: flex; flex-direction: column; gap: 8px; }
.ds-card { display: flex; gap: 12px; align-items: center; border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; }
.ds-card.off { opacity: .6; }
.ds-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.ds-price { color: var(--brand); font-weight: 800; }
.ds-actions { display: flex; gap: 4px; flex-wrap: wrap; justify-content: flex-end; }
.ds-thumb { width: 96px; height: 54px; flex: none; border-radius: 6px; background: #1d2024; display: flex; align-items: center; justify-content: center; overflow: hidden; font-size: 1.6rem; }
.ds-thumb img { width: 100%; height: 100%; object-fit: cover; }
.ds-thumb.lg { width: 192px; height: 108px; background: var(--bg, #f3f3f3); }
.ds-editor { margin-bottom: 14px; border-color: var(--brand); }
.ds-days label { gap: 4px; }

/* ---------------------------------------------------------------- staff sign-in */
.topbar .who { color: #fff; font-weight: 700; font-size: .9rem; padding: 4px 10px; border-radius: 999px 0 0 999px; background: rgba(255,255,255,.14); margin-left: 8px; white-space: nowrap; }
.topbar .signout { color: #fff; text-decoration: none; font-weight: 700; font-size: .85rem; padding: 4px 10px; border-radius: 0 999px 999px 0;
  background: var(--brand); white-space: nowrap; }
.topbar .signout:hover { filter: brightness(1.15); }
body.signin-page { min-height: 100vh; display: flex; }
.signin-wrap { margin: auto; width: 100%; max-width: 560px; padding: 24px 16px; }
.signin-brand { text-align: center; font-size: 1.6rem; font-weight: 900; margin-bottom: 14px; }
.signin { padding: 22px; }
.signin h1 { font-size: 1.4rem; margin: 0 0 10px; }
.signin-foot { text-align: center; margin-top: 10px; }
.si-people { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
.si-person { padding: 22px 10px; font: inherit; font-size: 1.15rem; font-weight: 800; border-radius: 12px; border: 1px solid var(--line); background: var(--panel); color: var(--ink); cursor: pointer; }
.si-person:hover, .si-person:focus-visible { border-color: var(--brand); outline: none; box-shadow: 0 0 0 2px var(--brand); }
.si-dots { display: flex; gap: 12px; justify-content: center; margin: 14px 0 18px; }
.si-dots span { width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--ink); }
.si-dots span.on { background: var(--ink); }
.si-pad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; max-width: 340px; margin: 0 auto; }
.si-pad button { padding: 18px 0; font: inherit; font-size: 1.5rem; font-weight: 800; border-radius: 12px; border: 1px solid var(--line); background: var(--panel); color: var(--ink); cursor: pointer; }
.si-pad button.clr { font-size: 1rem; }
.si-pad button.ok { font-size: 1rem; background: var(--brand); color: #fff; border-color: var(--brand); }
.si-pad button:active { transform: scale(.96); }
.stf-layout { grid-template-columns: minmax(320px, 1fr) minmax(0, 1fr); }
.stf-layout .panel { margin-bottom: 14px; }

/* ---------------------------------------------------------------- cut bench check-off + changed orders */
.ticket .cut-list li.cut-item { display: flex; gap: 10px; align-items: flex-start; cursor: pointer; }
.ticket .cut-list .cbox { flex: none; width: 26px; height: 26px; margin-top: 1px; border: 2px solid var(--ink); border-radius: 6px;
  display: flex; align-items: center; justify-content: center; font-weight: 900; font-size: 1.05rem; background: var(--panel); }
.ticket .cut-list li.checked .cbox { background: var(--ok); border-color: var(--ok); color: #fff; }
.ticket .cut-list li.checked .main { opacity: .55; text-decoration: line-through; }
.ticket .kchip { display: inline-block; margin-left: 6px; padding: 0 7px; border-radius: 999px; font-size: .72rem; font-weight: 700;
  vertical-align: middle; background: var(--warn-bg); color: var(--warn); text-decoration: none; }
.ticket .kchip.ok { background: var(--ok-bg); color: var(--ok); }
.ticket .edited { margin: 4px 0; padding: 3px 8px; border-radius: 6px; background: var(--warn-bg); color: var(--warn); font-weight: 700; font-size: .85rem; }

/* ---------------------------------------------------------------- changing an existing order (Take Order) */
.edit-banner { margin: 0 0 10px; padding: 10px 12px; border-radius: 10px; background: var(--warn-bg); color: var(--ink);
  border: 2px solid var(--warn); font-weight: 600; }
.edit-banner .small { font-weight: 400; }
body.editing-order #paySection, body.editing-order #cardWrap { display: none !important; }
body.editing-order #placeBtn { background: var(--warn); border-color: var(--warn); }
.nowrap { white-space: nowrap; }

/* ---------------------------------------------------------------- Take Order on-screen keys (touch tills) */
.panel.cust h2 { display: flex; align-items: center; gap: 8px; }
.tk-toggle { margin-left: auto; font-size: .75rem; font-weight: 600; }
.tk-pad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin: 2px 0 10px; }
.tk-pad button { padding: 14px 0; font: inherit; font-size: 1.35rem; font-weight: 800; border-radius: 10px; border: 1px solid var(--line);
  background: var(--panel); color: var(--ink); cursor: pointer; touch-action: manipulation; }
.tk-pad button.go { font-size: 1rem; background: var(--brand); border-color: var(--brand); color: #fff; }
.tk-pad button:active, .tk-kb button:active { transform: scale(.95); background: var(--chip); }
.tk-kb { position: fixed; left: 0; right: 0; bottom: 0; z-index: 60; background: #24211e; padding: 8px 8px 12px;
  transform: translateY(105%); transition: transform .18s ease-out; box-shadow: 0 -6px 20px rgba(0,0,0,.25); }
.tk-kb.open { transform: none; }
.tk-rows { max-width: 1100px; margin: 0 auto; display: grid; gap: 6px; }
.tk-row { display: flex; gap: 6px; }
.tk-kb button { flex: 1; min-width: 0; padding: 16px 0; font: inherit; font-size: 1.25rem; font-weight: 700; border-radius: 8px; border: 0;
  background: #f5f1ea; color: #1f1c19; cursor: pointer; touch-action: manipulation; }
.tk-kb button.k-del, .tk-kb button.k-shift, .tk-kb button.k-sym, .tk-kb button.k-abc { background: #cfc8bc; }
.tk-kb button.k-shift.on { background: #fff; outline: 2px solid var(--brand); }
.tk-kb button.k-shift.caps { background: var(--brand); color: #fff; }
.tk-kb button.k-space { flex: 4; }
.tk-kb button.k-done, .tk-kb button.k-next { flex: 1.6; font-size: 1rem; background: var(--brand); color: #fff; }
.tk-kb button.k-next { background: #3b6fd4; }
body.tk-open main { padding-bottom: 300px; }
body.tk-open .ac-list li { padding: 12px 10px; font-size: 1rem; }
.tk-toggle.on { background: var(--brand); color: #fff; border-color: var(--brand); }

/* ---------------------------------------------------------------- removed ingredients ("NO onion") */
.nos { color: var(--bad); font-weight: 800; }
.ticket .nos { font-size: 1rem; text-transform: uppercase; letter-spacing: .02em; }
.rm-grid .opt.rm { padding: 5px 10px; font-size: .85rem; }
.rm-grid .opt.rm.on { background: var(--bad); border-color: var(--bad); color: #fff; text-decoration: none; }
.deal-modal .rm-grid { margin: 2px 0 6px; gap: 4px; }
.deal-modal .rm-grid .opt.rm { padding: 3px 8px; font-size: .8rem; }
.deal-modal .deal-pick h3 + .rm-grid { margin-top: 0; }
