/* Table ordering on the customer website (online-order-table.js; online-order.html only).
   Everything derives from the checkout window's own tokens (online-order-newpanel.css, .co-v2):
   same ink, paper, ticket grey, amber for "waiting", the same two faces (Archivo for words,
   JetBrains Mono for anything printed). One signature: the table marker in the strip is cut like
   the tent card that stands on a table, and each sent order reads as the ticket it printed. */

.bqt-strip,
.bqt-sheet,
body.bq-table-mode #checkoutModal {
  --bqt-ink: #17191f;
  --bqt-paper: #ffffff;
  --bqt-ticket: #f2f4f7;
  --bqt-line: #dde1e7;
  --bqt-rule: #b6bcc6;
  --bqt-mute: #626977;
  --bqt-wait: #e89b12;
  --bqt-wait-wash: #fff4dc;
  --bqt-wait-ink: #7a4800;
  --bqt-ok-ink: #0f6b5f;
  --bqt-ok-wash: #e4f3ef;
  --bqt-stop: #b42318;
  --bqt-stop-wash: #fdeceb;
  --bqt-ui: 'Archivo', 'Helvetica Neue', Arial, sans-serif;
  --bqt-print: 'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
}

/* The page is one full-height stage (#onlineOrderRoot). In table mode the strip takes its own
   row above it and the stage takes the rest. */
body.bq-table-mode { display: flex; flex-direction: column; }
body.bq-table-mode #onlineOrderRoot { flex: 1 1 auto; height: auto !important; min-height: 0; }

/* What a table guest never needs: website hours, Pickup / Delivery, contact, texts. */
body.bq-table-mode .m2-onepage-meta,
body.bq-table-mode .oo-type-chip,
body.bq-table-mode #checkoutFulfillmentBlock,
body.bq-table-mode #checkoutModal .checkout-contact-field,
body.bq-table-mode #checkoutModal .checkout-field-spacer,
body.bq-table-mode #checkoutDeliveryBlock,
body.bq-table-mode #checkoutDeliveryQuotesBlock,
body.bq-table-mode #checkoutSmsBlock { display: none !important; }

/* ---------- the strip ---------- */
.bqt-strip {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 52px;
  padding: 6px 12px;
  padding-top: max(6px, env(safe-area-inset-top));
  box-sizing: border-box;
  background: var(--bqt-ink);
  color: #fff;
  font-family: var(--bqt-ui);
}
.bqt-tent {
  flex: 0 0 auto;
  min-width: 34px;
  padding: 7px 9px 5px;
  box-sizing: border-box;
  background: var(--bqt-paper);
  color: var(--bqt-ink);
  font: 800 19px/1 var(--bqt-print);
  letter-spacing: -0.02em;
  text-align: center;
  /* a tent card seen from the front: narrower at the fold */
  clip-path: polygon(13% 0, 87% 0, 100% 100%, 0 100%);
}
.bqt-tent[hidden] { display: none; }
.bqt-where {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}
.bqt-where-main {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.01em;
}
.bqt-where-sub {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12.5px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.66);
}
.bqt-where-sub[hidden] { display: none; }
.bqt-strip-btn {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 38px;
  padding: 0 12px;
  border: 0;
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  font: 700 13.5px var(--bqt-ui);
  letter-spacing: -0.005em;
  white-space: nowrap;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.bqt-strip-btn[hidden] { display: none; }
.bqt-strip-btn:hover:not(:disabled) { background: rgba(255, 255, 255, 0.2); }
.bqt-strip-btn:active:not(:disabled) { transform: translateY(1px); }
.bqt-strip-btn:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.bqt-strip-btn:disabled { cursor: default; opacity: 0.72; }
.bqt-strip-btn.is-done { background: transparent; box-shadow: inset 0 0 0 1.5px rgba(255, 255, 255, 0.3); opacity: 1; }
.bqt-strip-btn--orders { background: var(--bqt-paper); color: var(--bqt-ink); }
.bqt-strip-btn--orders:hover:not(:disabled) { background: #eceef2; }
.bqt-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--bqt-rule);
}
.bqt-strip-btn--orders[data-tone="wait"] .bqt-dot { background: var(--bqt-wait); animation: bqtPulse 1.6s ease-in-out infinite; }
.bqt-strip-btn--orders[data-tone="ok"] .bqt-dot { background: #12a37f; }
.bqt-strip-btn--orders[data-tone="stop"] .bqt-dot { background: var(--bqt-stop); }
@keyframes bqtPulse { 50% { opacity: 0.35; } }

/* ---------- the window ---------- */
.bqt-sheet {
  position: fixed;
  inset: 0;
  z-index: 10040;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(17, 19, 25, 0.55);
  font-family: var(--bqt-ui);
  color: var(--bqt-ink);
}
.bqt-sheet[hidden] { display: none; }
.bqt-card {
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
  width: 100%;
  max-width: 440px;
  max-height: calc(100vh - 32px);
  max-height: calc(100dvh - 32px);
  border-radius: 22px;
  background: var(--bqt-paper);
  box-shadow: 0 30px 80px rgba(15, 18, 25, 0.28);
  outline: none;
  overflow: hidden;
}
.bqt-card-head {
  flex: 0 0 auto;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 24px 24px 6px;
}
.bqt-card-store { margin: 0 0 4px; font: 600 14px/1.3 var(--bqt-ui); color: var(--bqt-mute); }
.bqt-card-title { margin: 0; font: 800 28px/1.08 var(--bqt-ui); letter-spacing: -0.025em; color: var(--bqt-ink); }
.bqt-close {
  flex: 0 0 auto;
  height: 36px;
  margin: -4px -8px 0 0;
  padding: 0 10px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--bqt-mute);
  font: 600 15px var(--bqt-ui);
  cursor: pointer;
}
.bqt-close:hover { color: var(--bqt-ink); background: var(--bqt-ticket); }
.bqt-close:focus-visible { outline: 2px solid var(--bqt-ink); outline-offset: 2px; }
.bqt-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  padding: 14px 24px 8px;
}
.bqt-body--refused { padding-top: 28px; }
.bqt-refused-text,
.bqt-empty { margin: 12px 0 8px; font: 500 16px/1.45 var(--bqt-ui); color: var(--bqt-mute); }
.bqt-empty { margin-top: 4px; }

