:root {
  --bg: #eef0f3; --panel: #fff; --ink: #1d2733; --muted: #6b7684; --line: #dde1e7;
  --blue: #1773e8; --blue-d: #0f5cc0; --green: #22a35a; --amber: #f2a20c; --red: #e23b3b; --purple: #7d5be6;
  --teal: #0aa3a3; --radius: 12px;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, sans-serif;
  color: var(--ink); -webkit-tap-highlight-color: transparent;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); overscroll-behavior: none; }
body { -webkit-user-select: none; user-select: none; touch-action: manipulation; }
input, textarea, select { -webkit-user-select: text; user-select: text; font: inherit; }
button { font: inherit; color: inherit; cursor: pointer; }
h1, h2, h3 { margin: 0 0 12px; }
h2 { font-size: 22px; }

/* top bar */
.topbar { height: 56px; background: #1d2733; color: #fff; display: flex; align-items: center; gap: 8px; padding: 0 12px; position: sticky; top: 0; z-index: 5; }
.topbar .brand { font-weight: 700; letter-spacing: .3px; margin-right: 8px; }
.topbar .spacer { flex: 1; }
.topbar .tb { background: rgba(255,255,255,.08); border: 0; color: #fff; border-radius: 10px; padding: 9px 14px; font-weight: 600; }
.topbar .tb.on { background: var(--blue); }
.topbar .clock { font-variant-numeric: tabular-nums; opacity: .8; padding: 0 6px; }

/* buttons & inputs */
.btn { border: 1px solid var(--line); background: #fff; border-radius: 10px; padding: 10px 16px; font-weight: 600; min-height: 44px; }
.btn:active { transform: scale(.98); }
.btn.primary { background: var(--blue); border-color: var(--blue); color: #fff; }
.btn.green { background: var(--green); border-color: var(--green); color: #fff; }
.btn.red { background: var(--red); border-color: var(--red); color: #fff; }
.btn.amber { background: var(--amber); border-color: var(--amber); color: #fff; }
.btn.ghost { background: transparent; }
.btn.big { min-height: 64px; font-size: 18px; }
.btn.small { min-height: 34px; padding: 6px 10px; font-size: 14px; }
.btn:disabled { opacity: .45; }
.input, select.input, textarea.input { width: 100%; border: 1px solid var(--line); border-radius: 10px; padding: 11px 12px; background: #fff; min-height: 44px; }
label.field { display: block; margin-bottom: 12px; font-size: 13px; color: var(--muted); font-weight: 600; }
label.field > .input, label.field > select, label.field > textarea { margin-top: 4px; color: var(--ink); font-weight: 400; font-size: 16px; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.row.end { justify-content: flex-end; margin-top: 16px; }
.muted { color: var(--muted); }
.pill { display: inline-block; padding: 2px 8px; border-radius: 99px; font-size: 12px; font-weight: 700; background: #e7ecf3; color: #3b4652; }
.pill.red { background: #fde3e3; color: var(--red); }
.pill.amber { background: #fff1d6; color: #9a6300; }

/* modal */
.backdrop { position: fixed; inset: 0; background: rgba(15,22,30,.45); display: flex; align-items: center; justify-content: center; z-index: 50; padding: 16px; }
.modal { background: #fff; border-radius: 16px; padding: 22px; width: min(520px, 100%); max-height: 92vh; overflow: auto; position: relative; box-shadow: 0 20px 60px rgba(0,0,0,.25); }
.modal.wide { width: min(900px, 100%); }
.modal-x { position: absolute; right: 10px; top: 8px; border: 0; background: none; font-size: 30px; color: var(--muted); width: 44px; height: 44px; }
.choice-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
.choice-grid .btn.on { background: var(--blue); color: #fff; border-color: var(--blue); }

/* PIN pad */
.pin { text-align: center; }
.pin-msg { min-height: 20px; color: var(--muted); }
.pin-msg.bad { color: var(--red); font-weight: 600; }
.pin-dots { display: flex; gap: 14px; justify-content: center; margin: 14px 0 18px; }
.pin-dots span { width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--ink); }
.pin-dots span.on { background: var(--ink); }
.pin-keys { display: grid; grid-template-columns: repeat(3, 84px); gap: 12px; justify-content: center; }
.key { height: 70px; border-radius: 50%; border: 1px solid var(--line); background: #f7f8fa; font-size: 26px; font-weight: 500; }
.key:active { background: var(--blue); color: #fff; }

/* toasts */
.toasts { position: fixed; right: 12px; top: 68px; z-index: 80; display: flex; flex-direction: column; gap: 8px; max-width: 380px; }
.toast { background: #1d2733; color: #fff; padding: 14px 16px; border-radius: 12px; font-weight: 600; box-shadow: 0 8px 24px rgba(0,0,0,.25); }
.toast.error { background: var(--red); }
.toast.ready { background: var(--green); font-size: 18px; }
.offline { display: none; position: fixed; bottom: 0; left: 0; right: 0; background: var(--red); color: #fff; text-align: center; padding: 10px; font-weight: 700; z-index: 90; }

/* floor plan */
.floor-wrap { display: flex; height: calc(100vh - 56px); }
.floor { flex: 1; padding: 10px; min-width: 0; }
.floor svg { width: 100%; height: 100%; background: #fafbfc; border-radius: var(--radius); border: 1px solid var(--line); touch-action: none; }
.wall { stroke: #a9b1bb; stroke-width: 6; stroke-linecap: round; }
.area { fill: #e9ecf0; stroke: #c9cfd6; stroke-width: 2; }
.fixture-label { font-size: 15px; fill: #8a939e; text-anchor: middle; font-weight: 600; pointer-events: none; }
.seat { fill: #cfd5dc; }
.tbl { cursor: pointer; }
.tbl .top { stroke-width: 3; }
.tbl text { text-anchor: middle; pointer-events: none; }
.tbl .num { font-size: 26px; font-weight: 800; fill: #fff; }
.tbl .sub { font-size: 14px; font-weight: 700; fill: rgba(255,255,255,.95); }
.tbl.free .top { fill: #fff; stroke: #c3cad3; }
.tbl.free .num { fill: #3b4652; }
.tbl.free .sub { fill: var(--muted); }
.timer-ring { fill: none; stroke-width: 5; }
.timer-ring.amber { stroke: var(--amber); }
.timer-ring.red { stroke: var(--red); animation: pulse 1s infinite; }
@keyframes pulse { 50% { opacity: .25; } }
.side { width: 290px; padding: 10px 10px 10px 0; display: flex; flex-direction: column; gap: 10px; overflow: auto; }
.card { background: var(--panel); border-radius: var(--radius); border: 1px solid var(--line); padding: 12px; }
.legend { display: flex; flex-wrap: wrap; gap: 6px; font-size: 12px; }
.legend span { display: inline-flex; align-items: center; gap: 4px; }
.legend i { width: 12px; height: 12px; border-radius: 3px; display: inline-block; }
.ta-item { display: flex; justify-content: space-between; align-items: center; padding: 10px; border-radius: 10px; background: #f6f7f9; margin-top: 6px; border-left: 5px solid var(--purple); cursor: pointer; }
.ta-item.amber { border-left-color: var(--amber); }
.ta-item.red { border-left-color: var(--red); background: #fdeaea; }

/* order screen */
.order { display: flex; flex-direction: column; height: calc(100vh - 56px); }
.order-head { display: flex; align-items: center; gap: 8px; padding: 8px 10px; background: #fff; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.order-head .title { font-size: 20px; font-weight: 800; margin-right: 6px; }
.courses { display: flex; gap: 10px; overflow-x: auto; padding: 10px; background: #e6e9ee; min-height: 200px; max-height: 42vh; }
.course { flex: 0 0 260px; background: #fff; border-radius: var(--radius); border: 2px solid transparent; display: flex; flex-direction: column; max-height: calc(42vh - 20px); }
.course.cur { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(23,115,232,.15); }
.course.empty { border-style: dashed; border-color: #b9c1cb; background: #f4f6f8; }
.course-head { display: flex; align-items: center; justify-content: space-between; padding: 8px 10px; border-bottom: 1px solid var(--line); gap: 6px; }
.course-head b { font-size: 16px; }
.course-items { overflow-y: auto; flex: 1; }
.line { display: flex; gap: 8px; padding: 8px 10px; border-bottom: 1px solid #f0f2f5; cursor: pointer; }
.line:active { background: #f2f6fd; }
.line .nm { flex: 1; min-width: 0; font-weight: 600; }
.line .mods { font-size: 13px; color: var(--muted); font-weight: 500; }
.line .note { font-size: 13px; color: #9a6300; font-weight: 700; }
.line .allergy { font-size: 13px; color: #fff; background: var(--red); border-radius: 6px; padding: 1px 6px; font-weight: 800; display: inline-block; margin-top: 2px; }
.line .pr { font-variant-numeric: tabular-nums; }
.line .st { width: 22px; text-align: center; }
.line.unsent .nm::before { content: '●'; color: var(--blue); font-size: 11px; margin-right: 5px; vertical-align: 2px; }
.line.voided { opacity: .5; text-decoration: line-through; }
.menu { flex: 1; display: flex; flex-direction: column; min-height: 0; padding: 10px; gap: 10px; }
.cats { display: flex; gap: 8px; flex-wrap: wrap; }
.cat { border: 0; border-radius: 10px; padding: 0 14px; height: 52px; color: #fff; font-weight: 700; font-size: 15px; opacity: .85; }
.cat.on { opacity: 1; box-shadow: inset 0 -5px 0 rgba(0,0,0,.25); }
.items { flex: 1; overflow-y: auto; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); grid-auto-rows: 84px; gap: 8px; align-content: start; }
.tile { border: 0; border-radius: 10px; color: #fff; font-weight: 700; padding: 8px 10px; text-align: left; display: flex; flex-direction: column; justify-content: space-between; font-size: 15px; line-height: 1.15; position: relative; }
.tile .p { font-weight: 600; opacity: .9; font-size: 14px; }
.tile.out { filter: grayscale(1); opacity: .45; }
.tile.out::after { content: 'SOLD OUT'; position: absolute; right: 8px; bottom: 8px; font-size: 11px; background: #000; padding: 2px 5px; border-radius: 4px; }
.order-foot { display: flex; align-items: center; gap: 10px; padding: 10px; background: #fff; border-top: 1px solid var(--line); }
.order-foot .total { font-size: 22px; font-weight: 800; flex: 1; }

/* kitchen display */
.kds-tabs { display: flex; gap: 6px; }
.kds { padding: 10px; display: flex; gap: 10px; align-items: flex-start; overflow-x: auto; min-height: calc(100vh - 120px); }
/* one long row: most urgent on the left, never stacked under each other */
.kds > .ticket { flex: 0 0 300px; margin-bottom: 0; }
body.kds-large .kds > .ticket { flex-basis: 360px; }
.ticket-head .qpos { display: inline-flex; align-items: center; justify-content: center; min-width: 26px; height: 26px; border-radius: 999px; background: #fff; color: #1d2733; font-weight: 800; font-size: 14px; margin-right: 8px; vertical-align: middle; }
.kds-stats { display: flex; gap: 8px; padding: 8px 10px 0; flex-wrap: wrap; }
.kds-stats .st { display: flex; flex-direction: column; padding: 6px 12px; border-radius: 10px; background: rgba(127,127,127,.14); min-width: 110px; }
.kds-stats .st small { font-size: 11px; opacity: .75; text-transform: uppercase; letter-spacing: .03em; }
.kds-stats .st b { font-size: 18px; }
.kds-stats .st.ok b { color: #1f9d55; } .kds-stats .st.amber b { color: #e08e0b; } .kds-stats .st.red b { color: #e23b3b; }
.ticket { break-inside: avoid; background: #fff; border-radius: var(--radius); margin-bottom: 10px; overflow: hidden; border: 1px solid var(--line); position: relative; }
/* frame round a ticket that's running late: amber at the first warning, flashing red past the max time */
.ticket::after { content: ''; position: absolute; top: 0; right: 0; bottom: 0; left: 0; border-radius: inherit; pointer-events: none; z-index: 2; }
.ticket.frame-amber::after { border: 6px solid var(--amber); }
.ticket.frame-red::after { border: 7px solid var(--red); animation: frame-pulse 1s infinite; }
@keyframes frame-pulse { 50% { border-color: rgba(226, 59, 59, .35); } }
.ticket-head { padding: 10px 12px; color: #fff; background: #3b4652; display: flex; justify-content: space-between; align-items: flex-start; gap: 6px; }
.ticket-head .big { font-size: 22px; font-weight: 800; line-height: 1.1; }
.ticket-head .meta { font-size: 13px; opacity: .9; }
.ticket.takeaway .ticket-head { background: var(--purple); }
.ticket-note { background: #fff5d6; color: #7a5200; padding: 8px 12px; font-weight: 700; }
.kcourse-head { display: flex; justify-content: space-between; align-items: center; padding: 6px 12px; background: #eef1f5; font-weight: 800; font-size: 14px; letter-spacing: .3px; }
.kcourse-head.amber { background: var(--amber); color: #fff; }
.kcourse-head.red { background: var(--red); color: #fff; animation: pulse 1s infinite; }
.kcourse.held { opacity: .45; }
.kcourse.held .kcourse-head { background: repeating-linear-gradient(45deg, #eef1f5, #eef1f5 8px, #e1e5ea 8px, #e1e5ea 16px); }
.kitem { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border-top: 1px solid #f0f2f5; cursor: pointer; }
.kitem:active { background: #eef4fd; }
.kitem .nm { flex: 1; font-size: 18px; font-weight: 700; }
.kitem .mods { font-size: 15px; color: #3b4652; font-weight: 600; }
.kitem .removed { font-size: 15px; color: var(--red); font-weight: 800; }
.kitem .note { font-size: 15px; background: #fff1b8; padding: 2px 6px; border-radius: 5px; font-weight: 700; display: inline-block; margin-top: 2px; }
.kitem .allergy { background: var(--red); color: #fff; font-weight: 900; padding: 4px 8px; border-radius: 6px; margin-top: 4px; font-size: 15px; }
.kitem .state { width: 44px; height: 44px; border-radius: 50%; border: 2px solid #c9cfd6; display: flex; align-items: center; justify-content: center; font-size: 22px; flex: 0 0 44px; }
.kitem.ack .state { border-color: var(--blue); color: var(--blue); }
.kitem.ready .state { background: var(--amber); border-color: var(--amber); color: #fff; animation: pulse 1.2s infinite; }
.kitem.collected .state { background: var(--green); border-color: var(--green); color: #fff; }
.kitem.collected .nm { text-decoration: line-through; color: var(--muted); }
.kitem.voided { text-decoration: line-through; opacity: .5; }
.kitem.voided .state { border-color: var(--red); color: var(--red); font-size: 13px; font-weight: 900; }
.undo { border: 0; background: none; color: var(--muted); font-size: 18px; width: 36px; height: 44px; }
.empty-state { text-align: center; color: var(--muted); padding: 60px 20px; font-size: 18px; }
.start-overlay { position: fixed; inset: 0; background: #1d2733; color: #fff; display: flex; flex-direction: column; align-items: center; justify-content: center; z-index: 60; gap: 16px; text-align: center; padding: 20px; }

/* back office */
.admin { display: flex; height: calc(100vh - 56px); }
.admin-nav { width: 200px; background: #fff; border-right: 1px solid var(--line); padding: 10px; display: flex; flex-direction: column; gap: 4px; }
.admin-nav button { text-align: left; border: 0; background: none; padding: 12px; border-radius: 10px; font-weight: 600; }
.admin-nav button.on { background: #e7f0fd; color: var(--blue-d); }
.admin-main { flex: 1; overflow: auto; padding: 16px; min-width: 0; }
.split { display: flex; gap: 16px; align-items: flex-start; }
.split > .list { width: 340px; flex: 0 0 340px; max-height: calc(100vh - 140px); overflow: auto; }
.split > .form { flex: 1; min-width: 0; }
.list-item { padding: 10px 12px; border-radius: 10px; cursor: pointer; display: flex; justify-content: space-between; gap: 8px; align-items: center; }
.list-item:hover { background: #f3f5f8; }
.list-item.on { background: #e7f0fd; }
.list-head { font-size: 12px; font-weight: 800; text-transform: uppercase; color: var(--muted); padding: 12px 12px 4px; letter-spacing: .5px; display: flex; align-items: center; gap: 6px; }
.list-head i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.checks { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 6px; }
.checks label { display: flex; gap: 6px; align-items: center; padding: 8px; border: 1px solid var(--line); border-radius: 8px; font-size: 14px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.grid3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; }
.section-title { font-size: 13px; font-weight: 800; color: var(--muted); text-transform: uppercase; letter-spacing: .5px; margin: 18px 0 8px; }
.editor { display: flex; gap: 12px; height: calc(100vh - 140px); }
.editor .canvas { flex: 1; min-width: 0; }
.editor .canvas svg { width: 100%; height: 100%; background: #fafbfc; border: 1px solid var(--line); border-radius: var(--radius); touch-action: none; }
.editor .props { width: 270px; flex: 0 0 270px; overflow: auto; }
.sel .top, .sel rect.area, .sel ellipse.area { stroke: var(--blue) !important; stroke-width: 4 !important; }
.sel line.wall { stroke: var(--blue); }
.handle { fill: var(--blue); cursor: nwse-resize; }
.grid-line { stroke: #eef0f3; stroke-width: 1; }

/* launcher */
.launch { max-width: 760px; margin: 0 auto; padding: 40px 20px; }
.launch-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px; margin-top: 20px; }
.launch-grid a { display: block; background: #fff; border-radius: 16px; padding: 26px 20px; text-decoration: none; color: var(--ink); border: 1px solid var(--line); }
.launch-grid a b { display: block; font-size: 20px; margin-bottom: 6px; }

@media (max-width: 900px) {
  .floor-wrap { flex-direction: column; }
  .side { width: auto; flex-direction: row; padding: 10px 10px 0; overflow-x: auto; flex: 0 0 auto; }
  .side > * { flex: 1 0 220px; }
  .side .legend, .side .muted { display: none; }
}
@media (max-width: 760px) {
  .course { flex-basis: 220px; }
  .admin-nav { width: 64px; }
  .split { flex-direction: column; }
  .split > .list { width: 100%; flex: none; max-height: 40vh; }
}
.btn { color: var(--ink); }
.btn.primary, .btn.green, .btn.red, .btn.amber { color: #fff; }
.row > select.input { width: auto; min-width: 220px; }
.props .checks { grid-template-columns: 1fr 1fr; }

@media (max-width: 640px) {
  .order { height: auto; min-height: calc(100vh - 56px); }
  .courses { max-height: none; }
  .course { max-height: none; }
  .menu { flex: none; }
  .items { overflow: visible; grid-template-columns: repeat(2, 1fr); }
  .order-foot { position: sticky; bottom: 0; z-index: 4; }
  .order-head .title { font-size: 17px; }
  .topbar { gap: 6px; }
}

/* ===== Front of house, modelled on Lightspeed K-Series (dark) ===== */
body.foh {
  --k-bg: #1c2030; --k-panel: #2b3043; --k-panel2: #343a4f; --k-line: #3f465d; --k-ink: #f4f6fb; --k-muted: #a3abc2;
  --k-blue: #2747e3; --k-blue-line: #1c34b0; --k-link: #6b95ff; --k-tile: #3b4157; --k-tile-bar: #3d6bff;
  --k-green: #3f8f5c; --k-red: #ff5d5d; --k-black: #0d0f15;
  background: var(--k-bg); color: var(--k-ink);
}
.foh-top { background: var(--k-bg); justify-content: space-between; border-bottom: 1px solid var(--k-line); }
.foh-top .logout { background: none; border: 0; color: var(--k-red); font-size: 17px; font-weight: 500; min-width: 90px; text-align: left; }
.foh-top .who { font-weight: 700; font-size: 17px; }
.foh-top .clock { min-width: 90px; text-align: right; }
.botnav { position: fixed; left: 0; right: 0; bottom: 0; height: 60px; background: var(--k-bg); border-top: 1px solid var(--k-line); display: flex; justify-content: center; gap: 4px; z-index: 6; padding-bottom: env(safe-area-inset-bottom, 0px); }
.botnav button, .botnav a { flex: 0 1 150px; background: none; border: 0; color: var(--k-muted); font-weight: 600; font-size: 14px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; text-decoration: none; }
.botnav span { font-size: 18px; line-height: 1; }
.botnav .on { color: var(--k-link); }
.botnav button:disabled { opacity: .35; }
body.foh #app { height: calc(100vh - 116px); overflow: hidden; }

/* dark popups and controls on front of house */
.foh .modal { background: var(--k-panel); color: var(--k-ink); }
.foh .modal .muted, .foh .muted { color: var(--k-muted); }
.foh .modal-x { color: var(--k-muted); }
.foh .btn { background: var(--k-panel2); border-color: var(--k-line); color: var(--k-ink); }
.foh .btn.on, .foh .choice-grid .btn.on, .foh .btn.primary { background: var(--k-blue); border-color: var(--k-blue); color: #fff; }
.foh .btn.green { background: var(--k-green); border-color: var(--k-green); }
.foh .btn.red { background: #c63c3c; border-color: #c63c3c; }
.foh .btn.amber { background: #d9890a; border-color: #d9890a; }
.foh .input, .foh textarea.input { background: var(--k-bg); color: var(--k-ink); border-color: var(--k-line); }
.foh label.field { color: var(--k-muted); }
.foh .key { background: var(--k-panel2); border-color: var(--k-line); color: var(--k-ink); }
.foh .pin-dots span { border-color: var(--k-ink); }
.foh .pin-dots span.on { background: var(--k-ink); }
.foh .section-title { color: var(--k-muted); }

/* floor plan */
.foh .floor-wrap { height: 100%; }
.foh .floor svg { background: #232839; border-color: var(--k-line); }
.foh .area { fill: #2c3246; stroke: #454c66; }
.foh .wall { stroke: #6b7390; }
.foh .fixture-label { fill: #8d95ad; }
.foh .seat { fill: #4a5169; }
.foh .tbl.free .top { fill: #343a4f; stroke: #59607a; }
.foh .tbl.free .num { fill: #fff; }
.foh .tbl.free .sub { fill: var(--k-muted); }
.foh .card { background: var(--k-panel); border-color: var(--k-line); }
.foh .ta-item { background: var(--k-panel2); }
.foh .ta-item.red { background: #4a2630; }

/* register */
.reg { display: flex; height: 100%; gap: 6px; padding: 6px; background: var(--k-bg); }
.tk { width: 37%; max-width: 440px; min-width: 300px; display: flex; flex-direction: column; min-height: 0; gap: 6px; }
.tk > :not(.kp) { background: var(--k-panel); }
.tk-head { display: flex; justify-content: space-between; align-items: center; padding: 12px 14px 6px; border-radius: 6px 6px 0 0; }
.tk-name { font-size: 19px; }
.link { background: none; border: 0; color: var(--k-link); font-size: 16px; font-weight: 500; padding: 6px 0; }
.link.red { color: var(--k-red); }
.tk-chips { display: flex; gap: 6px; flex-wrap: wrap; padding: 0 14px 10px; margin-top: -6px; border-bottom: 1px solid var(--k-line); }
.chip { background: var(--k-panel2); border: 0; color: var(--k-ink); border-radius: 6px; padding: 7px 10px; font-weight: 600; font-size: 13px; }
.chip.amber { background: #6b4a10; color: #ffd27a; }
.chip.red { background: #6b2020; color: #ffb3b3; }
.tk-note { color: #ffd27a; font-weight: 700; padding: 6px 14px; font-size: 14px; margin-top: -6px; }
.tk-body { flex: 1; overflow-y: auto; min-height: 0; margin-top: -6px; }
.tk-course-head { display: flex; justify-content: space-between; align-items: center; padding: 6px 14px; background: #262b3c; font-weight: 700; font-size: 12px; text-transform: uppercase; letter-spacing: .6px; color: var(--k-muted); min-height: 38px; }
.tk-course.cur .tk-course-head { background: var(--k-blue); color: #fff; }
.tk-course.cur .cstate { color: #dfe6ff; }
.cstate { font-size: 12px; font-weight: 600; text-transform: none; letter-spacing: 0; }
.cstate.fired { color: #ffc861; }
.fire { background: #e8920c; color: #fff; border: 0; border-radius: 6px; padding: 5px 16px; font-weight: 800; }
.tk-line { display: flex; gap: 8px; padding: 10px 14px; border-bottom: 1px solid var(--k-line); align-items: flex-start; cursor: pointer; font-size: 15px; }
.tk-line:active { background: #3a4058; }
.tk-line .qty { width: 16px; font-variant-numeric: tabular-nums; }
.tk-line .nm { flex: 1; min-width: 0; }
.tk-line .edit { color: var(--k-muted); font-size: 13px; }
.tk-line .mods { color: var(--k-muted); font-size: 14px; margin-top: 3px; }
.tk-line .note { color: #ffd27a; font-size: 14px; font-weight: 600; margin-top: 3px; }
.tk-line .allergy { display: inline-block; background: #d63a3a; color: #fff; font-size: 12px; font-weight: 800; border-radius: 4px; padding: 1px 6px; margin-top: 4px; }
.tk-line .st { width: 18px; text-align: center; font-size: 13px; }
.tk-line .pr { font-variant-numeric: tabular-nums; }
.tk-line.unsent .qty { color: var(--k-link); font-weight: 800; }
.tk-line.unsent { background: #2f3650; }
.tk-line.voided { opacity: .4; text-decoration: line-through; }
.tk-empty { padding: 12px 14px; color: var(--k-muted); font-size: 14px; }
.tk-add-course { display: block; width: calc(100% - 28px); margin: 10px 14px; min-height: 42px; border: 1px dashed #59607a; background: none; color: var(--k-link); border-radius: 6px; font-weight: 600; }
.tk-sum { padding: 8px 14px; border-top: 1px solid var(--k-line); color: var(--k-muted); font-size: 14px; border-radius: 0 0 6px 6px; margin-top: -6px; }
.tk-sum > div { display: flex; justify-content: space-between; font-variant-numeric: tabular-nums; }
.tk-sum .t { color: var(--k-ink); font-size: 16px; font-weight: 700; margin-top: 2px; }
.kp { background: var(--k-panel); border-radius: 6px; padding: 6px; }
.kp-hint { color: var(--k-muted); font-size: 13px; text-align: right; padding: 2px 6px 6px; }
.kp-grid { display: grid; grid-template-columns: 1fr 1fr 1fr 1.25fr; gap: 3px; }
.kp-grid button { border: 0; min-height: 50px; font-size: 22px; color: var(--k-ink); }
.kp-grid .k { background: #3a4054; }
.kp-grid .k:active { background: #4a5170; }
.kp-grid .k.c { color: var(--k-red); font-weight: 700; }
.kp-grid .side { font-size: 15px; font-weight: 600; border-radius: 4px; }
.kp-grid .side.text { background: #2f3550; color: var(--k-link); }
.kp-grid .side.blue { background: #4a6cf7; color: #fff; }
.kp-grid .side.green { background: var(--k-green); color: #fff; }
.kp-grid .side:disabled { opacity: .4; }
.catcol { width: 190px; flex: 0 0 190px; overflow-y: auto; display: flex; flex-direction: column; background: var(--k-blue); border-radius: 4px; }
.catbtn { flex: 0 0 auto; min-height: 66px; border: 0; border-bottom: 1px solid var(--k-blue-line); background: var(--k-blue); color: #fff; font-size: 16px; font-weight: 500; padding: 0 8px; }
.catbtn.on { background: #1734c4; box-shadow: inset 4px 0 0 #fff; font-weight: 700; }
.itemgrid { flex: 1; min-width: 0; display: flex; flex-direction: column; background: var(--k-black); border-radius: 4px; overflow: hidden; }
.itemgrid-head { text-align: center; padding: 14px 8px; color: #fff; position: relative; }
.itemgrid-head b { font-size: 17px; }
.itemgrid-head span { position: absolute; right: 12px; top: 16px; color: var(--k-muted); font-size: 12px; font-weight: 600; }
.itemgrid-tiles { flex: 1; overflow-y: auto; display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); grid-auto-rows: 120px; gap: 6px; padding: 0 6px 6px; align-content: start; }
.itile { border: 0; border-bottom: 6px solid var(--k-tile-bar); background: var(--k-tile); color: #fff; border-radius: 3px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; font-size: 17px; font-weight: 500; text-align: center; padding: 8px; position: relative; }
.itile:active { background: #4b526c; }
.itile .p { color: var(--k-muted); font-size: 13px; }
.itile.out { opacity: .35; }
.itile.out::after { content: 'SOLD OUT'; position: absolute; top: 6px; right: 6px; font-size: 10px; background: #d63a3a; padding: 2px 5px; border-radius: 3px; font-weight: 800; }
.paybar { border: 0; background: var(--k-green); color: #fff; font-size: 18px; font-weight: 600; min-height: 64px; margin: 0 6px 6px; border-radius: 3px; }
.paybar:disabled { opacity: .4; }

/* split checks: columns side by side, swipe sideways for more */
/* the split check screen (not the tick-box groups, which are .checks) */
.checks-screen { height: 100%; display: flex; flex-direction: column; background: var(--k-black); }
.checks-bar { display: flex; align-items: center; gap: 16px; padding: 8px 14px; border-bottom: 1px solid var(--k-line); background: var(--k-bg); flex-wrap: wrap; }
.checks-bar b { font-size: 17px; }
.checks-bar .muted { font-size: 13px; margin-left: auto; }
.checks-main { flex: 1; display: flex; min-height: 0; }
.checks-cols { flex: 1; display: flex; gap: 6px; overflow-x: auto; overflow-y: hidden; padding: 6px; scroll-snap-type: x proximity; min-width: 0; }
.chk { flex: 0 0 300px; background: var(--k-panel); border-radius: 4px; display: flex; flex-direction: column; min-height: 0; scroll-snap-align: start; }
.chk.paid { opacity: .7; }
.chk-head { display: flex; justify-content: space-between; align-items: center; padding: 12px 14px; border-bottom: 1px solid var(--k-line); }
.chk-head b { display: block; font-size: 17px; }
.chk-head span { color: var(--k-muted); font-size: 12px; }
.chk-body { flex: 1; overflow-y: auto; min-height: 0; }
.chk-line { display: flex; align-items: center; gap: 8px; padding: 10px 14px; border-bottom: 1px solid var(--k-line); cursor: pointer; }
.chk-line .nm { flex: 1; min-width: 0; font-size: 15px; }
.chk-line .mods { color: var(--k-muted); font-size: 13px; }
.chk-line .link { font-size: 14px; border-left: 1px solid var(--k-line); padding-left: 12px; }
.chk-line.on { background: var(--k-blue); }
.chk-line.on .mods { color: #dfe6ff; }
.chk-line.on .link { color: #fff; }
.drop { margin: 8px; min-height: 48px; border: 2px dashed var(--k-link); background: #24305a; color: #fff; border-radius: 6px; font-weight: 700; }
.chk-foot { padding-top: 6px; }
.chk-foot .paybar { width: calc(100% - 12px); }
.paidtag { text-align: center; color: #8fe3ad; font-weight: 700; padding: 18px 8px 22px; }
.checks-rail { width: 76px; flex: 0 0 76px; display: flex; flex-direction: column; gap: 6px; padding: 6px 6px 6px 0; }
.rail { background: var(--k-panel2); border: 0; color: var(--k-ink); border-radius: 4px; min-height: 76px; font-size: 24px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; }
.rail small { font-size: 11px; color: var(--k-muted); font-weight: 600; text-align: center; line-height: 1.15; }
.rail:disabled { opacity: .35; }
.pay-amount { font-size: 44px; font-weight: 800; text-align: center; margin: 6px 0; font-variant-numeric: tabular-nums; }

/* open orders */
.orders { height: 100%; overflow-y: auto; padding: 12px; }
.orders-bar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.orders-list { display: flex; flex-direction: column; gap: 6px; }
.orow { display: grid; grid-template-columns: 10px 1.4fr 1fr 1fr auto; gap: 14px; align-items: center; background: var(--k-panel); border: 0; color: var(--k-ink); border-radius: 6px; padding: 14px; text-align: left; font-size: 15px; }
.orow i { width: 10px; height: 32px; border-radius: 3px; }
.orow span { color: var(--k-muted); }
.orow .amt { color: var(--k-ink); font-weight: 700; font-variant-numeric: tabular-nums; }
.foh .empty-state { color: var(--k-muted); }

@media (max-width: 1000px) {
  .catcol { width: 140px; flex-basis: 140px; }
  .catbtn { font-size: 14px; min-height: 56px; }
  .itemgrid-tiles { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); grid-auto-rows: 96px; }
}
@media (max-width: 760px) {
  body.foh #app { height: auto; min-height: calc(100vh - 116px); overflow: visible; padding-bottom: 70px; }
  .reg { flex-direction: column; height: auto; }
  .tk { width: auto; max-width: none; min-width: 0; }
  .tk-body { max-height: 38vh; }
  .catcol { width: auto; flex: none; flex-direction: row; overflow-x: auto; }
  .catbtn { min-height: 48px; white-space: nowrap; border-bottom: 0; border-right: 1px solid var(--k-blue-line); padding: 0 14px; }
  .itemgrid-tiles { grid-template-columns: repeat(2, 1fr); overflow: visible; }
  .checks-screen { height: calc(100vh - 116px); }
  .chk { flex-basis: 82vw; }
  .orow { grid-template-columns: 10px 1fr auto; }
  .orow span:not(.amt) { display: none; }
}
.kp-grid .side { display: flex; align-items: center; justify-content: center; text-align: center; line-height: 1.2; }

/* paper slip for receipts shown on screen */
.slip { background: #fffef8; color: #111; font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: 12.5px; line-height: 1.45; padding: 16px 12px; width: max-content; max-width: 100%; margin: 0 auto; box-shadow: 0 2px 10px rgba(0,0,0,.2); border-radius: 2px; overflow-x: auto; }
.slip .sl { white-space: pre; }
.slip .c { text-align: center; }
.slip .b { font-weight: 800; }
.slip .big { font-size: 17px; font-weight: 800; }
.unfire { background: none; border: 1px solid currentColor; color: #ffc861; border-radius: 6px; padding: 3px 10px; font-size: 12px; font-weight: 700; text-transform: none; letter-spacing: 0; }
.tk-course.cur .unfire { color: #fff; }
.tk-line .disc { color: #8fe3ad; font-size: 13px; margin-top: 3px; }
.tk-line .pr s { color: var(--k-muted); font-size: 12px; }
.timeline { max-height: 60vh; overflow-y: auto; border: 1px solid var(--line); border-radius: 10px; }
.foh .timeline { border-color: var(--k-line); }
.tl { display: grid; grid-template-columns: 84px 1fr auto; gap: 12px; padding: 9px 12px; border-bottom: 1px solid var(--line); font-size: 14px; align-items: baseline; }
.foh .tl { border-color: var(--k-line); }
.tl b { font-variant-numeric: tabular-nums; }
.tl i { color: var(--muted); font-style: normal; font-size: 12px; }
.foh .tl i { color: var(--k-muted); }
.foh .modal .checks label { border-color: var(--k-line); }
.foh select.input { background: var(--k-bg); color: var(--k-ink); }
.foh .slip { color: #111; }

.tk-sum .promo { color: #8fe3ad; }
.tk-sum .promo small { color: var(--k-muted); font-size: 12px; }
.offer { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--k-line); }

/* ===== back office ===== */
.admin-nav { width: 230px; overflow-y: auto; }
.admin-nav .navsearch { margin-bottom: 6px; min-height: 40px; }
.nav-group { font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .6px; color: var(--muted); padding: 12px 12px 2px; }
.admin-nav button { padding: 9px 12px; }
.page { max-width: 1200px; display: flex; flex-direction: column; gap: 14px; }
.page > h2 { margin: 0; }
.page h3 { margin: 0 0 10px; font-size: 16px; }
.page .row.end { margin-top: 0; }
.page .grid2, .page .grid3 { align-items: start; }
.periods { gap: 6px; }
.periods .input { width: auto; min-height: 34px; padding: 4px 8px; }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; }
.tile-stat { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; display: flex; flex-direction: column; gap: 2px; }
.tile-stat span { font-size: 12px; color: var(--muted); font-weight: 700; text-transform: uppercase; letter-spacing: .4px; }
.tile-stat b { font-size: 24px; font-variant-numeric: tabular-nums; }
.tile-stat small { color: var(--muted); }
.tbl-wrap { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; font-size: 14px; background: #fff; }
table.data th { text-align: left; font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .4px; padding: 8px 10px; border-bottom: 2px solid var(--line); white-space: nowrap; }
table.data td { padding: 8px 10px; border-bottom: 1px solid #eef0f3; vertical-align: middle; font-variant-numeric: tabular-nums; }
table.data tr:hover td { background: #f8f9fb; }
table.data .input { min-height: 36px; padding: 6px 8px; }
.bars { display: flex; flex-direction: column; gap: 6px; }
.bar { display: grid; grid-template-columns: minmax(90px, 1.2fr) 2fr auto; gap: 10px; align-items: center; font-size: 14px; }
.bar > div { height: 12px; background: #eef1f5; border-radius: 6px; overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--blue); border-radius: 6px; }
.bar b { font-variant-numeric: tabular-nums; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0; }
.picker { border: 1px solid var(--line); border-radius: 10px; padding: 10px; display: flex; flex-direction: column; gap: 4px; }
.warn { background: #fff1d6; color: #7a5200; padding: 10px 14px; border-radius: 10px; font-weight: 600; margin: 0; }
ol.top { margin: 0; padding-left: 22px; columns: 2; }
ol.top li { padding: 3px 0; break-inside: avoid; }
ol.top li span { margin-right: 8px; }
.admin .split > .form { min-width: 0; }
@media (max-width: 900px) { .admin-nav { width: 180px; } ol.top { columns: 1; } }
.ipbox { background: #1d2733; color: #fff; border-radius: var(--radius); padding: 16px 20px; display: flex; flex-direction: column; gap: 4px; }
.ipbox span { font-size: 12px; text-transform: uppercase; letter-spacing: .6px; opacity: .7; font-weight: 700; }
.ipbox b { font-size: 34px; font-variant-numeric: tabular-nums; letter-spacing: .5px; }
.ipbox small { opacity: .7; }
table.data code { font-size: 13px; background: #f3f5f8; padding: 3px 6px; border-radius: 6px; user-select: all; -webkit-user-select: all; }

.bottle-steps { display: flex; flex-direction: column; gap: 4px; margin: 12px 0; font-size: 14px; color: var(--muted); }
.bottle-steps .on { color: var(--ink); font-weight: 800; }
.bottle-steps .done { text-decoration: line-through; }
.bottle-stage { background: #111; border-radius: 10px; overflow: hidden; }
.bottle-stage:empty { display: none; }
.bottle-result { margin-top: 12px; font-size: 16px; }
.bottle-result b { font-size: 20px; }
.slip-logo { width: 150px; height: auto; display: inline-block; margin-bottom: 4px; }

.stock-list { display: flex; flex-direction: column; max-height: 60vh; overflow-y: auto; border-top: 1px solid var(--line); }
.stock-row { display: grid; grid-template-columns: 1fr 130px 56px; gap: 10px; align-items: center; padding: 8px 2px; border-bottom: 1px solid var(--line); }

/* sold-out choices, training & standby banners */
.btn.soldout { text-decoration: line-through; }
.mode-banner { position: fixed; top: 0; left: 0; right: 0; z-index: 900; padding: 6px 12px; text-align: center; font-weight: 800; font-size: 14px; cursor: pointer; }
.mode-banner.training { background: repeating-linear-gradient(45deg, #f2b705, #f2b705 14px, #e0a800 14px, #e0a800 28px); color: #1d1d1d; }
.mode-banner.standby { background: #7a3cc9; color: #fff; cursor: default; }
body.has-banner { padding-top: 30px; }
.standby-link { color: #fff; text-decoration: underline; font-weight: 800; margin-left: 8px; }
.wait-bars { display: grid; grid-template-columns: 70px 1fr 60px; gap: 4px 8px; align-items: center; font-size: 13px; }
.wait-bars .bar { height: 14px; border-radius: 4px; background: #1773e8; }
.wait-bars .bar.amber { background: #e7a100; } .wait-bars .bar.red { background: #e23b3b; }
.label-card { border: 1px dashed #999; border-radius: 6px; padding: 8px; width: 220px; font-size: 12px; text-align: center; background: #fff; color: #111; }
.label-card b { display: block; font-size: 15px; }

/* kitchen & bar: dark theme and larger text (per screen) */
body.kds-dark { --bg: #0f141a; --panel: #1a222c; --ink: #eef2f6; --muted: #9aa6b4; --line: #2c3743; background: var(--bg); color: var(--ink); }
body.kds-dark .ticket { background: #1a222c; border-color: #2c3743; }
body.kds-dark .ticket-head { background: #2b3540; }
body.kds-dark .ticket.takeaway .ticket-head { background: #5a3fc0; }
body.kds-dark .ticket-note { background: #4a3a10; color: #ffd772; }
body.kds-dark .kcourse-head { background: #232d38; color: #eef2f6; }
body.kds-dark .kcourse.held .kcourse-head { background: repeating-linear-gradient(45deg, #232d38, #232d38 8px, #2c3743 8px, #2c3743 16px); }
body.kds-dark .kitem { border-top-color: #26303b; }
body.kds-dark .kitem:active { background: #22344d; }
body.kds-dark .kitem .mods { color: #c3ccd6; }
body.kds-dark .kitem .removed { color: #ff7b7b; }
body.kds-dark .kitem .note { background: #5a4a12; color: #ffe08a; }
body.kds-dark .kitem .state { border-color: #4b5866; }
body.kds-dark .kitem.ack .state { border-color: #5aa2ff; color: #5aa2ff; }
body.kds-dark .modal { background: #1a222c; color: #eef2f6; }
body.kds-dark .btn { background: #232d38; border-color: #36424f; color: #eef2f6; }
body.kds-dark .btn.red { background: var(--red); border-color: var(--red); color: #fff; }
body.kds-dark .btn.primary { background: var(--blue); border-color: var(--blue); color: #fff; }
body.kds-dark .input { background: #10161d; border-color: #36424f; color: #eef2f6; }
body.kds-dark .empty-state, body.kds-dark .muted { color: #9aa6b4; }
body.kds-dark .card { background: #1a222c; border-color: #2c3743; }
body.kds-large .kitem .nm { font-size: 24px; }
body.kds-large .kitem .mods, body.kds-large .kitem .removed, body.kds-large .kitem .note, body.kds-large .kitem .allergy { font-size: 19px; }
body.kds-large .ticket-head .big { font-size: 28px; }
body.kds-large .ticket-head .meta, body.kds-large .kcourse-head { font-size: 17px; }
body.kds-large .kds { columns: 380px; }
.kitem .same { display: table; margin-top: 4px; font-size: 13px; font-weight: 600; color: #0d5bb5; background: #e7f0fd; border-radius: 999px; padding: 2px 9px; }
.kitem .same b { font-weight: 800; }
.kitem .same i { color: #9a6300; font-style: normal; }
body.kds-dark .kitem .same { background: #16304f; color: #9cc8ff; }
body.kds-dark .kitem .same i { color: #ffd772; }
body.kds-large .kitem .same { font-size: 16px; }

/* app mode, table notes, allergen filter, same again, running late, messages */
ol.steps { padding-left: 20px; line-height: 1.6; font-size: 17px; }
.tbl text.flags { font-size: 18px; text-anchor: middle; }
.chip.flagged { background: #3a2a55; color: #f3e8ff; }
.tk-note.cust { background: #2b2140; color: #e8d9ff; }
.ticket-flags { background: #efe6ff; color: #4b2a99; padding: 6px 12px; font-weight: 800; font-size: 15px; }
body.kds-dark .ticket-flags { background: #2b2140; color: #e0ccff; }
.itemgrid-head .freefrom { border: 0; border-radius: 999px; padding: 6px 12px; font-weight: 700; font-size: 13px; background: rgba(255,255,255,.1); color: inherit; }
.itemgrid-head .freefrom.on { background: #e23b3b; color: #fff; }
.itile.contains { opacity: .32; }
.itile .al { display: block; font-size: 11px; font-weight: 800; color: #ffb3b3; margin-top: 4px; }
.itile .al.unsure { color: #ffd772; }
.again { display: flex; flex-direction: column; gap: 6px; margin: 10px 0; max-height: 50vh; overflow: auto; }
.again-row { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: 10px; background: rgba(127,127,127,.12); }
.again-row.off { opacity: .45; }
.again-row .tick { width: 40px; height: 40px; border-radius: 10px; border: 2px solid #22a35a; background: #22a35a; color: #fff; font-size: 22px; font-weight: 900; flex: 0 0 40px; }
.again-row.off .tick { background: transparent; }
.again-name { flex: 1; font-weight: 700; font-size: 17px; cursor: pointer; }
.again-name small { display: block; font-weight: 500; opacity: .75; font-size: 13px; }
.again-row .qty { display: flex; align-items: center; gap: 8px; }
.again-row .qty .btn { min-width: 44px; padding: 6px; font-size: 20px; }
.again-row .qty b { min-width: 22px; text-align: center; font-size: 18px; }
.late-stack { position: fixed; right: 14px; bottom: 76px; z-index: 950; display: flex; flex-direction: column; gap: 8px; max-width: 340px; }
.late-card { background: #e23b3b; color: #fff; border-radius: 14px; padding: 12px 14px; box-shadow: 0 10px 30px rgba(0,0,0,.35); font-size: 15px; animation: pop .25s ease-out; }
.late-card b { display: block; font-size: 17px; margin-bottom: 2px; }
.late-card .row { margin-top: 8px; gap: 8px; }
.late-card .btn { background: rgba(255,255,255,.18); border: 0; color: #fff; }
.late-card .btn.primary { background: #fff; color: #b51f1f; }
@keyframes pop { from { transform: translateY(12px); opacity: 0; } to { transform: none; opacity: 1; } }
.staff-msg p { font-size: 22px; font-weight: 700; line-height: 1.35; margin: 12px 0 18px; white-space: pre-wrap; }
.staff-msg p.important { color: #e23b3b; }
.itile.section { background: color-mix(in srgb, var(--c) 55%, #1d2733); color: #fff; }
.itile.section .n { font-size: 20px; font-weight: 800; }
.itile.back { background: transparent; border: 2px dashed rgba(255,255,255,.25); }

/* front of house typing boxes: dark text on white so what's typed always shows (iPhone/iPad included) */
.foh .input, .foh textarea.input, .foh select.input { background: #fff; color: #111; -webkit-text-fill-color: #111; caret-color: #1773e8; border-color: #c9cfd6; font-size: 18px; font-weight: 600; opacity: 1; }
.foh .input::placeholder, .foh textarea.input::placeholder { color: #8a93a3; -webkit-text-fill-color: #8a93a3; font-weight: 400; }
.tbl.dirty .top { fill: #4a4f63 !important; stroke: #9aa3b8 !important; stroke-dasharray: 6 4; stroke-width: 2px; }
.tbl.dirty .sub { fill: #ffd772; font-weight: 700; }
.topbar .tb { white-space: nowrap; }
.kds-tabs { overflow-x: auto; flex-wrap: nowrap; scrollbar-width: none; min-width: 0; flex: 0 1 auto; }
.kds-tabs::-webkit-scrollbar { display: none; }
.pin-keys.small .key { height: 52px; font-size: 22px; }
.till-version { position: fixed; left: 6px; bottom: 2px; font-size: 10px; opacity: .45; z-index: 1; pointer-events: none; color: #888; }
.foh .till-version { bottom: 62px; }
.printer-warn { position: fixed; left: 50%; transform: translateX(-50%); top: 62px; z-index: 940; background: #e23b3b; color: #fff; padding: 8px 14px; border-radius: 12px; font-size: 14px; box-shadow: 0 8px 24px rgba(0,0,0,.3); max-width: min(720px, 94vw); text-align: center; }
.printer-warn.low { background: #e7a100; color: #1d1d1d; }
/* menu tabs inside Starters / Mains / Desserts / Drinks */
.subcats { display: flex; gap: 6px; overflow-x: auto; padding: 0 10px 8px; scrollbar-width: none; flex: 0 0 auto; }
.subcats::-webkit-scrollbar { display: none; }
.subcat { flex: 0 0 auto; border: 0; border-radius: 999px; padding: 9px 14px; font-weight: 700; font-size: 14px; background: rgba(255,255,255,.08); color: inherit; white-space: nowrap; border-bottom: 3px solid transparent; }
.subcat.on { background: var(--c); color: #fff; }
.choice-grid.compact { grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 6px; }
.choice-grid.compact .btn { min-height: 40px; padding: 6px 8px; font-size: 14px; }
.openitem { flex: 0 0 auto; margin: 0 10px 8px; border: 2px dashed rgba(255,255,255,.28); background: transparent; color: inherit; border-radius: 10px; padding: 12px; font-weight: 700; font-size: 15px; }
.foh .printer-warn { top: auto; bottom: 72px; }
.printer-warn { z-index: 45; pointer-events: none; }
.late-stack { z-index: 48; }
.foh .printer-warn { top: auto; bottom: 66px; left: 8px; right: auto; transform: none; max-width: 300px; font-size: 12px; padding: 6px 10px; text-align: left; opacity: .95; }
.slip-qr { display: inline-block; width: 90px; height: 90px; line-height: 90px; border: 2px dashed #777; margin: 4px auto; font-size: 12px; }
.paidtag { background: #22a35a; color: #fff; border-radius: 6px; padding: 1px 6px; font-weight: 800; font-size: 11px; }
.topay { color: #ffb84d; font-weight: 700; }
.chip.paidchip { background: #22a35a; color: #fff; font-weight: 800; }

/* PIN pad: switch between 4-digit staff PINs and 6-digit back office PINs */
.key.key-len { font-size: 13px; line-height: 1.15; font-weight: 600; color: var(--blue); }
.key.key-len small { font-size: 11px; font-weight: 500; color: var(--muted); }
.foh .key.key-len { color: var(--k-ink); }

/* resOS bookings on the floor plan */
.tbl.booked .top { stroke: var(--blue) !important; stroke-width: 3px; stroke-dasharray: 2 5; }
.tbl.booked .sub { fill: #7fb2ff; font-weight: 800; }
.tbl.booked.due .top { stroke: var(--amber) !important; stroke-dasharray: none; stroke-width: 4px; }
.tbl.booked.due .sub { fill: #ffc65a; }
.tbl text.nextbk { font-size: 13px; font-weight: 800; fill: #ffc65a; }
.tbl text.bkname { font-size: 14px; font-weight: 800; fill: #7fb2ff; }
.tbl.booked.due text.bkname { fill: #ffc65a; }

/* Course taken back: stays on the kitchen / bar screen until Got it */
.unfire-alert { text-align: center; border: 8px solid var(--red); border-radius: 14px; padding: 18px 16px; margin: -6px; }
.unfire-alert .unfire-title { font-size: 46px; font-weight: 900; color: var(--red); letter-spacing: 2px; }
.unfire-alert .unfire-what { font-size: 26px; font-weight: 800; margin: 6px 0 4px; }
.unfire-alert p { font-size: 17px; margin: 8px 0; }
.unfire-alert ul { list-style: none; padding: 0; margin: 10px 0; font-size: 22px; font-weight: 700; }
.unfire-alert li { padding: 4px 0; border-top: 1px solid var(--line); }
.unfire-alert .unfire-ok { background: var(--red); border-color: var(--red); color: #fff; width: 100%; margin-top: 14px; font-size: 24px; padding: 16px; }

/* Cash up (bar screen and back office) */
.modal:has(.cashup) { width: min(1180px, 100%); }
.cashup h2 { margin: 0 0 2px; }
.cashup h3 { margin: 14px 0 6px; font-size: 16px; }
.cu-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; margin-top: 8px; }
@media (max-width: 820px) { .cu-grid { grid-template-columns: 1fr; } }
.cu-line { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 6px 0; border-bottom: 1px solid var(--line); font-size: 16px; }
.cu-line .cu-in { width: 130px; }
.cu-line.cu-sum { font-size: 18px; border-bottom: 2px solid var(--ink); }
.cu-in { font-size: 18px; text-align: right; padding: 8px 10px; }
.cu-count { display: grid; gap: 4px; }
.cu-row { display: grid; grid-template-columns: 52px 18px 110px 1fr; align-items: center; gap: 8px; }
.cu-row .cu-den { font-size: 18px; }
.cu-row .cu-val { text-align: right; font-weight: 700; font-size: 16px; }
.cu-row .cu-odd { grid-column: 1 / -1; color: var(--red); font-size: 12px; text-align: right; }
.cu-row .cu-odd:empty { display: none; }
.cu-totals { margin: 10px 0; display: grid; gap: 4px; }
.cu-tot { display: flex; justify-content: space-between; padding: 6px 10px; border-radius: 8px; background: rgba(127,127,127,.08); font-size: 16px; }
.cu-tot.cu-big { font-size: 22px; padding: 10px 12px; }
.cu-tot.ok { background: rgba(34,163,90,.15); color: var(--green); }
.cu-tot.bad { background: rgba(226,59,59,.13); color: var(--red); }
body.kds-dark .cu-line { border-color: #2c3642; }

/* tick boxes on the dark iPad screens: compact rows, no black slabs */
.foh .modal .checks label { background: transparent; padding: 10px 12px; }
.modal .checks { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
div.field { margin-bottom: 12px; }
div.field > label { display: block; font-size: 13px; color: var(--muted); font-weight: 600; margin-bottom: 4px; }
.foh div.field > label { color: var(--k-muted); }
.kitem .added { font-size: 15px; color: var(--blue); font-weight: 800; }
body.kds-dark .kitem .added { color: #7fb2ff; }
.btn.topping { justify-content: flex-start; text-align: left; }
.btn.topping .tick { font-size: 22px; }
.btn.topping.struck { opacity: .7; text-decoration: line-through; }

/* served course: stays at the bottom of the ticket, greyed, while a later course is still to be fired */
.kcourse.served { opacity: .45; }
.kcourse.served .kcourse-head { background: transparent; color: var(--muted); }
.kcourse.served .kitem { cursor: default; }
/* food runner (expo): ready dishes stand out */
.kds.expo .kitem.ready { background: #1f9d55; color: #fff; }
.kds.expo .kitem.ready .nm::after { content: '  READY - TAP WHEN TAKEN'; font-size: 13px; font-weight: 800; opacity: .9; }
.kds.expo .kitem:not(.ready):not(.collected) { opacity: .6; }

/* What needs doing now */
.command .alert-row { display: flex; align-items: center; gap: 10px; padding: 8px 6px; margin-top: 6px; border-radius: 10px; cursor: pointer; border-left: 4px solid var(--k-line, #59607a); background: rgba(255,255,255,.04); }
.command .alert-row.p100, .command .alert-row.p90 { border-left-color: #e23b3b; }
.command .alert-row.p80, .command .alert-row.p75, .command .alert-row.p70 { border-left-color: #f2a20c; }
.command .alert-row.p65, .command .alert-row.p60, .command .alert-row.p55 { border-left-color: #4d8dff; }
.command .alert-icon { font-size: 22px; }
.command .alert-text { font-weight: 800; font-size: 15px; }
.command .alert-why { font-size: 12px; opacity: .75; }
.command .alert-ok { flex: none; min-width: 40px; }
/* the runner doesn't hold tickets or change the kitchen's ticks */
.kds.expo .ticket-head .btn { display: none; }
.kds.expo .kitem > :not(.nm) { display: none; }

/* ================= phones (Lightspeed-style) ================= */
@media (max-width: 700px) {
  html, body.foh { max-width: 100%; overflow-x: hidden; }
  body.foh .foh-top { flex-wrap: wrap; gap: 4px 10px; padding: 6px 10px; font-size: 14px; }
  body.foh .foh-top > * { white-space: nowrap; }
  body.foh .modal { width: calc(100vw - 16px); max-width: calc(100vw - 16px); padding: 16px; }
  body.foh .choice-grid { grid-template-columns: repeat(2, 1fr); }
  .floor-wrap { flex-direction: column; height: auto; }
  .floor-wrap .side { width: auto; display: flex; flex-direction: column; gap: 10px; }
  .floor-wrap .side > .btn.big { min-height: 56px; height: auto; }
  .ph-floor-switch { display: flex; gap: 8px; padding: 8px 2px; }
  .ph-tables { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
  .ph-table { min-height: 84px; border-radius: 14px; border: 2px solid rgba(255,255,255,.12); background: var(--c, #343a4f); color: #fff; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; padding: 6px; }
  .ph-table b { font-size: 26px; line-height: 1; }
  .ph-table small { font-size: 12px; opacity: .9; text-align: center; }
  .ph-table.ring-amber { box-shadow: 0 0 0 3px #f2a20c; }
  .ph-table.ring-red { box-shadow: 0 0 0 3px #e23b3b; }
  /* order screen */
  body.ph-order-view #nav { display: none; }
  body.ph-order-view #app { padding-bottom: 90px; }
  .ph-head { position: sticky; top: 0; z-index: 5; display: flex; justify-content: space-between; align-items: center; padding: 10px 4px; background: var(--k-bg, #1b1f2c); }
  .ph-head b { font-size: 19px; }
  .ph-courses { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 4px 0 10px; color: var(--k-muted); font-size: 13px; }
  .chip.on { background: var(--blue); color: #fff; border-color: var(--blue); }
  .ph-tiles { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .ph-tile { min-height: 92px; border-radius: 16px; border: 0; background: #2346e0; color: #fff; font-size: 20px; font-weight: 800; }
  .ph-crumb { display: flex; gap: 12px; align-items: center; margin: 2px 0 8px; font-size: 18px; }
  .ph-subcats { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
  .ph-list { display: flex; flex-direction: column; gap: 6px; }
  .ph-item { display: flex; align-items: center; gap: 10px; min-height: 58px; padding: 10px 14px; border-radius: 12px; border: 0; border-left: 5px solid var(--c, #3d6bff); background: #2e3446; color: #fff; text-align: left; font-size: 17px; }
  .ph-item .n { flex: 1; font-weight: 700; }
  .ph-item .n small { display: block; font-weight: 600; font-size: 12px; color: #ffb4b4; }
  .ph-item .p { font-weight: 700; opacity: .85; }
  .ph-item.out { opacity: .45; }
  .ph-item.section { background: #263052; }
  .ph-count { background: #22a35a; color: #fff; border-radius: 999px; padding: 2px 9px; font-weight: 800; font-size: 14px; }
  .ph-order .tk-body { max-height: none; }
  .ph-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 12px; }
  .ph-actions .btn.green { background: #22a35a; border-color: #22a35a; color: #fff; }
  .ph-bar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; display: grid; grid-template-columns: 1fr 1.2fr 1.6fr; gap: 8px; padding: 8px 10px calc(8px + env(safe-area-inset-bottom, 0px)); background: #141824; border-top: 1px solid rgba(255,255,255,.1); }
  .ph-tab { border: 0; border-radius: 12px; background: #2a3042; color: #cfd6e6; font-size: 18px; font-weight: 800; min-height: 54px; display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1.1; }
  .ph-tab small { font-size: 12px; font-weight: 600; }
  .ph-tab.on { background: #3a4a7a; color: #fff; }
  .ph-go { border: 0; border-radius: 12px; background: #2346e0; color: #fff; font-size: 18px; font-weight: 800; min-height: 54px; }
  .ph-go.pay { background: #22a35a; }
}
@media (max-width: 700px) {
  .ph .freefrom { display: block; width: 100%; min-height: 46px; border-radius: 12px; border: 1px solid rgba(255,255,255,.18); background: #2a3042; color: #e6ebf5; font-size: 16px; font-weight: 700; }
  .ph .freefrom.on { background: #6b2b2b; border-color: #e23b3b; }
  /* pop-ups go at the top on a phone, so they never cover Send */
  .late-stack { top: 8px; bottom: auto; left: 8px; right: 8px; max-width: none; }
  .toasts { top: 8px; left: 8px; right: 8px; max-width: none; }
  .ph-go[disabled] { background: #2a3042; color: #8a93a8; }
}
/* Full screen does nothing on an iPhone */
@media (max-width: 700px) and (hover: none) { body.foh .foh-top [aria-label="Full screen"] { display: none; } }
@media (max-width: 700px) {
  .late-stack { top: 0; left: 0; right: 0; gap: 0; }
  .late-card { border-radius: 0 0 12px 12px; padding: 6px 10px; font-size: 13px; display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 2px 8px; }
  .late-card b { font-size: 14px; margin: 0; grid-column: 1; }
  .late-card > div:not(.row) { grid-column: 1; font-size: 12px; opacity: .9; }
  .late-card .row { grid-column: 2; grid-row: 1 / span 2; gap: 6px; margin: 0; }
  .late-card .btn { min-height: 34px; padding: 4px 10px; font-size: 13px; }
  .late-card:not(:first-child) { display: none; }
}
@media (max-width: 700px) {
  /* Takeaway / Collection doesn't need to be huge on a phone */
  .floor-wrap .side > .btn.primary.big { min-height: 44px; height: auto; padding: 8px 12px; font-size: 16px; flex: none; }
}
@media (max-width: 700px) {
  /* each card on the phone is only as tall as what's in it */
  .floor-wrap .side > * { flex: 0 0 auto; height: auto; min-height: 0; }
  /* no number keypad on a phone: tap a dish twice for two. Keep Fire, Split check, Print bill and Send */
  .kp-hint, .kp-grid .k { display: none; }
  .kp-grid { grid-template-columns: 1fr 1fr; gap: 6px; }
  .kp-grid button.side { min-height: 52px; font-size: 16px; border-radius: 10px; }
}

/* Bookings screen */
.card.tap { cursor: pointer; }
.bk-days { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 6px; }
.bk-days .chip { flex: none; display: flex; flex-direction: column; align-items: center; padding: 6px 12px; line-height: 1.2; }
.bk-days .chip small { opacity: .8; font-size: 12px; }
.bk-summary { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; margin: 10px 0; }
.bk-hour { font-size: 13px; padding: 2px 8px; border-radius: 999px; background: rgba(127,127,127,.18); }
.bk-list { display: flex; flex-direction: column; gap: 6px; }
.bk-row { display: grid; grid-template-columns: 64px 1fr auto; gap: 10px; align-items: center; padding: 10px; border-radius: 10px; background: rgba(127,127,127,.1); }
.bk-row.done { opacity: .5; }
.bk-time { font-size: 20px; font-weight: 800; }
.bk-note { font-size: 13px; opacity: .8; margin-top: 2px; }
.bk-warn { font-size: 12px; color: #f2a20c; margin-top: 2px; }
.bk-actions { display: flex; gap: 6px; align-items: center; }
.bk-actions .btn.amber { background: #f2a20c; border-color: #f2a20c; color: #111; }
.bk-actions .btn.red { background: #e23b3b; border-color: #e23b3b; color: #fff; }
.bk-status { font-size: 13px; opacity: .8; min-width: 54px; text-align: center; }
@media (max-width: 700px) { .bk-row { grid-template-columns: 52px 1fr; } .bk-actions { grid-column: 1 / -1; justify-content: flex-end; } .bk-time { font-size: 17px; } }
/* Bookings for prep (kitchen) */
.kb-top { display: flex; gap: 10px; margin: 10px 0; }
.kb-big { flex: 1; text-align: center; padding: 10px; border-radius: 12px; background: rgba(127,127,127,.12); }
.kb-big b { display: block; font-size: 32px; line-height: 1.1; }
.kb-big span { font-size: 13px; opacity: .8; }
.kb-slots { display: flex; gap: 6px; align-items: flex-end; overflow-x: auto; padding: 6px 0 10px; }
.kb-slot { flex: none; width: 48px; display: flex; flex-direction: column; align-items: center; font-size: 12px; }
.kb-bar { width: 26px; border-radius: 6px 6px 2px 2px; background: #2f7de1; margin-bottom: 3px; }
.kb-allergy { padding: 10px 12px; border-radius: 10px; background: rgba(226,59,59,.14); color: inherit; margin-bottom: 10px; font-size: 16px; }
.kb-list { display: flex; flex-direction: column; gap: 5px; }
.kb-row { display: grid; grid-template-columns: 64px 1fr; gap: 10px; padding: 9px 10px; border-radius: 10px; background: rgba(127,127,127,.1); font-size: 16px; }
.kb-row.big { border-left: 5px solid #f2a20c; }
.kb-time { font-size: 19px; }
.kb-note { font-size: 13px; opacity: .85; margin-top: 2px; }
/* the chosen day / option (everywhere, not just phones) */
.chip.on { background: var(--blue); color: #fff; border-color: var(--blue); }
.bk-row.walkin { background: rgba(77,141,255,.12); }
.bkform .choice-grid { grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); }

.btn.best { box-shadow: 0 0 0 3px #22a35a; }
.front-btns .btn { min-height: 52px; font-size: 16px; }
.promises { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; padding: 6px 12px; background: rgba(242,162,12,.12); }
.promises .chip.on { background: #22a35a; border-color: #22a35a; }

.bk-hits { display: flex; flex-direction: column; gap: 4px; margin: -4px 0 8px; }
.bk-hits .hit { display: grid; grid-template-columns: auto 1fr; gap: 0 10px; text-align: left; padding: 8px 10px; }
.bk-hits .hit small { grid-column: 1 / -1; opacity: .8; }
.bk-linked { font-size: 14px; color: #1f9d55; font-weight: 700; padding: 4px 0; }
.btn.green { background: #22a35a; border-color: #22a35a; color: #fff; }
.bkform .checks { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 6px; }
.bkform .checks label { padding: 8px 10px; font-size: 14px; }
@media (max-width: 700px) {
  .ph-legend { padding: 8px 4px 2px; }
  .ph-legend .legend { gap: 6px 12px; font-size: 13px; }
  .ph-legend .legend i { width: 14px; height: 14px; }
}

.cust-row { display: grid; grid-template-columns: auto 1fr; gap: 0 10px; width: 100%; text-align: left; padding: 8px 12px; margin-bottom: 4px; }
.cust-row small { grid-column: 1 / -1; opacity: .8; }
.visits { display: flex; flex-direction: column; gap: 4px; }
.visit { display: grid; grid-template-columns: 110px 1fr; gap: 0 10px; padding: 6px 10px; border-radius: 8px; background: rgba(127,127,127,.1); font-size: 14px; }
.visit small { grid-column: 2; opacity: .8; }
.bk-name { padding: 0; color: inherit; text-decoration: underline dotted; }
.front-btns .btn { padding-left: 6px; padding-right: 6px; }

/* cloud trial copy: a reminder it isn't the live till yet */
body.trial-copy::after { content: 'TRIAL COPY - not live'; position: fixed; left: 50%; bottom: 62px; transform: translateX(-50%); z-index: 900; background: #f2a20c; color: #111; font: 700 12px system-ui, sans-serif; padding: 3px 10px; border-radius: 999px; pointer-events: none; }
