/* Ilé · M&M POS — Apple HIG, dark.
   Dossier: APPLE HIG (Control Room/ui-ux-library/engine/styles/apple-hig.md),
   matched to the approved Floor Map v2 exemplar (site/private/preview/,
   Craig 2026-09-26: "yes!!! Perfect, now we talking!"). Intent contract:
   pos-app/ILE_INTENT.md.

   Deep black systemBackground (#000) everywhere (Craig, 2026-09-26: "no
   stars just deep black"), system type only, HIG system status colours,
   continuous-corner radii, separators instead of boxes, materials only on
   chrome (bars, sheets). No glow, no decorative gradient, no looping
   animation, no drawn art. M&M gold is the one app tint.

   The legacy token NAMES (--ground/--panel/--ink/--warning/...) are kept
   because the guest pages (table.html, pay.html, order-status.html) share
   this file and style themselves off them. */

:root {
  color-scheme: dark;

  /* HIG dark system colours */
  --bg: #000000;              /* systemBackground */
  --bg-2: #1C1C1E;            /* secondarySystemBackground: grouped lists, sheets */
  --bg-3: #2C2C2E;            /* tertiarySystemBackground: tiles, rows inside sheets */
  --bg-4: #3A3A3C;            /* pressed */
  --label: #FFFFFF;
  --label-2: rgba(235, 235, 245, .60);
  --label-3: rgba(235, 235, 245, .30);
  --sep: rgba(84, 84, 88, .60);
  --fill: rgba(118, 118, 128, .24);   /* tertiarySystemFill: gray buttons, inputs, segmented track */
  --fill-2: rgba(118, 118, 128, .36);

  --tint: #e8ac2f;            /* M&M gold, dark variant (the app tint) */
  --on-tint: #1c1400;
  --green: #30D158;
  --orange: #FF9F0A;
  --blue: #0A84FF;
  --red: #FF453A;
  --yellow: #FFD60A;
  --gray: #8E8E93;

  --r-row: 10px;
  --r-tile: 14px;
  --r-group: 12px;
  --r-sheet: 22px;
  --spring: cubic-bezier(.32, .72, 0, 1);

  --font-body: -apple-system, BlinkMacSystemFont, "SF Pro Text", system-ui, "Segoe UI", Roboto, sans-serif;
  --font-display: -apple-system, BlinkMacSystemFont, "SF Pro Display", system-ui, "Segoe UI", Roboto, sans-serif;
  --font-mono: ui-monospace, "SF Mono", Menlo, monospace;

  /* Legacy names, same values (guest pages + any inline style still on them) */
  --ground: var(--bg);
  --panel: var(--bg-2);
  --panel-raised: var(--bg-3);
  --ink: var(--label);
  --ink-dim: var(--label-2);
  --hairline: var(--sep);
  --structural: var(--label-3);
  --running: var(--green);
  --idle: var(--label-3);
  --warning: var(--tint);
  --fault: var(--red);
  --offline: rgba(235, 235, 245, .22);
  --sys-blue: var(--blue);
  --radius: var(--r-tile);
  --space-1: 8px; --space-2: 16px; --space-3: 24px; --space-4: 32px; --space-5: 48px; --space-6: 64px;
  --fs-0: 13px; --fs-1: 15px; --fs-2: 17px; --fs-3: 20px; --fs-4: 28px; --fs-5: 34px;
  --tap-min: 44px;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
img { max-width: 100%; }

html, body {
  margin: 0;
  height: 100%;
  background: var(--bg);
  color: var(--label);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.3;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
#app { min-height: 100%; display: flex; flex-direction: column; }
::selection { background: var(--tint); color: var(--on-tint); }

/* ---------- controls ---------- */
button, input, select, textarea { font-family: inherit; font-size: inherit; color: inherit; }
input, select, textarea {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  background: var(--fill);
  border: none;
  border-radius: var(--r-row);
  color: var(--label);
  font-size: 17px;
}
input::placeholder, textarea::placeholder { color: var(--label-3); }
select { appearance: none; -webkit-appearance: none; padding-right: 32px;
  background-image: linear-gradient(45deg, transparent 50%, var(--label-2) 50%), linear-gradient(135deg, var(--label-2) 50%, transparent 50%);
  background-position: calc(100% - 17px) 50%, calc(100% - 12px) 50%;
  background-size: 5px 5px, 5px 5px; background-repeat: no-repeat; }
input[type="checkbox"] { width: 22px; height: 22px; min-height: 0; accent-color: var(--green); padding: 0; }
input[type="range"] { background: none; padding: 0; accent-color: var(--tint); }
:focus-visible { outline: 2px solid var(--tint); outline-offset: 2px; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--tint); outline-offset: 0; }

label { display: block; font-size: 13px; line-height: 18px; color: var(--label-2); margin: 0 0 6px 4px; }
.field { margin-bottom: 14px; }

/* Buttons: HIG gray (default), filled (the ONE primary), destructive, plain. */
button {
  cursor: pointer;
  border: none;
  background: var(--fill);
  color: var(--label);
  border-radius: 12px;
  min-height: 44px;
  padding: 10px 18px;
  font-size: 17px;
  font-weight: 600;
  line-height: 1.2;
  transition: transform 120ms var(--spring), opacity 120ms ease, background-color 120ms ease;
}
button:active { transform: scale(.97); opacity: .85; }
button:disabled { opacity: .4; cursor: not-allowed; transform: none; }
.btn-primary { background: var(--tint); color: var(--on-tint); }
.btn-fault { background: var(--red); color: #fff; }
.btn-warning { background: var(--green); color: #002a0f; }
.btn-ghost { background: transparent; color: var(--tint); }
.btn-destructive { background: transparent; color: var(--red); }
.btn-block { width: 100%; }
.btn-lg { min-height: 50px; font-size: 17px; }
.icon-btn { min-width: 44px; padding: 8px 10px; }
.btn-row { display: flex; gap: 10px; }
.btn-row > * { flex: 1; }

/* ---------- segmented control (one row, every 2-3 way choice) ---------- */
.ile-seg {
  display: flex; gap: 2px; padding: 2px;
  background: var(--fill); border-radius: 10px;
}
.ile-seg > button {
  flex: 1 1 0; min-height: 36px; padding: 6px 12px; border-radius: 8px;
  background: transparent; color: var(--label); font-size: 15px; font-weight: 590;
  white-space: nowrap;
}
.ile-seg > button.on { background: #636366; box-shadow: 0 3px 8px rgba(0,0,0,.12), 0 3px 1px rgba(0,0,0,.04); }
.ile-seg > button:active { transform: none; }
.ile-seg.inline { display: inline-flex; }
.ile-seg.inline > button { flex: 0 0 auto; }

/* ---------- inset grouped list ---------- */
.ile-head { font-size: 13px; line-height: 18px; color: var(--label-2); text-transform: uppercase;
  letter-spacing: .02em; margin: 22px 16px 7px; }
.ile-head:first-child { margin-top: 4px; }
.ile-foot { font-size: 13px; line-height: 18px; color: var(--label-2); margin: 7px 16px 0; }
.ile-list { background: var(--bg-2); border-radius: var(--r-group); overflow: hidden; }
.ile-row {
  position: relative; display: flex; align-items: center; gap: 12px;
  min-height: 44px; padding: 11px 16px; width: 100%;
  background: transparent; border: none; border-radius: 0; text-align: left;
  font-size: 17px; font-weight: 400; color: var(--label);
}
.ile-row + .ile-row::before, .ile-row + .ile-rowwrap::before, .ile-rowwrap + .ile-row::before {
  content: ""; position: absolute; top: 0; right: 0; left: 16px; height: 1px; background: var(--sep); transform: scaleY(.5);
}
.ile-row.has-icon + .ile-row::before { left: 56px; }
button.ile-row:active, a.ile-row:active, .ile-row[role="button"]:active { background: var(--bg-4); transform: none; opacity: 1; }
.ile-row .grow { flex: 1; min-width: 0; }
.ile-row .t { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ile-row .s { display: block; font-size: 13px; line-height: 18px; color: var(--label-2); margin-top: 1px; }
.ile-row .v { color: var(--label-2); font-variant-numeric: tabular-nums; text-align: right; flex-shrink: 0; }
.ile-row .v.strong { color: var(--label); font-weight: 600; }
.chev, .ile-row .chev { width: 8px; height: 13px; flex-shrink: 0; color: var(--label-3); }
.ile-row .ic { width: 30px; height: 30px; border-radius: 7px; display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; background: var(--fill-2); color: var(--label); }
.ile-row .ic svg { width: 18px; height: 18px; }
.ile-row input, .ile-row select { background: transparent; padding: 0; min-height: 22px; text-align: right; flex: 1; border-radius: 0; }
.ile-row input:focus, .ile-row select:focus { outline: none; }
.ile-row select { text-align-last: right; padding-right: 22px; background-position: calc(100% - 9px) 50%, calc(100% - 4px) 50%; }
.ile-row.destructive { color: var(--red); }
.ile-row.tinted { color: var(--tint); }
.ile-row.center { justify-content: center; }
.ile-row .red { color: var(--red); }
.ile-row .green { color: var(--green); }

.ile-row.wrap .t { white-space: normal; }
.ile-row input[type="checkbox"] { flex: 0 0 auto; }
.ile-row .tp-mini { flex-shrink: 0; }
/* iOS switch */
.ile-switch { appearance: none; -webkit-appearance: none; position: relative; flex: 0 0 auto;
  width: 51px !important; height: 31px !important; min-height: 0; padding: 0; border-radius: 16px;
  background: var(--fill-2); cursor: pointer; transition: background-color 200ms ease; }
.ile-switch::after { content: ""; position: absolute; top: 2px; left: 2px; width: 27px; height: 27px; border-radius: 50%;
  background: #fff; box-shadow: 0 3px 8px rgba(0,0,0,.15), 0 3px 1px rgba(0,0,0,.06); transition: transform 250ms var(--spring); }
.ile-switch:checked { background: var(--green); }
.ile-switch:checked::after { transform: translateX(20px); }
.ile-switch:focus { outline: none; }
.ile-switch:focus-visible { outline: 2px solid var(--tint); outline-offset: 2px; }
.welcome-list { margin: 8px 0; }
.tp-tabs.ile-seg { margin: 14px 0 10px; }
.modal label { margin-top: 4px; }
.modal textarea { min-height: 88px; }

/* ---------- sheet (every dialog: modal-backdrop + modal) ---------- */
.modal-backdrop {
  position: fixed; inset: 0; z-index: 70;
  background: rgba(0, 0, 0, .48);
  display: flex; align-items: flex-end; justify-content: center;
  animation: ile-fade 200ms ease;
}
.modal {
  width: 100%; max-width: 560px; max-height: 90vh; overflow-y: auto;
  background: var(--bg-2);
  border-radius: var(--r-sheet) var(--r-sheet) 0 0;
  padding: 8px 20px calc(20px + env(safe-area-inset-bottom, 0px));
  box-shadow: 0 -2px 30px rgba(0,0,0,.4);
  animation: ile-sheet-up 380ms var(--spring);
  -webkit-overflow-scrolling: touch;
}
.modal::before { content: ""; display: block; width: 36px; height: 5px; border-radius: 3px;
  background: var(--label-3); margin: 0 auto 10px; }
.modal h3 { font-size: 20px; line-height: 25px; font-weight: 700; margin: 4px 0 4px; text-transform: none; font-family: var(--font-display); }
.modal > p, .modal .sheet-sub { color: var(--label-2); font-size: 15px; line-height: 20px; margin: 0 0 14px; }
.modal .ile-list { background: var(--bg-3); }
.modal .ile-list .ile-row:active { background: #48484a; }
.modal .ile-seg { margin-bottom: 14px; }
.modal input, .modal select, .modal textarea { background: var(--bg-3); }
.modal .ile-row input, .modal .ile-row select { background: transparent; }
.modal .sheet-actions { display: flex; gap: 10px; margin-top: 18px; }
.modal .sheet-actions > button { flex: 1; min-height: 50px; }
@media (min-width: 700px) {
  .modal-backdrop { align-items: center; padding: 24px; }
  .modal { border-radius: var(--r-sheet); padding-bottom: 20px; max-height: 86vh; }
  .modal::before { display: none; }
  .modal { padding-top: 18px; }
}
@keyframes ile-sheet-up { from { transform: translateY(40px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes ile-fade { from { opacity: 0; } to { opacity: 1; } }

/* reason chips inside a sheet */
.ile-chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 14px; }
.ile-chip { min-height: 36px; padding: 7px 14px; border-radius: 999px; font-size: 15px; font-weight: 500;
  background: var(--bg-3); color: var(--label); }
.ile-chip.on { background: var(--tint); color: var(--on-tint); font-weight: 600; }
.sheet-err { color: var(--red); font-size: 15px; font-weight: 600; margin: 12px 4px 0; }
.sheet-note { color: var(--label-2); font-size: 13px; line-height: 18px; margin: 8px 4px 0; }

/* action menu (the "…" popover) */
.ile-menu-bg { position: fixed; inset: 0; z-index: 75; }
.ile-menu { position: fixed; min-width: 250px; max-width: 320px; border-radius: 14px; overflow: hidden;
  background: rgba(37, 37, 39, .92); -webkit-backdrop-filter: blur(30px) saturate(1.6); backdrop-filter: blur(30px) saturate(1.6);
  box-shadow: 0 10px 40px rgba(0,0,0,.45); animation: ile-pop 160ms var(--spring); transform-origin: top right; }
.ile-menu button { display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%;
  min-height: 44px; padding: 11px 16px; border-radius: 0; background: transparent; font-size: 17px; font-weight: 400; text-align: left; }
.ile-menu button + button { border-top: .5px solid var(--sep); }
.ile-menu button:active { background: rgba(255,255,255,.08); transform: none; }
.ile-menu button.destructive { color: var(--red); }
.ile-menu button svg { width: 18px; height: 18px; flex-shrink: 0; }
@keyframes ile-pop { from { transform: scale(.9); opacity: 0; } to { transform: none; opacity: 1; } }

/* ---------- boot / sign-in ---------- */
.boot-screen, .auth-screen {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 32px 16px; gap: 14px; text-align: center;
}
.boot-sub { color: var(--label-2); font-size: 15px; }
.auth-title { font-family: var(--font-display); font-size: 28px; line-height: 34px; font-weight: 700; margin: 6px 0 0; }
.auth-mark { font-family: var(--font-display); font-size: 28px; font-weight: 700; }
.auth-card { width: 100%; max-width: 420px; text-align: left; margin-top: 6px; }
.auth-card > p { color: var(--label-2); font-size: 15px; margin: 0 4px 14px; }
.auth-card .ile-list { margin-bottom: 16px; }
.auth-card .ile-row input { text-align: left; }
.auth-hint { font-size: 13px; line-height: 18px; color: var(--label-2); margin: 12px 4px 0; text-align: center; }
.auth-error { color: var(--red); font-size: 15px; font-weight: 600; margin: 0 4px 12px; }
.auth-switch { margin-top: 10px; text-align: center; }
.auth-switch a, .auth-link { color: var(--tint); cursor: pointer; font-size: 17px; background: none; min-height: 44px; display: inline-flex; align-items: center; padding: 0 8px; }
.build-stamp { color: var(--label-3); font-size: 12px; }
.build-refresh { background: transparent; color: var(--label-2); font-size: 13px; font-weight: 500; min-height: 32px; padding: 4px 10px; }

.brand-lockup { display: inline-flex; align-items: center; gap: 14px; justify-content: center;
  background: #1b0d07; padding: 14px 22px; border-radius: 18px; }
.brand-x { color: var(--label-3); font-size: 17px; }
.brand-mark { width: min(200px, 56vw); height: auto; display: block; }
.brand-mark-nb { width: min(52px, 14vw); height: auto; display: block; border-radius: 50%; }
.brand-mark-md { width: min(160px, 50vw); height: auto; display: block; }
.brand-mark-nb-md { width: min(44px, 12vw); height: auto; display: block; border-radius: 50%; }
.brand-mark-sm { height: 30px; width: auto; display: block; }
.brand-mark-nb-sm { height: 18px; width: auto; display: block; border-radius: 50%; }

.switcher-grid { width: 100%; max-width: 640px; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.switcher-tile { background: var(--bg-2); border-radius: var(--r-tile); min-height: 88px; padding: 14px 16px;
  display: flex; flex-direction: column; justify-content: center; align-items: flex-start; gap: 2px; text-align: left; }
.switcher-tile-name { font-size: 17px; font-weight: 600; }
.switcher-tile-role { font-size: 13px; color: var(--label-2); font-weight: 400; }

/* PIN: the iOS passcode look */
.pinpad-card { text-align: center; max-width: 320px; }
.pinpad-name { font-size: 20px; font-weight: 600; margin: 4px 0 18px; }
.pinpad-dots { display: flex; justify-content: center; gap: 18px; margin-bottom: 18px; }
.pinpad-dot { width: 13px; height: 13px; border-radius: 50%; border: 1.5px solid var(--label); background: transparent; }
.pinpad-dot.filled { background: var(--label); }
.pinpad-keys { display: grid; grid-template-columns: repeat(3, 78px); gap: 16px 24px; justify-content: center; margin-bottom: 14px; }
.pinpad-key { width: 78px; height: 78px; min-height: 0; padding: 0; border-radius: 50%; background: var(--bg-3);
  font-size: 34px; font-weight: 400; font-variant-numeric: tabular-nums; }
.pinpad-key[data-key="back"] { background: transparent; font-size: 22px; }
.pinpad-key:active { background: #636366; transform: none; }

.welcome-screen { flex: 1; display: flex; flex-direction: column; justify-content: center; gap: 12px;
  width: 100%; max-width: 520px; margin: 0 auto; padding: 32px 16px; }
.welcome-screen h1 { font-family: var(--font-display); font-size: 34px; line-height: 41px; font-weight: 700; margin: 0; }
.welcome-screen > p { color: var(--label-2); margin: 0; }
.welcome-role-badge { font-size: 15px; color: var(--tint); font-weight: 600; }

/* ---------- shell ---------- */
.shell { flex: 1; display: flex; flex-direction: column; min-height: 100%; }
.shell-body { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.topbar {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: calc(8px + env(safe-area-inset-top, 0px)) 16px 8px;
  min-height: 52px;
  background: rgba(0, 0, 0, .8);
  -webkit-backdrop-filter: blur(20px) saturate(1.8); backdrop-filter: blur(20px) saturate(1.8);
  border-bottom: .5px solid var(--sep);
}
.topbar-id { display: flex; align-items: center; gap: 12px; min-width: 0; }
.topbar-id .brand-lockup { padding: 3px 10px; gap: 8px; border-radius: 9px; }
.topbar-who { display: flex; flex-direction: column; min-width: 0; }
.topbar-role { font-size: 15px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar-build { font-size: 11px; color: var(--label-3); }
.topbar-actions { display: flex; gap: 6px; align-items: center; flex-shrink: 0; }
.topbar-actions button { min-height: 36px; padding: 6px 12px; font-size: 15px; }
.btn-logoff { background: transparent; color: var(--tint); font-weight: 600; }
.demo-chip { font-size: 13px; font-weight: 600; color: var(--tint); }

.main { flex: 1; width: 100%; max-width: 1100px; margin: 0 auto;
  padding: 16px 16px calc(96px + env(safe-area-inset-bottom, 0px)); }

/* phone / portrait: bottom tab bar */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
  display: flex; justify-content: space-around;
  padding: 6px 4px calc(4px + env(safe-area-inset-bottom, 0px));
  background: rgba(22, 22, 23, .86);
  -webkit-backdrop-filter: blur(20px) saturate(1.8); backdrop-filter: blur(20px) saturate(1.8);
  border-top: .5px solid var(--sep);
}
.tab {
  flex: 1 1 0; display: flex; flex-direction: column; align-items: center; gap: 3px;
  min-height: 48px; min-width: 0; padding: 4px 2px; border-radius: 10px;
  background: transparent; color: var(--gray); font-size: 11px; font-weight: 500;
}
.tab:active { transform: none; }
.tab.active { color: var(--tint); }
.tab .glyph { display: flex; }
.tab .glyph svg { width: 24px; height: 24px; }
.tab-label { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.tab[data-tier="secondary"] { display: none; }
.tab-section-label { display: none; }

/* iPad landscape / desktop: sidebar */
@media (min-width: 1000px) {
  .shell { flex-direction: row; }
  .tabbar {
    position: sticky; top: 0; bottom: auto; flex-direction: column; justify-content: flex-start;
    width: 232px; height: 100vh; overflow-y: auto; flex-shrink: 0;
    padding: calc(12px + env(safe-area-inset-top, 0px)) 10px 16px; gap: 2px;
    background: var(--bg-2); border-top: none; border-right: .5px solid var(--sep);
    -webkit-backdrop-filter: none; backdrop-filter: none;
  }
  .tab { flex: 0 0 auto; flex-direction: row; justify-content: flex-start; gap: 12px;
    min-height: 44px; padding: 0 12px; font-size: 17px; font-weight: 400; color: var(--label); }
  .tab .glyph { color: var(--tint); }
  .tab .glyph svg { width: 20px; height: 20px; }
  .tab.active { background: var(--tint); color: var(--on-tint); font-weight: 600; }
  .tab.active .glyph { color: var(--on-tint); }
  .tab[data-tier="secondary"] { display: flex; }
  .tab-more { display: none; }
  .tab-section-label { display: block; font-size: 13px; font-weight: 600; color: var(--label-2);
    padding: 16px 12px 6px; }
  .main { padding-bottom: 24px; }
}

/* ---------- page headings ---------- */
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin: 0 0 14px; }
.section-title { font-family: var(--font-display); font-size: 28px; line-height: 34px; font-weight: 700; text-transform: capitalize; }
.section-head .ile-seg { flex: 0 1 auto; }
.section-head button { min-height: 36px; padding: 6px 14px; font-size: 15px; }
.page-sub { color: var(--label-2); font-size: 15px; margin: -8px 0 16px; }

/* ---------- status language ---------- */
.status-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 6px; }
.badge { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; font-weight: 600; color: var(--label-2); white-space: nowrap; }
.badge-draft { color: var(--tint); }
.badge-fired { color: var(--orange); }
.badge-preparing { color: var(--orange); }
.badge-ready { color: var(--blue); }
.badge-delivered { color: var(--label-2); }
.badge-void { color: var(--red); }
.badge-paid { color: var(--green); }

.empty-state { text-align: center; color: var(--label-2); padding: 40px 16px; font-size: 15px; }
.tile-meta { font-size: 13px; line-height: 18px; color: var(--label-2); }

/* toast: a HUD capsule */
.toast {
  position: fixed; left: 50%; transform: translateX(-50%); z-index: 95;
  bottom: calc(100px + env(safe-area-inset-bottom, 0px));
  max-width: min(520px, calc(100vw - 32px));
  padding: 12px 20px; border-radius: 16px;
  background: rgba(44, 44, 46, .94); -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px);
  box-shadow: 0 8px 30px rgba(0,0,0,.4);
  font-size: 15px; font-weight: 600; text-align: center;
  animation: ile-fade 200ms ease;
}
@media (min-width: 1000px) { .toast { bottom: 24px; } }

/* ---------- lists still built from the older row markup ---------- */
.row-list { background: var(--bg-2); border-radius: var(--r-group); overflow: hidden; }
.row-card {
  position: relative; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  width: 100%; min-height: 56px; padding: 10px 16px; background: transparent; border: none; border-radius: 0;
  text-align: left; cursor: pointer; font-weight: 400;
}
.row-card + .row-card::before { content: ""; position: absolute; top: 0; right: 0; left: 16px; height: 1px; background: var(--sep); transform: scaleY(.5); }
.row-card:active { background: var(--bg-4); transform: none; opacity: 1; }
.row-card-main { min-width: 0; flex: 1; }
.row-title { font-size: 17px; font-weight: 400; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row-sub { font-size: 13px; line-height: 18px; color: var(--label-2); margin-top: 1px; }
.row-meta { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.row-meta .row-sub { font-size: 17px; margin: 0; font-variant-numeric: tabular-nums; }
.row-chevron { color: var(--label-3); font-size: 22px; line-height: 1; font-weight: 400; }
.row-secondary-action { background: transparent; color: var(--tint); font-size: 15px; font-weight: 600; min-height: 36px; padding: 6px 8px; }
.row-settled { opacity: .55; }

.card { background: var(--bg-2); border-radius: var(--r-group); padding: 14px 16px; margin-bottom: 16px; }

.disclosure { background: var(--bg-2); border-radius: var(--r-group); overflow: hidden; margin: 0 0 16px; }
.disclosure > summary { list-style: none; cursor: pointer; min-height: 44px; padding: 11px 16px;
  display: flex; align-items: center; gap: 8px; font-size: 17px; }
.disclosure > summary::-webkit-details-marker { display: none; }
.disclosure > summary::after { content: ""; margin-left: auto; width: 8px; height: 8px;
  border-right: 2px solid var(--label-3); border-bottom: 2px solid var(--label-3); transform: rotate(-45deg); transition: transform 200ms var(--spring); }
.disclosure[open] > summary::after { transform: rotate(45deg); }
.disclosure-count { color: var(--label-2); }
.disclosure > .row-list, .disclosure > .ile-list { border-radius: 0; border-top: .5px solid var(--sep); }

.pill-group { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.pill { min-height: 36px; padding: 7px 14px; border-radius: 999px; font-size: 15px; font-weight: 500; background: var(--fill); }
.pill.active { background: var(--tint); color: var(--on-tint); font-weight: 600; }

.table-list { width: 100%; border-collapse: collapse; }
.table-list th, .table-list td { text-align: left; padding: 10px 8px; border-bottom: .5px solid var(--sep); font-size: 15px; }

/* ---------- menu grid (ordering) ---------- */
.menu-scroll { max-height: 52vh; overflow-y: auto; -webkit-overflow-scrolling: touch; margin-bottom: 16px; }
.menu-cat { margin-bottom: 18px; }
.menu-cat-name { position: sticky; top: 0; z-index: 1; background: var(--bg); font-size: 20px; font-weight: 700;
  padding: 6px 2px 8px; text-transform: capitalize; }
.tp .menu-cat-name { background: var(--bg-2); }
.menu-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.menu-tile { display: flex; flex-direction: column; align-items: flex-start; justify-content: space-between; gap: 6px;
  min-height: 84px; padding: 11px 12px; border-radius: var(--r-tile); background: var(--bg-3); text-align: left; font-weight: 400; }
.menu-tile:disabled { opacity: .35; }
.menu-tile-cat { display: none; }
.menu-tile-name { font-size: 15px; font-weight: 600; line-height: 1.2; }
.menu-tile-price { font-size: 15px; color: var(--label-2); font-variant-numeric: tabular-nums; }
.qty-btn { min-width: 44px; min-height: 44px; padding: 0; font-size: 20px; line-height: 1; border-radius: 50%; }
.menu-lane-group { margin-bottom: 24px; }
.menu-lane-title { font-size: 13px; color: var(--label-2); text-transform: uppercase; letter-spacing: .02em; margin: 0 4px 7px; }
.menu-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 11px 0; border-bottom: .5px solid var(--sep); }
.menu-row-name { font-weight: 600; }
.menu-row-price { color: var(--label-2); font-variant-numeric: tabular-nums; }

/* ---------- order ticket (#/orders/:id) ---------- */
.order-bar { display: flex; align-items: center; gap: 12px; margin: 0 0 14px; }
.order-bar-id { flex: 1; min-width: 0; }
.order-bar-table { display: block; font-family: var(--font-display); font-size: 28px; line-height: 34px; font-weight: 700; }
.order-bar-no { display: block; font-size: 13px; color: var(--label-2); }
.order-bar-total { font-size: 22px; font-weight: 700; font-variant-numeric: tabular-nums; }
.order-bar .btn-ghost { padding: 6px 4px; }
.order-more { width: 44px; min-width: 44px; padding: 0; font-size: 20px; letter-spacing: 0; }
.lane-switch { margin: 0 0 14px; }
.ticket-total { display: flex; justify-content: space-between; padding: 11px 16px; font-variant-numeric: tabular-nums; }
.ticket-total.grand { font-weight: 700; font-size: 20px; }
.ticket-item-name { font-weight: 400; }

/* ---------- KDS (kitchen / bar) ---------- */
.lane-root { display: flex; flex-direction: column; }
.lane-count { color: var(--label-2); font-size: 17px; }
.lane-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; }
.kds-card { background: var(--bg-2); border-radius: var(--r-tile); padding: 14px 16px; display: flex; flex-direction: column; gap: 6px; }
.kds-card-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.kds-card-table { font-size: 20px; font-weight: 700; }
.kds-card-time { font-size: 13px; font-weight: 600; padding: 3px 9px; border-radius: 999px; background: var(--fill); color: var(--label); font-variant-numeric: tabular-nums; }
.kds-card-time.attention { background: rgba(255,159,10,.2); color: var(--orange); }
.kds-card-time.urgent { background: rgba(255,69,58,.2); color: var(--red); }
.kds-card-item { font-size: 20px; line-height: 1.25; font-weight: 600; }
.kds-card-item .note { color: var(--label-2); font-weight: 400; }
.kds-card-who { font-size: 13px; color: var(--label-2); }
.kds-card-actions { display: flex; gap: 8px; margin-top: 4px; }
.kds-card-actions > button { flex: 1; min-height: 50px; }
.kds-ready { background: var(--blue); color: #fff; }
.lane-display .kds-card-table { font-size: 26px; }
.lane-display .kds-card-item { font-size: 26px; }
.lane-display .kds-card-actions > button { min-height: 64px; font-size: 20px; }
.lane-display .section-title { font-size: 34px; line-height: 41px; }

/* Receipt: the on-screen stand-in for the printer that isn't wired in yet.
   A plain static card now: no lamp, no paper feed, no tear, no zigzag. */
.printer-rig { margin-bottom: 16px; }
.printer-rig:not(.busy) { display: none; }
.printer-body { display: none; }
.printer-paper { display: flex; justify-content: center; }
.receipt { width: min(320px, 100%); background: #f5f3ee; color: #111; border-radius: 12px;
  font-family: var(--font-mono); font-size: 13px; line-height: 1.45; padding: 12px 16px; box-shadow: 0 6px 24px rgba(0,0,0,.4); }
.receipt-head { text-align: center; font-weight: 700; font-family: var(--font-body); }
.receipt-sub { text-align: center; font-size: 12px; color: #555; font-family: var(--font-body); }
.receipt-rule { border-top: 1px dashed #999; margin: 8px 0; }
.receipt-table { font-size: 20px; font-weight: 700; font-family: var(--font-body); }
.receipt-line { display: flex; justify-content: space-between; gap: 10px; }
.receipt-note { font-size: 12px; font-style: italic; }
.receipt-foot { font-size: 12px; text-align: center; color: #555; font-family: var(--font-body); }
.receipt-total { font-weight: 700; }
.receipt-demo { text-align: center; font-size: 12px; font-weight: 600; color: #8a5a00; font-family: var(--font-body); }
.receipt-demo-sub { text-align: center; font-size: 11px; color: #777; font-family: var(--font-body); }
.receipt-edge, .printer-slot, .printer-lamp, .printer-sim { display: none; }

/* ---------- front desk ---------- */
.fd-status { font-size: 13px; font-weight: 600; }
.fd-status.paid { color: var(--green); }
.fd-status.unpaid { color: var(--label-2); }
.fd-ready { color: var(--blue); font-weight: 600; }
.reader-note { font-size: 13px; line-height: 18px; color: var(--label-2); margin: 10px 16px 0; }

/* ---------- ledger / feed rows ---------- */
.ledger-row { position: relative; display: grid; grid-template-columns: 1fr auto; gap: 2px 12px; align-items: center;
  padding: 11px 16px; min-height: 56px; }
.ledger-row + .ledger-row::before { content: ""; position: absolute; top: 0; right: 0; left: 16px; height: 1px; background: var(--sep); transform: scaleY(.5); }
.ledger-row[data-feed-order]:not([data-feed-order=""]):active { background: var(--bg-4); }
.ledger-main { min-width: 0; }
.ledger-title { font-size: 17px; }
.ledger-sub { font-size: 13px; line-height: 18px; color: var(--label-2); margin-top: 2px; }
.ledger-amt { font-variant-numeric: tabular-nums; color: var(--label); text-align: right; }
.ledger-row.blocked .ledger-title { color: var(--red); }
.ledger-time { font-size: 13px; color: var(--label-2); }
.alert-banner { display: flex; gap: 12px; align-items: flex-start; background: rgba(255,69,58,.14); color: var(--label);
  border-radius: var(--r-group); padding: 12px 16px; margin: 0 0 16px; }
.alert-banner strong { color: var(--red); display: block; }

/* ---------- chat ---------- */
.chat-messages { max-height: 320px; overflow-y: auto; padding: 0 16px; }
.chat-msg { padding: 10px 0; border-bottom: .5px solid var(--sep); }
.chat-msg:last-child { border-bottom: none; }
.chat-msg-meta { font-size: 13px; color: var(--label-2); margin-bottom: 2px; }
.chat-msg-model .chat-msg-meta { color: var(--tint); }
.chat-msg-body { font-size: 15px; line-height: 1.4; }

/* ---------- Z report ---------- */
.z-hero { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; margin: 0 0 4px; }
.z-net { font-family: var(--font-display); font-size: 34px; line-height: 41px; font-weight: 700; font-variant-numeric: tabular-nums; }
.z-state { font-size: 15px; font-weight: 600; }
.z-state.closed { color: var(--green); }
.z-state.open { color: var(--orange); }
.z-grid { display: grid; grid-template-columns: 1fr; gap: 0 20px; }
@media (min-width: 900px) { .z-grid { grid-template-columns: 1fr 1fr; } }
.z-actions { margin-top: 20px; }

/* ================== FLOOR (the exemplar, on live data) ================== */
.fl-home { display: flex; flex-direction: column; align-items: stretch; }
.main:has(.fl-home) { max-width: none; padding-top: 10px; padding-bottom: calc(92px + env(safe-area-inset-bottom, 0px)); overflow: hidden; }
@media (min-width: 1000px) { .main:has(.fl-home) { padding-bottom: 12px; } }
html:has(.fl-home), body:has(.fl-home) { overflow: hidden; overscroll-behavior: none; }
.fl-full { display: flex; justify-content: center; }
.fl-stage { position: relative; width: 100%; aspect-ratio: 4 / 3; flex: none;
  border-radius: 18px; background: var(--bg-2); overflow: hidden; container-type: inline-size; }
.fl-stage.fl-turned { aspect-ratio: 3 / 4; }

.fl-zone { position: absolute; border-radius: 14px; box-shadow: inset 0 0 0 1px var(--sep); pointer-events: none; }
.fl-zone-name { position: absolute; top: 8px; left: 12px; font-size: 17px; line-height: 22px; font-weight: 700; color: var(--label); white-space: nowrap; }
.fl-pass { position: absolute; display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 0 14px; border-radius: var(--r-tile); background: var(--bg-3); overflow: hidden;
  box-shadow: 0 1px 2px rgba(0,0,0,.06), 0 4px 12px rgba(0,0,0,.07); }
.fl-pass-name { font-size: 17px; font-weight: 700; white-space: nowrap; }
.fl-pass-val { display: flex; align-items: baseline; gap: 6px; white-space: nowrap; }
.fl-pass-val b { font-size: 22px; font-weight: 700; font-variant-numeric: tabular-nums; }
.fl-pass-val span { font-size: 13px; color: var(--label-2); }
.fl-pass.live b { color: var(--blue); }

/* The table tile: Home-app accessory tile. Neutral fill one step above the
   stage; the STATE rides on the icon square, the big number and the status
   line -- never a tinted slab or a coloured outline. */
.fl-node {
  position: absolute; display: flex; flex-direction: column; align-items: flex-start; justify-content: flex-start;
  padding: 10px; min-height: 0; gap: 0; overflow: hidden; text-align: left; font-weight: 400; line-height: 1.2;
  border-radius: var(--r-tile); background: var(--bg-3); color: var(--label);
  box-shadow: 0 1px 2px rgba(0,0,0,.06), 0 4px 12px rgba(0,0,0,.07);
  --st: var(--gray);
}
.fl-node:active { transform: scale(.97); background: var(--bg-4); opacity: 1; }
.fl-bar { border-radius: 50%; padding: 2px; align-items: center; justify-content: center; text-align: center; overflow: visible; }
.fl-body { display: flex; flex-direction: column; align-items: flex-start; width: 100%; min-width: 0; flex: 1; }
.fl-bar .fl-body { align-items: center; justify-content: center; }
.fl-row1 { display: flex; align-items: center; gap: 8px; width: 100%; min-width: 0; }
.fl-bar .fl-row1 { flex-direction: column; gap: 1px; }
.fl-tile-icon { width: 28px; height: 28px; border-radius: 8px; flex-shrink: 0; display: flex; align-items: center; justify-content: center;
  background: color-mix(in srgb, var(--st) 22%, transparent); color: var(--st); }
.fl-tile-icon svg { width: 16px; height: 16px; }
.fl-bar .fl-tile-icon { width: 22px; height: 22px; border-radius: 50%; }
.fl-bar .fl-tile-icon svg { width: 13px; height: 13px; }
.fl-t { font-size: 15px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.fl-bar .fl-t { font-size: 11px; }
.fl-elapsed { font-size: 22px; font-weight: 700; line-height: 1.1; margin-top: 4px; color: var(--st); font-variant-numeric: tabular-nums; }
.fl-elapsed-unit { font-size: 22px; }
.fl-bigrow { display: flex; align-items: baseline; gap: 6px; min-width: 0; max-width: 100%; }
.fl-who { font-size: 12px; color: var(--label-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.fl-status { margin-top: auto; padding-top: 3px; font-size: 11px; line-height: 13px; font-weight: 600; color: var(--st);
  max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fl-sub { font-size: 12px; color: var(--label-2); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.fl-bar .fl-sub { font-size: 9px; margin: 0; }
.fl-unsent-dot { position: absolute; top: 8px; right: 8px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px;
  background: var(--tint); color: var(--on-tint); font-size: 11px; font-weight: 700; display: flex; align-items: center; justify-content: center; }
.fl-bar .fl-unsent-dot { top: -2px; right: -2px; }
.fl-qrmark { position: absolute; top: 8px; right: 10px; font-size: 11px; font-weight: 700; color: var(--tint); }

/* one status colour per state (the HIG system set, never re-skinned) */
.fl-empty       { --st: var(--gray); }
.fl-open-tab    { --st: var(--green); }
.fl-fired       { --st: var(--orange); }
.fl-preparing   { --st: var(--orange); }
.fl-ready       { --st: var(--blue); }
.fl-settled     { --st: var(--gray); }
.fl-delivered   { --st: var(--gray); }
.fl-hold-reserved { --st: var(--yellow); }
.fl-hold-bussing  { --st: var(--red); }
.fl-notmine { opacity: .45; }

/* portrait iPad: ~110pt tiles, so tighter chrome keeps "Table 10" whole */
@container (max-width: 900px) {
  .fl-node { padding: 8px; }
  .fl-row1 { gap: 6px; }
  .fl-tile-icon { width: 22px; height: 22px; border-radius: 6px; }
  .fl-tile-icon svg { width: 13px; height: 13px; }
  .fl-t { font-size: 14px; }
  .fl-elapsed { font-size: 20px; }
  /* narrow tiles are taller here: let the status wrap rather than cut the amount */
  .fl-status { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
}
/* the room's frame on narrow containers */
@container (max-width: 640px) {
  .fl-zone-name, .fl-pass-name { font-size: 13px; }
  .fl-pass-val b { font-size: 17px; }
  .fl-t { font-size: 12px; }
  .fl-elapsed, .fl-elapsed-unit { font-size: 16px; }
  .fl-node { padding: 7px; }
  .fl-tile-icon { width: 22px; height: 22px; border-radius: 6px; }
  .fl-tile-icon svg { width: 13px; height: 13px; }
  .fl-bar .fl-tile-icon { width: 16px; height: 16px; }
}

.fl-home-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 10px; }
.fl-legend { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 13px; color: var(--label-2); }
.fl-legend > span { display: inline-flex; align-items: center; gap: 6px; }
.fl-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--st); }
.fl-nb { font-size: 12px; color: var(--label-3); white-space: nowrap; }
.fl-offplan { margin-top: 10px; }
.fl-offplan-row { display: flex; flex-wrap: wrap; gap: 8px; }
.fl-chip { min-height: 36px; padding: 6px 14px; font-size: 15px; border-radius: 999px; }

/* floor toolbar (topbar) */
.fl-toolbar { display: flex; gap: 6px; }
.fl-turn-btn, .fl-lock-btn { display: inline-flex; align-items: center; gap: 6px; background: var(--fill); color: var(--label); }
.fl-turn-btn svg, .fl-lock-btn svg { width: 16px; height: 16px; }
.fl-turn-deg { color: var(--label-2); font-weight: 400; }
.fl-lock-btn.on { background: var(--tint); color: var(--on-tint); }

/* mini map (QR sheet, table sheet) */
.fl-mini { max-width: 300px; margin: 8px auto 14px; aspect-ratio: 4 / 3; }
.fl-mininode { position: absolute; border-radius: 4px; background: var(--fill-2); display: flex; align-items: center; justify-content: center;
  font-size: 10px; font-weight: 700; color: var(--on-tint); }
.fl-mininode.fl-bar { border-radius: 50%; }
.fl-mininode.fl-mini-on { background: var(--tint); z-index: 2; }

/* read-only table sheet (kitchen/security) */
.fl-routing { margin: 0 0 14px; }
.fl-route-term { color: var(--label-2); font-size: 13px; }

/* ready bell: a notification banner, not a slab */
.bell-banner { position: fixed; z-index: 80; left: 50%; transform: translateX(-50%);
  top: calc(10px + env(safe-area-inset-top, 0px)); width: min(520px, calc(100vw - 24px));
  border-radius: 18px; overflow: hidden;
  background: rgba(44, 44, 46, .94); -webkit-backdrop-filter: blur(30px) saturate(1.6); backdrop-filter: blur(30px) saturate(1.6);
  box-shadow: 0 10px 40px rgba(0,0,0,.5); animation: ile-drop 380ms var(--spring); }
@keyframes ile-drop { from { transform: translate(-50%, -30px); opacity: 0; } to { transform: translate(-50%, 0); opacity: 1; } }
.bell-row { display: grid; grid-template-columns: auto 1fr; gap: 0 12px; width: 100%; text-align: left; background: none; border-radius: 0;
  padding: 12px 16px; font-weight: 400; }
.bell-row::before { content: ""; grid-row: span 3; width: 10px; height: 10px; border-radius: 50%; background: var(--blue); margin-top: 6px; }
.bell-row + .bell-row { border-top: .5px solid var(--sep); }
.bell-row:active { transform: none; background: rgba(255,255,255,.06); }
.bell-table { font-size: 17px; font-weight: 600; }
.bell-what { font-size: 15px; color: var(--label-2); }
.bell-go { font-size: 13px; color: var(--blue); font-weight: 600; }
.bell-dismiss { width: 100%; border-radius: 0; background: transparent; color: var(--tint); border-top: .5px solid var(--sep); font-size: 15px; }

/* new build available */
.update-pill { position: fixed; z-index: 90; left: 50%; transform: translateX(-50%);
  bottom: calc(24px + env(safe-area-inset-bottom, 0px));
  display: grid; gap: 2px; padding: 10px 20px; border-radius: 999px;
  background: var(--tint); color: var(--on-tint); box-shadow: 0 8px 30px rgba(0,0,0,.45); animation: ile-fade 200ms ease; }
.update-pill:active { transform: translateX(-50%) scale(.97); }
.update-pill-t { font-weight: 700; font-size: 15px; }
.update-pill-s { font-size: 12px; font-weight: 500; opacity: .75; }

/* ================== TABLE PANEL (side sheet over the room) ================== */
.tp-backdrop { position: fixed; inset: 0; z-index: 60; background: rgba(0,0,0,.4); animation: ile-fade 200ms ease; }
.tp {
  position: fixed; z-index: 61; left: 0; right: 0; bottom: 0; max-height: 88vh;
  display: flex; flex-direction: column;
  background: var(--bg-2); border-radius: var(--r-sheet) var(--r-sheet) 0 0;
  padding: 14px 16px calc(14px + env(safe-area-inset-bottom, 0px));
  box-shadow: 0 -2px 30px rgba(0,0,0,.45);
  animation: ile-sheet-up 380ms var(--spring);
}
@media (min-width: 1000px) {
  .tp { left: auto; top: 10px; right: 10px; bottom: 10px; max-height: none; width: min(560px, 46vw);
    border-radius: var(--r-sheet); padding: 16px 18px 16px; animation: ile-slide-in 380ms var(--spring); }
  .tp.tp-wide { width: min(1100px, calc(100vw - 20px)); }
}
@keyframes ile-slide-in { from { transform: translateX(40px); opacity: 0; } to { transform: none; opacity: 1; } }

.tp-head { display: flex; align-items: flex-start; gap: 10px; }
.tp-head-id { flex: 1; min-width: 0; }
.tp-table { font-family: var(--font-display); font-size: 28px; line-height: 34px; font-weight: 700; }
.tp-sub { color: var(--label-2); font-size: 15px; line-height: 20px; }
.tp-total { font-size: 22px; font-weight: 700; font-variant-numeric: tabular-nums; padding-top: 4px; }
.tp-head-btns { display: flex; gap: 8px; }
.tp-close, .tp-more { width: 36px; height: 36px; min-height: 0; min-width: 0; padding: 0; border-radius: 50%;
  background: var(--fill); color: var(--label-2); font-size: 17px; font-weight: 600; display: flex; align-items: center; justify-content: center; }
.tp-close svg, .tp-more svg { width: 18px; height: 18px; }
.tp-tabs { margin: 14px 0 10px; }
.tp-journey { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 6px; font-size: 13px; color: var(--label-3); margin: 0 2px 12px; }
.tp-step.done { color: var(--label-2); }
.tp-step.now { color: var(--tint); font-weight: 600; }
.tp-step + .tp-step::before { content: "›"; margin-right: 6px; color: var(--label-3); }

.tp-scroll { flex: 1; min-height: 0; overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; }
.tp-group { background: var(--bg-3); border-radius: var(--r-group); overflow: hidden; margin-bottom: 12px; }
.tp-group-head { font-size: 13px; color: var(--label-2); text-transform: uppercase; letter-spacing: .02em; margin: 14px 16px 7px; }
.tp-group-head:first-child { margin-top: 2px; }
.tp-line { position: relative; display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 48px; padding: 8px 12px 8px 16px; font-size: 17px; }
.tp-line + .tp-line::before { content: ""; position: absolute; top: 0; right: 0; left: 16px; height: 1px; background: var(--sep); transform: scaleY(.5); }
.tp-line-main { flex: 1; min-width: 0; }
.tp-line-name { display: block; }
.tp-line-sub { display: block; font-size: 13px; color: var(--label-2); margin-top: 1px; }
.tp-line-actions { display: flex; align-items: center; gap: 4px; flex-shrink: 0; }
.tp-line .amt { font-variant-numeric: tabular-nums; color: var(--label-2); min-width: 64px; text-align: right; }
.tp-mini { min-height: 36px; padding: 6px 10px; font-size: 15px; font-weight: 600; background: transparent; color: var(--tint); }
.tp-mini.red { color: var(--red); }
.tp-mini.go { background: var(--green); color: #002a0f; border-radius: 999px; padding: 6px 14px; }
.tp-qty { width: 34px; height: 34px; min-height: 0; padding: 0; border-radius: 50%; font-size: 20px; font-weight: 500; line-height: 1; background: var(--fill); }
.tp-qtynum { min-width: 22px; text-align: center; font-variant-numeric: tabular-nums; font-weight: 600; }
.tp-sums { background: var(--bg-3); border-radius: var(--r-group); overflow: hidden; margin-bottom: 6px; }
.tp-billtotal { display: flex; justify-content: space-between; padding: 12px 16px; font-size: 20px; font-weight: 700; font-variant-numeric: tabular-nums; }
.tp-sums .tp-billtotal { border-top: .5px solid var(--sep); }
.tp-note { font-size: 13px; line-height: 18px; color: var(--label-2); margin: 6px 16px 12px; }

.tp-actions { display: flex; flex-direction: column; gap: 10px; padding-top: 12px; }
.tp-actions .pair { display: flex; gap: 10px; }
.tp-actions .pair > button { flex: 1; }
.tp-big { width: 100%; min-height: 50px; font-size: 17px; }
.tp-label { display: block; font-size: 13px; color: var(--label-2); text-transform: uppercase; letter-spacing: .02em; margin: 16px 16px 7px; }
.tp-input { width: 100%; }
.tp-locked { padding-top: 14px; display: flex; flex-direction: column; gap: 12px; }
.tp-locked-line { font-size: 20px; font-weight: 600; }

/* send bar: one filled button pinned under the scroll */
.tp-sendbar { flex: none; padding-top: 12px; }
.tp-send { width: 100%; min-height: 56px; border-radius: 14px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; font-size: 17px; font-weight: 700; }
.tp-send-sub { font-size: 13px; font-weight: 500; opacity: .75; }
.tp-draft-head { color: var(--tint); }

/* ordering inside the panel: menu left, ticket right on iPad */
.tp-orderbody { display: flex; flex-direction: column; flex: 1; min-height: 0; overflow-y: auto; -webkit-overflow-scrolling: touch; }
.tp-orderbody > .tp-scroll { flex: none; overflow: visible; }
@media (min-width: 1000px) {
  .tp-orderbody { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(300px, 1fr); gap: 16px; overflow: hidden; }
  .tp-orderbody > .tp-scroll, .tp-side { overflow-y: auto; min-height: 0; overscroll-behavior: contain; }
}

/* split the bill */
.sp-count { display: flex; align-items: center; justify-content: center; gap: 18px; margin: 6px 0 14px; }
.sp-count-num { font-size: 22px; font-weight: 700; min-width: 5ch; text-align: center; font-variant-numeric: tabular-nums; }
.sp-brushes { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 10px; }
.sp-brush { min-height: 36px; padding: 6px 14px; border-radius: 999px; font-size: 15px; font-weight: 500; background: var(--fill);
  box-shadow: inset 0 0 0 2px var(--sp); }
.sp-brush.on { background: var(--sp); color: #111; font-weight: 700; }
.sp-units { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; margin: 0 0 12px; }
.sp-unit { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; min-height: 56px; padding: 8px 12px; text-align: left;
  font-size: 15px; font-weight: 500; background: var(--bg-3); border-radius: 12px; }
.sp-unit.on { box-shadow: inset 4px 0 0 var(--sp); }
.sp-unit-meta { font-size: 13px; color: var(--label-2); font-weight: 400; }
.sp-warn { color: var(--orange); font-weight: 600; font-size: 15px; margin: 0 4px 12px; }
.sp-check { position: relative; display: grid; grid-template-columns: 1fr auto auto; align-items: center; gap: 10px; min-height: 52px; padding: 6px 12px 6px 16px; }
.sp-check + .sp-check::before { content: ""; position: absolute; top: 0; right: 0; left: 16px; height: 1px; background: var(--sep); transform: scaleY(.5); }
.sp-paid { opacity: .55; }
.sp-who { display: flex; align-items: center; gap: 10px; }
.sp-dot { width: 12px; height: 12px; border-radius: 50%; background: var(--sp); flex-shrink: 0; }
.sp-amt { font-weight: 600; font-variant-numeric: tabular-nums; }
.sp-paidword { font-size: 13px; color: var(--label-2); }
.qr-box { background: #fff; border-radius: 14px; padding: 12px; margin: 4px auto 12px; width: fit-content; }
.qr-box img { display: block; }
.qr-status { text-align: center; font-size: 20px; font-weight: 700; margin: 0 0 12px; }
.qr-status.paid { color: var(--green); }
.qr-url { word-break: break-all; font-size: 12px; color: var(--label-2); text-align: center; margin: 0 0 12px; }

/* ---------- screen lock (counter-rotates the whole body) ---------- */
html.mm-lock-90 body, html.mm-lock-180 body, html.mm-lock-270 body {
  position: fixed; top: 0; left: 0; overflow: hidden; width: var(--mm-lockdim-w); height: var(--mm-lockdim-h);
}
html.mm-lock-90 body { transform-origin: top left; transform: rotate(-90deg) translateX(-100%); }
html.mm-lock-270 body { transform-origin: top left; transform: rotate(90deg) translateY(-100%); }
html.mm-lock-180 body { transform-origin: center center; transform: rotate(180deg); }
html.mm-lock-90 .tabbar, html.mm-lock-270 .tabbar { height: var(--mm-lockdim-h); }

@media print {
  body { background: #fff; color: #000; }
  .qr-sheet-logo { filter: invert(1); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}