/* a sent order = the ticket it printed */
.bqt-ticket {
  --zig: 10px;
  margin: 0 0 14px;
  padding: 20px 16px 22px;
  background: var(--bqt-ticket);
  font-family: var(--bqt-print);
  -webkit-mask:
    conic-gradient(from -45deg at bottom, #0000, #000 1deg 89deg, #0000 90deg) bottom / var(--zig) 51% repeat-x,
    conic-gradient(from 135deg at top, #0000, #000 1deg 89deg, #0000 90deg) top / var(--zig) 51% repeat-x;
  mask:
    conic-gradient(from -45deg at bottom, #0000, #000 1deg 89deg, #0000 90deg) bottom / var(--zig) 51% repeat-x,
    conic-gradient(from 135deg at top, #0000, #000 1deg 89deg, #0000 90deg) top / var(--zig) 51% repeat-x;
}
.bqt-ticket-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 0 0 10px;
  padding: 0 0 10px;
  border-bottom: 1.5px dashed var(--bqt-rule);
}
.bqt-ticket-no { min-width: 0; font: 700 16px/1.2 var(--bqt-print); letter-spacing: -0.01em; }
.bqt-ticket.is-fresh .bqt-ticket-no { font-size: 22px; }
.bqt-stamp {
  flex: 0 0 auto;
  padding: 4px 7px 3px;
  border: 1.5px solid currentColor;
  border-radius: 5px;
  font: 700 11.5px/1 var(--bqt-print);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.bqt-ticket[data-tone="wait"] .bqt-stamp { color: var(--bqt-wait-ink); background: var(--bqt-wait-wash); }
.bqt-ticket[data-tone="ok"] .bqt-stamp { color: var(--bqt-ok-ink); background: var(--bqt-ok-wash); }
.bqt-ticket[data-tone="stop"] .bqt-stamp { color: var(--bqt-stop); background: var(--bqt-stop-wash); }
.bqt-ticket-items { margin: 0 0 10px; padding: 0 0 10px; border-bottom: 1.5px dashed var(--bqt-rule); list-style: none; }
.bqt-ticket-items li {
  display: grid;
  grid-template-columns: 3ch minmax(0, 1fr) auto;
  gap: 0 8px;
  align-items: baseline;
  margin: 0 0 6px;
  font: 500 14px/1.35 var(--bqt-print);
}
.bqt-ticket-items li:last-child { margin-bottom: 0; }
.bqt-qty { font-weight: 700; }
.bqt-item-name { overflow-wrap: anywhere; font-weight: 600; }
.bqt-amt { font-family: var(--bqt-print); font-weight: 600; white-space: nowrap; font-variant-numeric: tabular-nums; }
.bqt-ticket-note { margin: 0 0 10px; font: 500 13px/1.4 var(--bqt-print); color: var(--bqt-mute); overflow-wrap: anywhere; }
.bqt-ticket-total { display: flex; justify-content: space-between; gap: 12px; margin: 0 0 10px; font: 700 15px/1.3 var(--bqt-print); }
.bqt-ticket-line { margin: 0; font: 600 14.5px/1.4 var(--bqt-ui); color: var(--bqt-ink); }
.bqt-ticket[data-tone="stop"] .bqt-ticket-line { color: var(--bqt-stop); }
.bqt-ticket[data-tone="wait"] .bqt-ticket-line { color: var(--bqt-wait-ink); }

.bqt-ticket-rest { margin: 6px 0 0; font: 500 14px/1.4 var(--bqt-ui); color: var(--bqt-mute); }
.bqt-bill-at { font: 500 13.5px/1.3 var(--bqt-ui); color: var(--bqt-mute); white-space: nowrap; }

.bqt-lock-note { margin: 2px 0 16px; font: 500 13.5px/1.45 var(--bqt-ui); color: var(--bqt-mute); }

.bqt-bill { margin: 4px 0 12px; padding-top: 14px; border-top: 1.5px solid var(--bqt-line); }
.bqt-bill-title { margin: 0 0 8px; font: 700 15px/1.3 var(--bqt-ui); color: var(--bqt-ink); }
.bqt-bill-list { margin: 0; padding: 0; list-style: none; }
.bqt-bill-list li {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 12px;
  min-height: 48px;
  border-bottom: 1px solid var(--bqt-line);
  font: 600 14.5px/1.3 var(--bqt-print);
}
.bqt-bill-list li:last-child { border-bottom: 0; }
.bqt-due {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin: 6px 0 4px;
  padding-top: 12px;
  border-top: 1.5px solid var(--bqt-ink);
  font: 700 16px/1.3 var(--bqt-ui);
}
.bqt-due-hint { margin: 0 0 6px; font: 500 13.5px/1.4 var(--bqt-ui); color: var(--bqt-mute); }
.bqt-register { margin: 8px 0 10px; font: 500 14.5px/1.45 var(--bqt-ui); color: var(--bqt-mute); }
.bqt-register.is-on { padding: 12px 14px; border-radius: 12px; background: var(--bqt-ticket); color: var(--bqt-ink); font-weight: 600; }
.bqt-link {
  padding: 0;
  border: 0;
  background: none;
  color: var(--bqt-ink);
  font: 600 14.5px var(--bqt-ui);
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}
.bqt-link:focus-visible { outline: 2px solid var(--bqt-ink); outline-offset: 3px; border-radius: 4px; }
.bqt-pay-error { margin: 8px 0 10px; padding: 12px 14px; border-radius: 12px; background: var(--bqt-stop-wash); color: var(--bqt-stop); font: 600 14.5px/1.4 var(--bqt-ui); }

.bqt-actions {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 10px 24px 18px;
  padding-bottom: max(18px, env(safe-area-inset-bottom));
  border-top: 1px solid var(--bqt-line);
  background: var(--bqt-paper);
}
.bqt-btn {
  border: 0;
  border-radius: 14px;
  font: 700 17px var(--bqt-ui);
  letter-spacing: -0.01em;
  cursor: pointer;
  transition: background-color 0.12s ease, transform 0.08s ease;
  -webkit-tap-highlight-color: transparent;
}
.bqt-btn:active:not(:disabled) { transform: translateY(1px); }
.bqt-btn:focus-visible { outline: 2px solid var(--bqt-ink); outline-offset: 3px; }
.bqt-btn:disabled { opacity: 0.6; cursor: default; }
.bqt-btn--primary { height: 54px; background: var(--bqt-ink); color: #fff; }
.bqt-btn--primary:hover:not(:disabled) { background: #000; }
.bqt-btn--quiet { height: 44px; background: transparent; color: var(--bqt-mute); font-size: 15px; font-weight: 600; }
.bqt-btn--quiet:hover:not(:disabled) { color: var(--bqt-ink); }
.bqt-btn--pay { width: 100%; height: 48px; margin-top: 12px; background: var(--bqt-ink); color: #fff; font-family: var(--bqt-ui); font-size: 16px; }
.bqt-btn--small { height: 38px; padding: 0 16px; border-radius: 11px; background: var(--bqt-ink); color: #fff; font-size: 14.5px; }

@media (max-width: 520px) {
  .bqt-sheet { align-items: flex-end; padding: 0; }
  .bqt-card { max-width: none; max-height: calc(100dvh - 28px); border-radius: 22px 22px 0 0; }
  .bqt-card-head { padding: 22px 18px 4px; }
  .bqt-body { padding: 12px 18px 8px; }
  .bqt-actions { padding-left: 18px; padding-right: 18px; }
  .bqt-card-title { font-size: 26px; }
}
@media (max-width: 359px) {
  .bqt-strip { gap: 7px; padding-left: 8px; padding-right: 8px; }
  .bqt-strip-btn { padding: 0 9px; font-size: 13px; }
  .bqt-where-sub { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .bqt-strip-btn--orders[data-tone="wait"] .bqt-dot { animation: none; }
  .bqt-btn, .bqt-strip-btn { transition: none; }
}

/* ---------- the review screen (the checkout window in table mode) ---------- */
body.bq-table-mode #checkoutModal .bqt-note { margin: 0 0 16px; }
body.bq-table-mode #checkoutModal .bqt-note label {
  display: block;
  margin: 0 0 6px;
  font: 600 15px/1.3 var(--bqt-ui);
  color: var(--bqt-ink);
}
body.bq-table-mode #checkoutModal .bqt-note label span { font-weight: 500; color: var(--bqt-mute); }
body.bq-table-mode #checkoutModal .bqt-note textarea {
  display: block;
  width: 100%;
  min-height: 64px;
  box-sizing: border-box;
  padding: 12px 14px;
  border: 1.5px solid var(--bqt-line);
  border-radius: 12px;
  background: var(--bqt-paper);
  color: var(--bqt-ink);
  font: 500 16px/1.4 var(--bqt-ui);
  resize: vertical;
}
body.bq-table-mode #checkoutModal .bqt-note textarea::placeholder { color: #9aa0aa; }
body.bq-table-mode #checkoutModal .bqt-note textarea:focus { outline: none; border-color: var(--bqt-ink); }
body.bq-table-mode #checkoutModal .bqt-send-error {
  margin: 0 0 12px;
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--bqt-stop-wash);
  color: var(--bqt-stop);
  font: 600 15px/1.4 var(--bqt-ui);
}
body.bq-table-mode #checkoutModal .bqt-send-error[hidden] { display: none; }
body.bq-table-mode #checkoutModal .bqt-lock-hint { margin: 0; font: 500 13.5px/1.45 var(--bqt-ui); color: var(--bqt-mute); }
body.bq-table-mode #checkoutModal .bqt-lock-hint[hidden] { display: none; }

/* The tip at a table: three percents of the bill (the restaurant's own, table settings), each with
   its amount, then the quieter "Custom" and "No tip". Selected state is the checkout's own. */
body.bq-table-mode #checkoutModal #staffTipOptions .bqt-tip {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  min-height: 60px;
  padding: 8px 4px;
}
body.bq-table-mode #checkoutModal .bqt-tip-pct { font: 700 18px/1.1 var(--bqt-print); letter-spacing: -0.02em; }
body.bq-table-mode #checkoutModal .bqt-tip-amt { font: 500 13px/1.2 var(--bqt-print); opacity: 0.72; }
body.bq-table-mode #checkoutModal .bqt-tip-more { grid-column: 1 / -1; display: flex; gap: 8px; }
body.bq-table-mode #checkoutModal .bqt-tip-quiet {
  flex: 1 1 0;
  min-height: 44px;
  border: 1.5px solid var(--bqt-line);
  border-radius: 12px;
  background: transparent;
  color: var(--bqt-mute);
  font: 600 15px var(--bqt-ui);
  cursor: pointer;
}
body.bq-table-mode #checkoutModal .bqt-tip-quiet.is-on { border-color: var(--bqt-ink); color: var(--bqt-ink); }
body.bq-table-mode #checkoutModal .bqt-tip-quiet:focus-visible,
body.bq-table-mode #checkoutModal .bqt-tip-custom-box:focus-within { outline: 2px solid var(--bqt-ink); outline-offset: 2px; }
body.bq-table-mode #checkoutModal .bqt-tip-custom {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font: 600 15px var(--bqt-ui);
  color: var(--bqt-ink);
}
body.bq-table-mode #checkoutModal .bqt-tip-custom-box {
  display: flex;
  align-items: center;
  gap: 4px;
  width: 132px;
  height: 46px;
  padding: 0 12px;
  border: 1.5px solid var(--bqt-line);
  border-radius: 12px;
  background: var(--bqt-paper);
  font: 600 17px var(--bqt-print);
}
body.bq-table-mode #checkoutModal .bqt-tip-custom-box input {
  width: 100%;
  min-width: 0;
  padding: 0;
  border: 0;
  outline: 0;
  background: transparent;
  font: inherit;
  color: inherit;
  text-align: right;
  -moz-appearance: textfield;
}
body.bq-table-mode #checkoutModal .bqt-tip-custom-box input::-webkit-outer-spin-button,
body.bq-table-mode #checkoutModal .bqt-tip-custom-box input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
